Package com.hbm_m.block.entity.machines
Class MachineFrackingTowerBlockEntity
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.MachineFrackingTowerBlockEntity
- All Implemented Interfaces:
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>
BlockEntity для Fracking Tower (Гидроразрывная вышка).
Порт из версии 1.7.10 (TileEntityMachineFrackingTower).
Функционал:
- Добыча нефти и газа из руды (oil_ore, ore_bedrock_oil)
- Требует FrackSol для работы
- Производит сырую нефть и газ
- Поддержка апгрейдов скорости и энергии
-
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 TypeFieldDescriptionprotected intprotected static longprotected static intprotected static intprotected static doubleprotected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler>protected final FluidTankprotected static intprotected static intprotected static intprotected static intprotected final FluidTankprotected intstatic final intprotected static longprotected static intprotected static intprotected final FluidTankprotected intprotected intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected static intprotected intFields 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 net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionMachineFrackingTowerBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyAfterburnerEffect(net.minecraft.core.BlockPos pos) Применение эффекта Afterburner апгрейда.protected voidapplyNormalDepositDrain(net.minecraft.core.BlockPos orePos) Обычное нефтяное месторождение постепенно истощается.protected booleanПроверка возможности работы машины.net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player) protected net.minecraft.core.BlockPosПробивает вертикальный ствол трубы OIL_PIPE вниз и возвращает достигнутое нефтяное месторождение.protected net.minecraft.core.BlockPosПоиск руды нефти в радиусе действия.<T> net.minecraftforge.common.util.LazyOptional<T>getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction side) longprotected net.minecraft.network.chat.ComponentintgetDelay()net.minecraft.network.chat.Componentintintnet.minecraft.world.phys.AABBРендер-баундинг бокс по умолчанию.voidprotected booleanisAnyOilDeposit(net.minecraft.world.level.block.Block block) protected booleanisBedrockOilDeposit(net.minecraft.world.level.block.Block block) protected booleanisItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack) voidload(net.minecraft.nbt.CompoundTag tag) static voidprotected voidВыполнение операции гидроразрыва (добыча).protected voidprocessContainerPair(int inputSlot, int outputSlot, FluidTank sourceTank) Перелив из танка машины в контейнер в слоте инвентаря.protected voidОбработка жидкостных контейнеров (канистр и баллонов).protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) protected voidstatic voidtick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MachineFrackingTowerBlockEntity entity) protected voidMethods 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, setRemoved, 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 net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, hasCustomOutlineRendering, requestModelDataUpdate, serializeNBT
-
Field Details
-
maxPower
protected static long maxPower -
consumption
protected static long consumption -
solutionRequired
protected static int solutionRequired -
delay
protected static int delay -
oilPerDeposit
protected static int oilPerDeposit -
gasPerDepositMin
protected static int gasPerDepositMin -
gasPerDepositMax
protected static int gasPerDepositMax -
drainChance
protected static double drainChance -
oilPerBedrockDeposit
protected static int oilPerBedrockDeposit -
gasPerBedrockDepositMin
protected static int gasPerBedrockDepositMin -
gasPerBedrockDepositMax
protected static int gasPerBedrockDepositMax -
destructionRange
protected static int destructionRange -
oilTank
-
gasTank
-
fracksolTank
-
fluidHandler
protected net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> fluidHandler -
progressTimer
protected int progressTimer -
indicator
protected int indicator -
speedUpgradeLevel
protected int speedUpgradeLevel -
powerUpgradeLevel
protected int powerUpgradeLevel -
afterburnerUpgradeLevel
protected int afterburnerUpgradeLevel -
SLOT_BATTERY
public static final int SLOT_BATTERY- See Also:
-
SLOT_CANISTER_IN
public static final int SLOT_CANISTER_IN- See Also:
-
SLOT_CANISTER_OUT
public static final int SLOT_CANISTER_OUT- See Also:
-
SLOT_GAS_IN
public static final int SLOT_GAS_IN- See Also:
-
SLOT_GAS_OUT
public static final int SLOT_GAS_OUT- See Also:
-
SLOT_UPGRADE_1
public static final int SLOT_UPGRADE_1- See Also:
-
SLOT_UPGRADE_2
public static final int SLOT_UPGRADE_2- See Also:
-
SLOT_UPGRADE_3
public static final int SLOT_UPGRADE_3- See Also:
-
INVENTORY_SIZE
public static final int INVENTORY_SIZE- See Also:
-
-
Constructor Details
-
MachineFrackingTowerBlockEntity
public MachineFrackingTowerBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName() -
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) -
getDefaultName
protected net.minecraft.network.chat.Component getDefaultName()- Specified by:
getDefaultNamein classBaseMachineBlockEntity
-
isItemValidForSlot
protected boolean isItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
isItemValidForSlotin classBaseMachineBlockEntity
-
getOilTank
-
getGasTank
-
getFracksolTank
-
getIndicator
public int getIndicator() -
getProgressTimer
public int getProgressTimer() -
getDelay
public int getDelay() -
getConsumption
public long getConsumption() -
tick
public static void tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MachineFrackingTowerBlockEntity entity) -
updateUpgrades
protected void updateUpgrades() -
processFluidContainers
protected void processFluidContainers()Обработка жидкостных контейнеров (канистр и баллонов). -
processContainerPair
Перелив из танка машины в контейнер в слоте инвентаря. На Forge — через FLUID_HANDLER_ITEM capability. На Fabric — через FluidStorage.ITEM. -
canOperate
protected boolean canOperate()Проверка возможности работы машины. -
performFrackingOperation
protected void performFrackingOperation()Выполнение операции гидроразрыва (добыча). Порт из оригинального onSuck(). -
findOilOre
@Nullable protected net.minecraft.core.BlockPos findOilOre()Поиск руды нефти в радиусе действия. -
drillAndFindOilDepositBelow
@Nullable protected net.minecraft.core.BlockPos drillAndFindOilDepositBelow()Пробивает вертикальный ствол трубы OIL_PIPE вниз и возвращает достигнутое нефтяное месторождение. -
isAnyOilDeposit
protected boolean isAnyOilDeposit(net.minecraft.world.level.block.Block block) -
isBedrockOilDeposit
protected boolean isBedrockOilDeposit(net.minecraft.world.level.block.Block block) -
applyNormalDepositDrain
protected void applyNormalDepositDrain(net.minecraft.core.BlockPos orePos) Обычное нефтяное месторождение постепенно истощается. Bedrock Oil не истощается (обрабатывается отдельной веткой). -
applyAfterburnerEffect
protected void applyAfterburnerEffect(net.minecraft.core.BlockPos pos) Применение эффекта Afterburner апгрейда. -
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classBaseMachineBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classBaseMachineBlockEntity
-
setupFluidCapability
protected void setupFluidCapability()- Overrides:
setupFluidCapabilityin 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
-
getRenderBoundingBox
public net.minecraft.world.phys.AABB getRenderBoundingBox()Description copied from class:BaseMachineBlockEntityРендер-баундинг бокс по умолчанию. На Forge это@Overrideметода из BlockEntity, на Fabric — обычный public метод. Подклассы могут переопределить для мультиблоков с увеличенным размером.- Specified by:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
getRenderBoundingBoxin classBaseMachineBlockEntity
-
loadConfig
-