public abstract class AbstractFurnaceBlockEntity extends LockableContainerBlockEntity implements SidedInventory, RecipeUnlocker, RecipeInputProvider, Tickable
Modifier and Type | Field and Description |
---|---|
private static int[] |
BOTTOM_SLOTS |
private int |
burnTime |
private int |
cookTime |
private int |
cookTimeTotal |
private int |
fuelTime |
protected DefaultedList<ItemStack> |
inventory |
protected PropertyDelegate |
propertyDelegate |
private it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Identifier> |
recipesUsed |
protected RecipeType<? extends AbstractCookingRecipe> |
recipeType |
private static int[] |
SIDE_SLOTS |
private static int[] |
TOP_SLOTS |
pos, removed, world
Modifier | Constructor and Description |
---|---|
protected |
AbstractFurnaceBlockEntity(BlockEntityType<?> blockEntityType,
RecipeType<? extends AbstractCookingRecipe> recipeType) |
Modifier and Type | Method and Description |
---|---|
private static void |
addFuel(Map<Item,Integer> map,
ItemConvertible item,
int fuelTime) |
private static void |
addFuel(Map<Item,Integer> fuelTimes,
Tag<Item> tag,
int fuelTime) |
protected boolean |
canAcceptRecipeOutput(Recipe<?> recipe) |
boolean |
canExtract(int slot,
ItemStack stack,
Direction dir)
Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.
|
boolean |
canInsert(int slot,
ItemStack stack,
Direction dir)
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.
|
boolean |
canPlayerUse(PlayerEntity player) |
static boolean |
canUseAsFuel(ItemStack stack) |
void |
clear() |
private void |
craftRecipe(Recipe<?> recipe) |
static Map<Item,Integer> |
createFuelTimeMap() |
void |
dropExperience(PlayerEntity player) |
private static void |
dropExperience(World world,
Vec3d vec3d,
int int2,
float float2) |
void |
fromTag(BlockState state,
CompoundTag tag) |
int[] |
getAvailableSlots(Direction side)
Gets the available slot positions that are reachable from a given side.
|
protected int |
getCookTime() |
protected int |
getFuelTime(ItemStack fuel) |
Recipe<?> |
getLastRecipe() |
ItemStack |
getStack(int slot)
Fetches the stack currently stored at the given slot.
|
private boolean |
isBurning() |
boolean |
isEmpty() |
private static boolean |
isNonFlammableWood(Item item) |
boolean |
isValid(int slot,
ItemStack stack)
Returns whether the given stack is a valid for the indicated slot position.
|
List<Recipe<?>> |
method_27354(World world,
Vec3d vec3d) |
void |
provideRecipeInputs(RecipeFinder finder) |
ItemStack |
removeStack(int slot)
Removes the stack currently stored at the indicated slot.
|
ItemStack |
removeStack(int slot,
int amount)
Removes a specific number of items from the given slot.
|
void |
setLastRecipe(Recipe<?> recipe) |
void |
setStack(int slot,
ItemStack stack) |
int |
size() |
void |
tick() |
CompoundTag |
toTag(CompoundTag tag) |
void |
unlockLastRecipe(PlayerEntity player) |
checkUnlocked, checkUnlocked, createMenu, createScreenHandler, getContainerName, getCustomName, getDisplayName, getName, setCustomName
applyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count, getMaxCountPerStack, markDirty, onClose, onOpen
shouldCraftRecipe
hasCustomName
private static final int[] TOP_SLOTS
private static final int[] BOTTOM_SLOTS
private static final int[] SIDE_SLOTS
protected DefaultedList<ItemStack> inventory
private int burnTime
private int fuelTime
private int cookTime
private int cookTimeTotal
protected final PropertyDelegate propertyDelegate
private final it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Identifier> recipesUsed
protected final RecipeType<? extends AbstractCookingRecipe> recipeType
protected AbstractFurnaceBlockEntity(BlockEntityType<?> blockEntityType, RecipeType<? extends AbstractCookingRecipe> recipeType)
private static boolean isNonFlammableWood(Item item)
private static void addFuel(Map<Item,Integer> map, ItemConvertible item, int fuelTime)
private boolean isBurning()
public void fromTag(BlockState state, CompoundTag tag)
fromTag
in class LockableContainerBlockEntity
public CompoundTag toTag(CompoundTag tag)
toTag
in class LockableContainerBlockEntity
protected int getFuelTime(ItemStack fuel)
protected int getCookTime()
public static boolean canUseAsFuel(ItemStack stack)
public int[] getAvailableSlots(Direction side)
getAvailableSlots
in interface SidedInventory
public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir)
canInsert
in interface SidedInventory
public boolean canExtract(int slot, ItemStack stack, Direction dir)
canExtract
in interface SidedInventory
public ItemStack getStack(int slot)
ItemStack.EMPTY
.public ItemStack removeStack(int slot, int amount)
removeStack
in interface Inventory
public ItemStack removeStack(int slot)
removeStack
in interface Inventory
public void setStack(int slot, ItemStack stack)
public boolean canPlayerUse(PlayerEntity player)
canPlayerUse
in interface Inventory
public boolean isValid(int slot, ItemStack stack)
public void setLastRecipe(@Nullable Recipe<?> recipe)
setLastRecipe
in interface RecipeUnlocker
@Nullable public Recipe<?> getLastRecipe()
getLastRecipe
in interface RecipeUnlocker
public void unlockLastRecipe(PlayerEntity player)
unlockLastRecipe
in interface RecipeUnlocker
public void dropExperience(PlayerEntity player)
public void provideRecipeInputs(RecipeFinder finder)
provideRecipeInputs
in interface RecipeInputProvider