Class MachineChemicalPlantBlockEntity

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.BaseMachineBlockEntity
com.hbm_m.block.entity.machines.MachineChemicalPlantBlockEntity
All Implemented Interfaces:
IFluidConnectorMK2, IFluidProviderMK2, IFluidReceiverMK2, IFluidStandardReceiverMK2, IFluidStandardSenderMK2, IFluidStandardTransceiverMK2, IFluidUserMK2, NodeNet.ILoadedEntry, IEnergyConnector, IEnergyProvider, IEnergyReceiver, IFrameSupportable, IUpgradeInfoProvider, 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 MachineChemicalPlantBlockEntity extends BaseMachineBlockEntity implements IFrameSupportable, IUpgradeInfoProvider, IFluidStandardTransceiverMK2
Chemical Plant BlockEntity - порт с 1.7.10. 22 слота, 6 FluidTank (3 input, 3 output), энергия. Логика крафтов - заглушка.
  • Field Details

    • data

      protected final net.minecraft.world.inventory.ContainerData data
  • Constructor Details

    • MachineChemicalPlantBlockEntity

      public MachineChemicalPlantBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • checkForFrame

      public void checkForFrame()
      Description copied from interface: IFrameSupportable
      Запускает проверку, должна ли структура в данный момент отображать рамку. Реализация этого метода должна вызывать централизованную логику проверки и затем использовать setFrameVisible() для применения результата.
      Specified by:
      checkForFrame in interface IFrameSupportable
    • setFrameVisible

      public boolean setFrameVisible(boolean visible)
      Description copied from interface: IFrameSupportable
      Устанавливает новое состояние видимости рамки и синхронизирует его с клиентом.
      Specified by:
      setFrameVisible in interface IFrameSupportable
      Parameters:
      visible - Новое состояние видимости.
      Returns:
      true, если состояние было изменено, иначе false.
    • isFrameVisible

      public boolean isFrameVisible()
      Specified by:
      isFrameVisible in interface IFrameSupportable
      Returns:
      Текущее клиентское состояние видимости рамки. Используется рендерером.
    • getRenderBoundingBox

      public net.minecraft.world.phys.AABB getRenderBoundingBox()
      Description copied from class: BaseMachineBlockEntity
      Рендер-баундинг бокс по умолчанию. На Forge это @Override метода из BlockEntity, на Fabric — обычный public метод. Подклассы могут переопределить для мультиблоков с увеличенным размером.
      Specified by:
      getRenderBoundingBox in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      getRenderBoundingBox in class BaseMachineBlockEntity
    • tick

      public static void tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MachineChemicalPlantBlockEntity entity)
    • getModule

      public MachineModuleChemplant getModule()
    • getReceivingTanks

      public FluidTank[] getReceivingTanks()
      Specified by:
      getReceivingTanks in interface IFluidStandardReceiverMK2
    • getSendingTanks

      public FluidTank[] getSendingTanks()
      Specified by:
      getSendingTanks in interface IFluidStandardSenderMK2
    • getAllTanks

      public FluidTank[] getAllTanks()
      Description copied from interface: IFluidUserMK2
      Все баки этой машины. Используется для display/debug.
      Specified by:
      getAllTanks in interface IFluidUserMK2
    • isLoaded

      public boolean isLoaded()
      Specified by:
      isLoaded in interface NodeNet.ILoadedEntry
    • getValidUpgrades

      public Map<ItemMachineUpgrade.UpgradeType,Integer> getValidUpgrades()
      Specified by:
      getValidUpgrades in interface IUpgradeInfoProvider
    • getActiveFluidInputSlotCount

      public int getActiveFluidInputSlotCount()
      Количество входных fluid-баков, которые реально задаёт текущий рецепт (без этого «лишние» NONE-баки становятся сетевыми стоками и размазывают воду между слотами). 0 если рецепт не выбран или не содержит жидкостей.
    • getDemand

      public long getDemand(net.minecraft.world.level.material.Fluid fluid, int pressure)
      Description copied from interface: IFluidReceiverMK2
      Сколько жидкости этого типа/давления можно принять.
      Specified by:
      getDemand in interface IFluidReceiverMK2
      Specified by:
      getDemand in interface IFluidStandardReceiverMK2
    • transferFluid

      public long transferFluid(net.minecraft.world.level.material.Fluid fluid, int pressure, long amount)
      Description copied from interface: IFluidReceiverMK2
      Принять amount единиц жидкости.
      Specified by:
      transferFluid in interface IFluidReceiverMK2
      Specified by:
      transferFluid in interface IFluidStandardReceiverMK2
      Returns:
      остаток, который не удалось принять (0 = всё принято)
    • getReceivingPressureRange

      public int[] getReceivingPressureRange(net.minecraft.world.level.material.Fluid fluid)
      Description copied from interface: IFluidReceiverMK2
      Диапазон давлений, которые этот получатель принимает.
      Specified by:
      getReceivingPressureRange in interface IFluidReceiverMK2
      Specified by:
      getReceivingPressureRange in interface IFluidStandardReceiverMK2
    • drops

      public void drops()
    • getDefaultName

      protected net.minecraft.network.chat.Component getDefaultName()
      Specified by:
      getDefaultName in class BaseMachineBlockEntity
    • getDisplayName

      public net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
    • isItemValidForSlot

      protected boolean isItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack)
      Specified by:
      isItemValidForSlot in class BaseMachineBlockEntity
    • 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:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • getInputTanks

      public FluidTank[] getInputTanks()
    • getOutputTanks

      public FluidTank[] getOutputTanks()
    • getAvailableRecipes

      public List<ChemicalPlantRecipe> getAvailableRecipes()
    • getBlueprintFolder

      public net.minecraft.world.item.ItemStack getBlueprintFolder()
    • getDidProcess

      public boolean getDidProcess()
    • isChemplantEffectsActive

      public boolean isChemplantEffectsActive()
      Клиентский звук BER, приращение anim и жидкость не должны зависеть только от didProcess в одном сетевом снимке: между пакетами он часто false → мигание цвета/UV и обрыв лупа. На клиенте учитываем MachineChemicalPlantBlock.RENDER_ACTIVE и синхронизированный MachineModuleBase.getProgress().
    • getSelectedRecipeId

      @Nullable public net.minecraft.resources.ResourceLocation getSelectedRecipeId()
    • setSelectedRecipe

      public void setSelectedRecipe(@Nullable net.minecraft.resources.ResourceLocation recipeId)
    • getProgress

      public int getProgress()
    • getMaxProgress

      public int getMaxProgress()
    • getAnim

      public float getAnim(float partialTicks)
    • getFluid

      public dev.architectury.fluid.FluidStack getFluid()
    • getFluidFillFraction

      public float getFluidFillFraction()
    • saveAdditional

      protected void saveAdditional(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveAdditional in class BaseMachineBlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      load in class BaseMachineBlockEntity
    • setRemoved

      public void setRemoved()
      Overrides:
      setRemoved in class BaseMachineBlockEntity
    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      onLoad in class BaseMachineBlockEntity
    • getCapability

      @NotNull public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(@NotNull net.minecraftforge.common.capabilities.Capability<T> cap, @Nullable net.minecraft.core.Direction side)
      Specified by:
      getCapability in interface net.minecraftforge.common.capabilities.ICapabilityProvider
      Overrides:
      getCapability in class BaseMachineBlockEntity
    • invalidateCaps

      public void invalidateCaps()
      Specified by:
      invalidateCaps in interface net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>
      Overrides:
      invalidateCaps in class BaseMachineBlockEntity