Class BlockBehaviorLiquid

java.lang.Object
org.cloudburstmc.api.block.behavior.BlockBehavior
Direct Known Subclasses:
BlockBehaviorLava, BlockBehaviorWater

public abstract class BlockBehaviorLiquid extends BlockBehaviorTransparent
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
     
    protected org.cloudburstmc.api.block.BlockType
     
    protected com.nukkitx.math.vector.Vector3f
     
    protected org.cloudburstmc.api.block.BlockType
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockBehaviorLiquid​(org.cloudburstmc.api.block.BlockType flowingId, org.cloudburstmc.api.block.BlockType stationaryId)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.nukkitx.math.vector.Vector3f
    addVelocityToEntity​(org.cloudburstmc.api.block.Block block, com.nukkitx.math.vector.Vector3f vector, org.cloudburstmc.api.entity.Entity entity)
     
    protected boolean
    canFlowInto​(org.cloudburstmc.api.block.Block block)
     
    protected void
    checkForHarden​(org.cloudburstmc.api.block.Block block)
     
    void
     
    protected void
    flowIntoBlock​(org.cloudburstmc.api.block.Block block, int newFlowDecay, boolean falling)
     
    org.cloudburstmc.api.item.ItemStack[]
    getDrops​(org.cloudburstmc.api.block.Block block, org.cloudburstmc.api.item.ItemStack hand)
     
    protected int
    getEffectiveFlowDecay​(org.cloudburstmc.api.block.BlockState state)
     
    protected int
    getFlowDecay​(org.cloudburstmc.api.block.BlockState state)
     
    int
    getFlowDecayPerBlock​(org.cloudburstmc.api.block.Block block)
     
    org.cloudburstmc.api.block.BlockType
     
    com.nukkitx.math.vector.Vector3f
    getFlowVector​(org.cloudburstmc.api.block.Block block)
     
    static float
    getFluidHeightPercent​(org.cloudburstmc.api.block.BlockState state)
     
    float
    getMaxY​(org.cloudburstmc.api.block.Block block)
     
    protected org.cloudburstmc.api.block.BlockState
    getState​(int decay, boolean falling)
     
    org.cloudburstmc.api.block.BlockType
     
    boolean
     
    boolean
     
    boolean
    isSameLiquid​(org.cloudburstmc.api.block.BlockType other)
     
    static boolean
    isWater​(org.cloudburstmc.api.block.BlockType type)
     
    protected boolean
    liquidCollide​(org.cloudburstmc.api.block.Block cause, org.cloudburstmc.api.block.BlockState result)
     
    void
    onEntityCollide​(org.cloudburstmc.api.block.Block block, org.cloudburstmc.api.entity.Entity entity)
     
    int
    onUpdate​(org.cloudburstmc.api.block.Block block, int type)
     
    protected org.cloudburstmc.api.util.AxisAlignedBB
     
    org.cloudburstmc.api.item.ItemStack
    toItem​(org.cloudburstmc.api.block.Block block)
     
    protected void
    triggerLavaMixEffects​(org.cloudburstmc.api.level.Level level, com.nukkitx.math.vector.Vector3f pos)
     
    boolean
     

    Methods inherited from class org.cloudburstmc.server.block.behavior.BlockBehaviorTransparent

    getColor

    Methods inherited from class org.cloudburstmc.server.block.behavior.BaseBlockBehavior

    getBreakTime, placeBlock

    Methods inherited from class org.cloudburstmc.api.block.behavior.BlockBehavior

    canBeActivated, canBeBrokenWith, canBeClimbed, canBeFlooded, canBePlaced, canBePushed, canBeReplaced, canHarvestWithHand, canPassThrough, canSilkTouch, canWaterlogFlowing, canWaterlogSource, checkTool, clone, collidesWithBB, collidesWithBB, getBoundingBox, getBoundingBox, getBoundingBox, getBurnAbility, getBurnChance, getCollisionBoxes, getCollisionBoxes, getComparatorInputOverride, getDescriptionId, getDropExp, getFilterLevel, getFrictionFactor, getHardness, getLightLevel, getMinimalTier, getResistance, getSaveId, getStrongPower, getToolType, getWeakPower, hasComparatorInputOverride, isBreakable, isNormalBlock, isPowerSource, isSolid, isTransparent, onActivate, onActivate, onBreak, onBreak, place, placeBlock, placeBlock, placeBlock, removeBlock, removeBlock, tickRate

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • flowingId

      protected final org.cloudburstmc.api.block.BlockType flowingId
    • stationaryId

      protected final org.cloudburstmc.api.block.BlockType stationaryId
    • adjacentSources

      public int adjacentSources
    • flowVector

      protected com.nukkitx.math.vector.Vector3f flowVector
  • Constructor Details

    • BlockBehaviorLiquid

      public BlockBehaviorLiquid(org.cloudburstmc.api.block.BlockType flowingId, org.cloudburstmc.api.block.BlockType stationaryId)
  • Method Details

    • recalculateBoundingBox

      protected org.cloudburstmc.api.util.AxisAlignedBB recalculateBoundingBox()
    • getDrops

      public org.cloudburstmc.api.item.ItemStack[] getDrops(org.cloudburstmc.api.block.Block block, org.cloudburstmc.api.item.ItemStack hand)
      Overrides:
      getDrops in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • hasEntityCollision

      public boolean hasEntityCollision()
      Overrides:
      hasEntityCollision in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • isLiquid

      public boolean isLiquid()
      Overrides:
      isLiquid in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • getMaxY

      public float getMaxY(org.cloudburstmc.api.block.Block block)
    • getFluidHeightPercent

      public static float getFluidHeightPercent(org.cloudburstmc.api.block.BlockState state)
    • getFlowDecay

      protected int getFlowDecay(org.cloudburstmc.api.block.BlockState state)
    • getEffectiveFlowDecay

      protected int getEffectiveFlowDecay(org.cloudburstmc.api.block.BlockState state)
    • clearCaches

      public void clearCaches()
    • getFlowVector

      public com.nukkitx.math.vector.Vector3f getFlowVector(org.cloudburstmc.api.block.Block block)
    • addVelocityToEntity

      public com.nukkitx.math.vector.Vector3f addVelocityToEntity(org.cloudburstmc.api.block.Block block, com.nukkitx.math.vector.Vector3f vector, org.cloudburstmc.api.entity.Entity entity)
      Overrides:
      addVelocityToEntity in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • getFlowDecayPerBlock

      public int getFlowDecayPerBlock(org.cloudburstmc.api.block.Block block)
    • onUpdate

      public int onUpdate(org.cloudburstmc.api.block.Block block, int type)
      Overrides:
      onUpdate in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • flowIntoBlock

      protected void flowIntoBlock(org.cloudburstmc.api.block.Block block, int newFlowDecay, boolean falling)
    • checkForHarden

      protected void checkForHarden(org.cloudburstmc.api.block.Block block)
    • triggerLavaMixEffects

      protected void triggerLavaMixEffects(org.cloudburstmc.api.level.Level level, com.nukkitx.math.vector.Vector3f pos)
    • onEntityCollide

      public void onEntityCollide(org.cloudburstmc.api.block.Block block, org.cloudburstmc.api.entity.Entity entity)
      Overrides:
      onEntityCollide in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • liquidCollide

      protected boolean liquidCollide(org.cloudburstmc.api.block.Block cause, org.cloudburstmc.api.block.BlockState result)
    • canFlowInto

      protected boolean canFlowInto(org.cloudburstmc.api.block.Block block)
    • getState

      protected org.cloudburstmc.api.block.BlockState getState(int decay, boolean falling)
    • toItem

      public org.cloudburstmc.api.item.ItemStack toItem(org.cloudburstmc.api.block.Block block)
      Overrides:
      toItem in class org.cloudburstmc.api.block.behavior.BlockBehavior
    • usesWaterLogging

      public boolean usesWaterLogging()
    • isSameLiquid

      public boolean isSameLiquid(org.cloudburstmc.api.block.BlockType other)
    • getFlowingType

      public org.cloudburstmc.api.block.BlockType getFlowingType()
    • getStationaryId

      public org.cloudburstmc.api.block.BlockType getStationaryId()
    • isWater

      public static boolean isWater(org.cloudburstmc.api.block.BlockType type)