Class MachineCrystallizerBlockEntity

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.MachineCrystallizerBlockEntity
All Implemented Interfaces:
IFluidConnectorMK2, IFluidReceiverMK2, IFluidStandardReceiverMK2, IFluidUserMK2, NodeNet.ILoadedEntry, IEnergyConnector, IEnergyProvider, IEnergyReceiver, 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 MachineCrystallizerBlockEntity extends BaseMachineBlockEntity implements IFluidStandardReceiverMK2
Crystallizer BlockEntity — рудный окислитель, порт с 1.7.10.

Слоты:

  • 0 — вход (руда / предмет)
  • 1 — батарея
  • 2 — выход (кристалл)
  • 3 — слот заливки жидкости (ведро/контейнер с кислотой)
  • 4 — слот выхода жидкости (опустевший контейнер)
  • 5, 6 — апгрейды (пока не реализовано)
  • 7 — слот идентификатора жидкости (пока не реализовано)

Логика обработки:

  1. Зарядка от батареи в слоте 1.
  2. Перенос жидкости из контейнера в слоте 3 в внутренний бак.
  3. Поиск рецепта в CrystallizerRecipes по входу и текущей жидкости в баке.
  4. Если рецепт найден и есть энергия / кислота / место в выходе — крутим прогресс.
  5. По достижении duration — выдаём результат, тратим кислоту, с учётом productivity тратим (или не тратим) вход.
  • Field Details

    • angle

      public float angle
    • prevAngle

      public float prevAngle
    • data

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

    • MachineCrystallizerBlockEntity

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

    • tick

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

      public int getPowerRequired()
    • getDuration

      public int getDuration()
    • isOn

      public boolean isOn()
    • getPowerScaled

      public long getPowerScaled(int scale)
    • getProgressScaled

      public int getProgressScaled(int scale)
    • getTank

      public FluidTank getTank()
    • getContainerData

      public net.minecraft.world.inventory.ContainerData getContainerData()
    • getReceivingTanks

      public FluidTank[] getReceivingTanks()
      Specified by:
      getReceivingTanks in interface IFluidStandardReceiverMK2
    • 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
    • getRenderBoundingBox

      public net.minecraft.world.phys.AABB getRenderBoundingBox()
      The controller BlockEntity is only one block, but the animated spinner/fluid BER is rendered across the whole 3x3x6 multiblock. Without the expanded render bounds, Minecraft frustum-culls the BER when the controller block itself leaves the camera frustum, which makes the spinner and fluid disappear at steep viewing angles.
      Specified by:
      getRenderBoundingBox in interface net.minecraftforge.common.extensions.IForgeBlockEntity
      Overrides:
      getRenderBoundingBox in class BaseMachineBlockEntity
    • 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
    • stillValid

      public boolean stillValid(net.minecraft.world.entity.player.Player player)
    • 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
    • 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
    • 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