Class BlockStateModifyCallback

java.lang.Object
dev.latvian.mods.kubejs.block.callback.BlockStateModifyCallback
Direct Known Subclasses:
BlockStateMirrorCallback, BlockStateModifyPlacementCallback, BlockStateRotateCallback

public class BlockStateModifyCallback extends Object
  • Constructor Details

    • BlockStateModifyCallback

      public BlockStateModifyCallback(net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • cycle

      @Info("Cycles the property") public <T extends Comparable<T>> BlockStateModifyCallback cycle(net.minecraft.world.level.block.state.properties.Property<T> property)
    • getState

      @Info("Gets the state. If it has been modified, gets the new state") public net.minecraft.world.level.block.state.BlockState getState()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProperties

      @Info("Get the properties this block has that can be changed") public Collection<net.minecraft.world.level.block.state.properties.Property<?>> getProperties()
    • hasProperty

      @Info("Checks if this block has the specified property") public <T extends Comparable<T>> boolean hasProperty(net.minecraft.world.level.block.state.properties.Property<T> property)
    • getValue

      @Info("Gets the value of the passed in property") public <T extends Comparable<T>> T getValue(net.minecraft.world.level.block.state.properties.Property<T> property)
    • get

      @Info("Gets the value of the pased in property") public <T extends Comparable<T>> T get(net.minecraft.world.level.block.state.properties.Property<T> property)
    • getOptionalValue

      @Info("Gets the value of the passed in property as an Optional. If the property does not exist in this block the Optional will be empty") public <T extends Comparable<T>> Optional<T> getOptionalValue(net.minecraft.world.level.block.state.properties.Property<T> property)
    • setValue

      @Info("Sets the value of the specified property") public <T extends Comparable<T>, V extends T> BlockStateModifyCallback setValue(net.minecraft.world.level.block.state.properties.Property<T> property, V comparable)
    • set

      @Info("Sets the value of the specified boolean property") public BlockStateModifyCallback set(net.minecraft.world.level.block.state.properties.BooleanProperty property, boolean value)
    • set

      @Info("Sets the value of the specified integer property") public BlockStateModifyCallback set(net.minecraft.world.level.block.state.properties.IntegerProperty property, Integer value)
    • set

      @Info("Sets the value of the specified enum property") public <T extends Enum<T> & net.minecraft.util.StringRepresentable> BlockStateModifyCallback set(net.minecraft.world.level.block.state.properties.EnumProperty<T> property, String value)
    • populateNeighbours

      public BlockStateModifyCallback populateNeighbours(Map<Map<net.minecraft.world.level.block.state.properties.Property<?>,Comparable<?>>,net.minecraft.world.level.block.state.BlockState> map)
    • getValues

      @Info("Get a map of this blocks properties to it\'s value") public Map<net.minecraft.world.level.block.state.properties.Property<?>,Comparable<?>> getValues()
    • rotate

      @Info("Rotate the block using the specified Rotation") public BlockStateModifyCallback rotate(net.minecraft.world.level.block.Rotation rotation)
    • mirror

      @Info("Mirror the block using the specified Mirror") public BlockStateModifyCallback mirror(net.minecraft.world.level.block.Mirror mirror)
    • updateShape

      @Info("Updates the shape of this block. Mostly used in waterloggable blocks to update the water flow") public BlockStateModifyCallback updateShape(net.minecraft.core.Direction direction, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.LevelAccessor levelAccessor, net.minecraft.core.BlockPos blockPos, net.minecraft.core.BlockPos blockPos2)