public abstract class AbstractFurnaceBlockEntity extends LockableContainerBlockEntity implements SidedInventory, RecipeUnlocker, RecipeInputProvider
| 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 |
private 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,
BlockPos blockPos,
BlockState blockState,
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) |
private static boolean |
canAcceptRecipeOutput(Recipe<?> recipe,
DefaultedList<ItemStack> defaultedList,
int int2) |
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 static boolean |
craftRecipe(Recipe<?> recipe,
DefaultedList<ItemStack> defaultedList,
int int2) |
static Map<Item,Integer> |
createFuelTimeMap() |
void |
dropExperience(ServerPlayerEntity serverPlayerEntity) |
private static void |
dropExperience(ServerWorld serverWorld,
Vec3d vec3d,
int int2,
float float2) |
void |
fromTag(CompoundTag compoundTag) |
int[] |
getAvailableSlots(Direction side)
Gets the available slot positions that are reachable from a given side.
|
private static int |
getCookTime(World world,
RecipeType<? extends AbstractCookingRecipe> recipeType,
Inventory inventory) |
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(ServerWorld serverWorld,
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() |
static void |
tick(World world,
BlockPos blockPos,
BlockState blockState,
AbstractFurnaceBlockEntity abstractFurnaceBlockEntity) |
CompoundTag |
toTag(CompoundTag tag) |
void |
unlockLastRecipe(PlayerEntity player) |
checkUnlocked, checkUnlocked, createMenu, createScreenHandler, getContainerName, getCustomName, getDisplayName, getName, setCustomNamecancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, toInitialChunkDataTag, toUpdatePacketclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsAny, count, getMaxCountPerStack, markDirty, onClose, onOpenshouldCraftRecipehasCustomNameprivate 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
private final RecipeType<? extends AbstractCookingRecipe> recipeType
protected AbstractFurnaceBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState, 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(CompoundTag compoundTag)
fromTag in class LockableContainerBlockEntitypublic CompoundTag toTag(CompoundTag tag)
toTag in class LockableContainerBlockEntitypublic static void tick(World world, BlockPos blockPos, BlockState blockState, AbstractFurnaceBlockEntity abstractFurnaceBlockEntity)
private static boolean canAcceptRecipeOutput(@Nullable Recipe<?> recipe, DefaultedList<ItemStack> defaultedList, int int2)
private static boolean craftRecipe(@Nullable Recipe<?> recipe, DefaultedList<ItemStack> defaultedList, int int2)
protected int getFuelTime(ItemStack fuel)
private static int getCookTime(World world, RecipeType<? extends AbstractCookingRecipe> recipeType, Inventory inventory)
public static boolean canUseAsFuel(ItemStack stack)
public int[] getAvailableSlots(Direction side)
getAvailableSlots in interface SidedInventorypublic boolean canInsert(int slot,
ItemStack stack,
@Nullable
Direction dir)
canInsert in interface SidedInventorypublic boolean canExtract(int slot,
ItemStack stack,
Direction dir)
canExtract in interface SidedInventorypublic ItemStack getStack(int slot)
ItemStack.EMPTY.public ItemStack removeStack(int slot, int amount)
removeStack in interface Inventorypublic ItemStack removeStack(int slot)
removeStack in interface Inventorypublic void setStack(int slot,
ItemStack stack)
public boolean canPlayerUse(PlayerEntity player)
canPlayerUse in interface Inventorypublic boolean isValid(int slot,
ItemStack stack)
public void setLastRecipe(@Nullable Recipe<?> recipe)
setLastRecipe in interface RecipeUnlocker@Nullable public Recipe<?> getLastRecipe()
getLastRecipe in interface RecipeUnlockerpublic void unlockLastRecipe(PlayerEntity player)
unlockLastRecipe in interface RecipeUnlockerpublic void dropExperience(ServerPlayerEntity serverPlayerEntity)
public List<Recipe<?>> method_27354(ServerWorld serverWorld, Vec3d vec3d)
private static void dropExperience(ServerWorld serverWorld, Vec3d vec3d, int int2, float float2)
public void provideRecipeInputs(RecipeFinder finder)
provideRecipeInputs in interface RecipeInputProvider