mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-13 00:37:42 +00:00
This commit is contained in:
1 parent
3fb1fc3972
commit
ca62dd0de3
1 file changed
+11
-5
@@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
@@ -86,11 +87,8 @@ public final class ChiselController {
|
||||
for (int i = 0; i < variations.length; i++) {
|
||||
ICarvingVariation v = variations[i];
|
||||
if (v.getBlock() == block && v.getBlockMeta() == metadata) {
|
||||
if(shifting)
|
||||
idx = (i - 1) % variations.length; // move to the previous in the group
|
||||
else
|
||||
idx = (i + 1) % variations.length; // move to the next in the group
|
||||
break;
|
||||
idx = i + variations.length + (shifting ? -1 : 1);
|
||||
idx %= variations.length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,4 +113,12 @@ public final class ChiselController {
|
||||
}
|
||||
}
|
||||
|
||||
// This still shows the block being broken, but it's better than nothing
|
||||
@SubscribeEvent
|
||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||
ItemStack stack = event.getPlayer().getCurrentEquippedItem();
|
||||
if (event.getPlayer().capabilities.isCreativeMode && stack != null && stack.getItem() instanceof IChiselItem) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user