Interface IDroneRegistry

All Known Implementing Classes:
DroneRegistry

public interface IDroneRegistry
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPathfindableBlock(net.minecraft.world.level.block.Block block, IPathfindHandler handler)
    Normally drones will pathfind through any block that doesn't have any collisions.
    net.minecraft.world.entity.PathfinderMob
    deliverFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack deliveredFluid)
    Similar to deliverItemsAmazonStyle, but with Fluids.
    net.minecraft.world.entity.PathfinderMob
    deliverItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... deliveredStacks)
    Will spawn in a Drone a distance away from the given coordinate.
    getDrone(net.minecraft.world.level.Level level, int entityID)
    Get the IDrone API object for the given entity ID
    getDrone(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Get the IDrone API object for the block entity at the given position
    net.minecraft.world.entity.PathfinderMob
    retrieveFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack queriedFluid)
    The opposite of deliverFluidAmazonStyle.
    net.minecraft.world.entity.PathfinderMob
    retrieveItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... queriedStacks)
    The opposite of deliverItemsAmazonStyle.
  • Method Details

    • addPathfindableBlock

      void addPathfindableBlock(net.minecraft.world.level.block.Block block, IPathfindHandler handler)
      Normally drones will pathfind through any block that doesn't have any collisions. With this method you can register custom blocks to allow the drone to pathfind through them. If the block requires any special handling, e.g. to allow pathfinding under certain conditions, you can pass a IPathFindHandler with the registry.
      Parameters:
      block - the block to allow pathfinding through
      handler - can be null, to always allow pathfinding through this block.
    • deliverItemsAmazonStyle

      net.minecraft.world.entity.PathfinderMob deliverItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... deliveredStacks)
      Will spawn in a Drone a distance away from the given coordinate. When there is an inventory at the given block position, the drone will export the items there. If there is no inventory or items don't fit, the drone will travel to 5 blocks above the specified Y level, and drop the deliveredStacks. When there isn't a clear path for the items to fall these 5 blocks the Drone will deliver at a Y level above the specified Y that is clear. If no clear blocks can be found (when there are only solid blocks), the Drone will drop the items very high up in the air instead.

      When a player attempts to catch the drone (by wrenching it), the drone will only the drop the items that it was delivering (or none if it dropped those items already). The Drone itself never will be dropped.

      Parameters:
      globalPos - global position to deliver items to
      deliveredStacks - stacks to be delivered by the drone
      Returns:
      the drone; you can use this to set a custom name for example (defaults to "Amadron Delivery Drone").
      Throws:
      IllegalArgumentException - if the array of ItemStacks is empty or contains more than 36 separate stacks
    • retrieveItemsAmazonStyle

      net.minecraft.world.entity.PathfinderMob retrieveItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... queriedStacks)
      The opposite of deliverItemsAmazonStyle. Will retrieve the queried items from an inventory at the specified location.
      Parameters:
      globalPos - the global position to retrieve items from
      queriedStacks - the stacks to retrieve
      Returns:
      the drone
    • deliverFluidAmazonStyle

      net.minecraft.world.entity.PathfinderMob deliverFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack deliveredFluid)
      Similar to deliverItemsAmazonStyle, but with Fluids. Will spawn in a Drone that will fill an IFluidHandler at the given block position. If the fluid doesn't fit or there isn't a IFluidHandler, the fluid will be lost.
      Parameters:
      globalPos - global position to deliver the fluid to
      deliveredFluid - the fluid to deliver
      Returns:
      the drone
      Throws:
      IllegalArgumentException - if the FluidStack contains more than 576,000 mB of fluid (the maximum a fully upgraded drone can carry)
    • retrieveFluidAmazonStyle

      net.minecraft.world.entity.PathfinderMob retrieveFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack queriedFluid)
      The opposite of deliverFluidAmazonStyle. Will retrieve the queried fluid from an IFluidHandler at the specified location.
      Parameters:
      globalPos - global block position to retrieve fluid from
      queriedFluid - the fluid to retrieve
      Returns:
      the drone
    • getDrone

      Optional<IDrone> getDrone(net.minecraft.world.level.Level level, int entityID)
      Get the IDrone API object for the given entity ID
      Parameters:
      level - the level
      entityID - the entity ID
      Returns:
      an IDrone object, or Optional.empty() if the entity isn't a drone
    • getDrone

      Optional<IDrone> getDrone(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Get the IDrone API object for the block entity at the given position
      Parameters:
      level - the level
      pos - the block entity's position
      Returns:
      an IDrone object, or Optional.empty() if the block entity at the given pos isn't a Programmable Controller