Class WorldSharedTank

java.lang.Object
net.minecraftforge.fluids.capability.templates.FluidTank
org.cyclops.cyclopscore.fluid.Tank
org.cyclops.cyclopscore.fluid.SingleUseTank
org.cyclops.evilcraft.core.fluid.WorldSharedTank
All Implemented Interfaces:
net.minecraftforge.fluids.capability.IFluidHandler, net.minecraftforge.fluids.IFluidTank, org.cyclops.cyclopscore.capability.fluid.IFluidHandlerCapacity, org.cyclops.cyclopscore.capability.fluid.IFluidHandlerMutable

public class WorldSharedTank extends org.cyclops.cyclopscore.fluid.SingleUseTank
A tank that has shared contents for a given ID. Based on World NBT storage.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Tank data stored in the world.

    Nested classes/interfaces inherited from interface net.minecraftforge.fluids.capability.IFluidHandler

    net.minecraftforge.fluids.capability.IFluidHandler.FluidAction
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The NBT name for the fluid tank.
    protected String
     

    Fields inherited from class org.cyclops.cyclopscore.fluid.SingleUseTank

    NBT_ACCEPTED_FLUID

    Fields inherited from class net.minecraftforge.fluids.capability.templates.FluidTank

    capacity, fluid, validator
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldSharedTank(int capacity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraftforge.fluids.FluidStack
    drain(int maxDrain, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
     
    net.minecraftforge.fluids.FluidStack
    drain(net.minecraftforge.fluids.FluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
     
    int
    fill(net.minecraftforge.fluids.FluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
     
    net.minecraft.world.level.material.Fluid
     
    net.minecraftforge.fluids.FluidStack
     
    int
     
    int
    Get the previous fluid amount, used for interpolating fluid amounts client-side.
    int
     
    Get the tank ID.
    void
    readTankFromNBT(net.minecraft.nbt.CompoundTag nbt)
     
    protected void
     
    protected boolean
     
    void
    Reset the previous fluid storage, used for interpolating fluid amounts client-side.
    void
    setFluid(net.minecraftforge.fluids.FluidStack fluid)
     
    void
    setTankID(String tankID)
    Set the tank ID.
    void
    writeTankToNBT(net.minecraft.nbt.CompoundTag nbt)
     
    protected void
     

    Methods inherited from class org.cyclops.cyclopscore.fluid.SingleUseTank

    addDirtyMarkListener, removeDirtyMarkListener, reset, sendUpdate, setAcceptedFluid

    Methods inherited from class org.cyclops.cyclopscore.fluid.Tank

    getFluidType, getTankCapacity, isEmpty, isFull, readFromNBT, readFromNBT, setFluidInTank, setTankCapacity, writeToNBT, writeToNBT

    Methods inherited from class net.minecraftforge.fluids.capability.templates.FluidTank

    getCapacity, getFluidInTank, getTanks, isFluidValid, isFluidValid, onContentsChanged, setCapacity, setValidator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraftforge.fluids.capability.IFluidHandler

    getFluidInTank, getTanks, isFluidValid
  • Field Details

  • Constructor Details

    • WorldSharedTank

      public WorldSharedTank(int capacity)
  • Method Details

    • resetPreviousFluid

      public void resetPreviousFluid()
      Reset the previous fluid storage, used for interpolating fluid amounts client-side.
    • getPreviousAmount

      public int getPreviousAmount()
      Get the previous fluid amount, used for interpolating fluid amounts client-side.
      Returns:
      The previous amount.
    • writeTankToNBT

      public void writeTankToNBT(net.minecraft.nbt.CompoundTag nbt)
      Overrides:
      writeTankToNBT in class org.cyclops.cyclopscore.fluid.SingleUseTank
    • readTankFromNBT

      public void readTankFromNBT(net.minecraft.nbt.CompoundTag nbt)
      Overrides:
      readTankFromNBT in class org.cyclops.cyclopscore.fluid.SingleUseTank
    • readWorldFluid

      protected void readWorldFluid()
    • writeWorldFluid

      protected void writeWorldFluid()
    • setFluid

      public void setFluid(net.minecraftforge.fluids.FluidStack fluid)
      Overrides:
      setFluid in class net.minecraftforge.fluids.capability.templates.FluidTank
    • getFluid

      public net.minecraftforge.fluids.FluidStack getFluid()
      Specified by:
      getFluid in interface net.minecraftforge.fluids.IFluidTank
      Overrides:
      getFluid in class net.minecraftforge.fluids.capability.templates.FluidTank
    • getFluidAmount

      public int getFluidAmount()
      Specified by:
      getFluidAmount in interface net.minecraftforge.fluids.IFluidTank
      Overrides:
      getFluidAmount in class net.minecraftforge.fluids.capability.templates.FluidTank
    • getSpace

      public int getSpace()
      Overrides:
      getSpace in class net.minecraftforge.fluids.capability.templates.FluidTank
    • 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
      Specified by:
      fill in interface net.minecraftforge.fluids.IFluidTank
      Overrides:
      fill in class org.cyclops.cyclopscore.fluid.SingleUseTank
    • 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
      Specified by:
      drain in interface net.minecraftforge.fluids.IFluidTank
      Overrides:
      drain in class org.cyclops.cyclopscore.fluid.SingleUseTank
    • 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
      Specified by:
      drain in interface net.minecraftforge.fluids.IFluidTank
      Overrides:
      drain in class org.cyclops.cyclopscore.fluid.SingleUseTank
    • getTankID

      public String getTankID()
      Get the tank ID.
      Returns:
      The tank ID.
    • setTankID

      public void setTankID(String tankID)
      Set the tank ID.
      Parameters:
      tankID - The new tank ID.
    • getAcceptedFluid

      public net.minecraft.world.level.material.Fluid getAcceptedFluid()
      Overrides:
      getAcceptedFluid in class org.cyclops.cyclopscore.fluid.SingleUseTank
    • replaceInnerFluid

      protected boolean replaceInnerFluid()
      Overrides:
      replaceInnerFluid in class org.cyclops.cyclopscore.fluid.Tank