Package com.hbm_m.block.entity.machines
Class AnvilBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
com.hbm_m.block.entity.machines.AnvilBlockEntity
- All Implemented Interfaces:
net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.MenuProvider,net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>,net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>,net.minecraftforge.common.extensions.IForgeBlockEntity,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
public class AnvilBlockEntity
extends net.minecraft.world.level.block.entity.BlockEntity
implements net.minecraft.world.MenuProvider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionAnvilBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanconsumeMaterials(net.minecraft.world.entity.player.Player player, boolean craftMax, com.hbm_m.block.entity.machines.AnvilBlockEntity.EnergyTransferTracker tracker) Расходует материалы после крафтаbooleancraft(net.minecraft.world.entity.player.Player player, boolean craftMax) Выполняет крафт и помещает результат в инвентарь игрокаnet.minecraft.world.inventory.AbstractContainerMenucreateMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player) voiddrops()net.minecraft.network.chat.ComponentOptional<net.minecraft.resources.ResourceLocation>getTier()net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>net.minecraft.nbt.CompoundTagvoidhandleCombineOutputTaken(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack outputStack) voidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag) voidload(net.minecraft.nbt.CompoundTag tag) voidopenGui(net.minecraft.server.level.ServerPlayer player) voidpopulateInputsFromPlayer(net.minecraft.server.level.ServerPlayer player, AnvilRecipe recipe) protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidsetSelectedRecipeId(net.minecraft.resources.ResourceLocation recipeId) voidОбновляет выходной слот на основе текущих входов и выбранного рецептаMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
Constructor Details
-
AnvilBlockEntity
public AnvilBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classnet.minecraft.world.level.block.entity.BlockEntity
-
drops
public void drops() -
getDisplayName
public net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider
-
createMenu
@Nullable public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
openGui
public void openGui(net.minecraft.server.level.ServerPlayer player) -
getItemHandler
-
getTier
-
getSelectedRecipeId
-
setSelectedRecipeId
public void setSelectedRecipeId(@Nullable net.minecraft.resources.ResourceLocation recipeId) -
updateCrafting
public void updateCrafting()Обновляет выходной слот на основе текущих входов и выбранного рецепта -
consumeMaterials
public boolean consumeMaterials(net.minecraft.world.entity.player.Player player, boolean craftMax, @Nullable com.hbm_m.block.entity.machines.AnvilBlockEntity.EnergyTransferTracker tracker) Расходует материалы после крафта- Parameters:
player- игрок, выполняющий крафтcraftMax- если true, крафтит максимальное количество- Returns:
- true, если материалы были успешно расходованы
-
handleCombineOutputTaken
public void handleCombineOutputTaken(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack outputStack) -
craft
public boolean craft(net.minecraft.world.entity.player.Player player, boolean craftMax) Выполняет крафт и помещает результат в инвентарь игрока -
populateInputsFromPlayer
public void populateInputsFromPlayer(net.minecraft.server.level.ServerPlayer player, AnvilRecipe recipe) -
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag()- Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
@Nullable public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag) - Specified by:
handleUpdateTagin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity
-