Class ThrusterBrain

java.lang.Object
net.jcm.vsch.blocks.thruster.ThrusterBrain
All Implemented Interfaces:
net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.energy.IEnergyStorage, net.minecraftforge.fluids.capability.IFluidHandler

public class ThrusterBrain extends Object implements net.minecraftforge.energy.IEnergyStorage, net.minecraftforge.fluids.capability.IFluidHandler, net.minecraftforge.common.capabilities.ICapabilityProvider
  • Constructor Details

  • Method Details

    • getEngine

      public ThrusterEngine getEngine()
    • getPeripheralType

      public String getPeripheralType()
    • getThrusterCount

      public int getThrusterCount()
    • getThrusters

      public List<AbstractThrusterBlockEntity> getThrusters()
    • setThrusterMode

      public void setThrusterMode(ThrusterData.ThrusterMode mode)
    • getCurrentPower

      public double getCurrentPower()
    • getMaxThrottle

      public double getMaxThrottle()
    • setCurrentPower

      protected void setCurrentPower(double power)
    • getCurrentThrottle

      public double getCurrentThrottle()
    • getPower

      public double getPower()
      Returns:
      thruster power in range of [0.0, 1.0]
    • setPower

      public void setPower(double power)
    • getPeripheralMode

      public boolean getPeripheralMode()
    • setPeripheralMode

      public void setPeripheralMode(boolean on)
    • getDataBlock

      public AbstractThrusterBlockEntity getDataBlock()
    • getThrusterMode

      public ThrusterData.ThrusterMode getThrusterMode()
    • getThrusterData

      public ThrusterData getThrusterData()
    • setChanged

      public void setChanged()
    • markPowerChanged

      protected void markPowerChanged()
    • copySettingFrom

      public void copySettingFrom(ThrusterBrain origin)
    • readFromNBT

      public void readFromNBT(net.minecraft.nbt.CompoundTag data)
    • writeToNBT

      public net.minecraft.nbt.CompoundTag writeToNBT(net.minecraft.nbt.CompoundTag data)
    • getCapability

      public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> cap, net.minecraft.core.Direction direction)
      Specified by:
      getCapability in interface net.minecraftforge.common.capabilities.ICapabilityProvider
    • tick

      public void tick(net.minecraft.server.level.ServerLevel level)
    • neighborChanged

      public void neighborChanged(AbstractThrusterBlockEntity thruster, net.minecraft.world.level.block.Block block, net.minecraft.core.BlockPos pos, boolean moving)
    • canMerge

      public boolean canMerge(ThrusterBrain other)
    • receiveEnergy

      public int receiveEnergy(int maxReceive, boolean simulate)
      Specified by:
      receiveEnergy in interface net.minecraftforge.energy.IEnergyStorage
    • extractEnergy

      public int extractEnergy(int maxExtract, boolean simulate)
      Specified by:
      extractEnergy in interface net.minecraftforge.energy.IEnergyStorage
    • getEnergyStored

      public int getEnergyStored()
      Specified by:
      getEnergyStored in interface net.minecraftforge.energy.IEnergyStorage
    • getMaxEnergyStored

      public int getMaxEnergyStored()
      Specified by:
      getMaxEnergyStored in interface net.minecraftforge.energy.IEnergyStorage
    • canExtract

      public boolean canExtract()
      Specified by:
      canExtract in interface net.minecraftforge.energy.IEnergyStorage
    • canReceive

      public boolean canReceive()
      Specified by:
      canReceive in interface net.minecraftforge.energy.IEnergyStorage
    • getTanks

      public int getTanks()
      Specified by:
      getTanks in interface net.minecraftforge.fluids.capability.IFluidHandler
    • getFluidInTank

      public net.minecraftforge.fluids.FluidStack getFluidInTank(int tank)
      Specified by:
      getFluidInTank in interface net.minecraftforge.fluids.capability.IFluidHandler
    • getTankCapacity

      public int getTankCapacity(int tank)
      Specified by:
      getTankCapacity in interface net.minecraftforge.fluids.capability.IFluidHandler
    • isFluidValid

      public boolean isFluidValid(int tank, net.minecraftforge.fluids.FluidStack stack)
      Specified by:
      isFluidValid in interface net.minecraftforge.fluids.capability.IFluidHandler
    • fill

      public int fill(net.minecraftforge.fluids.FluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
      Specified by:
      fill in interface net.minecraftforge.fluids.capability.IFluidHandler
    • drain

      public net.minecraftforge.fluids.FluidStack drain(net.minecraftforge.fluids.FluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
      Specified by:
      drain in interface net.minecraftforge.fluids.capability.IFluidHandler
    • drain

      public net.minecraftforge.fluids.FluidStack drain(int maxDrain, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
      Specified by:
      drain in interface net.minecraftforge.fluids.capability.IFluidHandler