From e55dc197cb873f790c1955bc69e2a3ed6ee0ace8 Mon Sep 17 00:00:00 2001 From: TheCricket Date: Mon, 27 Oct 2014 16:26:14 -0400 Subject: [PATCH] Added in all of the original files --- LICENSE | 11 +- README.md | 4 +- gradlew | 0 .../info/jbcs/minecraft/chisel/Chisel.java | 77 +++++-- .../jbcs/minecraft/chisel/CommonProxy.java | 11 + .../jbcs/minecraft/chisel/Configurations.java | 2 + .../chisel/block/BlockAutoChisel.java | 62 ++++- .../tileentity/TileEntityAutoChisel.java | 214 ++++++++++++++++++ .../chisel/client/gui/GuiAutoChisel.java | 26 +++ .../chisel/inventory/ContainerAutoChisel.java | 76 +++++++ .../chisel/inventory/ContainerChisel.java | 4 +- .../minecraft/chisel/item/ItemChisel.java | 3 +- .../assets/chisel/textures/autochisel-gui.png | Bin 4609 -> 7419 bytes src/main/resources/mcmod.info | 2 +- 14 files changed, 458 insertions(+), 34 deletions(-) mode change 100755 => 100644 gradlew create mode 100644 src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java create mode 100644 src/main/java/info/jbcs/minecraft/chisel/client/gui/GuiAutoChisel.java create mode 100644 src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerAutoChisel.java diff --git a/LICENSE b/LICENSE index d159169d..d6a93266 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ - GNU GENERAL PUBLIC LICENSE +GNU GENERAL PUBLIC LICENSE Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., + Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - Copyright (C) + {description} + Copyright (C) {year} {fullname} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. - , 1 April 1989 + {signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into @@ -337,3 +337,4 @@ proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. + diff --git a/README.md b/README.md index 14a079b1..51c0ca45 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Chisel ======= Chisel is a mod for Minecraft which adds aesthetic blocks to the game through the use of a chisel. Originally created by -AUTOMATIC_MAIDEN, it was ported to Minecraft 1.7.2 by asie, and maintained by Pokefenn. +AUTOMATIC_MAIDEN, it was ported to Minecraft 1.7.2 by asie, and maintained by Pokefenn during 1.7.10 and now maintained by Cricket. Issue Reporting ---------------- @@ -27,4 +27,4 @@ To set up the mod as to allow you to make changes, do the following: 7. After opening the project in IntelliJ, run 'gradlew genIntellijRuns' in the command terminal you opened earlier. 8. You now have a functional local copy of Chisel, ready to develop on. -MAKE SURE TO UPDATE YOUR FORK BEFORE MAKING A PULL REQUEST. \ No newline at end of file +MAKE SURE TO UPDATE YOUR FORK BEFORE MAKING A PULL REQUEST. diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 diff --git a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java index 0f0adbe9..02eafe8a 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java @@ -1,26 +1,14 @@ 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.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; -import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.network.IGuiHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.Type; +import info.jbcs.minecraft.chisel.block.BlockAutoChisel; import info.jbcs.minecraft.chisel.block.BlockCarvable; -import info.jbcs.minecraft.chisel.carving.Carving; +import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel; +import info.jbcs.minecraft.chisel.client.gui.GuiAutoChisel; import info.jbcs.minecraft.chisel.client.gui.GuiChisel; import info.jbcs.minecraft.chisel.entity.EntityBallOMoss; import info.jbcs.minecraft.chisel.entity.EntityCloudInABottle; import info.jbcs.minecraft.chisel.entity.EntitySmashingRock; +import info.jbcs.minecraft.chisel.inventory.ContainerAutoChisel; import info.jbcs.minecraft.chisel.inventory.ContainerChisel; import info.jbcs.minecraft.chisel.inventory.InventoryChiselSelection; import info.jbcs.minecraft.chisel.item.ItemBallOMoss; @@ -30,15 +18,36 @@ import info.jbcs.minecraft.chisel.item.ItemSmashingRock; import info.jbcs.minecraft.chisel.world.GeneratorLimestone; import info.jbcs.minecraft.chisel.world.GeneratorMarble; import info.jbcs.minecraft.utilities.General; + +import java.io.File; + import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; - -import java.io.File; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.Type; @Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = "@MOD_VERSION@", guiFactory = "info.jbcs.minecraft.chisel.client.gui.GuiFactory"/*, dependencies = "after:ForgeMicroblock;"*/) @@ -61,6 +70,8 @@ public class Chisel public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID+":step.templeblock", 1.0f, 1.0f); public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f); + public static Block autoChisel; + public static int RenderEldritchId; public static int RenderCTMId; public static int RenderCarpetId; @@ -130,9 +141,15 @@ public class Chisel } }; - chisel = (ItemChisel) new ItemChisel(Carving.chisel).setTextureName("chisel:chisel").setCreativeTab(CreativeTabs.tabTools); + chisel = (ItemChisel) new ItemChisel().setTextureName("chisel:chisel").setCreativeTab(CreativeTabs.tabTools); GameRegistry.registerItem(chisel, "chisel"); + if(Configurations.featureEnabled("autoChisel")){ + autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChisel").setCreativeTab(CreativeTabs.tabTools); + GameRegistry.registerBlock(autoChisel, autoChisel.getUnlocalizedName()); + proxy.registerTileEntities(); + } + if(Configurations.featureEnabled("cloud")) { itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle().setTextureName("Chisel:cloudinabottle").setCreativeTab(CreativeTabs.tabTools); @@ -167,13 +184,31 @@ public class Chisel @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new ContainerChisel(player.inventory, new InventoryChiselSelection(null)); + switch (ID){ + case 0: + return new ContainerChisel(player.inventory, new InventoryChiselSelection(null)); + case 1: + TileEntity tileentity = world.getTileEntity(x, y, z); + if (tileentity instanceof TileEntityAutoChisel) + return new ContainerAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity); + default: + return null; + } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new GuiChisel(player.inventory, new InventoryChiselSelection(null)); + switch (ID){ + case 0: + return new GuiChisel(player.inventory, new InventoryChiselSelection(null)); + case 1: + TileEntity tileentity = world.getTileEntity(x, y, z); + if (tileentity instanceof TileEntityAutoChisel) + return new GuiAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity); + default: + return null; + } } }); diff --git a/src/main/java/info/jbcs/minecraft/chisel/CommonProxy.java b/src/main/java/info/jbcs/minecraft/chisel/CommonProxy.java index a2e38f0f..d6fc4c4a 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/CommonProxy.java +++ b/src/main/java/info/jbcs/minecraft/chisel/CommonProxy.java @@ -1,7 +1,18 @@ package info.jbcs.minecraft.chisel; +import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel; +import net.minecraft.tileentity.TileEntity; +import cpw.mods.fml.common.registry.GameRegistry; + public class CommonProxy { + public void registerTileEntities() { + registerTileEntity(TileEntityAutoChisel.class, "autoChisel"); + } + + private void registerTileEntity(Class cls, String baseName) { + GameRegistry.registerTileEntity(cls, "tile.autoChisel." + baseName); + } public void preInit() { } diff --git a/src/main/java/info/jbcs/minecraft/chisel/Configurations.java b/src/main/java/info/jbcs/minecraft/chisel/Configurations.java index 32fe4815..f382403b 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Configurations.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Configurations.java @@ -15,6 +15,7 @@ public class Configurations public static boolean chiselStoneToCobbleBricks; public static boolean enableChiseling; public static boolean chiselRecipe; + public static boolean autoChisel; public static int factoryBlockAmount; public static int particlesTickrate; @@ -38,6 +39,7 @@ public class Configurations marbleAmount = config.get("worldgen", "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7); limestoneAmount = config.get("worldgen", "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8); chiselRecipe = config.get("general", "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false); + autoChisel = config.get("general", "autoChisel", true, "Should people be allowed to use the auto chisel").getBoolean(false); if(config.hasChanged()) { diff --git a/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java b/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java index 65b1b75e..09cdcd13 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java @@ -1,7 +1,18 @@ package info.jbcs.minecraft.chisel.block; +import info.jbcs.minecraft.chisel.Chisel; +import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel; + +import java.util.Random; + +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -14,9 +25,58 @@ public class BlockAutoChisel extends BlockContainer setHardness(1F); } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1, float y1, float z1){ + TileEntity tile = world.getTileEntity(x, y, z); + if(world.isRemote) + return true; + if(tile !=null && tile instanceof TileEntityAutoChisel) + player.openGui(Chisel.instance, 1, world, x, y, z); + return true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int par6){ + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, block, par6); + } + + private void dropItems(World world, int x, int y, int z){ + Random random = new Random(); + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(!(tileEntity instanceof IInventory)){ + return; + } + + IInventory inventory = (IInventory) tileEntity; + + for(int c = 0; c < inventory.getSizeInventory(); c++){ + ItemStack stack = inventory.getStackInSlot(c); + + if(stack != null && stack.stackSize > 0){ + float rx = random.nextFloat() * 0.8F + 0.1F; + float ry = random.nextFloat() * 0.8F + 0.1F; + float rz = random.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, stack); + + if(stack.hasTagCompound()){ + entityItem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy()); + } + + float factor = 0.05F; + entityItem.motionX = random.nextGaussian() * factor; + entityItem.motionY = random.nextGaussian() * factor + 0.2F; + entityItem.motionZ = random.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + stack.stackSize = 0; + } + } + } + @Override public TileEntity createNewTileEntity(World var1, int var2) { - return null; + return new TileEntityAutoChisel(); } } diff --git a/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java b/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java new file mode 100644 index 00000000..fb1d2307 --- /dev/null +++ b/src/main/java/info/jbcs/minecraft/chisel/block/tileentity/TileEntityAutoChisel.java @@ -0,0 +1,214 @@ +package info.jbcs.minecraft.chisel.block.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityAutoChisel extends TileEntity implements ISidedInventory{ + + private ItemStack[] inventory = new ItemStack[3]; + private String name = "autoChisel"; + + @Override + public boolean canUpdate() { + return false; + } + + @Override + public ItemStack decrStackSize(int slot, int size) { + if (inventory[slot] != null) { + ItemStack is; + if (inventory[slot].stackSize <= size) { + is = inventory[slot]; + inventory[slot] = null; + return is; + } else { + is = inventory[slot].splitStack(size); + if (inventory[slot].stackSize == 0) + inventory[slot] = null; + return is; + } + } else + return null; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList tags = nbt.getTagList("Items", 10); + inventory = new ItemStack[getSizeInventory()]; + + for (int i = 0; i < tags.tagCount(); i++) { + NBTTagCompound data = tags.getCompoundTagAt(i); + int j = data.getByte("Slot") & 255; + + if (j >= 0 && j < inventory.length) { + inventory[j] = ItemStack.loadItemStackFromNBT(data); + } + } + + if (nbt.hasKey("CustomName", 8)) + { + this.name = nbt.getString("CustomName"); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList tags = new NBTTagList(); + + for (int i = 0; i < inventory.length; i++) { + if (inventory[i] != null) { + NBTTagCompound data = new NBTTagCompound(); + data.setByte("Slot", (byte) i); + inventory[i].writeToNBT(data); + tags.appendTag(data); + } + } + + nbt.setTag("Items", tags); + + if (this.hasCustomInventoryName()) + { + nbt.setString("CustomName", this.name); + } + } + + @Override + public int getSizeInventory(){ + return inventory.length; + } + + @Override + public ItemStack getStackInSlot(int slot){ + return inventory[slot]; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + if (inventory[slot] != null) { + ItemStack is = inventory[slot]; + inventory[slot] = null; + return is; + } else + return null; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack){ + inventory[slot] = stack; + + if(stack != null && stack.stackSize > getInventoryStackLimit()){ + stack.stackSize = getInventoryStackLimit(); + } + markDirty(); + } + + @Override + public String getInventoryName(){ + return name; + } + + @Override + public final boolean isUseableByPlayer(EntityPlayer player){ + return true; + } + + @Override + public int getInventoryStackLimit(){ + return 64; + } + + @Override + public boolean hasCustomInventoryName(){ + return false; + } + + @Override + public int[] getAccessibleSlotsFromSide(int side){ + int[] slots = new int[getSizeInventory()]; + + for(int c = 0; c < slots.length; c++){ + slots[c] = c; + } + + if(side != 0){ + return slots; + } else if(side == 0){ + return new int[] {2}; + } else { + return null; + } + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemStack){ + return true; + } + + @Override + public boolean canInsertItem(int slot, ItemStack itemStack, int side){ + if(side != 0){ + if(slot == 0){ + return true; + } else { + return false; + } + } else if(side == 0){ + if(slot == 2){ + return true; + } else { + return false; + } + } else { + return false; + } + } + + @Override + public boolean canExtractItem(int slot, ItemStack itemStack, int side){ + if(side != 0){ + if(slot == 1){ + return true; + } else { + return false; + } + } else if(side == 0){ + if(slot == 2){ + return true; + } else { + return false; + } + } else { + return false; + } + } + + @Override + public void openInventory(){} + + @Override + public void closeInventory(){ + NBTTagList tags = new NBTTagList(); + System.out.print(tags); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound tag = new NBTTagCompound(); + writeToNBT(tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { + readFromNBT(packet.func_148857_g()); + } +} diff --git a/src/main/java/info/jbcs/minecraft/chisel/client/gui/GuiAutoChisel.java b/src/main/java/info/jbcs/minecraft/chisel/client/gui/GuiAutoChisel.java new file mode 100644 index 00000000..867c867e --- /dev/null +++ b/src/main/java/info/jbcs/minecraft/chisel/client/gui/GuiAutoChisel.java @@ -0,0 +1,26 @@ +package info.jbcs.minecraft.chisel.client.gui; + +import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel; +import info.jbcs.minecraft.chisel.inventory.ContainerAutoChisel; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiAutoChisel extends GuiContainer { + + private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png"); + + public GuiAutoChisel(InventoryPlayer inventoryPlayer, TileEntityAutoChisel tileEntityAutoChisel){ + super(new ContainerAutoChisel(inventoryPlayer, tileEntityAutoChisel)); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3){ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(gui); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x ,y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerAutoChisel.java b/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerAutoChisel.java new file mode 100644 index 00000000..09f37ec8 --- /dev/null +++ b/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerAutoChisel.java @@ -0,0 +1,76 @@ +package info.jbcs.minecraft.chisel.inventory; + +import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerAutoChisel extends Container { + + public static TileEntityAutoChisel autoChisel; + public static EntityPlayer player; + + public ContainerAutoChisel(InventoryPlayer player, TileEntityAutoChisel tileEntityAutoChisel){ + + this.player = player.player; + autoChisel = tileEntityAutoChisel; + + addSlotToContainer(new Slot(tileEntityAutoChisel, 0, 53, 15)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 103, 15)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 78, 51)); + + bindPlayerInventory(player); + } + + protected void bindPlayerInventory(InventoryPlayer invPlayer){ + for(int row = 0; row < 3; row++){ + for(int column = 0; column < 9; column++){ + addSlotToContainer(new Slot(invPlayer, column + row * 9 + 9, 8 + column * 18, 84 + row * 18)); + } + } + + for(int slotNumber = 0; slotNumber < 9; slotNumber++){ + addSlotToContainer(new Slot(invPlayer, slotNumber, 8 + slotNumber * 18, 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return autoChisel.isUseableByPlayer(player); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + ItemStack stack = null; + Slot slotObject = (Slot) inventorySlots.get(slot); + + if(slotObject != null && slotObject.getHasStack()){ + ItemStack stackInSlot = slotObject.getStack(); + stack = stackInSlot.copy(); + + if(slot < autoChisel.getSizeInventory()){ + if(!this.mergeItemStack(stackInSlot, 0, 35, true)){ + return null; + } + } else if(!this.mergeItemStack(stackInSlot, 0, 3, false)){ + return null; + } + + if(stackInSlot.stackSize == 0){ + slotObject.putStack(null); + } else { + slotObject.onSlotChanged(); + } + + if(stackInSlot.stackSize == stack.stackSize){ + return null; + } + + slotObject.onPickupFromSlot(player, stackInSlot); + } + + return stack; + } +} \ No newline at end of file diff --git a/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerChisel.java b/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerChisel.java index ce223b89..74404ce7 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerChisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/inventory/ContainerChisel.java @@ -62,8 +62,8 @@ public class ContainerChisel extends Container for(int l = 0; l < 9; l++) { addSlotToContainer(l == currentIndex ? - new SlotChiselPlayer(this, inventoryplayer, l, 8 + l * 18, 160 - 18) : - new Slot(inventoryplayer, l, 8 + l * 18, 160 - 18) + new SlotChiselPlayer(this, inventoryplayer, l, 8 + l * 18, 160 - 18) : + new Slot(inventoryplayer, l, 8 + l * 18, 160 - 18) ); } diff --git a/src/main/java/info/jbcs/minecraft/chisel/item/ItemChisel.java b/src/main/java/info/jbcs/minecraft/chisel/item/ItemChisel.java index ee3d6142..d289e15d 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/item/ItemChisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/item/ItemChisel.java @@ -18,7 +18,7 @@ public class ItemChisel extends ItemTool implements IChiselMode public static Carving carving = Carving.chisel; private static final HashSet toolSet = new HashSet(); - public ItemChisel(Carving c) + public ItemChisel() { super(1, ToolMaterial.IRON, CarvableHelper.getChiselBlockSet()); @@ -28,7 +28,6 @@ public class ItemChisel extends ItemTool implements IChiselMode setUnlocalizedName("chisel"); toolSet.add("chisel"); - //this.carving = c; } @Override diff --git a/src/main/resources/assets/chisel/textures/autochisel-gui.png b/src/main/resources/assets/chisel/textures/autochisel-gui.png index db89019826ae0e721e0011b95a9c461325e1206f..a090d5830a314d66e274d08cc754b86f63106a7a 100644 GIT binary patch literal 7419 zcmeHMYgAL&6+RK)f{~e8m61ebkXfRDWk9Pyv^-)&!10ABk7u5lIj=6P`grLM|kklUz)qcDgzp?dq)I2P^kH?mqkM z^L^jm=dy2=57}g**+c+<31zwaY5+#T$5CMXSokBQJwoBn= zy4-&^0F!TO{%})2Tfu~#)1y5$M6Ze38oeiE*A_qx*|sy`1Dwt=w=r5 z_TFicDmPB+I)+Xuy=!K))ctv~zFoquP!G+7bIko!Q+ZLzJT7UpU0+wYghXP^p1q4~ z4CbIRhXFRb@`S2ljPUn}q9%wDdTkG~+oDpwb^!o8!+`x4R+E`hH)Eb?23V=1x|elthppO%DP7FXfbSZAEyP12cr*_%ThH@rTr(YZ^E+)^i$S~pkx2lJbiMT!?$K@3a! z{mCb#W(&_DodSM!i9~O)xxXlG@L-&c@|ewHv16b_iqwiG_DtAgkNJJ4o8=u}AND1LRUfv1VGkiNb; z5|T+UUZNamOBdu$rdXHVeyWn5B`Hx3qU?C0&QC|&V|+wa2{+9l?#@jIcCR`sUly`_ zNMZS|k?mipA9Gdxj}cWLJIiya+=tkw4@3aH@sdWP!Dk)S2FG%P=rrGD!+LQ=2Ii-E0}D|`k%sC; z4EJ~wrJ+d}Nm-{`ejeNpz4KfNUah*Jl3w#WIgnGT%x-fW-pMX`Wq#hcZ^#;R^v)EO z(qCOjqPO^*EwdJj(sb}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index 212cf867..f467f62c 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -7,7 +7,7 @@ "mcversion": "${mcversion}", "url": "http://www.minecraftforum.net/forums/thread/1294901", "updateUrl": "", - "authorList": [ "AUTOMATIC_MAIDEN", "Pokefenn" ], + "authorList": [ "AUTOMATIC_MAIDEN", "Pokefenn", "Cricket"], "credits": "This mod uses a lot of textures from the Painterly pack: http://painterlypack.net/. Also one stone variation is designed to look like a block from Doku. Oh, and asie for porting the mod to 1.7.2", "logoFile": "", "screenshots": [],