Package com.hbm_m.block.entity.machines
Class LaunchPadBaseBlockEntity
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.LaunchPadBaseBlockEntity
- All Implemented Interfaces:
IFluidConnectorMK2,IFluidReceiverMK2,IFluidStandardReceiverMK2,IFluidUserMK2,NodeNet.ILoadedEntry,IRadarCommandReceiver,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>
- Direct Known Subclasses:
LaunchPadBlockEntity,LaunchPadLargeBlockEntity,LaunchPadRustedBlockEntity
public abstract class LaunchPadBaseBlockEntity
extends BaseMachineBlockEntity
implements IRadarCommandReceiver, IFluidStandardReceiverMK2
Базовый BlockEntity для всех пусковых площадок.
Инвентарь (7 слотов), энергия, жидкостные баки, пуск ракет и подписка
на энерго-/жидкостные сети через
getConPos() (угловые коннекторы мультиблока).-
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 net.minecraft.world.item.ItemStackprotected intКулдаун перед следующим пуском.protected static final longprotected static final longprotected static final Map<net.minecraft.world.item.Item,net.minecraft.world.entity.EntityType<? extends MissileBaseEntity>> Регистрация ракет: Item -> тип сущности (заполняется вregisterLaunchables()).protected intprotected intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected intТекущее логическое состояние площадки (для GUI).static final intstatic final intstatic final intstatic final intprotected final FluidTank[]Топливный и окислительный баки (как в оригинале — по 24k mB).Fields 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
ConstructorsModifierConstructorDescriptionprotectedLaunchPadBaseBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionprotected static NodeDirPos[]buildStandardConPos(net.minecraft.core.BlockPos controller) booleancanConnect(net.minecraft.world.level.material.Fluid fluid, net.minecraft.core.Direction fromDir) Может ли этот коннектор принимать/отдавать жидкость указанного типа с указанной стороны.booleancanConnectEnergy(net.minecraft.core.Direction side) Может ли этот блок подключаться к энергосети с указанной стороныbooleanprotected voidКреативная батарея мгновенно заполняет буфер; обычные — черезBaseMachineBlockEntity.chargeFromBatterySlot(int).voidАгрегирует редстоун с контроллера и всех частей мультиблока (как у дверей).static voidclientLaunchPadSmokeTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) protected static voidcommonServerTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, LaunchPadBaseBlockEntity be) Общий server‑tick для всех пусковых площадок.net.minecraft.world.inventory.AbstractContainerMenucreateMenu(int containerId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.entity.player.Player player) protected voidfinalizeLaunch(net.minecraft.world.entity.Entity missile) Финализация пуска: спавн entity, звук, расход ресурсов.Все баки этой машины.abstract NodeDirPos[]Угловые коннекторы мультиблока для подписки в энерго-/жидкостные сети.intDesignator slot index; rusted pad uses slot 3.int0 — нет шкалы (твердотопливные ракеты, отсутствует/неверная ракета) 1 — бак полон (топлива хватает для пуска) -1 — топливо есть, но недостаточноprotected intgetGaugeState(int tankIndex) static net.minecraft.world.item.ItemgetLaunchItemFor(net.minecraft.world.entity.EntityType<?> entityType) protected doubleСмещение точки старта ракеты относительно верха блока.net.minecraft.world.item.ItemStackMissile stack for BER / client preview.intMissile slot index; rusted pad overrides (same index 0).intnet.minecraft.world.phys.AABBTall missiles extend above the 1-block pad; default BE AABB would cull the BER.intgetState()getTanks()net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacketnet.minecraft.nbt.CompoundTagvoidhandleUpdateTag(net.minecraft.nbt.CompoundTag tag) booleanhasFuel()protected net.minecraft.world.entity.EntityinstantiateMissile(int targetX, int targetZ) Создание сущности ракеты из текущего слота.protected booleanisItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack) booleanisLoaded()booleanbooleanisMissileValid(net.minecraft.world.item.ItemStack stack) protected abstract booleanДополнительные условия в конкретной площадке (задержка, анимации и т.п.).booleanЗапуск по дизайнатору (слот 1).booleanlaunchToCoordinate(int targetX, int targetZ) Запуск по координатам (X/Z).booleanlaunchToEntity(net.minecraft.world.entity.Entity entity) Пуск по сущности-цели (радар, сопровождение).voidload(net.minecraft.nbt.CompoundTag tag) booleanneedsDesignator(net.minecraft.world.item.Item item) Нужен ли дизайнатор для запуска данной ракеты.static voidСвязывает предметы ракет с типами сущностей.protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) booleansendCommandEntity(net.minecraft.world.entity.Entity target) booleansendCommandPosition(net.minecraft.core.BlockPos pos) voidsetControllerRedstone(boolean powered) protected booleansetFuel(MissileItem missile) protected voidsubscribeToCornerNetworks(net.minecraft.world.level.Level level) protected booleanЗаливка бочек в баки.Пуск, инициируемый внешним триггером (например, IBomb.explode).Methods inherited from class com.hbm_m.block.entity.BaseMachineBlockEntity
canExtract, canReceive, chargeFromBatterySlot, chargeItemInSlot, createGhostItemsFromIngredients, createInventoryHandler, dropInventoryContents, ensureNetworkInitialized, extractEnergy, getCapability, getDefaultName, getEnergyDelta, getEnergyStored, getGhostItems, getInventory, getMaxEnergyStored, getPriority, getProvideSpeed, getReceiveSpeed, invalidateCaps, isCriticalSlot, isEnergyProviderItem, isEnergyReceiverItem, onDataPacket, onLoad, receiveEnergy, sendUpdateToClient, setEnergyCapacity, setEnergyStored, setLevel, setRemoved, 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.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, serializeNBTMethods inherited from interface net.minecraft.world.MenuProvider
getDisplayName
-
Field Details
-
TANK_CAPACITY_MB
public static final int TANK_CAPACITY_MB- See Also:
-
SLOT_MISSILE
public static final int SLOT_MISSILE- See Also:
-
SLOT_DESIGNATOR
public static final int SLOT_DESIGNATOR- See Also:
-
SLOT_BATTERY
public static final int SLOT_BATTERY- See Also:
-
SLOT_FUEL_IN
public static final int SLOT_FUEL_IN- See Also:
-
SLOT_FUEL_OUT
public static final int SLOT_FUEL_OUT- See Also:
-
SLOT_OXIDIZER_IN
public static final int SLOT_OXIDIZER_IN- See Also:
-
SLOT_OXIDIZER_OUT
public static final int SLOT_OXIDIZER_OUT- See Also:
-
SLOT_COUNT
public static final int SLOT_COUNT- See Also:
-
STATE_MISSING
public static final int STATE_MISSING- See Also:
-
STATE_LOADING
public static final int STATE_LOADING- See Also:
-
STATE_READY
public static final int STATE_READY- See Also:
-
MAX_POWER
protected static final long MAX_POWER- See Also:
-
MAX_RECEIVE
protected static final long MAX_RECEIVE- See Also:
-
MISSILES
protected static final Map<net.minecraft.world.item.Item,net.minecraft.world.entity.EntityType<? extends MissileBaseEntity>> MISSILESРегистрация ракет: Item -> тип сущности (заполняется вregisterLaunchables()). -
state
protected int stateТекущее логическое состояние площадки (для GUI). -
redstonePower
protected int redstonePower -
prevRedstonePower
protected int prevRedstonePower -
clientMissilePreview
protected net.minecraft.world.item.ItemStack clientMissilePreview -
delay
protected int delayКулдаун перед следующим пуском. Уменьшается каждый серверный тик. Когда > 0 — площадка считается «загружающейся» (STATE_LOADING). -
tanks
Топливный и окислительный баки (как в оригинале — по 24k mB).
-
-
Constructor Details
-
LaunchPadBaseBlockEntity
protected LaunchPadBaseBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getMissileSlot
public int getMissileSlot()Missile slot index; rusted pad overrides (same index 0). -
getDesignatorSlot
public int getDesignatorSlot()Designator slot index; rusted pad uses slot 3. -
registerLaunchables
public static void registerLaunchables()Связывает предметы ракет с типами сущностей. Вызывается изMainRegistry.commonSetup. -
getLaunchItemFor
@Nullable public static net.minecraft.world.item.Item getLaunchItemFor(net.minecraft.world.entity.EntityType<?> entityType) -
buildStandardConPos
-
getConPos
Угловые коннекторы мультиблока для подписки в энерго-/жидкостные сети. -
clientLaunchPadSmokeTick
public static void clientLaunchPadSmokeTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
commonServerTick
protected static void commonServerTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, LaunchPadBaseBlockEntity be) Общий server‑tick для всех пусковых площадок. -
chargeLaunchPadBattery
protected void chargeLaunchPadBattery()Креативная батарея мгновенно заполняет буфер; обычные — черезBaseMachineBlockEntity.chargeFromBatterySlot(int). -
transferFluidContainers
protected boolean transferFluidContainers()Заливка бочек в баки. Мутации слотов пишутся обратно в инвентарь (как вMachineChemicalPlantBlockEntity.transferFluidsFromItems()). -
getRenderBoundingBox
public net.minecraft.world.phys.AABB getRenderBoundingBox()Tall missiles extend above the 1-block pad; default BE AABB would cull the BER.- Specified by:
getRenderBoundingBoxin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
getRenderBoundingBoxin classBaseMachineBlockEntity
-
getMissilePreviewStack
public net.minecraft.world.item.ItemStack getMissilePreviewStack()Missile stack for BER / client preview. On client uses synced copy when GUI is closed. -
setFuel
- Returns:
true, если тип хотя бы одного бака изменился (для клиентской синхронизации)
-
getGaugeState
protected int getGaugeState(int tankIndex) -
getState
public int getState() -
getFuelState
public int getFuelState()0 — нет шкалы (твердотопливные ракеты, отсутствует/неверная ракета) 1 — бак полон (топлива хватает для пуска) -1 — топливо есть, но недостаточно -
getOxidizerState
public int getOxidizerState() -
hasFuel
public boolean hasFuel() -
isMissileValid
public boolean isMissileValid() -
isMissileValid
public boolean isMissileValid(@NotNull net.minecraft.world.item.ItemStack stack) -
canLaunch
public boolean canLaunch() -
isReadyForLaunch
protected abstract boolean isReadyForLaunch()Дополнительные условия в конкретной площадке (задержка, анимации и т.п.). -
launchToCoordinate
public boolean launchToCoordinate(int targetX, int targetZ) Запуск по координатам (X/Z). Возвращает true, если ракета реально запущена. -
launchFromDesignator
public boolean launchFromDesignator()Запуск по дизайнатору (слот 1). ЕслиneedsDesignator(Item)== true (по умолчанию для всех баллистических ракет), требуется заряженный/валидный дизайнатор; иначе пуск отменяется. -
launchToEntity
public boolean launchToEntity(net.minecraft.world.entity.Entity entity) Пуск по сущности-цели (радар, сопровождение). -
sendCommandPosition
public boolean sendCommandPosition(net.minecraft.core.BlockPos pos) - Specified by:
sendCommandPositionin interfaceIRadarCommandReceiver
-
sendCommandEntity
public boolean sendCommandEntity(net.minecraft.world.entity.Entity target) - Specified by:
sendCommandEntityin interfaceIRadarCommandReceiver
-
needsDesignator
public boolean needsDesignator(net.minecraft.world.item.Item item) Нужен ли дизайнатор для запуска данной ракеты. По умолчанию — да, как в оригинале (баллистические ракеты не летают «в никуда»). Подклассы могут переопределить (например, для FOB‑шаттлов). -
instantiateMissile
protected net.minecraft.world.entity.Entity instantiateMissile(int targetX, int targetZ) Создание сущности ракеты из текущего слота. -
finalizeLaunch
protected void finalizeLaunch(net.minecraft.world.entity.Entity missile) Финализация пуска: спавн entity, звук, расход ресурсов. -
triggerLaunch
Пуск, инициируемый внешним триггером (например, IBomb.explode). Возвращает совместимый с системой бомб код результата. -
checkRedstonePower
public void checkRedstonePower()Агрегирует редстоун с контроллера и всех частей мультиблока (как у дверей). -
setControllerRedstone
public void setControllerRedstone(boolean powered) -
getLaunchOffset
protected double getLaunchOffset()Смещение точки старта ракеты относительно верха блока. -
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classBaseMachineBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classBaseMachineBlockEntity
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag()- Overrides:
getUpdateTagin classBaseMachineBlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket getUpdatePacket()- Overrides:
getUpdatePacketin classBaseMachineBlockEntity
-
handleUpdateTag
public void handleUpdateTag(net.minecraft.nbt.CompoundTag tag) - Specified by:
handleUpdateTagin interfacenet.minecraftforge.common.extensions.IForgeBlockEntity- Overrides:
handleUpdateTagin classBaseMachineBlockEntity
-
isItemValidForSlot
protected boolean isItemValidForSlot(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
isItemValidForSlotin classBaseMachineBlockEntity
-
createMenu
public net.minecraft.world.inventory.AbstractContainerMenu createMenu(int containerId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.world.entity.player.Player player) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
canConnectEnergy
public boolean canConnectEnergy(net.minecraft.core.Direction side) Description copied from interface:IEnergyConnectorМожет ли этот блок подключаться к энергосети с указанной стороны- Specified by:
canConnectEnergyin interfaceIEnergyConnector- Overrides:
canConnectEnergyin classBaseMachineBlockEntity- Parameters:
side- Сторона подключения (null = любая)
-
getTanks
-
subscribeToCornerNetworks
protected void subscribeToCornerNetworks(net.minecraft.world.level.Level level) -
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
-
canConnect
public boolean canConnect(net.minecraft.world.level.material.Fluid fluid, net.minecraft.core.Direction fromDir) Description copied from interface:IFluidConnectorMK2Может ли этот коннектор принимать/отдавать жидкость указанного типа с указанной стороны.- Specified by:
canConnectin interfaceIFluidConnectorMK2- Parameters:
fluid- тип жидкостиfromDir- направление ОТ ЭТОГО узла к соседу (сторона, через которую идёт соединение)
-