I'm running ScriptCraft with Tekkit Lite + BukkitForge (build 255).
In an unmodified ScriptCraft and BukkitForge, I'm unable to set blocks to type 0. ScriptCraft retrieves a block at a given position and uses setTypeIdAndData on the block to set the block type and metadata. This works for any block except air blocks (ID 0).
I'm new to BukkitForge and the Bukkit API, but I think the bug may be in the following line in CraftBlock.java:setTypeIdAndData():
if (type > 4096 || data > 16 || net.minecraft.block.Block.blocksList[type] == null) {
What happens if type is 0?
Would something like this work better?
if (type > 4096 || data > 16 || (type != 0 && net.minecraft.block.Block.blocksList[type] == null)) {
As a workaround, I've modified ScriptCraft on my server to use block.setTypeId when setting blocks to type 0.
I'm running ScriptCraft with Tekkit Lite + BukkitForge (build 255).
In an unmodified ScriptCraft and BukkitForge, I'm unable to set blocks to type 0. ScriptCraft retrieves a block at a given position and uses setTypeIdAndData on the block to set the block type and metadata. This works for any block except air blocks (ID 0).
I'm new to BukkitForge and the Bukkit API, but I think the bug may be in the following line in CraftBlock.java:setTypeIdAndData():
What happens if type is 0?
Would something like this work better?
As a workaround, I've modified ScriptCraft on my server to use block.setTypeId when setting blocks to type 0.
Cheers,