From 49ade553f0e93b5d56b4df371c22e8435013e804 Mon Sep 17 00:00:00 2001 From: Fenn Date: Mon, 15 Sep 2014 11:25:33 +0100 Subject: [PATCH] Fix the derps from that commit, i hate git. --- .../info/jbcs/minecraft/chisel/Chisel.java | 134 ------------------ 1 file changed, 134 deletions(-) diff --git a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java index 9f5fe7d9..452586e2 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java @@ -3,7 +3,6 @@ package info.jbcs.minecraft.chisel; import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; @@ -218,137 +217,4 @@ public class Chisel } } -<<<<<<< HEAD -======= - HashMap chiselUseTime = new HashMap(); - HashMap chiselUseLocation = new HashMap(); - Random random = new Random(); - - @SubscribeEvent - public void onPlayerClick(PlayerInteractEvent event) { - if(event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return; - if (!Configurations.enableChiseling) return; - EntityPlayer player = event.entityPlayer; - ItemStack stack = player.getHeldItem(); - if (stack == null || stack.getItem() != chisel) return; - - World world = event.world; - int x = event.x; - int y = event.y; - int z = event.z; - - Block block = world.getBlock(x, y, z); - int blockMeta = world.getBlockMetadata(x, y, z); - - ItemStack chiselTarget = null; - - if(stack.stackTagCompound != null) - { - chiselTarget = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget")); - } - - boolean chiselHasBlockInside = true; - - if(chiselTarget == null) - { - chiselHasBlockInside = false; - - Long useTime = chiselUseTime.get(player.getCommandSenderName()); - String loc = chiselUseLocation.get(player.getCommandSenderName()); - - if(useTime != null && chiselUseLocation != null && loc.equals(x + "|" + y + "|" + z)) - { - long cooldown = 20; - long time = world.getWorldInfo().getWorldTotalTime(); - - if(time>useTime-cooldown && time= variations.length) index = 0; - } - CarvingVariation var = variations[index]; - chiselTarget = new ItemStack(var.block, 1, var.damage); - } - } - Item result = null; - int targetMeta = 0; - - Item target = chiselTarget.getItem(); - - targetMeta = chiselTarget.getItemDamage(); - - boolean match = ItemChisel.carving.isVariationOfSameClass(Block.getBlockFromItem(target), targetMeta, block, blockMeta); - result = target; - - /* special case: stone can be carved to cobble and bricks */ - if(Configurations.chiselStoneToCobbleBricks) - { - if(!match && block.equals(Blocks.stone) && Block.getBlockFromItem(target).equals(ChiselBlocks.blockCobblestone)) - match = true; - if(!match && block.equals(Blocks.stone) && Block.getBlockFromItem(target).equals(ChiselBlocks.stoneBrick)) - match = true; - } - if(!match) - return; //noReplace = true; - - int updateValue = 1; - - if(!world.isRemote || chiselHasBlockInside) - { - world.setBlock(x, y, z, Block.getBlockFromItem(result), targetMeta, updateValue); - world.markBlockForUpdate(x, y, z); - } - - switch(FMLCommonHandler.instance().getEffectiveSide()) - { - case SERVER: - chiselUseTime.put(player.getCommandSenderName(), world.getWorldInfo().getWorldTotalTime()); - chiselUseLocation.put(player.getCommandSenderName(), x + "|" + y + "|" + z); - - try - { - //TODO chisel left click thingy - // Packet packet = Chisel.packet.create(Packets.CHISELED).writeInt(x).writeInt(y).writeInt(z); - // Chisel.packet.sendToAllAround(packet, new TargetPoint(player.dimension, x, y, z, 30.0f)); - } catch(Exception e) - { - e.printStackTrace(); - } - break; - - case CLIENT: - if(chiselHasBlockInside) - { - String sound = ItemChisel.carving.getVariationSound(result, chiselTarget.getItemDamage()); - GeneralChiselClient.spawnChiselEffect(x, y, z, sound); - } - break; - - default: - break; - } - - stack.damageItem(1, player); - if(stack.stackSize == 0) - { - player.inventory.mainInventory[player.inventory.currentItem] = chiselHasBlockInside ? chiselTarget : null; - } - } - - @SubscribeEvent - public void onBlockBreak(BlockEvent.BreakEvent event) { - if (!Configurations.enableChiseling) return; - EntityPlayer player = event.getPlayer(); - ItemStack stack = player.getHeldItem(); - if (stack == null || stack.getItem() != chisel) return; ->>>>>>> origin/master - }