diff --git a/ThingyCraft.ipr b/ThingyCraft.ipr deleted file mode 100644 index 7faaa8c24..000000000 --- a/ThingyCraft.ipr +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - almandine - amazonite - andradite - clinohumite - crafter - danburite - diopside - ellpeck - fayalite - forsterite - gemification - glossular - goshen - goshenite - idiochromatic - iolite - lepidolite - mcmod - mcversion - melanite - minecraftforge - moldavite - nuummite - orthoclase - paraiba - peridot - pickaxe - rhodochrosite - rodochrosite - smithsonite - sodalite - sonatype - sphene - thingycraft - titanian - tourlamine - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.6 - - - - - - - - - - - - - - diff --git a/build.gradle b/build.gradle index 64821c73a..22e0a7bf1 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ group = "ellpeck.gemification" archivesBaseName = "Gemification" minecraft { - version = "1.7.10-10.13.2.1236" + version = "1.7.10-10.13.2.1264" runDir = "idea" } diff --git a/src/main/java/ellpeck/gemification/blocks/models/ModelBaseG.java b/src/main/java/ellpeck/gemification/blocks/models/ModelBaseG.java new file mode 100644 index 000000000..87adc331d --- /dev/null +++ b/src/main/java/ellpeck/gemification/blocks/models/ModelBaseG.java @@ -0,0 +1,10 @@ +package ellpeck.gemification.blocks.models; + +import net.minecraft.client.model.ModelBase; + +public class ModelBaseG extends ModelBase{ + + public void render(float f){ + + } +} diff --git a/src/main/java/ellpeck/gemification/blocks/models/ModelCrucible.java b/src/main/java/ellpeck/gemification/blocks/models/ModelCrucible.java index 209f688b9..5cc1bfe2b 100644 --- a/src/main/java/ellpeck/gemification/blocks/models/ModelCrucible.java +++ b/src/main/java/ellpeck/gemification/blocks/models/ModelCrucible.java @@ -3,7 +3,7 @@ package ellpeck.gemification.blocks.models; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; -public class ModelCrucible extends ModelBase{ +public class ModelCrucible extends ModelBaseG{ public ModelRenderer floor, rimOne, rimTwo, rimThree, rimFour, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour; public ModelCrucible() { @@ -50,7 +50,7 @@ public class ModelCrucible extends ModelBase{ this.supportThree.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2); } - public void render(float f) { + public void render(float f){ this.supportTwo.render(f); this.wallTwo.render(f); this.floor.render(f); diff --git a/src/main/java/ellpeck/gemification/blocks/models/RendererHoldingTileEntity.java b/src/main/java/ellpeck/gemification/blocks/models/RendererHoldingTileEntity.java index 0ff11b2fc..5b636c141 100644 --- a/src/main/java/ellpeck/gemification/blocks/models/RendererHoldingTileEntity.java +++ b/src/main/java/ellpeck/gemification/blocks/models/RendererHoldingTileEntity.java @@ -8,10 +8,10 @@ import org.lwjgl.opengl.GL11; public class RendererHoldingTileEntity implements IItemRenderer { - ModelCrucible model; + ModelBaseG model; ResourceLocation texture; - public RendererHoldingTileEntity(ModelCrucible model, ResourceLocation res){ + public RendererHoldingTileEntity(ModelBaseG model, ResourceLocation res){ this.model = model; texture = res; } diff --git a/src/main/java/ellpeck/gemification/crafting/CrucibleCraftingManager.java b/src/main/java/ellpeck/gemification/crafting/CrucibleCraftingManager.java index 2af9de4fa..56d749288 100644 --- a/src/main/java/ellpeck/gemification/crafting/CrucibleCraftingManager.java +++ b/src/main/java/ellpeck/gemification/crafting/CrucibleCraftingManager.java @@ -18,10 +18,10 @@ public class CrucibleCraftingManager{ @SuppressWarnings("all") public void initRecipes(){ - this.addRecipe(new ItemStack(Blocks.acacia_stairs), Util.fluidNone, 200, new Object[]{"ccc", "cgc", "ccc", 'c', Blocks.cobblestone, 'g', new ItemStack(Items.stick)}); + this.addRecipe(new ItemStack(Blocks.acacia_stairs), Util.fluidChromeDiopside, 200, new Object[]{"ccc", "cgc", "ccc", 'c', Blocks.cobblestone, 'g', new ItemStack(Items.stick)}); } - @SuppressWarnings("static-access, unchecked") + @SuppressWarnings("unchecked, static-access") public void addRecipe(ItemStack output, GemType fluidNeeded, int processTimeNeeded, Object ... recipe){ String s = ""; int i = 0; diff --git a/src/main/java/ellpeck/gemification/tile/TileEntityBase.java b/src/main/java/ellpeck/gemification/tile/TileEntityBase.java new file mode 100644 index 000000000..1a92ab6b7 --- /dev/null +++ b/src/main/java/ellpeck/gemification/tile/TileEntityBase.java @@ -0,0 +1,22 @@ +package ellpeck.gemification.tile; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityBase extends TileEntity{ + + public Packet getDescriptionPacket(){ + NBTTagCompound compound = new NBTTagCompound(); + this.writeToNBT(compound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), compound); + } + + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet){ + super.onDataPacket(net, packet); + this.readFromNBT(packet.func_148857_g()); + } + +} diff --git a/src/main/java/ellpeck/gemification/tile/TileEntityCrucible.java b/src/main/java/ellpeck/gemification/tile/TileEntityCrucible.java index 10d6765bb..2ff9ace8b 100644 --- a/src/main/java/ellpeck/gemification/tile/TileEntityCrucible.java +++ b/src/main/java/ellpeck/gemification/tile/TileEntityCrucible.java @@ -18,17 +18,8 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -public class TileEntityCrucible extends TileEntity implements ISidedInventory { +public class TileEntityCrucible extends TileEntityInventoryBase{ - /** - * 0-3: Inputs - * 4: Main Input - * 5-8: Inputs - * 9: Water - * 10: Gem - * 11: Output - */ - public ItemStack slots[] = new ItemStack[12]; public final int slotOutput = 11; public final int slotMainInput = 4; public final int slotWater = 9; @@ -45,6 +36,18 @@ public class TileEntityCrucible extends TileEntity implements ISidedInventory { private boolean isCrafting = false; public static ItemStack output; + public TileEntityCrucible(){ + /** + * 0-3: Inputs + * 4: Main Input + * 5-8: Inputs + * 9: Water + * 10: Gem + * 11: Output + */ + this.slots = new ItemStack[12]; + } + public void updateEntity(){ if(!worldObj.isRemote){ this.craft(); @@ -101,127 +104,23 @@ public class TileEntityCrucible extends TileEntity implements ISidedInventory { } } - public int getSizeInventory() { - return slots.length; - } - - public ItemStack getStackInSlot(int i) { - return slots[i]; - } - - public ItemStack decrStackSize(int i, int j) { - if (slots[i] != null) { - ItemStack stackAt; - if (slots[i].stackSize <= j) { - stackAt = slots[i]; - slots[i] = null; - return stackAt; - } else { - stackAt = slots[i].splitStack(j); - if (slots[i].stackSize == 0) - slots[i] = null; - return stackAt; - } - } - return null; - } - - public ItemStack getStackInSlotOnClosing(int i) { - return getStackInSlot(i); - } - - public void setInventorySlotContents(int i, ItemStack stack){ - this.slots[i] = stack; - } - public String getInventoryName() { return InitBlocks.blockCrucible.getUnlocalizedName().substring(5); } - public boolean hasCustomInventoryName() { - return false; - } - - public int getInventoryStackLimit() { - return 64; - } - - public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64; - } - - public void openInventory() { - - } - - public void closeInventory() { - - } - - public boolean isItemValidForSlot(int i, ItemStack stack) { - return false; - } - public void writeToNBT(NBTTagCompound compound){ super.writeToNBT(compound); - NBTTagList tagList = new NBTTagList(); - for(int currentIndex = 0; currentIndex < slots.length; ++currentIndex){ - if (slots[currentIndex] != null){ - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte)currentIndex); - slots[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } - } - compound.setTag("Items", tagList); - compound.setInteger("CurrentFluidID", this.currentFluidID); } - public void readFromNBT(NBTTagCompound nbtTagCompound){ - super.readFromNBT(nbtTagCompound); - NBTTagList tagList = nbtTagCompound.getTagList("Items", 10); - for (int i = 0; i < tagList.tagCount(); ++i){ - NBTTagCompound tagCompound = tagList.getCompoundTagAt(i); - byte slotIndex = tagCompound.getByte("Slot"); - if (slotIndex >= 0 && slotIndex < slots.length){ - slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - - this.currentFluidID = nbtTagCompound.getInteger("CurrentFluidID"); + public void readFromNBT(NBTTagCompound compound){ + super.readFromNBT(compound); + this.currentFluidID = compound.getInteger("CurrentFluidID"); if(this.currentFluidID == Util.fluidWater.ID) this.currentFluid = Util.fluidWater; else if(this.currentFluidID == Util.fluidNone.ID) this.currentFluid = Util.fluidNone; else this.currentFluid = Util.gemList.get(this.currentFluidID); } - public Packet getDescriptionPacket() { - NBTTagCompound compound = new NBTTagCompound(); - this.writeToNBT(compound); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), compound); - } - - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - super.onDataPacket(net, packet); - this.readFromNBT(packet.func_148857_g()); - } - - public String getName() { - return InitBlocks.blockCrucible.getUnlocalizedName().substring(5); - } - - public int[] getAccessibleSlotsFromSide(int side) { - return new int[0]; - } - - public boolean canInsertItem(int par1, ItemStack stack, int par3) { - return false; - } - - public boolean canExtractItem(int par1, ItemStack stack, int par3) { - return false; - } - @SideOnly(Side.CLIENT) public int getCraftProcessScaled(int par1){ return this.currentProcessTime * par1 / this.processTimeNeeded; diff --git a/src/main/java/ellpeck/gemification/tile/TileEntityInventoryBase.java b/src/main/java/ellpeck/gemification/tile/TileEntityInventoryBase.java new file mode 100644 index 000000000..ea74feaa2 --- /dev/null +++ b/src/main/java/ellpeck/gemification/tile/TileEntityInventoryBase.java @@ -0,0 +1,111 @@ +package ellpeck.gemification.tile; + +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; + +public class TileEntityInventoryBase extends TileEntityBase implements ISidedInventory{ + + public ItemStack slots[]; + + public void writeToNBT(NBTTagCompound compound){ + super.writeToNBT(compound); + NBTTagList tagList = new NBTTagList(); + for(int currentIndex = 0; currentIndex < slots.length; ++currentIndex){ + if (slots[currentIndex] != null){ + NBTTagCompound tagCompound = new NBTTagCompound(); + tagCompound.setByte("Slot", (byte)currentIndex); + slots[currentIndex].writeToNBT(tagCompound); + tagList.appendTag(tagCompound); + } + } + compound.setTag("Items", tagList); + } + + public void readFromNBT(NBTTagCompound compound){ + super.readFromNBT(compound); + NBTTagList tagList = compound.getTagList("Items", 10); + for (int i = 0; i < tagList.tagCount(); ++i){ + NBTTagCompound tagCompound = tagList.getCompoundTagAt(i); + byte slotIndex = tagCompound.getByte("Slot"); + if (slotIndex >= 0 && slotIndex < slots.length){ + slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound); + } + } + } + + public int[] getAccessibleSlotsFromSide(int side) { + return new int[0]; + } + + public boolean canInsertItem(int par1, ItemStack stack, int par3) { + return false; + } + + public boolean canExtractItem(int par1, ItemStack stack, int par3) { + return false; + } + + public boolean hasCustomInventoryName() { + return false; + } + + public int getInventoryStackLimit() { + return 64; + } + + public boolean isUseableByPlayer(EntityPlayer player) { + return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64; + } + + public void openInventory() { + + } + + public void closeInventory() { + + } + + public boolean isItemValidForSlot(int i, ItemStack stack) { + return false; + } + + public ItemStack getStackInSlotOnClosing(int i) { + return getStackInSlot(i); + } + + public void setInventorySlotContents(int i, ItemStack stack){ + this.slots[i] = stack; + } + + public String getInventoryName() { + return null; + } + + public int getSizeInventory() { + return slots.length; + } + + public ItemStack getStackInSlot(int i) { + return slots[i]; + } + + public ItemStack decrStackSize(int i, int j) { + if (slots[i] != null) { + ItemStack stackAt; + if (slots[i].stackSize <= j) { + stackAt = slots[i]; + slots[i] = null; + return stackAt; + } else { + stackAt = slots[i].splitStack(j); + if (slots[i].stackSize == 0) + slots[i] = null; + return stackAt; + } + } + return null; + } +} diff --git a/src/main/resources/assets/gemification/lang/en_US.lang b/src/main/resources/assets/gemification/lang/en_US.lang index f0bb01b7d..46112d62a 100644 --- a/src/main/resources/assets/gemification/lang/en_US.lang +++ b/src/main/resources/assets/gemification/lang/en_US.lang @@ -1,4 +1,4 @@ -itemGroup.thingycraft=ThingyCraft +itemGroup.gemification=Gemification tile.oreGemOnyx.name=Onyx Ore tile.oreGemAlmandineGarnet.name=Almandine Garnet Ore