Search in sources :

Example 1 with CraftBlockData

use of org.bukkit.craftbukkit.v1_17_R1.block.data.CraftBlockData in project Denizen-For-Bukkit by DenizenScript.

the class EntityHelperImpl method setFallingBlockType.

@Override
public void setFallingBlockType(FallingBlock entity, BlockData block) {
    BlockState state = ((CraftBlockData) block).getState();
    FallingBlockEntity nmsEntity = ((CraftFallingBlock) entity).getHandle();
    try {
        FALLINGBLOCK_TYPE_SETTER.invoke(nmsEntity, state);
    } catch (Throwable ex) {
        Debug.echoError(ex);
    }
}
Also used : FallingBlockEntity(net.minecraft.world.entity.item.FallingBlockEntity) CraftBlockData(org.bukkit.craftbukkit.v1_17_R1.block.data.CraftBlockData) BlockState(net.minecraft.world.level.block.state.BlockState)

Example 2 with CraftBlockData

use of org.bukkit.craftbukkit.v1_17_R1.block.data.CraftBlockData in project Denizen-For-Bukkit by DenizenScript.

the class EntityHelperImpl method setFallingBlockType.

@Override
public void setFallingBlockType(FallingBlock entity, BlockData block) {
    BlockState state = ((CraftBlockData) block).getState();
    FallingBlockEntity nmsEntity = ((CraftFallingBlock) entity).getHandle();
    try {
        FALLINGBLOCK_TYPE_SETTER.invoke(nmsEntity, state);
    } catch (Throwable ex) {
        Debug.echoError(ex);
    }
}
Also used : FallingBlockEntity(net.minecraft.world.entity.item.FallingBlockEntity) CraftBlockData(org.bukkit.craftbukkit.v1_18_R1.block.data.CraftBlockData) BlockState(net.minecraft.world.level.block.state.BlockState)

Aggregations

FallingBlockEntity (net.minecraft.world.entity.item.FallingBlockEntity)2 BlockState (net.minecraft.world.level.block.state.BlockState)2 CraftBlockData (org.bukkit.craftbukkit.v1_17_R1.block.data.CraftBlockData)1 CraftBlockData (org.bukkit.craftbukkit.v1_18_R1.block.data.CraftBlockData)1