Package com.hbm_m.block.entity.machines
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.
- Перенос жидкости из контейнера в слоте 3 в внутренний бак.
- Поиск рецепта в
CrystallizerRecipesпо входу и текущей жидкости в баке. - Если рецепт найден и есть энергия / кислота / место в выходе — крутим прогресс.
- По достижении
duration— выдаём результат, тратим кислоту, с учётом productivity тратим (или не тратим) вход.
-
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>>Nested classes/interfaces inherited from interface com.hbm_m.interfaces.IEnergyReceiver
IEnergyReceiver.Priority -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatprotected final net.minecraft.world.inventory.ContainerDatafloatFields inherited from class com.hbm_m.block.entity.BaseMachineBlockEntity
capacity, energy, inventory, itemHandler, maxExtract, maxReceive, networkInitializedFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface com.hbm_m.api.fluids.IFluidUserMK2
DEFAULT_PRESSURE_RANGE, HIGHEST_VALID_PRESSUREFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionMachineCrystallizerBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.inventory.AbstractContainerMenucreateMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player) Все баки этой машины.<T> net.minecraftforge.common.util.LazyOptional<T>getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction side) net.minecraft.world.inventory.ContainerDataprotected net.minecraft.network.chat.Componentnet.minecraft.network.chat.ComponentintintlonggetPowerScaled(int scale) intgetProgressScaled(int scale) net.minecraft.world.phys.AABBThe controller BlockEntity is only one block, but the animated spinner/fluid BER is rendered across the whole 3x3x6 multiblock.getTank()voidprotected booleanisItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack) booleanisLoaded()booleanisOn()voidload(net.minecraft.nbt.CompoundTag tag) protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidbooleanstillValid(net.minecraft.world.entity.player.Player player) static voidtick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MachineCrystallizerBlockEntity entity) Methods inherited from class com.hbm_m.block.entity.BaseMachineBlockEntity
canConnectEnergy, canExtract, canReceive, chargeFromBatterySlot, chargeItemInSlot, createGhostItemsFromIngredients, createInventoryHandler, dropInventoryContents, ensureNetworkInitialized, extractEnergy, getEnergyDelta, getEnergyStored, getGhostItems, getInventory, getMaxEnergyStored, getPriority, getProvideSpeed, getReceiveSpeed, getUpdatePacket, getUpdateTag, handleUpdateTag, isCriticalSlot, isEnergyProviderItem, isEnergyReceiverItem, onDataPacket, onLoad, receiveEnergy, sendUpdateToClient, setEnergyCapacity, setEnergyStored, setLevel, setupFluidCapability, updateEnergyDeltaMethods 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, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, 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
getCapabilityMethods inherited from interface com.hbm_m.api.fluids.IFluidConnectorMK2
canConnectMethods inherited from interface com.hbm_m.api.fluids.IFluidReceiverMK2
getFluidPriority, getReceiverSpeed, isInfiniteNetworkSink, trySubscribeMethods inherited from interface com.hbm_m.api.fluids.IFluidStandardReceiverMK2
getDemand, getReceivingPressureRange, transferFluidMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, hasCustomOutlineRendering, requestModelDataUpdate, serializeNBT
-
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
-
getContainerData
public net.minecraft.world.inventory.ContainerData getContainerData() -
getReceivingTanks
- Specified by:
getReceivingTanksin interfaceIFluidStandardReceiverMK2
-
getAllTanks
Description copied from interface:IFluidUserMK2Все баки этой машины. Используется для display/debug.- Specified by:
getAllTanksin interfaceIFluidUserMK2
-
isLoaded
public boolean isLoaded()- Specified by:
isLoadedin interfaceNodeNet.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:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
getRenderBoundingBoxin classBaseMachineBlockEntity
-
getDefaultName
protected net.minecraft.network.chat.Component getDefaultName()- Specified by:
getDefaultNamein classBaseMachineBlockEntity
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider
-
isItemValidForSlot
protected boolean isItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
isItemValidForSlotin classBaseMachineBlockEntity
-
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:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classBaseMachineBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classBaseMachineBlockEntity
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classBaseMachineBlockEntity
-
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:
getCapabilityin interfacenet.minecraftforge.common.capabilities.ICapabilityProvider- Overrides:
getCapabilityin classBaseMachineBlockEntity
-
invalidateCaps
public void invalidateCaps()- Specified by:
invalidateCapsin interfacenet.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>- Overrides:
invalidateCapsin classBaseMachineBlockEntity
-