Enum Class DroneRegistry
- All Implemented Interfaces:
Serializable,Comparable<DroneRegistry>,Constable,IDroneRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Map<net.minecraft.world.level.block.Block,IPathfindHandler> -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPathfindableBlock(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.PathfinderMobdeliverFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack deliveredFluid) Similar to deliverItemsAmazonStyle, but with Fluids.net.minecraft.world.entity.PathfinderMobdeliverItemsAmazonStyle(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 theIDroneAPI object for the given entity IDgetDrone(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Get theIDroneAPI object for the block entity at the given positionstatic DroneRegistrynet.minecraft.world.entity.PathfinderMobretrieveFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack queriedFluid) The opposite of deliverFluidAmazonStyle.net.minecraft.world.entity.PathfinderMobretrieveItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... queriedStacks) The opposite of deliverItemsAmazonStyle.static DroneRegistryReturns the enum constant of this class with the specified name.static DroneRegistry[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
pathfindableBlocks
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
-
addPathfindableBlock
public void addPathfindableBlock(net.minecraft.world.level.block.Block block, IPathfindHandler handler) Description copied from interface:IDroneRegistryNormally 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.- Specified by:
addPathfindableBlockin interfaceIDroneRegistry- Parameters:
block- the block to allow pathfinding throughhandler- can be null, to always allow pathfinding through this block.
-
deliverItemsAmazonStyle
public net.minecraft.world.entity.PathfinderMob deliverItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... deliveredStacks) Description copied from interface:IDroneRegistryWill 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.
- Specified by:
deliverItemsAmazonStylein interfaceIDroneRegistry- Parameters:
globalPos- global position to deliver items todeliveredStacks- 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").
-
retrieveItemsAmazonStyle
public net.minecraft.world.entity.PathfinderMob retrieveItemsAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraft.world.item.ItemStack... queriedStacks) Description copied from interface:IDroneRegistryThe opposite of deliverItemsAmazonStyle. Will retrieve the queried items from an inventory at the specified location.- Specified by:
retrieveItemsAmazonStylein interfaceIDroneRegistry- Parameters:
globalPos- the global position to retrieve items fromqueriedStacks- the stacks to retrieve- Returns:
- the drone
-
deliverFluidAmazonStyle
public net.minecraft.world.entity.PathfinderMob deliverFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack deliveredFluid) Description copied from interface:IDroneRegistrySimilar 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.- Specified by:
deliverFluidAmazonStylein interfaceIDroneRegistry- Parameters:
globalPos- global position to deliver the fluid todeliveredFluid- the fluid to deliver- Returns:
- the drone
-
retrieveFluidAmazonStyle
public net.minecraft.world.entity.PathfinderMob retrieveFluidAmazonStyle(net.minecraft.core.GlobalPos globalPos, net.minecraftforge.fluids.FluidStack queriedFluid) Description copied from interface:IDroneRegistryThe opposite of deliverFluidAmazonStyle. Will retrieve the queried fluid from an IFluidHandler at the specified location.- Specified by:
retrieveFluidAmazonStylein interfaceIDroneRegistry- Parameters:
globalPos- global block position to retrieve fluid fromqueriedFluid- the fluid to retrieve- Returns:
- the drone
-
getDrone
Description copied from interface:IDroneRegistryGet theIDroneAPI object for the given entity ID- Specified by:
getDronein interfaceIDroneRegistry- Parameters:
level- the levelentityID- the entity ID- Returns:
- an IDrone object, or
Optional.empty()if the entity isn't a drone
-
getDrone
public Optional<IDrone> getDrone(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Description copied from interface:IDroneRegistryGet theIDroneAPI object for the block entity at the given position- Specified by:
getDronein interfaceIDroneRegistry- Parameters:
level- the levelpos- 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
-