Class OptionalMountedDispenseBehavior
java.lang.Object
com.simibubi.create.api.contraption.dispenser.DefaultMountedDispenseBehavior
com.simibubi.create.api.contraption.dispenser.OptionalMountedDispenseBehavior
- All Implemented Interfaces:
MountedDispenseBehavior
A mounted dispenser behavior that might fail, playing the empty sound if it does.
-
Field Summary
Fields inherited from class com.simibubi.create.api.contraption.dispenser.DefaultMountedDispenseBehavior
INSTANCEFields inherited from interface com.simibubi.create.api.contraption.dispenser.MountedDispenseBehavior
REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable net.minecraft.world.item.ItemStackdoExecute(net.minecraft.world.item.ItemStack stack, MovementContext context, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 facing) Dispense the given item.protected final net.minecraft.world.item.ItemStackexecute(net.minecraft.world.item.ItemStack stack, MovementContext context, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 facing) Dispense the given item.protected voidplaySound(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos) Methods inherited from class com.simibubi.create.api.contraption.dispenser.DefaultMountedDispenseBehavior
dispense, playAnimation, playAnimation, spawnItem
-
Constructor Details
-
OptionalMountedDispenseBehavior
public OptionalMountedDispenseBehavior()
-
-
Method Details
-
execute
protected final net.minecraft.world.item.ItemStack execute(net.minecraft.world.item.ItemStack stack, MovementContext context, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 facing) Description copied from class:DefaultMountedDispenseBehaviorDispense the given item. Sounds and particles are already handled.- Overrides:
executein classDefaultMountedDispenseBehavior- Returns:
- the remaining items after dispensing one
-
playSound
protected void playSound(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos) - Overrides:
playSoundin classDefaultMountedDispenseBehavior
-
doExecute
@Nullable protected @Nullable net.minecraft.world.item.ItemStack doExecute(net.minecraft.world.item.ItemStack stack, MovementContext context, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 facing) Dispense the given item.- Returns:
- the remaining items after dispensing one, or null if it failed
-