diff --git a/build.gradle b/build.gradle index dd09ab59..6da6cc6d 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-0.6.6d" +version = "1.7.10-0.7.0" group = "com.darkona.adventurebackpack" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "adventurebackpack" diff --git a/src/main/java/com/darkona/adventurebackpack/CreativeTabAB.java b/src/main/java/com/darkona/adventurebackpack/CreativeTabAB.java index b7166bc3..a10344a5 100644 --- a/src/main/java/com/darkona/adventurebackpack/CreativeTabAB.java +++ b/src/main/java/com/darkona/adventurebackpack/CreativeTabAB.java @@ -19,6 +19,17 @@ public Item getTabIconItem() return ModItems.machete; } + @Override + public String getTranslatedTabLabel() + { + return super.getTranslatedTabLabel(); + } + + @Override + public String getTabLabel() + { + return ModInfo.MOD_ID.toLowerCase(); + } }; diff --git a/src/main/java/com/darkona/adventurebackpack/block/BlockAdventureBackpack.java b/src/main/java/com/darkona/adventurebackpack/block/BlockAdventureBackpack.java index 1d09a631..dcd50603 100644 --- a/src/main/java/com/darkona/adventurebackpack/block/BlockAdventureBackpack.java +++ b/src/main/java/com/darkona/adventurebackpack/block/BlockAdventureBackpack.java @@ -126,7 +126,7 @@ private String getAssociatedTileColorName(IBlockAccess world, int x, int y, int @Override public boolean canRenderInPass(int pass) { - return pass == 1 || pass == 2; + return true; } @Override @@ -138,7 +138,7 @@ public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity @Override public float getEnchantPowerBonus(World world, int x, int y, int z) { - return getAssociatedTileColorName(world, x, y, z).equals("Bookshelf") ? 20 : 0; + return getAssociatedTileColorName(world, x, y, z).equals("Bookshelf") ? 10 : 0; } @Override diff --git a/src/main/java/com/darkona/adventurebackpack/block/TileAdventureBackpack.java b/src/main/java/com/darkona/adventurebackpack/block/TileAdventureBackpack.java index 938b38d5..46e9a7b0 100644 --- a/src/main/java/com/darkona/adventurebackpack/block/TileAdventureBackpack.java +++ b/src/main/java/com/darkona/adventurebackpack/block/TileAdventureBackpack.java @@ -303,6 +303,7 @@ public void loadFromNBT(NBTTagCompound compound) byte slot = item.getByte("Slot"); if (slot >= 0 && slot < inventory.length) { + inventory[slot] = ItemStack.loadItemStackFromNBT(item); } } diff --git a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiAdvBackpack.java b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiAdvBackpack.java index 8345a540..a82c596f 100644 --- a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiAdvBackpack.java +++ b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiAdvBackpack.java @@ -7,8 +7,6 @@ import com.darkona.adventurebackpack.init.ModNetwork; import com.darkona.adventurebackpack.inventory.BackpackContainer; import com.darkona.adventurebackpack.inventory.InventoryItem; -import com.darkona.adventurebackpack.network.GuiBackpackMessage; -import com.darkona.adventurebackpack.network.MessageConstants; import com.darkona.adventurebackpack.network.SleepingBagMessage; import com.darkona.adventurebackpack.util.Resources; import cpw.mods.fml.relauncher.Side; @@ -20,7 +18,9 @@ import org.lwjgl.opengl.GL11; /** - * Created by Darkona on 12/10/2014. + * Created on 12/10/2014 + * @author Darkona + * */ @SideOnly(Side.CLIENT) public class GuiAdvBackpack extends GuiContainer implements IBackpackGui @@ -33,11 +33,10 @@ public class GuiAdvBackpack extends GuiContainer implements IBackpackGui protected int Y; protected int Z; private EntityPlayer player; - private static final ResourceLocation texture = Resources.guiTextures("guiBackpack"); - private static GuiImageButtonNormal bedButton = new GuiImageButtonNormal(153, 6, 18, 18); - private static GuiImageButtonNormal craftButton = new GuiImageButtonNormal(5, 6, 18, 18); - private static GuiTank tankLeft = new GuiTank(25, 7, 64, 16, GeneralConfig.GUI_TANK_RES); - private static GuiTank tankRight = new GuiTank(135, 7, 64, 16, GeneralConfig.GUI_TANK_RES); + private static final ResourceLocation texture = Resources.guiTextures("guiBackpackNew"); + private static GuiImageButtonNormal bedButton = new GuiImageButtonNormal(5, 91, 18, 18); + private static GuiTank tankLeft = new GuiTank(25, 7, 100, 16, GeneralConfig.GUI_TANK_RES); + private static GuiTank tankRight = new GuiTank(207, 7, 100, 16, GeneralConfig.GUI_TANK_RES); private FluidStack lft; private FluidStack rgt; public int lefties; @@ -46,11 +45,11 @@ public class GuiAdvBackpack extends GuiContainer implements IBackpackGui public GuiAdvBackpack(EntityPlayer player, TileAdventureBackpack tileBackpack) { - super(new BackpackContainer(player.inventory, tileBackpack, BackpackContainer.SOURCE_TILE)); + super(new BackpackContainer(player, tileBackpack, BackpackContainer.SOURCE_TILE)); this.inventory = tileBackpack; this.source = true; - xSize = 176; - ySize = 166; + xSize = 248; + ySize = 207; this.X = tileBackpack.xCoord; this.Y = tileBackpack.yCoord; this.Z = tileBackpack.zCoord; @@ -61,12 +60,12 @@ public GuiAdvBackpack(EntityPlayer player, TileAdventureBackpack tileBackpack) public GuiAdvBackpack(EntityPlayer player, InventoryItem item, boolean wearing) { - super(new BackpackContainer(player.inventory, item, BackpackContainer.SOURCE_ITEM)); + super(new BackpackContainer(player, item, BackpackContainer.SOURCE_ITEM)); this.inventory = item; this.wearing = wearing; this.source = false; - xSize = 176; - ySize = 166; + xSize = 248; + ySize = 207; this.player = player; this.lefties = guiLeft; this.topsies = guiTop; @@ -92,58 +91,87 @@ protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); // Buttons and button highlight - int srcX = 177; - int srcY = 20; + int srcX = 1; + int srcY = 227; if (source) { if (bedButton.inButton(this, mouseX, mouseY)) { - bedButton.draw(this, srcX + 19, srcY + 19); + bedButton.draw(this, srcX + 19, srcY); } else { - bedButton.draw(this, srcX, srcY + 19); + bedButton.draw(this, srcX, srcY); } } - if (craftButton.inButton(this, mouseX, mouseY)) - { - craftButton.draw(this, srcX + 19, srcY); - } else + inventory.openInventory(); + lft = inventory.getLeftTank().getFluid(); + rgt = inventory.getRightTank().getFluid(); + + + + /* zLevel +=1; + if (tankLeft.inTank(this, mouseX, mouseY)) { - craftButton.draw(this, srcX, srcY); + drawHoveringText(tankLeft.getTankTooltip(), mouseX, mouseY, fontRendererObj); } + if (tankRight.inTank(this, mouseX, mouseY)) + { + drawHoveringText(tankRight.getTankTooltip(), mouseX, mouseY, fontRendererObj); + }*/ } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); inventory.openInventory(); lft = inventory.getLeftTank().getFluid(); rgt = inventory.getRightTank().getFluid(); - tankLeft.draw(this, lft); tankRight.draw(this, rgt); - +/* if (tankLeft.inTank(this, mouseX, mouseY)) { - GL11.glPushMatrix(); drawHoveringText(tankLeft.getTankTooltip(), mouseX - guiLeft, mouseY - guiTop, fontRendererObj); - GL11.glPopMatrix(); } if (tankRight.inTank(this, mouseX, mouseY)) { drawHoveringText(tankRight.getTankTooltip(), mouseX - guiLeft, mouseY - guiTop, fontRendererObj); } +*/ + + GL11.glPushMatrix(); + //GL11.glTranslatef(8f,64f,0f); + GL11.glScalef(0.6f, 0.6f, 0.6f); + String name = (lft != null) ? lft.getLocalizedName() : "None"; + String amount = (lft != null ? lft.amount : "Empty").toString(); + String capacity = Integer.toString(inventory.getLeftTank().getCapacity()); + int offsetY = 32; + int offsetX = 8; + fontRendererObj.drawString(getFirstWord(name), 1 + offsetX , 64 + offsetY,0x373737 ,false); + fontRendererObj.drawString(amount, 1 + offsetX, 79 + offsetY, 0x373737,false); + fontRendererObj.drawString(capacity , 1 + offsetX, 94 + offsetY, 0x373737,false); + + name = (rgt != null) ? rgt.getLocalizedName() : "None"; + amount = (rgt != null ? rgt.amount : "Empty").toString(); + fontRendererObj.drawString(getFirstWord(name), 369 + offsetX , 64 + offsetY, 0x373737,false); + fontRendererObj.drawString(amount, 369 + offsetX, 79 + offsetY, 0x373737,false); + fontRendererObj.drawString(capacity, 369 + offsetX, 94 + offsetY, 0x373737,false); + + GL11.glPopMatrix(); + } - /*GL11.glPushMatrix(); - GL11.glScalef(0.8f, 0.8f, 0.8f); - String name = "Adventure Backpack"; - fontRendererObj.drawString(name, ((xSize - fontRendererObj.getStringWidth(name)) / 2), 4, 0x404040); - GL11.glPopMatrix();*/ + private String getFirstWord(String text) { + if (text.indexOf(' ') > -1) { // Check if there is more than one word. + return text.substring(0, text.indexOf(' ')); // Extract first word. + } else { + return text; // Text is the first word itself. + } } @Override @@ -178,20 +206,6 @@ protected void mouseClicked(int mouseX, int mouseY, int button) { TileAdventureBackpack te = (TileAdventureBackpack) inventory; ModNetwork.networkWrapper.sendToServer(new SleepingBagMessage(te.xCoord, te.yCoord, te.zCoord)); - } else if (craftButton.inButton(this, mouseX, mouseY)) - { - if (source) - { - ModNetwork.networkWrapper - .sendToServer(new GuiBackpackMessage(MessageConstants.CRAFT_GUI, - MessageConstants.FROM_TILE)); - } else - { - ModNetwork.networkWrapper - .sendToServer(new GuiBackpackMessage(MessageConstants.CRAFT_GUI, - wearing ? MessageConstants.FROM_KEYBIND : MessageConstants.FROM_HOLDING)); - } - } super.mouseClicked(mouseX, mouseY, button); } diff --git a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiCraftAdvBackpack.java b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiCraftAdvBackpack.java deleted file mode 100644 index 9664ba9c..00000000 --- a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiCraftAdvBackpack.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.darkona.adventurebackpack.client.gui; - -import com.darkona.adventurebackpack.block.TileAdventureBackpack; -import com.darkona.adventurebackpack.common.IAdvBackpack; -import com.darkona.adventurebackpack.config.GeneralConfig; -import com.darkona.adventurebackpack.config.Keybindings; -import com.darkona.adventurebackpack.init.ModNetwork; -import com.darkona.adventurebackpack.inventory.BackCraftContainer; -import com.darkona.adventurebackpack.inventory.InventoryItem; -import com.darkona.adventurebackpack.network.GuiBackpackMessage; -import com.darkona.adventurebackpack.network.MessageConstants; -import com.darkona.adventurebackpack.util.Resources; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -/** - * Created on 12/10/2014 - * - * @author Darkona - */ -public class GuiCraftAdvBackpack extends GuiContainer implements IBackpackGui -{ - protected IAdvBackpack inventory; - protected boolean source; - private boolean wearing; - protected int X; - protected int Y; - protected int Z; - protected EntityPlayer player; - /* Tanks */ - private static GuiTankCraft tankLeft = new GuiTankCraft(8, 7, 64, 16, GeneralConfig.GUI_TANK_RES); - private static GuiTankCraft tankRight = new GuiTankCraft(153, 7, 64, 16, GeneralConfig.GUI_TANK_RES); - public int lefties; - public int topsies; - - /* Buttons */ - private static GuiImageButtonCraft backButton = new GuiImageButtonCraft(114, 24, 18, 18); - private static final ResourceLocation texture = Resources.guiTextures("guiBackpackCraft"); - - public GuiCraftAdvBackpack(EntityPlayer player, TileAdventureBackpack tile) - { - super(new BackCraftContainer(player, tile)); - this.inventory = tile; - this.source = true; - xSize = 176; - ySize = 166; - X = tile.xCoord; - Y = tile.yCoord; - Z = tile.zCoord; - this.lefties = guiLeft; - this.topsies = guiTop; - } - - public GuiCraftAdvBackpack(EntityPlayer player, InventoryItem item, boolean wearing) - { - super(new BackCraftContainer(player, player.worldObj, item)); - inventory = item; - this.player = player; - this.wearing = wearing; - source = false; - xSize = 176; - ySize = 166; - lefties = guiLeft; - topsies = guiTop; - } - - @Override - public void onGuiClosed() - { - if (inventory != null) - { - inventory.closeInventory(); - } - super.onGuiClosed(); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - this.mc.renderEngine.bindTexture(texture); - - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - - //Buttons - int srcX = 177; - int srcY = 111; - - if (backButton.inButton(this, mouseX, mouseY)) - { - backButton.draw(this, srcX + 19, srcY); - } else - { - backButton.draw(this, srcX, srcY); - } - } - - @Override - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) - { - - // this.fontRendererObj.drawString("Crafting Bench", 92, 7, 4210752); - GuiCraftAdvBackpack.tankLeft.draw(this, inventory.getLeftTank().getFluid()); - GuiCraftAdvBackpack.tankRight.draw(this, inventory.getRightTank().getFluid()); - if (tankLeft.inTank(this, mouseX, mouseY)) - { - drawHoveringText(tankLeft.getTankTooltip(), mouseX - guiLeft, mouseY - guiTop, fontRendererObj); - } - - if (tankRight.inTank(this, mouseX, mouseY)) - { - drawHoveringText(tankRight.getTankTooltip(), mouseX - guiLeft, mouseY - guiTop, fontRendererObj); - } - } - - @Override - public void initGui() - { - super.initGui(); - } - - @Override - public int getLeft() - { - return guiLeft; - } - - @Override - public int getTop() - { - return guiTop; - } - - @Override - public float getZLevel() - { - return this.zLevel; - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int button) - { - if (backButton.inButton(this, mouseX, mouseY)) - { - if (source) - { - ModNetwork.networkWrapper.sendToServer(new GuiBackpackMessage(MessageConstants.NORMAL_GUI, MessageConstants.FROM_TILE)); - } else - { - ModNetwork.networkWrapper - .sendToServer(new GuiBackpackMessage(MessageConstants.NORMAL_GUI, wearing ? - MessageConstants.FROM_KEYBIND : MessageConstants.FROM_HOLDING)); - } - } - super.mouseClicked(mouseX, mouseY, button); - } - - @Override - protected void keyTyped(char key, int keycode) - { - if (keycode == Keybindings.openBackpack.getKeyCode()) - { - player.closeScreen(); - } - super.keyTyped(key, keycode); - } - -} diff --git a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiImageButtonCraft.java b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiImageButtonCraft.java deleted file mode 100644 index 6d79364c..00000000 --- a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiImageButtonCraft.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.darkona.adventurebackpack.client.gui; - -/** - * Created on 12/10/2014 - * - * @author Darkona - */ -public class GuiImageButtonCraft -{ - private int X; - private int Y; - private int W; - private int H; - - public GuiImageButtonCraft(int X, int Y, int W, int H) - { - this.X = X; - this.Y = Y; - this.W = W; - this.H = H; - } - - public void draw(GuiCraftAdvBackpack gui, int srcX, int srcY) - { - gui.drawTexturedModalRect(gui.getLeft() + X, gui.getTop() + Y, srcX, srcY, W, H); - } - - public boolean inButton(GuiCraftAdvBackpack gui, int mouseX, int mouseY) - { - mouseX -= gui.getLeft(); - mouseY -= gui.getTop(); - return X <= mouseX && mouseX <= X + W && Y <= mouseY && mouseY <= Y + H; - } -} diff --git a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTank.java b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTank.java index 5a682e5a..3b02b240 100644 --- a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTank.java +++ b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTank.java @@ -4,7 +4,6 @@ import com.darkona.adventurebackpack.common.Constants; import com.darkona.adventurebackpack.config.ConfigHandler; import com.darkona.adventurebackpack.util.LogHelper; -import com.darkona.adventurebackpack.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; @@ -53,7 +52,7 @@ public GuiTank(int X, int Y, int H, int W, int resolution) public List getTankTooltip() { - String fluidName = (fluid != null) ? Utils.capitalize(fluid.getFluid().getName()) : "None"; + String fluidName = (fluid != null) ? fluid.getLocalizedName() : "None"; String fluidAmount = (fluid != null) ? fluid.amount + "/" + Constants.basicTankCapacity : "Empty"; ArrayList tankTips = new ArrayList(); tankTips.add(fluidName); @@ -103,8 +102,10 @@ private void drawMethodOne(GuiAdvBackpack gui) { for (int j = maxY - resolution; j >= maxY - pixelsY; j -= resolution) { - GL11.glColor4f(1, 1, 1, 128); + GL11.glPushMatrix(); + GL11.glColor4f(1, 1, 1, 1); gui.drawTexturedModelRectFromIcon(i, j, icon, resolution, resolution); + GL11.glPopMatrix(); } } } @@ -128,9 +129,11 @@ private void drawMethodTwo(GuiAdvBackpack gui) int iconY = 7; for (int j = maxY; j >= top; j--) { + GL11.glPushMatrix(); GL11.glColor4f(1, 1, 1, 1); drawFluidPixelFromIcon(i, j, icon, resolution, 1, 0, iconY, resolution, 0); iconY = (iconY == 0) ? 7 : iconY - 1; + GL11.glPopMatrix(); } } } @@ -140,7 +143,7 @@ private void drawMethodTwo(GuiAdvBackpack gui) * @param gui * @param */ - private void drawMethodThree(IBackpackGui gui) + private void drawMethodThree(GuiAdvBackpack gui) { if (fluid != null) { @@ -153,8 +156,9 @@ private void drawMethodThree(IBackpackGui gui) { for (int i = X; i <= X + W - 1; i++) { - GL11.glEnable(GL11.GL_BLEND); - if (j >= top + 4) + GL11.glPushMatrix(); + //GL11.glEnable(GL11.GL_BLEND); + if (j >= top + 5) { GL11.glColor4f(0.9f, 0.9f, 0.9f, 1); } else @@ -162,7 +166,8 @@ private void drawMethodThree(IBackpackGui gui) GL11.glColor4f(1, 1, 1, 1); } drawFluidPixelFromIcon(i, j, icon, 1, 1, 0, 0, 0, 0); - GL11.glDisable(GL11.GL_BLEND); + //GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); } } } catch (Exception oops) @@ -226,5 +231,7 @@ public void drawFluidPixelFromIcon(int x, int y, IIcon icon, int w, int h, int s tessellator.addVertexWithUV(x + w, y, zLevel, newMaxU, newMinV); tessellator.addVertexWithUV(x, y, zLevel, newMinU, newMinV); tessellator.draw(); + + } } diff --git a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTankCraft.java b/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTankCraft.java deleted file mode 100644 index 8babb2e8..00000000 --- a/src/main/java/com/darkona/adventurebackpack/client/gui/GuiTankCraft.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.darkona.adventurebackpack.client.gui; - -import codechicken.lib.render.TextureUtils; -import com.darkona.adventurebackpack.common.Constants; -import com.darkona.adventurebackpack.config.ConfigHandler; -import com.darkona.adventurebackpack.util.LogHelper; -import com.darkona.adventurebackpack.util.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Darkona on 12/10/2014. - */ -public class GuiTankCraft -{ - private int H; - private int W; - private int X; - private int Y; - private int resolution; - private int liquidPerPixel; - private float zLevel; - private FluidStack fluid; - - /** - * Draws the fluid from a fluidstack in a GUI. - * - * @param X The X coordinate to start drawing from. - * @param Y The Y coordinate to start drawing from. - * @param H The height in pixels of the tank. - * @param W The width in pixels of the tank. - * @param resolution The resolution of the fluid painted in the tank. Higher values - * mean smaller and more numerous boxes. Values can be 1, 2, 4, - * 8, 16. Other values are untested, but i guess they should - * always be integer divisors of the width, with modulus 0; - */ - public GuiTankCraft(int X, int Y, int H, int W, int resolution) - { - this.X = X; - this.Y = Y; - this.H = H; - this.W = W; - this.resolution = resolution > 0 ? W / resolution : W; - liquidPerPixel = Constants.basicTankCapacity / this.H; - } - - public List getTankTooltip() - { - String fluidName = (fluid != null) ? Utils.capitalize(fluid.getFluid().getName()) : "None"; - String fluidAmount = (fluid != null) ? fluid.amount + "/" + Constants.basicTankCapacity : "Empty"; - ArrayList tankTips = new ArrayList(); - tankTips.add(fluidName); - tankTips.add(fluidAmount); - return tankTips; - } - - /** - * @param gui - * @param theFluid - */ - public void draw(GuiCraftAdvBackpack gui, FluidStack theFluid) - { - fluid = theFluid; - this.zLevel = gui.getZLevel(); - switch (ConfigHandler.GUI_TANK_RENDER) - { - case 1: - drawMethodOne(gui); - break; - case 2: - drawMethodTwo(gui); - break; - case 3: - drawMethodThree(gui); - break; - default: - drawMethodThree(gui); - break; - } - - } - - /** - * @param gui - * @param - */ - private void drawMethodOne(GuiCraftAdvBackpack gui) - { - if (fluid != null) - { - IIcon icon = fluid.getFluid().getStillIcon(); - int pixelsY = fluid.amount / liquidPerPixel; - Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - int maxY = Y + H; - for (int i = X; i < X + W; i += resolution) - { - for (int j = maxY - resolution; j >= maxY - pixelsY; j -= resolution) - { - GL11.glColor4f(1, 1, 1, 128); - gui.drawTexturedModelRectFromIcon(i, j, icon, resolution, resolution); - } - } - } - } - - /** - * @param gui - * @param - */ - private void drawMethodTwo(GuiCraftAdvBackpack gui) - { - if (fluid != null) - { - IIcon icon = fluid.getFluid().getStillIcon(); - int pixelsY = fluid.amount / liquidPerPixel; - Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - int top = Y + H - pixelsY; - int maxY = Y + H - 1; - for (int i = X; i < X + W; i += resolution) - { - int iconY = 7; - for (int j = maxY; j >= top; j--) - { - GL11.glColor4f(1, 1, 1, 1); - drawFluidPixelFromIcon(i, j, icon, resolution, 1, 0, iconY, resolution, 0); - iconY = (iconY == 0) ? 7 : iconY - 1; - } - } - } - } - - /** - * @param gui - * @param - */ - private void drawMethodThree(GuiCraftAdvBackpack gui) - { - if (fluid != null) - { - try - { - IIcon icon = fluid.getFluid().getStillIcon(); - TextureUtils.bindAtlas(fluid.getFluid().getSpriteNumber()); - int top = Y + H - (fluid.amount / liquidPerPixel); - for (int j = Y + H - 1; j >= top; j--) - { - for (int i = X; i <= X + W - 1; i++) - { - GL11.glEnable(GL11.GL_BLEND); - if (j >= top + 4) - { - GL11.glColor4f(0.9f, 0.9f, 0.9f, 1); - } else - { - GL11.glColor4f(1, 1, 1, 1); - } - drawFluidPixelFromIcon(i, j, icon, 1, 1, 0, 0, 0, 0); - GL11.glDisable(GL11.GL_BLEND); - } - } - } catch (Exception oops) - { - LogHelper.error("Exception while trying to render the fluid in the GUI"); - //oops.printStackTrace(); - } - } - } - - /** - * @param gui - * @param mouseX - * @param mouseY - * @return - */ - public boolean inTank(GuiCraftAdvBackpack gui, int mouseX, int mouseY) - { - mouseX -= gui.getLeft(); - mouseY -= gui.getTop(); - return X <= mouseX && mouseX <= X + W && Y <= mouseY && mouseY <= Y + H; - } - - /** - * Draws a box textured with the selected box of an icon. - * - * @param x The X coordinate where to start drawing the box. - * @param y The Y coordinate where to start drawing the box. - * @param icon The icon to draw from. - * @param w The Width of the drawed box. - * @param h The height of the drawed box. - * @param srcX The X coordinate from the icon to start drawing from. Starts - * at 0. - * @param srcY The Y coordinate from the icon to start drawing from. Starts - * at 0. - * @param srcW The width of the selection in the icon to draw from. Starts at - * 0. - * @param srcH The height of the selection in the icon to draw from. Starts - * at 0. - */ - public void drawFluidPixelFromIcon(int x, int y, IIcon icon, int w, int h, int srcX, int srcY, int srcW, int srcH) - { - double minU = icon.getMinU(); - double maxU = icon.getMaxU(); - double minV = icon.getMinV(); - double maxV = icon.getMaxV(); - - double singleU = (maxU - minU) / icon.getIconHeight(); - double singleV = (maxV - minV) / icon.getIconWidth(); - - double newMinU = minU + (singleU * srcX); - double newMinV = minV + (singleV * srcY); - - double newMaxU = newMinU + (singleU * srcW); - double newMaxV = newMinV + (singleV * srcH); - - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(x, y + h, zLevel, newMinU, newMaxV); - tessellator.addVertexWithUV(x + w, y + h, zLevel, newMaxU, newMaxV); - tessellator.addVertexWithUV(x + w, y, zLevel, newMaxU, newMinV); - tessellator.addVertexWithUV(x, y, zLevel, newMinU, newMinV); - tessellator.draw(); - } -} diff --git a/src/main/java/com/darkona/adventurebackpack/client/models/ModelAdventureBackpackArmor.java b/src/main/java/com/darkona/adventurebackpack/client/models/ModelAdventureBackpackArmor.java index 3d20cfb9..338cd5fb 100644 --- a/src/main/java/com/darkona/adventurebackpack/client/models/ModelAdventureBackpackArmor.java +++ b/src/main/java/com/darkona/adventurebackpack/client/models/ModelAdventureBackpackArmor.java @@ -1,9 +1,5 @@ package com.darkona.adventurebackpack.client.models; -/** - * Created by Darkona on 11/10/2014. - */ - import codechicken.lib.render.CCRenderState; import codechicken.lib.render.RenderUtils; import codechicken.lib.vec.Cuboid6; @@ -18,7 +14,11 @@ import net.minecraftforge.fluids.FluidStack; import org.lwjgl.opengl.GL11; - +/** + * Created on 11/10/2014 + * @author Darkona + * + */ public class ModelAdventureBackpackArmor extends ModelBiped { public static final ModelAdventureBackpackArmor instance = new ModelAdventureBackpackArmor(); @@ -311,7 +311,7 @@ public void setRotationAngles(float v1, float v2, float v3, float v4, float v5, { // Copyboy: For some reason this is not properly updated. isSneak = ((entity != null) ? ((EntityLivingBase) entity).isSneaking() : false); - bipedBody.offsetZ = (isSneak) ? 0 : .3F; + bipedBody.offsetZ = (isSneak) ? 0 : -.3F; super.setRotationAngles(v1, v2, v3, v4, v5, v6, entity); } diff --git a/src/main/java/com/darkona/adventurebackpack/client/models/ModelNew.java b/src/main/java/com/darkona/adventurebackpack/client/models/ModelNew.java new file mode 100644 index 00000000..92f30dbf --- /dev/null +++ b/src/main/java/com/darkona/adventurebackpack/client/models/ModelNew.java @@ -0,0 +1,418 @@ +package com.darkona.adventurebackpack.client.models; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.RenderUtils; +import codechicken.lib.vec.Cuboid6; +import codechicken.lib.vec.Vector3; +import com.darkona.adventurebackpack.common.Constants; +import com.darkona.adventurebackpack.common.IAdvBackpack; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraftforge.fluids.FluidTank; +import org.lwjgl.opengl.GL11; + +import java.util.List; + +/** + * Created on 17/12/2014 + * + * @author Darkona + */ +public class ModelNew extends ModelBase { + public ModelRenderer mainBody; + public ModelRenderer lampLight; + public ModelRenderer tankLeftTop; + public ModelRenderer tankRightTop; + public ModelRenderer bed; + public ModelRenderer lampPole1; + public ModelRenderer kitchenBase; + public ModelRenderer villagerNose; + public ModelRenderer pigNose; + public ModelRenderer ocelotNose; + public ModelRenderer leftStrap; + public ModelRenderer rightStrap; + public ModelRenderer top; + public ModelRenderer bottom; + public ModelRenderer pocketFace; + public ModelRenderer tankLeftBottom; + public ModelRenderer tankLeftWall4; + public ModelRenderer tankLeftWall3; + public ModelRenderer tankLeftWall2; + public ModelRenderer tankLeftWall1; + public ModelRenderer tankRightBottom; + public ModelRenderer tankRightWall2; + public ModelRenderer tankRightWall1; + public ModelRenderer tankRightWall3; + public ModelRenderer tankRightWall4; + public ModelRenderer bedStrapLeftMid; + public ModelRenderer bedStrapRightBottom; + public ModelRenderer bedStrapLeftBottom; + public ModelRenderer bedStrapRightMid; + public ModelRenderer bedStrapRightTop; + public ModelRenderer bedStrapLeftTop; + public ModelRenderer lampPole2; + public ModelRenderer lampTop; + public ModelRenderer lampPole3; + public ModelRenderer lampBottom; + public ModelRenderer lampGlassLeft; + public ModelRenderer lampGlassRight; + public ModelRenderer lampGlassBack; + public ModelRenderer lampGlassFront; + public ModelRenderer kitchen; + + public ModelNew() { + this.textureWidth = 128; + this.textureHeight = 64; + + //Main Backpack + + this.mainBody = new ModelRenderer(this, 0, 9); + this.mainBody.setRotationPoint(0.0F, 0.0F, 0.0F); + this.mainBody.addBox(-5.0F, 0.0F, -3.0F, 10, 9, 5); + + this.leftStrap = new ModelRenderer(this, 21, 24); + this.leftStrap.setRotationPoint(3.0F, 0.0F, -3.0F); + this.leftStrap.addBox(0.0F, 0.0F, -1.0F, 1, 8, 1); + this.mainBody.addChild(this.leftStrap); + + this.rightStrap = new ModelRenderer(this, 26, 24); + this.rightStrap.setRotationPoint(-4.0F, 0.0F, -3.0F); + this.rightStrap.addBox(0.0F, 0.0F, -1.0F, 1, 8, 1); + this.mainBody.addChild(this.rightStrap); + + this.top = new ModelRenderer(this, 0, 0); + this.top.setRotationPoint(0.0F, 0.0F, -3.0F); + this.top.addBox(-5.0F, -3.0F, 0.0F, 10, 3, 5); + this.mainBody.addChild(this.top); + + this.bottom = new ModelRenderer(this, 0, 34); + this.bottom.setRotationPoint(-5.0F, 9.0F, -3.0F); + this.bottom.addBox(0.0F, 0.0F, 0.0F, 10, 1, 4); + this.mainBody.addChild(this.bottom); + + this.pocketFace = new ModelRenderer(this, 0, 24); + this.pocketFace.setRotationPoint(0.0F, 6.9F, 2.0F); + this.pocketFace.addBox(-4.0F, -6.0F, 0.0F, 8, 6, 2); + this.mainBody.addChild(this.pocketFace); + + //Left Tank + + this.tankLeftTop = new ModelRenderer(this, 0, 40); + this.tankLeftTop.setRotationPoint(5.0F, 0.0F, -2.5F); + this.tankLeftTop.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + + this.tankLeftBottom = new ModelRenderer(this, 0, 46); + this.tankLeftBottom.setRotationPoint(0.0F, 9.0F, 0.0F); + this.tankLeftBottom.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + this.tankLeftTop.addChild(this.tankLeftBottom); + + this.tankLeftWall1 = new ModelRenderer(this, 0, 52); + this.tankLeftWall1.setRotationPoint(3.0F, -8.0F, 0.0F); + this.tankLeftWall1.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall1); + + this.tankLeftWall2 = new ModelRenderer(this, 5, 52); + this.tankLeftWall2.setRotationPoint(0.0F, -8.0F, 0.0F); + this.tankLeftWall2.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall2); + + this.tankLeftWall3 = new ModelRenderer(this, 10, 52); + this.tankLeftWall3.setRotationPoint(0.0F, -8.0F, 3.0F); + this.tankLeftWall3.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall3); + + this.tankLeftWall4 = new ModelRenderer(this, 15, 52); + this.tankLeftWall4.setRotationPoint(3.0F, -8.0F, 3.0F); + this.tankLeftWall4.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall4); + + //Right Tank + + this.tankRightTop = new ModelRenderer(this, 17, 40); + this.tankRightTop.setRotationPoint(-9.0F, 0.0F, -2.5F); + this.tankRightTop.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + + this.tankRightBottom = new ModelRenderer(this, 17, 46); + this.tankRightBottom.setRotationPoint(0.0F, 9.0F, 0.0F); + this.tankRightBottom.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + this.tankRightTop.addChild(this.tankRightBottom); + + this.tankRightWall1 = new ModelRenderer(this, 22, 52); + this.tankRightWall1.setRotationPoint(3.0F, -8.0F, 3.0F); + this.tankRightWall1.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall1); + + this.tankRightWall2 = new ModelRenderer(this, 27, 52); + this.tankRightWall2.setRotationPoint(3.0F, -8.0F, 0.0F); + this.tankRightWall2.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall2); + + this.tankRightWall3 = new ModelRenderer(this, 32, 52); + this.tankRightWall3.setRotationPoint(0.0F, -8.0F, 3.0F); + this.tankRightWall3.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall3); + + this.tankRightWall4 = new ModelRenderer(this, 37, 52); + this.tankRightWall4.setRotationPoint(0.0F, -8.0F, 0.0F); + this.tankRightWall4.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall4); + + //Bed + + this.bed = new ModelRenderer(this, 31, 0); + this.bed.setRotationPoint(-7.0F, 7.0F, 2.0F); + this.bed.addBox(0.0F, 0.0F, 0.0F, 14, 2, 2); + + this.bedStrapRightTop = new ModelRenderer(this, 40, 5); + this.bedStrapRightTop.setRotationPoint(2.0F, -1.0F, 0.0F); + this.bedStrapRightTop.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3); + this.bed.addChild(this.bedStrapRightTop); + + this.bedStrapRightMid = new ModelRenderer(this, 38, 10); + this.bedStrapRightMid.setRotationPoint(2.0F, 0.0F, 2.0F); + this.bedStrapRightMid.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1); + this.bed.addChild(this.bedStrapRightMid); + + this.bedStrapRightBottom = new ModelRenderer(this, 42, 15); + this.bedStrapRightBottom.setRotationPoint(2.0F, 2.0F, -1.0F); + this.bedStrapRightBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 3); + this.bed.addChild(this.bedStrapRightBottom); + + this.bedStrapLeftTop = new ModelRenderer(this, 31, 5); + this.bedStrapLeftTop.setRotationPoint(11.0F, -1.0F, 0.0F); + this.bedStrapLeftTop.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3); + this.bed.addChild(this.bedStrapLeftTop); + + this.bedStrapLeftMid = new ModelRenderer(this, 31, 10); + this.bedStrapLeftMid.setRotationPoint(10.0F, 0.0F, 2.0F); + this.bedStrapLeftMid.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1); + this.bed.addChild(this.bedStrapLeftMid); + + this.bedStrapLeftBottom = new ModelRenderer(this, 31, 15); + this.bedStrapLeftBottom.setRotationPoint(10.0F, 2.0F, -1.0F); + this.bedStrapLeftBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 3); + this.bed.addChild(this.bedStrapLeftBottom); + + //Lamp + + this.lampPole1 = new ModelRenderer(this, 32, 24); + this.lampPole1.setRotationPoint(5.0F, -10.0F, -1.0F); + this.lampPole1.addBox(0.0F, 0.0F, 0.0F, 1, 10, 1); + + this.lampPole2 = new ModelRenderer(this, 37, 25); + this.lampPole2.setRotationPoint(1.0F, 0.0F, 0.0F); + this.lampPole2.addBox(0.0F, 0.0F, 0.0F, 4, 1, 1); + this.lampPole1.addChild(this.lampPole2); + + this.lampPole3 = new ModelRenderer(this, 40, 28); + this.lampPole3.setRotationPoint(3.0F, 1.0F, 0.0F); + this.lampPole3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1); + this.lampPole2.addChild(this.lampPole3); + + this.lampTop = new ModelRenderer(this, 53, 8); + this.lampTop.setRotationPoint(3.5F, 2.0F, 0.5F); + this.lampTop.addBox(-2.5F, 0.0F, -2.5F, 5, 1, 5); + this.lampPole2.addChild(this.lampTop); + + this.lampGlassRight = new ModelRenderer(this, 41, 30); + this.lampGlassRight.setRotationPoint(-2.5F, 1.0F, -2.5F); + this.lampGlassRight.addBox(0.0F, 0.0F, 0.0F, 1, 4, 5); + this.lampTop.addChild(this.lampGlassRight); + + this.lampGlassFront = new ModelRenderer(this, 40, 40); + this.lampGlassFront.setRotationPoint(-1.5F, 1.0F, -2.5F); + this.lampGlassFront.addBox(0.0F, 0.0F, 0.0F, 3, 4, 1); + this.lampTop.addChild(this.lampGlassFront); + + this.lampGlassBack = new ModelRenderer(this, 40, 40); + this.lampGlassBack.setRotationPoint(-1.5F, 1.0F, 1.5F); + this.lampGlassBack.addBox(0.0F, 0.0F, 0.0F, 3, 4, 1); + this.lampTop.addChild(this.lampGlassBack); + + this.lampGlassLeft = new ModelRenderer(this, 41, 30); + this.lampGlassLeft.setRotationPoint(1.5F, 1.0F, -2.5F); + this.lampGlassLeft.addBox(0.0F, 0.0F, 0.0F, 1, 4, 5); + this.lampTop.addChild(this.lampGlassLeft); + + this.lampBottom = new ModelRenderer(this, 53, 23); + this.lampBottom.setRotationPoint(-2.5F, 5.0F, -0.5F); + this.lampBottom.addBox(0.0F, 0.0F, -2.0F, 5, 1, 5); + this.lampTop.addChild(this.lampBottom); + + this.lampLight = new ModelRenderer(this, 57, 15); + this.lampLight.setRotationPoint(8.0F, -7.0F, -2.0F); + this.lampLight.addBox(0.0F, 0.0F, 0.0F, 3, 4, 3); + + //Kitchen + + this.kitchenBase = new ModelRenderer(this, 49, 46); + this.kitchenBase.setRotationPoint(-9.0F, -1.0F, -1.5F); + this.kitchenBase.addBox(0.0F, 0.0F, 0.0F, 3, 1, 2); + + this.kitchen = new ModelRenderer(this, 49, 37); + this.kitchen.setRotationPoint(-3.0F, -2.0F, -1.5F); + this.kitchen.addBox(0.0F, 0.0F, 0.0F, 5, 2, 6); + this.kitchenBase.addChild(this.kitchen); + + //Noses + + this.villagerNose = new ModelRenderer(this, 64, 0); + this.villagerNose.setRotationPoint(-1.0F, 4.0F, 4.0F); + this.villagerNose.addBox(0.0F, 0.0F, 0.0F, 2, 4, 2); + + this.ocelotNose = new ModelRenderer(this, 74, 0); + this.ocelotNose.setRotationPoint(-1.0F, 4.0F, 4.0F); + this.ocelotNose.addBox(0.0F, 0.0F, 0.0F, 3, 2, 1); + + this.pigNose = new ModelRenderer(this, 74, 0); + this.pigNose.setRotationPoint(-2.0F, 4.0F, 4.0F); + this.pigNose.addBox(0.0F, 0.0F, 0.0F, 4, 3, 1); + + } + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float scale, IAdvBackpack backpack) + { + + //scale*=0.9; + boolean sleepingbag = backpack.isSBDeployed(); + FluidTank tankLeft = backpack.getLeftTank(); + FluidTank tankRight = backpack.getRightTank(); + setRotationAngles(f, f1, f2, f3, f4, scale, entity); + + GL11.glPushMatrix(); + renderBackpack(backpack,scale); + //renderFluidsInTanks(backpack.getLeftTank(),backpack.getRightTank(),scale); + GL11.glPopMatrix(); + + if (tankLeft != null && tankLeft.getFluid() != null && tankLeft.getFluid().getFluid().getIcon() != null) + { + Vector3 victor = new Vector3((tankLeftTop.rotationPointX*0.1f - 0.22f ), (tankLeftTop.rotationPointY * 0.1f + 0.05f ), + (tankLeftTop.rotationPointZ * 0.1f + 0.15f)); + GL11.glPushMatrix(); + CCRenderState.reset(); + CCRenderState.pullLightmap(); + CCRenderState.useNormals = true; + RenderUtils.renderFluidCuboid(tankLeft.getFluid(), new Cuboid6(0f,0.39f, 0f, 0.15f, 0f, 0.15f).add(victor), + ((1.0F * tankLeft.getFluidAmount()) / (1.0F * tankLeft.getCapacity())), 0.8); + GL11.glPopMatrix(); + + } + + if (tankRight != null && tankRight.getFluid() != null && tankRight.getFluid().getFluid().getIcon() != null) + { + Vector3 victor = new Vector3((tankRightTop.rotationPointX * 0.1f + 0.48f), (tankRightTop.rotationPointY * 0.1f + 0.05f), + (tankRightTop.rotationPointZ * 0.1f + 0.15f)); + GL11.glPushMatrix(); + CCRenderState.reset(); + CCRenderState.pullLightmap(); + CCRenderState.useNormals = true; + RenderUtils.renderFluidCuboid(tankRight.getFluid(), new Cuboid6(0,0.39, 0, 0.15,0 , 0.15).add(victor), + ((1.0F * tankRight.getFluidAmount()) / (1.0F * tankRight.getCapacity())), 0.8); + GL11.glPopMatrix(); + } + } + + private void renderFluidsInTanks(FluidTank tankLeft, FluidTank tankRight, float scale) + { + //Size of the cuboid + //Y-- is up, Y++ is down + float minX = 0f; + float minY = 0.5f; + float minZ = 0f; + + float maxX = 0.17f; + float maxY = 0f; + float maxZ = 0.17f; + + if (tankLeft != null && tankLeft.getFluid() != null && tankLeft.getFluid().getFluid().getIcon() != null) + { + //0.5F, -0.1F, -0.25F - Rotation Points of the top + //X++ to the right, X-- to the left + //Z-- to the front, Z++ to the back + Vector3 victor = new Vector3( + (tankLeftTop.rotationPointX * 0.1f - 0.17f ), // + (tankLeftTop.rotationPointY * 0.1f + 0.1f ), + (tankLeftTop.rotationPointZ * 0.1f + 0.13f )); + //ChickenStuff + CCRenderState.reset(); + CCRenderState.pullLightmap(); + CCRenderState.useNormals = true; + + Cuboid6 left = new Cuboid6(minX, minY, minZ, maxX, maxY, maxZ); + //Thanks Chickenbones! + RenderUtils.renderFluidCuboid(tankLeft.getFluid(), left.add(victor), ((1.0F * tankLeft.getFluidAmount()) / (1.0F * Constants.basicTankCapacity)), 0.2); + } + + if (tankRight != null && tankRight.getFluid() != null && tankRight.getFluid().getFluid().getIcon() != null) + { + //-0.9F, -0.1F, -0.25F - Rotation points of the top + //X-- to the right, X++ to the left + //Z-- to the front, Z++ to the back + Vector3 victor = new Vector3( + (tankRightTop.rotationPointX * 0.1f + 0.41f), // + (tankRightTop.rotationPointY * 0.1f + 0.1f), + (tankRightTop.rotationPointZ * 0.1f + 0.13f)); + //ChickenStuff + CCRenderState.reset(); + CCRenderState.pullLightmap(); + CCRenderState.useNormals = true; + + Cuboid6 right = new Cuboid6(minX, minY, minZ, maxX, maxY, maxZ); + RenderUtils.renderFluidCuboid(tankRight.getFluid(), right.add(victor), ((1.0F * tankRight.getFluidAmount()) / (1.0F * Constants.basicTankCapacity)), 0.2); + } + + } + + private void renderBackpack(IAdvBackpack backpack, float scale) + { + String color = backpack.getColorName(); + + if(color.equals("Quartz") || color.equals("Slime") || color.equals("Snow")){ + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + + this.mainBody.render(scale); + + GL11.glPopMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + + }else{ + this.mainBody.render(scale); + } + tankLeftTop.render(scale); + tankRightTop.render(scale); + + if(!backpack.isSBDeployed())bed.render(scale); + + if(color.equals("Pig") || color.equals("Horse")){ + pigNose.render(scale); + } + if(color.equals("Villager") || color.equals("IronGolem")){ + villagerNose.render(scale); + } + if(color.equals("Ocelot")){ + ocelotNose.render(scale); + } + + /*if(color.equals("Standard")) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + this.lampPole1.render(scale); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + }*/ + } + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/com/darkona/adventurebackpack/client/models/ModelNewArmor.java b/src/main/java/com/darkona/adventurebackpack/client/models/ModelNewArmor.java new file mode 100644 index 00000000..70b21b42 --- /dev/null +++ b/src/main/java/com/darkona/adventurebackpack/client/models/ModelNewArmor.java @@ -0,0 +1,397 @@ +package com.darkona.adventurebackpack.client.models; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.RenderUtils; +import codechicken.lib.vec.Cuboid6; +import codechicken.lib.vec.Vector3; +import com.darkona.adventurebackpack.client.render.RendererStack; +import com.darkona.adventurebackpack.common.Constants; +import com.darkona.adventurebackpack.common.IAdvBackpack; +import com.darkona.adventurebackpack.util.LogHelper; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import org.lwjgl.opengl.GL11; + +import java.util.List; + +/** + * Created on 17/12/2014 + * + * @author Darkona + */ +public class ModelNewArmor extends ModelBiped +{ + public static final ModelNewArmor instance = new ModelNewArmor(); + + public ModelRenderer mainBody; + public ModelRenderer tankLeftTop; + public ModelRenderer tankRightTop; + public ModelRenderer bed; + public ModelRenderer villagerNose; + public ModelRenderer pigNose; + public ModelRenderer ocelotNose; + public ModelRenderer leftStrap; + public ModelRenderer rightStrap; + public ModelRenderer top; + public ModelRenderer bottom; + public ModelRenderer pocketFace; + public ModelRenderer tankLeftBottom; + public ModelRenderer tankLeftWall4; + public ModelRenderer tankLeftWall3; + public ModelRenderer tankLeftWall2; + public ModelRenderer tankLeftWall1; + public ModelRenderer tankRightBottom; + public ModelRenderer tankRightWall2; + public ModelRenderer tankRightWall1; + public ModelRenderer tankRightWall3; + public ModelRenderer tankRightWall4; + public ModelRenderer bedStrapLeftMid; + public ModelRenderer bedStrapRightBottom; + public ModelRenderer bedStrapLeftBottom; + public ModelRenderer bedStrapRightMid; + public ModelRenderer bedStrapRightTop; + public ModelRenderer bedStrapLeftTop; + RendererStack lowerTool; + RendererStack upperTool; + private IAdvBackpack backpack; + private float scale = -1; + + public ModelNewArmor() { + this.textureWidth = 128; + this.textureHeight = 64; + + //Main Backpack + + this.mainBody = new ModelRenderer(this, 0, 9); + this.mainBody.addBox(-5.0F, 0.0F, -3.0F, 10, 9, 5); + this.mainBody.setRotationPoint(0.0F, 0.0F, 0.0F); + + this.leftStrap = new ModelRenderer(this, 21, 24); + this.leftStrap.setRotationPoint(3.0F, 0.0F, -3.0F); + this.leftStrap.addBox(0.0F, 0.0F, -1.0F, 1, 8, 1); + this.mainBody.addChild(this.leftStrap); + + this.rightStrap = new ModelRenderer(this, 26, 24); + this.rightStrap.setRotationPoint(-4.0F, 0.0F, -3.0F); + this.rightStrap.addBox(0.0F, 0.0F, -1.0F, 1, 8, 1); + this.mainBody.addChild(this.rightStrap); + + this.top = new ModelRenderer(this, 0, 0); + this.top.setRotationPoint(0.0F, 0.0F, -3.0F); + this.top.addBox(-5.0F, -3.0F, 0.0F, 10, 3, 5); + this.mainBody.addChild(this.top); + + this.bottom = new ModelRenderer(this, 0, 34); + this.bottom.setRotationPoint(-5.0F, 9.0F, -3.0F); + this.bottom.addBox(0.0F, 0.0F, 0.0F, 10, 1, 4); + this.mainBody.addChild(this.bottom); + + this.pocketFace = new ModelRenderer(this, 0, 24); + this.pocketFace.setRotationPoint(0.0F, 6.9F, 2.0F); + this.pocketFace.addBox(-4.0F, -6.0F, 0.0F, 8, 6, 2); + this.mainBody.addChild(this.pocketFace); + + //Left Tank + + this.tankLeftTop = new ModelRenderer(this, 0, 40); + this.tankLeftTop.setRotationPoint(5.0F, -1.0F, -2.5F); + this.tankLeftTop.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + + this.tankLeftBottom = new ModelRenderer(this, 0, 46); + this.tankLeftBottom.setRotationPoint(0.0F, 9.0F, 0.0F); + this.tankLeftBottom.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + this.tankLeftTop.addChild(this.tankLeftBottom); + + this.tankLeftWall1 = new ModelRenderer(this, 0, 52); + this.tankLeftWall1.setRotationPoint(3.0F, -8.0F, 0.0F); + this.tankLeftWall1.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall1); + + this.tankLeftWall2 = new ModelRenderer(this, 5, 52); + this.tankLeftWall2.setRotationPoint(0.0F, -8.0F, 0.0F); + this.tankLeftWall2.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall2); + + this.tankLeftWall3 = new ModelRenderer(this, 10, 52); + this.tankLeftWall3.setRotationPoint(0.0F, -8.0F, 3.0F); + this.tankLeftWall3.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall3); + + this.tankLeftWall4 = new ModelRenderer(this, 15, 52); + this.tankLeftWall4.setRotationPoint(3.0F, -8.0F, 3.0F); + this.tankLeftWall4.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankLeftBottom.addChild(this.tankLeftWall4); + + //Right Tank + + this.tankRightTop = new ModelRenderer(this, 17, 40); + this.tankRightTop.setRotationPoint(-9.0F, -1.0F, -2.5F); + this.tankRightTop.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + + this.tankRightBottom = new ModelRenderer(this, 17, 46); + this.tankRightBottom.setRotationPoint(0.0F, 9.0F, 0.0F); + this.tankRightBottom.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4); + this.tankRightTop.addChild(this.tankRightBottom); + + this.tankRightWall1 = new ModelRenderer(this, 22, 52); + this.tankRightWall1.setRotationPoint(3.0F, -8.0F, 3.0F); + this.tankRightWall1.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall1); + + this.tankRightWall2 = new ModelRenderer(this, 27, 52); + this.tankRightWall2.setRotationPoint(3.0F, -8.0F, 0.0F); + this.tankRightWall2.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall2); + + this.tankRightWall3 = new ModelRenderer(this, 32, 52); + this.tankRightWall3.setRotationPoint(0.0F, -8.0F, 3.0F); + this.tankRightWall3.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall3); + + this.tankRightWall4 = new ModelRenderer(this, 37, 52); + this.tankRightWall4.setRotationPoint(0.0F, -8.0F, 0.0F); + this.tankRightWall4.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1); + this.tankRightBottom.addChild(this.tankRightWall4); + + //Bed + + this.bed = new ModelRenderer(this, 31, 0); + this.bed.setRotationPoint(-7.0F, 7.0F, 2.0F); + this.bed.addBox(0.0F, 0.0F, 0.0F, 14, 2, 2); + + this.bedStrapRightTop = new ModelRenderer(this, 40, 5); + this.bedStrapRightTop.setRotationPoint(2.0F, -1.0F, 0.0F); + this.bedStrapRightTop.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3); + this.bed.addChild(this.bedStrapRightTop); + + this.bedStrapRightMid = new ModelRenderer(this, 38, 10); + this.bedStrapRightMid.setRotationPoint(2.0F, 0.0F, 2.0F); + this.bedStrapRightMid.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1); + this.bed.addChild(this.bedStrapRightMid); + + this.bedStrapRightBottom = new ModelRenderer(this, 42, 15); + this.bedStrapRightBottom.setRotationPoint(2.0F, 2.0F, -1.0F); + this.bedStrapRightBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 3); + this.bed.addChild(this.bedStrapRightBottom); + + this.bedStrapLeftTop = new ModelRenderer(this, 31, 5); + this.bedStrapLeftTop.setRotationPoint(11.0F, -1.0F, 0.0F); + this.bedStrapLeftTop.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3); + this.bed.addChild(this.bedStrapLeftTop); + + this.bedStrapLeftMid = new ModelRenderer(this, 31, 10); + this.bedStrapLeftMid.setRotationPoint(10.0F, 0.0F, 2.0F); + this.bedStrapLeftMid.addBox(0.0F, 0.0F, 0.0F, 2, 3, 1); + this.bed.addChild(this.bedStrapLeftMid); + + this.bedStrapLeftBottom = new ModelRenderer(this, 31, 15); + this.bedStrapLeftBottom.setRotationPoint(10.0F, 2.0F, -1.0F); + this.bedStrapLeftBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 3); + this.bed.addChild(this.bedStrapLeftBottom); + + //Noses + + this.villagerNose = new ModelRenderer(this, 64, 0); + this.villagerNose.setRotationPoint(-1.0F, 4.0F, 4.0F); + this.villagerNose.addBox(0.0F, 0.0F, 0.0F, 2, 4, 2); + + ocelotNose = new ModelRenderer(this, 74, 0); + ocelotNose.setRotationPoint(-1.0F, 4.0F, 4.0F); + ocelotNose.addBox(0.0F, 0.0F, 0.0F, 3, 2, 1); + + pigNose = new ModelRenderer(this, 74, 0); + pigNose.setRotationPoint(-2.0F, 4.0F, 4.0F); + pigNose.addBox(0.0F, 0.0F, 0.0F, 4, 3, 1); + + lowerTool = new RendererStack(this, true); + upperTool = new RendererStack(this, false); + + bipedBody.offsetZ = 0.3F; + bipedBody.offsetY = 0.2F; + + bipedBody.addChild(mainBody); + bipedBody.addChild(bed); + bipedBody.addChild(tankLeftTop); + bipedBody.addChild(tankRightTop); + bipedBody.addChild(villagerNose); + bipedBody.addChild(ocelotNose); + bipedBody.addChild(pigNose); + mainBody.addChild(lowerTool); + mainBody.addChild(upperTool); + } + + public ModelNewArmor setBackpack(IAdvBackpack backpack) + { + this.backpack = backpack; + return instance; + } + + private void startBlending() + { + //GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + } + + private void stopBlending() + { + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + // GL11.glPopMatrix(); + } + private void renderBackpack(Float f5){ + String color = backpack.getColorName(); + for(ModelRenderer model : (List)bipedBody.childModels) + { + model.mirror = false; + } + + lowerTool.setRotationPoint(-.5F, .10F, .3F); + setOffset(lowerTool, -.28F, 0.8F, -.1F ); + setOffset(upperTool, 0.0f, 0.04f, 0.25f ); + + lowerTool.stack = backpack.getStackInSlot(Constants.lowerTool); + upperTool.stack = backpack.getStackInSlot(Constants.upperTool); + + if(color.equals("Quartz") || color.equals("Slime") || color.equals("Snow")){ + startBlending(); + this.mainBody.render(f5); + stopBlending(); + }else{ + this.mainBody.render(f5); + } + + GL11.glPushMatrix(); + + tankLeftTop.render(f5); + tankRightTop.render(f5); + + bed.render(f5); + if(color.equals("Pig") || color.equals("Horse")){ + pigNose.render(scale); + } + if(color.equals("Villager") || color.equals("IronGolem")){ + villagerNose.render(scale); + } + if(color.equals("Ocelot")){ + ocelotNose.render(scale); + } + GL11.glPopMatrix(); + + + GL11.glPushMatrix(); + renderFluidInTank(backpack.getLeftTank(), scale, -.17f, .1f, .13f, tankLeftTop); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + renderFluidInTank(backpack.getRightTank(), scale, .41f, .1f, .13f, tankRightTop); + GL11.glPopMatrix(); + } + + private void renderFluidInTank(FluidTank tank, float scale, float offsetX, float offsetY, float offsetZ, ModelRenderer parent){ + //Side true is left, false is right + if (tank != null && tank.getFluid() != null && tank.getFluid().getFluid().getIcon() != null) + { + //Size of the cuboid + //Y-- is up, Y++ is down + float minX = 0f; + float minY = 0.5f; + float minZ = 0f; + + float maxX = 0.17f; + float maxY = 0f; + float maxZ = 0.17f; + Vector3 victor = new Vector3( + (parent.rotationPointX * 0.1f + offsetX), // + (parent.rotationPointY * 0.1f + offsetY), + (parent.rotationPointZ * 0.1f + offsetZ)); + + //ChickenStuff + /*CCRenderState.reset(); + CCRenderState.pullLightmap(); + CCRenderState.useNormals = true;*/ + + Cuboid6 cat = new Cuboid6(minX, minY, minZ, maxX, maxY, maxZ); + //Thanks Chickenbones! + RenderUtils.renderFluidCuboid(tank.getFluid(), cat.add(victor), ((1.0F * tank.getFluidAmount()) / (1.0F * Constants.basicTankCapacity)), 0.8); + } + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + + isSneak = ((entity != null) ? ((EntityLivingBase) entity).isSneaking() : false); + float oV = (isSneak) ? 0 : .3F; + + float scale = f5 * 0.9f; + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + GL11.glPushMatrix(); + GL11.glTranslatef(bipedBody.offsetX, bipedBody.offsetY, bipedBody.offsetZ); + GL11.glColor4f(1, 1, 1, 1); + + if (bipedBody.rotateAngleX == 0.0F && bipedBody.rotateAngleY == 0.0F && bipedBody.rotateAngleZ == 0.0F) + { + if (bipedBody.rotationPointX == 0.0F && bipedBody.rotationPointY == 0.0F && bipedBody.rotationPointZ == 0.0F) + { + renderBackpack(scale); + } + else + { + GL11.glTranslatef(bipedBody.rotationPointX * f5, bipedBody.rotationPointY * f5, bipedBody.rotationPointZ * f5); + renderBackpack(scale); + GL11.glTranslatef(-bipedBody.rotationPointX * f5, -bipedBody.rotationPointY * f5, -bipedBody.rotationPointZ * f5); + } + } + else + { + GL11.glPushMatrix(); + GL11.glTranslatef(bipedBody.rotationPointX * f5, bipedBody.rotationPointY * f5, bipedBody.rotationPointZ * f5); + + if (bipedBody.rotateAngleZ != 0.0F) + { + GL11.glRotatef(bipedBody.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (bipedBody.rotateAngleY != 0.0F) + { + GL11.glRotatef(bipedBody.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (bipedBody.rotateAngleX != 0.0F) + { + GL11.glRotatef(bipedBody.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + renderBackpack(scale); + GL11.glPopMatrix(); + } + GL11.glTranslatef(-bipedBody.offsetX, -bipedBody.offsetY, -(bipedBody.offsetZ)); + GL11.glPopMatrix(); + } + + public void setOffset(ModelRenderer modelRenderer, float x, float y, float z){ + modelRenderer.offsetX = x; + modelRenderer.offsetY = y; + modelRenderer.offsetZ = z; + } + + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + @Override + public void setRotationAngles(float v1, float v2, float v3, float v4, float v5, float v6, Entity entity) + { + super.setRotationAngles(v1, v2, v3, v4, v5, v6, entity); + } + +} diff --git a/src/main/java/com/darkona/adventurebackpack/client/render/RendererAdventureBackpackBlock.java b/src/main/java/com/darkona/adventurebackpack/client/render/RendererAdventureBackpackBlock.java index 6483a830..f7df13db 100644 --- a/src/main/java/com/darkona/adventurebackpack/client/render/RendererAdventureBackpackBlock.java +++ b/src/main/java/com/darkona/adventurebackpack/client/render/RendererAdventureBackpackBlock.java @@ -2,6 +2,7 @@ import com.darkona.adventurebackpack.block.TileAdventureBackpack; import com.darkona.adventurebackpack.client.models.ModelAdventureBackpackBlock; +import com.darkona.adventurebackpack.client.models.ModelNew; import com.darkona.adventurebackpack.util.Resources; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -18,11 +19,12 @@ public class RendererAdventureBackpackBlock extends TileEntitySpecialRenderer { - private ModelAdventureBackpackBlock model; +// private ModelAdventureBackpackBlock model; +private ModelNew model; public RendererAdventureBackpackBlock() { - this.model = new ModelAdventureBackpackBlock(); + this.model = new ModelNew();//new ModelAdventureBackpackBlock(); } @Override @@ -40,7 +42,7 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.1F, (float) z + 0.5F); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5f , (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); @@ -60,7 +62,8 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa } ResourceLocation modelTexture = Resources.backpackTextureFromColor((TileAdventureBackpack) te); bindTexture(modelTexture); - model.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1 / 20F, (TileAdventureBackpack) te); + model.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1 / 20F, (TileAdventureBackpack) te); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); GL11.glPopMatrix(); diff --git a/src/main/java/com/darkona/adventurebackpack/client/render/RendererItemAdventureBackpack.java b/src/main/java/com/darkona/adventurebackpack/client/render/RendererItemAdventureBackpack.java index 17cbe4d4..c9c1261c 100644 --- a/src/main/java/com/darkona/adventurebackpack/client/render/RendererItemAdventureBackpack.java +++ b/src/main/java/com/darkona/adventurebackpack/client/render/RendererItemAdventureBackpack.java @@ -1,6 +1,7 @@ package com.darkona.adventurebackpack.client.render; import com.darkona.adventurebackpack.client.models.ModelAdventureBackpackBlock; +import com.darkona.adventurebackpack.client.models.ModelNew; import com.darkona.adventurebackpack.inventory.InventoryItem; import com.darkona.adventurebackpack.util.Resources; import net.minecraft.client.Minecraft; @@ -14,11 +15,11 @@ */ public class RendererItemAdventureBackpack implements IItemRenderer { - private final ModelAdventureBackpackBlock model; + private final ModelNew model; public RendererItemAdventureBackpack() { - model = new ModelAdventureBackpackBlock(); + model = new ModelNew(); } public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) @@ -71,7 +72,7 @@ public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object GL11.glColor4f(1, 1, 1, 128); GL11.glPushMatrix(); - GL11.glTranslatef(-0.5f, 1.0f, -0.5f); + GL11.glTranslatef(-0.5f, 0f, -0.5f); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); @@ -95,7 +96,7 @@ public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object GL11.glColor4f(1, 1, 1, 128); GL11.glPushMatrix(); - GL11.glTranslatef(0f, 1.5f, 0f); + GL11.glTranslatef(0f, 1f, 0f); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); @@ -119,7 +120,7 @@ public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object GL11.glColor4f(1, 1, 1, 128); GL11.glPushMatrix(); - GL11.glTranslatef(0.8f, 1f, 0.0f); + GL11.glTranslatef(0.8f, 0.8f, 0.0f); GL11.glPushMatrix(); GL11.glScalef(0.9f, 0.9f, 0.9f); @@ -146,7 +147,7 @@ public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object GL11.glColor4f(1, 1, 1, 128); GL11.glPushMatrix(); - GL11.glTranslatef(1f, 1.5f, 0.8f); + GL11.glTranslatef(1f, 0.8f, 0.8f); GL11.glPushMatrix(); GL11.glScalef(1.5f, 1.5f, 1.5f); diff --git a/src/main/java/com/darkona/adventurebackpack/common/Actions.java b/src/main/java/com/darkona/adventurebackpack/common/Actions.java index 1b58f3e7..d85898df 100644 --- a/src/main/java/com/darkona/adventurebackpack/common/Actions.java +++ b/src/main/java/com/darkona/adventurebackpack/common/Actions.java @@ -149,6 +149,7 @@ public static void cycleTool(EntityPlayer player, int direction, int slot) { player.inventory.mainInventory[slot] = backpack.getStackInSlot(Constants.upperTool); backpack.setInventorySlotContentsNoSave(Constants.upperTool, backpack.getStackInSlot(Constants.lowerTool)); + LogHelper.info("Item of class " + backpack.getStackInSlot(Constants.lowerTool).getItem().getClass().getName()); backpack.setInventorySlotContentsNoSave(Constants.lowerTool, current); backpack.saveChanges(); player.inventory.closeInventory(); @@ -177,45 +178,143 @@ public static boolean tryPlaceOnDeath(EntityPlayer player) if (backpack != null) { World world = player.worldObj; - if (backpack.stackTagCompound.getString("colorName").equals("Creeper")) - { - BackpackAbilities.instance.itemCreeper(player, world, backpack); - } - ChunkCoordinates spawn = getNearestEmptyChunkCoordinates(world, (int) player.posX, (int) player.posY, (int) player.posZ, 10, false); - if (spawn != null) - { - if (((ItemAdventureBackpack) ModItems.adventureBackpack).placeBackpack(player.inventory.armorInventory[2], player, world, spawn.posX, spawn.posY, spawn.posZ, - ForgeDirection.UP.ordinal(), false)) + + /* for(int i = (int)player.posY - 5; i <= player.posY + 5; i+) + {*/ + ChunkCoordinates spawn = getNearestEmptyChunkCoordinates(world, (int) player.posX, (int) player.posZ,(int) player.posX, (int) player.posY, (int) player.posZ, 12, false, 1,(byte) 0); + + if (spawn != null) { - return true; + if (((ItemAdventureBackpack) ModItems.adventureBackpack).placeBackpack(player.inventory.armorInventory[2], player, world, spawn.posX, spawn.posY, spawn.posZ, + ForgeDirection.UP.ordinal(), false)) + { + return true; + } } - }else{ - //TODO Spawn the item entity for the backpack like everything else :( - } + /*}*/ } return false; } + + + private static ChunkCoordinates checkCoords(World world, int origX, int origZ, int X,int Y, int Z, boolean except) + { + //LogHelper.info("Checking coordinates in X="+X+", Y="+Y+", Z="+Z); + if (except && world.isSideSolid(X, Y - 1, Z, ForgeDirection.UP) && world.isAirBlock(X, Y, Z) && !areCoordinatesTheSame(origX, Y, origZ, X, Y, Z)) + { + //LogHelper.info("Found spot with the exception of the death point"); + return new ChunkCoordinates(X, Y, Z); + } + if (!except && world.isSideSolid(X, Y - 1, Z, ForgeDirection.UP) && world.isAirBlock(X, Y, Z)) + { + //LogHelper.info("Found spot without exceptions"); + return new ChunkCoordinates(X, Y, Z); + } + return null; + } + /** * Gets you the nearest Empty Chunk Coordinates, free of charge! Looks in three dimensions and finds a block * that a: can have stuff placed on it and b: has space above it. * * @param world The world object. - * @param x - * @param y - * @param z The coordinates of the central point of the search. + * @param origX Original X coordinate + * @param origZ Original Z coordinate + * @param X + * @param Y + * @param Z The coordinates of the central point of the search. * @param radius The radius of the search. If set to higher numbers, will create a ton of lag * @param except Wheter or not to include the origin of the search as a valid block. - * @return The coordinates of the block in the chunk of the world of the game of the server of the owner of the computer. + * @param steps number of steps of the recursive recursiveness that recurses through the recursion. It is the first size of the spiral, should be one (1) always at the first call. + * @param pass Pass switch for the witchcraft I can't quite explain. + * @return The coordinates of the block in the chunk of the world of the game of the server of the owner of the computer, where you can place something above it. */ - public static ChunkCoordinates getNearestEmptyChunkCoordinates(World world, int x, int y, int z, int radius, boolean except) + public static ChunkCoordinates getNearestEmptyChunkCoordinates(World world, int origX, int origZ, int X,int Y, int Z, int radius, boolean except, int steps, byte pass) { + //Spiral search, because I'm awesome :) + //This is so the backpack tries to get placed near the death point first + //And then goes looking farther away at each step + // Steps mod 2 == 0 => X++, Z-- + //Steps mod 2 == 1 => X--, Z++ - for (int i = x; i <= x + radius; ++i) + // + if(steps >= radius) return null; + int i = X, j = Z; + if (steps % 2 == 0) { - for (int j = y; j <= y + (radius / 2); ++j) + if(pass == 0) { - for (int k = z; k <= z + (radius); ++k) + for(;i <= X + steps; i++){ + ChunkCoordinates coords = checkCoords(world, origX, origZ, X, Y, Z, except); + if(coords != null) + { + return coords; + } + } + pass++; + return getNearestEmptyChunkCoordinates(world, origX,origZ,i,Y,j,radius,except,steps,pass); + } + if(pass == 1) + { + for(;j >= Z - steps; j--){ + ChunkCoordinates coords = checkCoords(world, origX, origZ, X, Y, Z, except); + if(coords != null) + { + return coords; + } + } + pass--; + steps++; + return getNearestEmptyChunkCoordinates(world, origX,origZ,i,Y,j,radius,except,steps,pass); + } + } + + if(steps % 2 == 1) + { + if(pass == 0) + { + for(;i >= X - steps; i--){ + ChunkCoordinates coords = checkCoords(world, origX, origZ, X, Y, Z, except); + if(coords != null) + { + return coords; + } + } + pass++; + return getNearestEmptyChunkCoordinates(world, origX,origZ,i,Y,j,radius,except,steps,pass); + } + if(pass == 1) + { + for(;j <= Z + steps; j++){ + ChunkCoordinates coords = checkCoords(world, origX, origZ, X, Y, Z, except); + if(coords != null) + { + return coords; + } + } + pass--; + steps++; + return getNearestEmptyChunkCoordinates(world, origX,origZ,i,Y,j,radius,except,steps,pass); + } + } + /* if (except && world.isSideSolid(X, Y - 1, Z, ForgeDirection.UP) && world.isAirBlock(X, Y, Z) && !areCoordinatesTheSame(x, y, z, X, Y, Z)) + { + return new ChunkCoordinates(X, Y, Z); + } + if (!except && world.isSideSolid(X, Y - 1, Z, ForgeDirection.UP) && world.isAirBlock(X, Y, Z)) + { + return new ChunkCoordinates(X, Y, Z); + }*/ + + + + /* Old code. Still works, though. + for (int i = x - radius; i <= x + radius; i++) + { + for (int j = y - (radius / 2); j <= y + (radius / 2); j++) + { + for (int k = z + radius; k <= z + (radius); k++) { if (except && world.isSideSolid(i, j - 1, k, ForgeDirection.UP) && world.isAirBlock(i, j, k) && !areCoordinatesTheSame(x, y, z, i, j, k)) { @@ -227,10 +326,11 @@ public static ChunkCoordinates getNearestEmptyChunkCoordinates(World world, int } } } - } + }*/ return null; } + /** * Compares two coordinates. Heh. * diff --git a/src/main/java/com/darkona/adventurebackpack/common/BackpackAbilities.java b/src/main/java/com/darkona/adventurebackpack/common/BackpackAbilities.java index c8fb8070..c7b0dba8 100644 --- a/src/main/java/com/darkona/adventurebackpack/common/BackpackAbilities.java +++ b/src/main/java/com/darkona/adventurebackpack/common/BackpackAbilities.java @@ -5,10 +5,11 @@ import com.darkona.adventurebackpack.init.ModFluids; import com.darkona.adventurebackpack.init.ModNetwork; import com.darkona.adventurebackpack.inventory.BackpackContainer; -import com.darkona.adventurebackpack.inventory.InventoryActions; import com.darkona.adventurebackpack.inventory.InventoryItem; +import com.darkona.adventurebackpack.network.CowAbilityMessage; import com.darkona.adventurebackpack.network.MessageConstants; import com.darkona.adventurebackpack.network.NyanCatMessage; +import com.darkona.adventurebackpack.util.LogHelper; import com.darkona.adventurebackpack.util.Utils; import com.darkona.adventurebackpack.util.Wearing; import cpw.mods.fml.common.network.NetworkRegistry; @@ -20,8 +21,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemSaddle; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; @@ -250,7 +249,7 @@ public void itemChicken(EntityPlayer player, World world, ItemStack backpack) if (eggTime <= 0) { player.playSound("mob.chicken.plop", 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.3F + 1.0F); - if (!world.isRemote) player.dropItem(new Items().egg, 1); + if (!world.isRemote) player.dropItem(Items.egg, 1); eggTime = Utils.secondsToTicks(200 + 10 * world.rand.nextInt(10)); } backpack.getTagCompound().setInteger("lastTime", eggTime); @@ -338,7 +337,7 @@ public void itemCreeper(EntityPlayer player, World world, ItemStack backpack) { if (player.getDistanceToEntity(entity) <= 3) { - world.playSoundAtEntity(player, "creeper.primed", 1.0F, 0.5F); + world.playSoundAtEntity(player, "creeper.primed", 1.2F, 0.5F); pssstTime = Utils.secondsToTicks(120); } } @@ -362,9 +361,8 @@ public void itemCreeper(EntityPlayer player, World world, ItemStack backpack) */ public void itemCow(EntityPlayer player, World world, ItemStack backpack) { - //if(world.isRemote)return; - IAdvBackpack inv = new InventoryItem(backpack); + FluidStack milkStack = new FluidStack(ModFluids.milk, 1); BackpackContainer cont = null; if(player.openContainer != null && player.openContainer instanceof BackpackContainer){ cont = (BackpackContainer)player.openContainer; @@ -372,21 +370,15 @@ public void itemCow(EntityPlayer player, World world, ItemStack backpack) inv = cont.inventory; } } - - - // inv = new InventoryItem(backpack); - - FluidStack milkStack = new FluidStack(ModFluids.milk, 1); - - if (inv.getLeftTank().fill(milkStack, false) <= 0 && inv.getRightTank().fill(milkStack, false) <= 0) return; - - - int eatTime = inv.getLastTime() - 1; + inv.openInventory(); + if (inv.getLeftTank().fill(milkStack, false) <= 0 && inv.getRightTank().fill(milkStack, false) <= 0) + { + return; + } + //Set Cow Properties + NBTTagCompound cowProperties; int wheatConsumed = 0; int milkTime = - 1; - NBTTagCompound cowProperties; - - //Set Cow Properties if (inv.getExtendedProperties() != null) { cowProperties = inv.getExtendedProperties(); @@ -400,62 +392,44 @@ public void itemCow(EntityPlayer player, World world, ItemStack backpack) cowProperties = new NBTTagCompound(); } + int eatTime = inv.getLastTime() == 0 ? Utils.secondsToTicks(1) : inv.getLastTime() - 1; - //Fun time! - not - - - //Eat the wheat - if (eatTime <= 0 && milkTime <= 0) - { - if (inv.hasItem(Items.wheat)) - { - if(!world.isRemote) - { - InventoryActions.consumeItemInBackpack(inv, Items.wheat); - } - ++wheatConsumed; - eatTime = Utils.secondsToTicks(/*15 + player.worldObj.rand.nextInt(15)*/1); - inv.saveChanges(); - - } - } - int factor = 1; - //Belly full, set the cycle - if (wheatConsumed == 16) + if(inv.hasItem(Items.wheat) && eatTime == 0 && milkTime <= 0) + { + LogHelper.info("Consuming Wheat in " + ((world.isRemote) ? "Client" : "Server")); + inv.consumeInventoryItem(Items.wheat); + if(!world.isRemote) { - wheatConsumed = 0; - milkTime = (1000 * factor) - factor; - world.playSoundAtEntity(player, "mob.cow.say", 1f, 1f); + EntityPlayerMP playerMP = (EntityPlayerMP) player; + ModNetwork.networkWrapper.sendTo(new CowAbilityMessage(player.getPersistentID().toString(),CowAbilityMessage.CONSUME_WHEAT),playerMP); } + wheatConsumed++; + } - //Make milk - if (milkTime >= 0 && (milkTime % factor == 0)) - { - if (inv.getLeftTank().fill(milkStack, true) > 0) - { - inv.saveChanges(); - } else if (inv.getRightTank().fill(milkStack, true) > 0) - { - inv.saveChanges(); - } - } - if (milkTime < 0) + int factor = 1; + if(wheatConsumed == 16) + { + + wheatConsumed = 0; + milkTime = (1000 * factor) - factor; + world.playSoundAtEntity(player, "mob.cow.say", 1f, 1f); + } + + if (milkTime >= 0 && (milkTime % factor == 0)) + { + if (inv.getLeftTank().fill(milkStack, true) <= 0) { - milkTime = 0; + inv.getRightTank().fill(milkStack, true); } + } - if (cont != null) cont.detectAndSendChanges(); - //Set the properties for the next cycle - cowProperties.setInteger("wheatConsumed", wheatConsumed); - cowProperties.setInteger("milkTime", milkTime); - inv.setExtendedProperties(cowProperties); - backpack.stackTagCompound.setInteger("lastTime", eatTime); - EntityPlayerMP playerMP = null; - if(player instanceof EntityPlayerMP){ - playerMP = (EntityPlayerMP)player; - } - if(playerMP != null)playerMP.sendContainerToPlayer(cont); - + cowProperties.setInteger("wheatConsumed", wheatConsumed); + cowProperties.setInteger("milkTime", milkTime); + inv.setExtendedProperties(cowProperties); + inv.setExtendedProperties(cowProperties); + inv.setLastTime(eatTime); + if(player.openContainer!=null)player.openContainer.detectAndSendChanges(); + inv.saveChanges(); } /** diff --git a/src/main/java/com/darkona/adventurebackpack/common/Constants.java b/src/main/java/com/darkona/adventurebackpack/common/Constants.java index 7620a8cd..5bba9930 100644 --- a/src/main/java/com/darkona/adventurebackpack/common/Constants.java +++ b/src/main/java/com/darkona/adventurebackpack/common/Constants.java @@ -8,19 +8,20 @@ public class Constants { - public static final int inventorySize = 22; + public static final int inventorySize = 45; public static final int bucket = FluidContainerRegistry.BUCKET_VOLUME; public static final int basicTankCapacity = bucket * 4; public static final int advancedTankCapacity = bucket * 8; public static final int heroicTankCapacity = bucket * 12; //Inventory Special Slots - public static final int upperTool = 16; - public static final int lowerTool = 17; + private static final int endOfInventory = inventorySize - 7; + public static final int upperTool = endOfInventory + 1; + public static final int lowerTool = upperTool + 1; - public static final int bucketInLeft = 18; - public static final int bucketOutLeft = 19; - public static final int bucketInRight = 20; - public static final int bucketOutRight = 21; + public static final int bucketInLeft = lowerTool + 1; + public static final int bucketOutLeft = bucketInLeft + 1; + public static final int bucketInRight = bucketOutLeft + 1; + public static final int bucketOutRight = bucketInRight + 1; } diff --git a/src/main/java/com/darkona/adventurebackpack/common/IAdvBackpack.java b/src/main/java/com/darkona/adventurebackpack/common/IAdvBackpack.java index b90f6e44..049b1bca 100644 --- a/src/main/java/com/darkona/adventurebackpack/common/IAdvBackpack.java +++ b/src/main/java/com/darkona/adventurebackpack/common/IAdvBackpack.java @@ -60,4 +60,6 @@ public interface IAdvBackpack extends IInventory void saveChanges(); boolean isSBDeployed(); + + void setLastTime(int time); } diff --git a/src/main/java/com/darkona/adventurebackpack/fluids/FluidMelonJuice.java b/src/main/java/com/darkona/adventurebackpack/fluids/FluidMelonJuice.java index c7374a7c..3805c3ab 100644 --- a/src/main/java/com/darkona/adventurebackpack/fluids/FluidMelonJuice.java +++ b/src/main/java/com/darkona/adventurebackpack/fluids/FluidMelonJuice.java @@ -39,7 +39,7 @@ public IIcon getFlowingIcon() @Override public int getColor(FluidStack stack) { - return 0xFFFAF0; + return 0xc31d08; } @Override diff --git a/src/main/java/com/darkona/adventurebackpack/fluids/FluidMilk.java b/src/main/java/com/darkona/adventurebackpack/fluids/FluidMilk.java index 55661baf..c8c98885 100644 --- a/src/main/java/com/darkona/adventurebackpack/fluids/FluidMilk.java +++ b/src/main/java/com/darkona/adventurebackpack/fluids/FluidMilk.java @@ -44,7 +44,7 @@ public IIcon getFlowingIcon() @Override public int getColor(FluidStack stack) { - return 0xFFFAF0; + return 0xffffff; } @Override diff --git a/src/main/java/com/darkona/adventurebackpack/handlers/GuiHandler.java b/src/main/java/com/darkona/adventurebackpack/handlers/GuiHandler.java index df447ca9..81d12fba 100644 --- a/src/main/java/com/darkona/adventurebackpack/handlers/GuiHandler.java +++ b/src/main/java/com/darkona/adventurebackpack/handlers/GuiHandler.java @@ -2,8 +2,6 @@ import com.darkona.adventurebackpack.block.TileAdventureBackpack; import com.darkona.adventurebackpack.client.gui.GuiAdvBackpack; -import com.darkona.adventurebackpack.client.gui.GuiCraftAdvBackpack; -import com.darkona.adventurebackpack.inventory.BackCraftContainer; import com.darkona.adventurebackpack.inventory.BackpackContainer; import com.darkona.adventurebackpack.inventory.InventoryItem; import com.darkona.adventurebackpack.util.Wearing; @@ -18,6 +16,7 @@ public class GuiHandler implements IGuiHandler { + public GuiHandler() { } @@ -34,7 +33,7 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int te = world.getTileEntity(x, y, z); if (te != null && te instanceof TileAdventureBackpack) { - return new BackpackContainer(player.inventory, (TileAdventureBackpack) te, BackpackContainer.SOURCE_TILE); + return new BackpackContainer(player, (TileAdventureBackpack) te, BackpackContainer.SOURCE_TILE); } break; case 1: @@ -42,7 +41,7 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int inv = Wearing.getBackpackInv(player, true); if (inv.getParentItemStack() != null) { - return new BackpackContainer(player.inventory, inv, BackpackContainer.SOURCE_ITEM); + return new BackpackContainer(player, inv, BackpackContainer.SOURCE_ITEM); } break; case 2: @@ -50,31 +49,7 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int inv = Wearing.getBackpackInv(player, false); if (inv.getParentItemStack() != null) { - return new BackpackContainer(player.inventory, inv, BackpackContainer.SOURCE_ITEM); - } - break; - case 3: - //ADVENTUREBACKPACK CRAFT GUI FROM TILE ENTITY - te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileAdventureBackpack) - { - return new BackCraftContainer(player, (TileAdventureBackpack) te); - } - break; - case 4: - //ADVENTUREBACKPACK CRAFT GUI FROM WEARING BACKPACK/KEYBIND - inv = Wearing.getBackpackInv(player, true); - if (inv.getParentItemStack() != null) - { - return new BackCraftContainer(player, world, inv); - } - break; - case 5: - //ADVENTUREBACKPACK CRAFT GUI FROM HOLDING BACKPACK / RIGHT CLICK - inv = Wearing.getBackpackInv(player, false); - if (inv.getParentItemStack() != null) - { - return new BackCraftContainer(player, world, inv); + return new BackpackContainer(player, inv, BackpackContainer.SOURCE_ITEM); } break; default: @@ -110,37 +85,13 @@ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int } break; case 2: - //ADVENTUREBACKPACK GUI FROM HOLDING BACKPACK /RIGHT CLICK + //ADVENTUREBACKPACK GUI FROM RIGHTCLICK/ HOLDING inv = Wearing.getBackpackInv(player, false); if (inv.getParentItemStack() != null) { return new GuiAdvBackpack(player, inv, false); } break; - case 3: - //ADVENTUREBACKPACK CRAFT GUI FROM TILE ENTITY - te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileAdventureBackpack) - { - return new GuiCraftAdvBackpack(player, (TileAdventureBackpack) te); - } - break; - case 4: - //ADVENTUREBACKPACK CRAFT GUI FROM WEARING BACKPACK/KEYBIND - inv = Wearing.getBackpackInv(player, true); - if (inv.getParentItemStack() != null) - { - return new GuiCraftAdvBackpack(player, inv, true); - } - break; - case 5: - //ADVENTUREBACKPACK CRAFT GUI FROM HOLDING BACKPACK / RIGHT CLICK - inv = Wearing.getBackpackInv(player, false); - if (inv.getParentItemStack() != null) - { - return new GuiCraftAdvBackpack(player, inv, false); - } - break; default: player.closeScreen(); break; diff --git a/src/main/java/com/darkona/adventurebackpack/handlers/PlayerEventHandler.java b/src/main/java/com/darkona/adventurebackpack/handlers/PlayerEventHandler.java index ae75ffae..9836e079 100644 --- a/src/main/java/com/darkona/adventurebackpack/handlers/PlayerEventHandler.java +++ b/src/main/java/com/darkona/adventurebackpack/handlers/PlayerEventHandler.java @@ -1,10 +1,7 @@ package com.darkona.adventurebackpack.handlers; import com.darkona.adventurebackpack.common.Actions; -import com.darkona.adventurebackpack.common.IAdvBackpack; import com.darkona.adventurebackpack.init.ModItems; -import com.darkona.adventurebackpack.inventory.BackpackContainer; -import com.darkona.adventurebackpack.inventory.InventoryItem; import com.darkona.adventurebackpack.reference.BackpackNames; import com.darkona.adventurebackpack.util.LogHelper; import com.darkona.adventurebackpack.util.Wearing; @@ -15,7 +12,6 @@ import net.minecraft.entity.monster.EntitySpider; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingEvent; @@ -78,11 +74,14 @@ public void playerDies(LivingDeathEvent event) if (event.entity instanceof EntityPlayer && Wearing.isWearingBackpack((EntityPlayer) event.entity)) { EntityPlayer player = ((EntityPlayer) event.entity); - if (Wearing.getWearingBackpack(player).getTagCompound().getString("colorName").equals("Creeper")) + + if (BackpackNames.getBackpackColorName(Wearing.getWearingBackpack(player)).equals("Creeper")) { player.worldObj.createExplosion(player, player.posX, player.posY, player.posZ, 4.0F, false); } - Actions.tryPlaceOnDeath(player); + if(!Actions.tryPlaceOnDeath(player)){ + Wearing.getWearingBackpack(player).getItem().onDroppedByPlayer(Wearing.getWearingBackpack(player),player); + } } event.setResult(Event.Result.ALLOW); } diff --git a/src/main/java/com/darkona/adventurebackpack/init/ModNetwork.java b/src/main/java/com/darkona/adventurebackpack/init/ModNetwork.java index da77874e..93980c99 100644 --- a/src/main/java/com/darkona/adventurebackpack/init/ModNetwork.java +++ b/src/main/java/com/darkona/adventurebackpack/init/ModNetwork.java @@ -1,9 +1,6 @@ package com.darkona.adventurebackpack.init; -import com.darkona.adventurebackpack.network.CycleToolMessage; -import com.darkona.adventurebackpack.network.GuiBackpackMessage; -import com.darkona.adventurebackpack.network.NyanCatMessage; -import com.darkona.adventurebackpack.network.SleepingBagMessage; +import com.darkona.adventurebackpack.network.*; import com.darkona.adventurebackpack.reference.ModInfo; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; @@ -26,5 +23,6 @@ public static void init() networkWrapper.registerMessage(GuiBackpackMessage.GuiBackpackMessageServerHandler.class, GuiBackpackMessage.class, messageCounter++, Side.SERVER); networkWrapper.registerMessage(NyanCatMessage.NyanCatMessageServerHandler.class, NyanCatMessage.class, messageCounter++, Side.SERVER); networkWrapper.registerMessage(SleepingBagMessage.SleepingBagMessageServerHandler.class, SleepingBagMessage.class, messageCounter++, Side.SERVER); + networkWrapper.registerMessage(CowAbilityMessage.CowAbilityMessageClientHandler.class, CowAbilityMessage.class, messageCounter++, Side.CLIENT); } } diff --git a/src/main/java/com/darkona/adventurebackpack/inventory/BackCraftContainer.java b/src/main/java/com/darkona/adventurebackpack/inventory/BackCraftContainer.java deleted file mode 100644 index a010944d..00000000 --- a/src/main/java/com/darkona/adventurebackpack/inventory/BackCraftContainer.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.darkona.adventurebackpack.inventory; - -import com.darkona.adventurebackpack.block.TileAdventureBackpack; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.world.World; - -/** - * Created by Darkona on 12/10/2014. - */ -public class BackCraftContainer extends Container -{ - - public IInventory inventory; - public boolean source; - public Boolean needsUpdate; - public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); - public IInventory craftResult = new InventoryCraftResult(); - private World world; - - public BackCraftContainer(EntityPlayer player, TileAdventureBackpack te) - { - needsUpdate = false; - inventory = te; - makeSlots(player.inventory); - source = true; - world = te.getWorldObj(); - } - - public BackCraftContainer(EntityPlayer player, World world, InventoryItem item) - { - needsUpdate = false; - inventory = item; - source = false; - makeSlots(player.inventory); - inventory.openInventory(); - this.world = world; - } - - private void makeSlots(InventoryPlayer invPlayer) - { - - IInventory sexy = this.craftMatrix; - - // Player's Hotbar - for (int x = 0; x < 9; x++) - { - addSlotToContainer(new Slot(invPlayer, x, 8 + 18 * x, 142)); - } - - // Player's Inventory - for (int y = 0; y < 3; y++) - { - for (int x = 0; x < 9; x++) - { - addSlotToContainer(new Slot(invPlayer, (x + y * 9 + 9), (8 + 18 * x), (84 + y * 18))); - } - } - - // Backpack Crafting Grid Inventory - for (int y = 0; y < 3; y++) - { - for (int x = 0; x < 3; x++) - { - addSlotToContainer(new Slot(sexy, (x + y * 3), (31 + 18 * x), (7 + y * 18))); - } - } - - addSlotToContainer(new SlotCrafting(invPlayer.player, this.craftMatrix, this.craftResult, 0, 91, 25)); - this.onCraftMatrixChanged(this.craftMatrix); - } - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) - { - return inventory.isUseableByPlayer(entityplayer); - } - - @Override - public void onCraftMatrixChanged(IInventory par1IInventory) - { - this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.world)); - } - - @Override - public void onContainerClosed(EntityPlayer par1EntityPlayer) - { - if (!this.world.isRemote) - { - for (int i = 0; i < 9; ++i) - { - ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); - - if (itemstack != null) - { - par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false); - } - } - } - } - - @Override - public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) - { - return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) - { - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) - { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - if (par2 == 0) - { - if (!this.mergeItemStack(itemstack1, 10, 46, true)) - { - return null; - } - - slot.onSlotChange(itemstack1, itemstack); - } else if (par2 >= 10 && par2 < 37) - { - if (!this.mergeItemStack(itemstack1, 37, 46, false)) - { - return null; - } - } else if (par2 >= 37 && par2 < 46) - { - if (!this.mergeItemStack(itemstack1, 10, 37, false)) - { - return null; - } - } else if (!this.mergeItemStack(itemstack1, 10, 46, false)) - { - return null; - } - - if (itemstack1.stackSize == 0) - { - slot.putStack((ItemStack) null); - } else - { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) - { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } - -} diff --git a/src/main/java/com/darkona/adventurebackpack/inventory/BackpackContainer.java b/src/main/java/com/darkona/adventurebackpack/inventory/BackpackContainer.java index 0ed3b033..485d73f9 100644 --- a/src/main/java/com/darkona/adventurebackpack/inventory/BackpackContainer.java +++ b/src/main/java/com/darkona/adventurebackpack/inventory/BackpackContainer.java @@ -1,13 +1,16 @@ package com.darkona.adventurebackpack.inventory; +import com.darkona.adventurebackpack.block.TileAdventureBackpack; import com.darkona.adventurebackpack.common.Constants; import com.darkona.adventurebackpack.common.IAdvBackpack; +import com.darkona.adventurebackpack.item.ItemAdventureBackpack; +import com.darkona.adventurebackpack.util.LogHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; +import net.minecraft.inventory.*; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.world.World; /** * Created by Darkona on 12/10/2014. @@ -18,31 +21,41 @@ public class BackpackContainer extends Container public IAdvBackpack inventory; public static boolean SOURCE_TILE = true; public static boolean SOURCE_ITEM = false; - - public BackpackContainer(InventoryPlayer invPlayer, IAdvBackpack backpack, boolean source) + public boolean source; + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public IInventory craftResult = new InventoryCraftResult(); + private World world; + + + private final int + PLAYER_HOT_START = 0, + PLAYER_HOT_END = PLAYER_HOT_START + 8, + PLAYER_INV_START = PLAYER_HOT_END + 1, + PLAYER_INV_END = PLAYER_INV_START + 26, + BACK_INV_START = PLAYER_INV_END + 1, + BACK_INV_END = BACK_INV_START + 38, + TOOL_START = BACK_INV_END + 1, + TOOL_END = TOOL_START + 1, + BUCKET_LEFT = TOOL_END + 1, + BUCKET_RIGHT = BUCKET_LEFT +2; + + public BackpackContainer(EntityPlayer player, IAdvBackpack backpack, boolean source) { inventory = backpack; - makeSlots(invPlayer); + makeSlots(player.inventory); + inventory.openInventory(); + this.source = source; } - - // =============================================== GETTERS ====================================================== // - // =============================================== SETTERS ====================================================== // - // ================================================ ORDER ======================================================= // - // ================================================ STACKS ====================================================== // - - - @Override - public boolean canInteractWith(EntityPlayer player) + private void bindPlayerInventory(InventoryPlayer invPlayer) { - return inventory.isUseableByPlayer(player); - } + int startX = 44; + int startY = 125; - private void bindPlayerInventory(InventoryPlayer invPlayer){ // Player's Hotbar for (int x = 0; x < 9; x++) { - addSlotToContainer(new Slot(invPlayer, x, 8 + 18 * x, 142)); + addSlotToContainer(new Slot(invPlayer, x, startX + 18 * x, 183)); } // Player's Inventory @@ -50,44 +63,110 @@ private void bindPlayerInventory(InventoryPlayer invPlayer){ { for (int x = 0; x < 9; x++) { - addSlotToContainer(new Slot(invPlayer, (x + y * 9 + 9), (8 + 18 * x), (84 + y * 18))); + addSlotToContainer(new Slot(invPlayer, (x + y * 9 + 9), (startX + 18 * x), (startY + y * 18))); } } + //Total 36 slots } private void makeSlots(InventoryPlayer invPlayer) { bindPlayerInventory(invPlayer); - int thing = 0; + // Backpack Inventory int startX = 62; int startY = 7; - for(int i = 0; i < 4; i++){ - for (int j = 0; j < 4; j++){ + int slot = 0; + + // 24 Slots + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 8; j++) + { + int offsetX = startX + (18 * j); + int offsetY = startY + (18 * i); + addSlotToContainer(new SlotBackpack(inventory, slot++, offsetX, offsetY)); + } + } + + // 15 Slots + startY = 61; + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 5; j++) + { int offsetX = startX + (18 * j); int offsetY = startY + (18 * i); - addSlotToContainer(new SlotBackpack(inventory, thing++, offsetX, offsetY));// 0 + addSlotToContainer(new SlotBackpack(inventory, slot++, offsetX, offsetY)); } } + LogHelper.info("Created " + slot + " slots in backpack Inventory"); + + //Upper Tool Slot - addSlotToContainer(new SlotTool(inventory, Constants.upperTool, 44, 25));// Upper Tool 16 + addSlotToContainer(new SlotTool(inventory, Constants.upperTool, 44, 79));// Upper Tool 16 //Lower Tool slot - addSlotToContainer(new SlotTool(inventory, Constants.lowerTool, 44, 43));// Lower Tool 17 + addSlotToContainer(new SlotTool(inventory, Constants.lowerTool, 44, 97));// Lower Tool 17 //Bucket Slots // bucket in left 18 - addSlotToContainer(new SlotFluid(inventory, Constants.bucketInLeft, 6, 25)); + addSlotToContainer(new SlotFluid(inventory, Constants.bucketInLeft, 6, 7)); // bucket out left 19 - addSlotToContainer(new SlotFluid(inventory, Constants.bucketOutLeft, 6, 55)); + addSlotToContainer(new SlotFluid(inventory, Constants.bucketOutLeft, 6, 37)); // bucket in right 20 - addSlotToContainer(new SlotFluid(inventory, Constants.bucketInRight, 153, 25)); + addSlotToContainer(new SlotFluid(inventory, Constants.bucketInRight, 226, 7)); // bucket out right 21 - addSlotToContainer(new SlotFluid(inventory, Constants.bucketOutRight, 153, 55)); + addSlotToContainer(new SlotFluid(inventory, Constants.bucketOutRight, 226, 37)); + + + //Craft Matrix + startX = 152; + for (int y = 0; y < 3; y++) + { + for (int x = 0; x < 3; x++) + { + int offsetX = startX + (18 * x); + int offsetY = startY + (18 * y); + addSlotToContainer(new Slot(craftMatrix, (x + y * 3), offsetX, offsetY)); + } + } + addSlotToContainer(new SlotCrafting(invPlayer.player, craftMatrix, craftResult, 0, 226, 97)); + this.onCraftMatrixChanged(craftMatrix); + //LogHelper.info("List of slots is " + this.inventorySlots.size() + " in size"); + + } + + /** + * places itemstacks in first x slots, x being aitemstack.lenght + * + * @param itemStacks + */ + + @Override + public void putStacksInSlots(ItemStack[] itemStacks) + { + for (int i = 0; i < itemStacks.length; i++) + { + this.getSlot(i).putStack(itemStacks[i]); + } + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } + + + @Override + public void onCraftMatrixChanged(IInventory par1IInventory) + { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.world)); } @Override @@ -95,21 +174,52 @@ public ItemStack transferStackInSlot(EntityPlayer player, int i) { // TODO Fix the shit disrespecting slot accepting itemstack. Slot slot = getSlot(i); + ItemStack result = null; if (slot != null && slot.getHasStack()) { ItemStack stack = slot.getStack(); - ItemStack result = stack.copy(); + result = stack.copy(); + if(player.getCurrentEquippedItem().equals(player.getItemInUse()) && player.getEquipmentInSlot(i).equals(player.getCurrentEquippedItem()))return null; if (i >= 36) { - if (!mergeItemStack(stack, 0, 36, false)) + if (!mergeItemStack(stack, PLAYER_HOT_START, PLAYER_INV_END + 1, false)) { return null; } - } else if (!mergeItemStack(stack, 36, 36 + inventory.getSizeInventory(), false)) - { - return null; } + if (i < 36) + { + if (SlotTool.isValidTool(stack)) + { + if (!mergeItemStack(stack, TOOL_START, TOOL_END + 1, false)) + { + if (!mergeItemStack(stack, BACK_INV_START, BACK_INV_END + 1, false)) + { + return null; + } + } + } else if (SlotFluid.valid(stack)) + { + if (!mergeItemStack(stack, BUCKET_LEFT, BUCKET_LEFT + 1, false)) + { + if(!mergeItemStack(stack, BUCKET_RIGHT, BUCKET_RIGHT + 1, false)) + { + if (!mergeItemStack(stack, BACK_INV_START, BACK_INV_END + 1, false)) + { + return null; + } + } + } + + } else if (!(stack.getItem() instanceof ItemAdventureBackpack)) + { + if (!mergeItemStack(stack, BACK_INV_START, BACK_INV_END + 1, false)) + { + return null; + } + } + } if (stack.stackSize == 0) { slot.putStack(null); @@ -118,20 +228,24 @@ public ItemStack transferStackInSlot(EntityPlayer player, int i) slot.onSlotChanged(); } + if (stack.stackSize == result.stackSize) + { + return null; + } slot.onPickupFromSlot(player, stack); inventory.onInventoryChanged(); - return result; } - return null; + return result; } + @Override public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); if (!player.worldObj.isRemote) { - for (int i = 0; i < inventory.getSizeInventory(); ++i) + for (int i = 0; i < inventory.getSizeInventory(); i++) { if (i == Constants.bucketInRight || i == Constants.bucketInLeft || i == Constants.bucketOutLeft || i == Constants.bucketOutRight) { @@ -143,7 +257,19 @@ public void onContainerClosed(EntityPlayer player) } } } + + for (int i = 0; i < 9; ++i) + { + ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); + + if (itemstack != null) + { + player.dropPlayerItemWithRandomChoice(itemstack, false); + } + } } + + } /** @@ -153,23 +279,12 @@ public void onContainerClosed(EntityPlayer player) public void detectAndSendChanges() { super.detectAndSendChanges(); - for (int i = 0; i < inventory.getInventory().length; ++i) - { - ItemStack itemstack = ((Slot) this.inventorySlots.get(i)).getStack(); - ItemStack itemstack1 = this.inventory.getInventory()[i]; - - if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) - { - itemstack1 = itemstack == null ? null : itemstack.copy(); - this.inventoryItemStacks.set(i, itemstack1); - } - } } @Override - public Slot getSlotFromInventory(IInventory p_75147_1_, int p_75147_2_) + public Slot getSlotFromInventory(IInventory iInventory, int index) { - return super.getSlotFromInventory(p_75147_1_, p_75147_2_); + return super.getSlotFromInventory(iInventory, index); } @Override @@ -267,10 +382,14 @@ public void putStackInSlot(int slot, ItemStack stack) } @Override - public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player) + public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) { + if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) { + return null; + } inventory.onInventoryChanged(); - return super.slotClick(par1, par2, par3, player); + return super.slotClick(slot, button, flag, player); } + } diff --git a/src/main/java/com/darkona/adventurebackpack/inventory/InventoryActions.java b/src/main/java/com/darkona/adventurebackpack/inventory/InventoryActions.java index b614ba6c..856e4864 100644 --- a/src/main/java/com/darkona/adventurebackpack/inventory/InventoryActions.java +++ b/src/main/java/com/darkona/adventurebackpack/inventory/InventoryActions.java @@ -1,5 +1,6 @@ package com.darkona.adventurebackpack.inventory; +import com.darkona.adventurebackpack.common.Constants; import com.darkona.adventurebackpack.common.IAdvBackpack; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -74,11 +75,11 @@ public static boolean transferContainerTank(IAdvBackpack backpack, FluidTank tan //How much fluid can this container hold. int amount = FluidContainerRegistry.getContainerCapacity(tank.getFluid(), stackIn); //Let's see how much can we drain this tank - FluidStack drain = tank.drain(amount, false); + FluidStack drain = tank.drain(Constants.bucket, false); ItemStack stackOut = FluidContainerRegistry.fillFluidContainer(drain, stackIn); - if (drain.amount >= amount) + if (drain.amount == amount) { if (backpack.getStackInSlot(slotOut) == null) { @@ -106,7 +107,7 @@ public static void consumeItemInBackpack(IAdvBackpack backpack, Item item) { ItemStack[] inventory = backpack.getInventory(); int i = -1; - for (int j = 0; j < inventory.length; ++j) + for (int j = 0; j < Constants.inventorySize-7; ++j) { if (backpack.getInventory()[j] != null && backpack.getInventory()[j].getItem() == item) { diff --git a/src/main/java/com/darkona/adventurebackpack/inventory/InventoryItem.java b/src/main/java/com/darkona/adventurebackpack/inventory/InventoryItem.java index bf4cf59d..37842cce 100644 --- a/src/main/java/com/darkona/adventurebackpack/inventory/InventoryItem.java +++ b/src/main/java/com/darkona/adventurebackpack/inventory/InventoryItem.java @@ -261,6 +261,12 @@ public boolean isSBDeployed() return false; } + @Override + public void setLastTime(int time) + { + this.lastTime = time; + } + @Override public int getSizeInventory() { diff --git a/src/main/java/com/darkona/adventurebackpack/inventory/SlotFluid.java b/src/main/java/com/darkona/adventurebackpack/inventory/SlotFluid.java index 6a440a8d..7333da35 100644 --- a/src/main/java/com/darkona/adventurebackpack/inventory/SlotFluid.java +++ b/src/main/java/com/darkona/adventurebackpack/inventory/SlotFluid.java @@ -16,6 +16,10 @@ public SlotFluid(IInventory inventory, int id, int x, int y) super(inventory, id, x, y); } + public static boolean valid(ItemStack stack){ + return ((stack != null) && (FluidContainerRegistry.isContainer(stack))); + } + @Override public boolean isItemValid(ItemStack stack) { diff --git a/src/main/java/com/darkona/adventurebackpack/inventory/SlotTool.java b/src/main/java/com/darkona/adventurebackpack/inventory/SlotTool.java index db48830f..f19c8bd8 100644 --- a/src/main/java/com/darkona/adventurebackpack/inventory/SlotTool.java +++ b/src/main/java/com/darkona/adventurebackpack/inventory/SlotTool.java @@ -1,12 +1,10 @@ package com.darkona.adventurebackpack.inventory; +import com.darkona.adventurebackpack.item.ItemAdventureBackpack; import com.darkona.adventurebackpack.item.ItemHose; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemHoe; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemTool; +import net.minecraft.item.*; /** * Created on 12/10/2014 @@ -33,11 +31,11 @@ public static boolean isValidTool(ItemStack stack) boolean valid = false; String[] validToolNames = { - "wrench", "hammer", "axe", "shovel", "grafter", "scoop", "crowbar", "mattock", "drill","hatchet" + "wrench", "hammer", "axe", "shovel", "grafter", "scoop", "crowbar", "mattock", "drill",/*"hatchet","excavator","chisel"*/ }; String[] invalidToolNames = { - "bucket", "sword", "dagger" + "bucket", "sword", "dagger", "sabre", "rapier", "shield", "cutlass", "bow", "whip" }; if (stack != null && stack.getMaxStackSize() == 1) @@ -46,13 +44,13 @@ public static boolean isValidTool(ItemStack stack) String name = item.getUnlocalizedName().toLowerCase(); // Vanilla - if (item instanceof ItemTool || item instanceof ItemHoe) + if (item instanceof ItemTool || item instanceof ItemHoe || item instanceof ItemShears || item instanceof ItemFishingRod || item instanceof ItemFlintAndSteel) { return true; } //Adventure Backpack duh! - if (item instanceof ItemHose) + if (item instanceof ItemHose || item instanceof ItemAdventureBackpack) { return false; } @@ -74,20 +72,36 @@ public static boolean isValidTool(ItemStack stack) try { // Tinker's Construct - if (java.lang.Class.forName("tconstruct.library.tools.HarvestTool").isInstance(item)) return true; - + if ( item.getClass().getName().contains("tconstruct.items.tools") ) return true; + } catch (Exception oops) + { + // oops.printStackTrace(); + } + try + { //Buildcraft if (java.lang.Class.forName("buildcraft.api.tools.IToolWrench").isInstance(item)) return true; - - //IndustrialCraft + } catch (Exception oops) + { + // oops.printStackTrace(); + } + try + { + //IndustrialCraft if (java.lang.Class.forName("ic2.api.item.IElectricItem").isInstance(item)) return true; - + } catch (Exception oops) + { + // oops.printStackTrace(); + } //Thaumcraft - - + try + { + //Thermal Expansion + if (java.lang.Class.forName("cofh.core.item.tool").isInstance(item)) return true; + if (java.lang.Class.forName("thermalexpansion.item.tool").isInstance(item)) return true; } catch (Exception oops) { - + // oops.printStackTrace(); } finally { return valid; diff --git a/src/main/java/com/darkona/adventurebackpack/item/ItemAdventureBackpack.java b/src/main/java/com/darkona/adventurebackpack/item/ItemAdventureBackpack.java index 5626c44d..cb423c60 100644 --- a/src/main/java/com/darkona/adventurebackpack/item/ItemAdventureBackpack.java +++ b/src/main/java/com/darkona/adventurebackpack/item/ItemAdventureBackpack.java @@ -3,9 +3,8 @@ import com.darkona.adventurebackpack.CreativeTabAB; import com.darkona.adventurebackpack.block.BlockAdventureBackpack; import com.darkona.adventurebackpack.block.TileAdventureBackpack; -import com.darkona.adventurebackpack.client.models.ModelAdventureBackpackArmor; +import com.darkona.adventurebackpack.client.models.ModelNewArmor; import com.darkona.adventurebackpack.common.BackpackAbilities; -import com.darkona.adventurebackpack.common.Constants; import com.darkona.adventurebackpack.events.UnequipBackpackEvent; import com.darkona.adventurebackpack.init.ModBlocks; import com.darkona.adventurebackpack.init.ModNetwork; @@ -21,7 +20,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -197,8 +195,7 @@ public boolean onDroppedByPlayer(ItemStack stack, EntityPlayer player) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack stack, int armorSlot) { InventoryItem inv = new InventoryItem(stack); - return ModelAdventureBackpackArmor.instance.setTanks(inv.getLeftTank().getFluid(), inv.getRightTank().getFluid()).setItems(inv.getStackInSlot(Constants.upperTool), - inv.getStackInSlot(Constants.lowerTool)); + return ModelNewArmor.instance.setBackpack(inv); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/darkona/adventurebackpack/item/ItemMachete.java b/src/main/java/com/darkona/adventurebackpack/item/ItemMachete.java index 67ca7b72..71333018 100644 --- a/src/main/java/com/darkona/adventurebackpack/item/ItemMachete.java +++ b/src/main/java/com/darkona/adventurebackpack/item/ItemMachete.java @@ -1,5 +1,6 @@ package com.darkona.adventurebackpack.item; +import com.darkona.adventurebackpack.CreativeTabAB; import com.darkona.adventurebackpack.init.ModMaterials; import com.google.common.collect.Sets; import net.minecraft.block.Block; @@ -51,7 +52,9 @@ public class ItemMachete extends ToolAB public ItemMachete() { + super(ModMaterials.ruggedIron, breakableBlocks); + setCreativeTab(CreativeTabAB.ADVENTURE_BACKPACK_CREATIVE_TAB); setMaxDamage(Items.iron_sword.getMaxDamage() + 250); this.field_150934_a = ModMaterials.ruggedIron.getDamageVsEntity(); this.setUnlocalizedName("machete"); @@ -136,4 +139,5 @@ public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, Entit */ return new ItemStack(new ItemShears()).getItem().onBlockStartBreak(itemstack, x, y, z, player); } + } diff --git a/src/main/java/com/darkona/adventurebackpack/network/CowAbilityMessage.java b/src/main/java/com/darkona/adventurebackpack/network/CowAbilityMessage.java new file mode 100644 index 00000000..be1d2bb9 --- /dev/null +++ b/src/main/java/com/darkona/adventurebackpack/network/CowAbilityMessage.java @@ -0,0 +1,91 @@ +package com.darkona.adventurebackpack.network; + +import com.darkona.adventurebackpack.common.IAdvBackpack; +import com.darkona.adventurebackpack.inventory.BackpackContainer; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; + +import java.util.UUID; + +/** + * Created on 16/10/2014 + * + * @author Darkona + */ +public class CowAbilityMessage implements IMessage +{ + + private byte action; + private String playerID; + public static final byte CONSUME_WHEAT = 0; + + public CowAbilityMessage() + { + } + + public CowAbilityMessage(String playerID, byte action) + { + this.playerID = playerID; + this.action = action; + } + + @Override + public void fromBytes(ByteBuf buf) + { + + playerID = ByteBufUtils.readUTF8String(buf); + action = buf.readByte(); + } + + @Override + public void toBytes(ByteBuf buf) + { + ByteBufUtils.writeUTF8String(buf, playerID); + buf.writeByte(action); + } + + public static class CowAbilityMessageServerHandler implements IMessageHandler + { + + @Override + public CowAbilityMessage onMessage(CowAbilityMessage message, MessageContext ctx) + { + + return null; + } + + + } + + public static class CowAbilityMessageClientHandler implements IMessageHandler + { + + @Override + public CowAbilityMessage onMessage(CowAbilityMessage message, MessageContext ctx) + { + EntityPlayer player = Minecraft.getMinecraft().theWorld.func_152378_a(UUID.fromString(message.playerID)); + + if(player.openContainer instanceof BackpackContainer) + { + BackpackContainer cont = ((BackpackContainer)player.openContainer); + cont.detectAndSendChanges(); + IAdvBackpack inv = cont.inventory; + switch(message.action) + { + case CONSUME_WHEAT: inv.consumeInventoryItem(Items.wheat); + } + player.inventoryContainer.detectAndSendChanges(); + inv.onInventoryChanged(); + inv.saveChanges(); + } + + return null; + } + } +} diff --git a/src/main/java/com/darkona/adventurebackpack/network/GuiBackpackMessage.java b/src/main/java/com/darkona/adventurebackpack/network/GuiBackpackMessage.java index 46b85e19..097c2340 100644 --- a/src/main/java/com/darkona/adventurebackpack/network/GuiBackpackMessage.java +++ b/src/main/java/com/darkona/adventurebackpack/network/GuiBackpackMessage.java @@ -2,7 +2,6 @@ import com.darkona.adventurebackpack.AdventureBackpack; import com.darkona.adventurebackpack.block.TileAdventureBackpack; -import com.darkona.adventurebackpack.inventory.BackCraftContainer; import com.darkona.adventurebackpack.inventory.BackpackContainer; import com.darkona.adventurebackpack.util.Wearing; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; @@ -78,36 +77,10 @@ public IMessage onMessage(GuiBackpackMessage message, MessageContext ctx) } } - if (message.type == MessageConstants.CRAFT_GUI) - { - if (message.from == MessageConstants.FROM_KEYBIND) - { - if (Wearing.isWearingBackpack(player)) - { - FMLNetworkHandler.openGui(player, AdventureBackpack.instance, 4, world, playerX, playerY, playerZ); - } - } - if (message.from == MessageConstants.FROM_HOLDING) - { - if (Wearing.isHoldingBackpack(player)) - { - FMLNetworkHandler.openGui(player, AdventureBackpack.instance, 5, world, playerX, playerY, playerZ); - } - } - } - if (message.from == MessageConstants.FROM_TILE) { if (message.type == MessageConstants.NORMAL_GUI) - { - if (player.openContainer instanceof BackCraftContainer) - { - TileAdventureBackpack te = (TileAdventureBackpack) ((BackCraftContainer) player.openContainer).inventory; - FMLNetworkHandler.openGui(player, AdventureBackpack.instance, 0, world, te.xCoord, te.yCoord, te.zCoord); - } - } - if (message.type == MessageConstants.CRAFT_GUI) { if (player.openContainer instanceof BackpackContainer) { diff --git a/src/main/java/com/darkona/adventurebackpack/reference/BackpackNames.java b/src/main/java/com/darkona/adventurebackpack/reference/BackpackNames.java index 6f1112ba..afe938f9 100644 --- a/src/main/java/com/darkona/adventurebackpack/reference/BackpackNames.java +++ b/src/main/java/com/darkona/adventurebackpack/reference/BackpackNames.java @@ -12,14 +12,14 @@ public class BackpackNames { public static String[] backpackNames = { - "Cow", "Black", "Blaze", "Coal", "Diamond", "Emerald", "Gold", "Iron", "Lapis", + "Cow", "Bat", "Black", "Blaze", "Carrot", "Coal", "Diamond", "Emerald", "Gold", "Iron", "IronGolem","Lapis", "Redstone", "Blue", "Bookshelf", "Brown", "Cactus", "Cake", "Chest", "Cookie", "Cyan", "Dragon", "Egg", "Electric", "Deluxe", "Enderman", "End", "Chicken", - "Ocelot", "Ghast", "Gray", "Green", "Haybale", "Leather", "LightBlue", "Glowstone", + "Ocelot", "Ghast", "Gray", "Green", "Haybale", "Horse","Leather", "LightBlue", "Glowstone", "LightGray", "Lime", "Magenta", "MagmaCube", "Melon", "BrownMushroom", "RedMushroom", - "Mooshroom", "Nether", "Wither", "Obsidian", "Orange", "Pigman", "Pink", "Pig", "Pumpkin", - "Purple", "Quartz", "Rainbow", "Red", "Sandstone", "Sheep", "Silver", "Creeper", "Skeleton", - "WitherSkeleton", "Zombie", "Slime", "Snow", "Spider", "Sponge", "Standard", "White", "Wolf", "Yellow" + "Mooshroom", "Nether", "Wither", "Obsidian", "Orange","Overworld", "Pigman", "Pink", "Pig", "Pumpkin", + "Purple", "Quartz", "Rainbow", "Red", "Sandstone", "Sheep", "Silver", "Squid", "Sunflower", "Creeper", "Skeleton", + "WitherSkeleton", "Zombie", "Slime", "Snow", "Spider", "Sponge", "Standard", "Villager", "White", "Wolf", "Yellow" }; diff --git a/src/main/resources/assets/adventurebackpack/lang/en_US.lang b/src/main/resources/assets/adventurebackpack/lang/en_US.lang index 19c105b5..d68f1b18 100644 --- a/src/main/resources/assets/adventurebackpack/lang/en_US.lang +++ b/src/main/resources/assets/adventurebackpack/lang/en_US.lang @@ -10,7 +10,7 @@ item.adventurebackpack:backpackHose.name=Backpack Hose item.adventurebackpack:adventureSuit.name=Adventurer's Suit item.adventurebackpack:adventureHat.name=Adventurer's Fedora item.adventurebackpack:pistonBoots.name=Piston Boots - +item.adventurebackpack:melonJuiceBottle.name=Melon Juice Bottle item.adventurebackpack:hose_leftTank_suck.name=Hose: Left Tank / Suck Mode item.adventurebackpack:hose_leftTank_spill.name=Hose: Left Tank / Spill Mode @@ -27,8 +27,13 @@ item.adventurebackpack:hoseUseless=Hose: Useless / No Backpack block.adventurebackpack:blockAdventureBackpack.name=Adventure Backpack Base #CreativeTab +itemGroup.adventurebackpack=Adventure Backpack #Keybindings keys.adventureBackpack.category=Adventure Backpack keys.adventureBackpack.openBackpackInventory=Open Backpack Inventory -keys.adventureBackpack.switchHoseTank=Switch Hose Tank \ No newline at end of file +keys.adventureBackpack.switchHoseTank=Switch Hose Tank + +#Fluids +fluid.melonJuice=Melon Juice +fluid.milk=Milk \ No newline at end of file diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Bat.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Bat.png new file mode 100644 index 00000000..468f0929 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Bat.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Black.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Black.png index 258ca94c..a85bc0e2 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Black.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Black.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Blaze.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Blaze.png index ff0c3666..83286bd0 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Blaze.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Blaze.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Blue.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Blue.png index 8af5182e..cca2aa24 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Blue.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Blue.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Bookshelf.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Bookshelf.png index 97d809c0..7e18126e 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Bookshelf.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Bookshelf.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Brown.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Brown.png index f2a1adc1..70f9f75f 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Brown.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Brown.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/BrownMushroom.png b/src/main/resources/assets/adventurebackpack/textures/backpack/BrownMushroom.png index 54fc2120..8b88876d 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/BrownMushroom.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/BrownMushroom.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Cactus.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Cactus.png index 1cba7db2..99872c8a 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Cactus.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Cactus.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Cake.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Cake.png index 18b2868f..6b2556c8 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Cake.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Cake.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Carrot.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Carrot.png new file mode 100644 index 00000000..f24c1978 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Carrot.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Chest.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Chest.png index 32fb8892..2720677b 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Chest.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Chest.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Chicken.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Chicken.png index bcd57ee1..8b4319b2 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Chicken.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Chicken.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Coal.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Coal.png index 3dc6782b..343409e7 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Coal.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Coal.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Cookie.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Cookie.png index 148121ca..6fa21d9c 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Cookie.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Cookie.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Cow.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Cow.png index 4e8d694f..652c6666 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Cow.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Cow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Creeper.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Creeper.png index 3179c5cd..0bc11d0a 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Creeper.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Creeper.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Cyan.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Cyan.png index f0d468dc..3b0c41e2 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Cyan.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Cyan.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Deluxe.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Deluxe.png index 86496574..4fa8ac48 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Deluxe.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Deluxe.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Diamond.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Diamond.png index a071d76b..852ed209 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Diamond.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Diamond.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Dragon.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Dragon.png index 16a99829..bc42740a 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Dragon.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Dragon.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Egg.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Egg.png index 5ce08e25..91b1b1e4 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Egg.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Egg.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Electric.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Electric.png index da547e03..2f1e5300 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Electric.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Electric.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Emerald.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Emerald.png index b5d1c06e..c621f12f 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Emerald.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Emerald.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/End.png b/src/main/resources/assets/adventurebackpack/textures/backpack/End.png index 6be05ca6..72c8dbf1 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/End.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/End.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Enderman.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Enderman.png index 78fd477f..40f70c71 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Enderman.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Enderman.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Ghast.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Ghast.png index 6d648aa9..2c78c16d 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Ghast.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Ghast.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Glowstone.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Glowstone.png index 95c11298..0228ecc3 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Glowstone.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Glowstone.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Gold.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Gold.png index bbc9423e..f8ebcdc3 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Gold.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Gold.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Gray.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Gray.png index e066871a..9eb4c1e0 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Gray.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Gray.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Green.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Green.png index d5140309..bbf3c379 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Green.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Green.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Haybale.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Haybale.png index e0f9a0b1..a8a63aa4 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Haybale.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Haybale.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Horse.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Horse.png new file mode 100644 index 00000000..e223eefe Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Horse.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Iron.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Iron.png index 57adb846..59b70d93 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Iron.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Iron.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/IronGolem.png b/src/main/resources/assets/adventurebackpack/textures/backpack/IronGolem.png new file mode 100644 index 00000000..d40360b2 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/IronGolem.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Lapis.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Lapis.png index 8be76aad..e8efca91 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Lapis.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Lapis.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Leather.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Leather.png index 10cac5a4..35c9e902 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Leather.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Leather.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/LightBlue.png b/src/main/resources/assets/adventurebackpack/textures/backpack/LightBlue.png index f08527f0..fbd1f2c1 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/LightBlue.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/LightBlue.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/LightGray.png b/src/main/resources/assets/adventurebackpack/textures/backpack/LightGray.png index 18e04fd6..cfc1c38b 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/LightGray.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/LightGray.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Lime.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Lime.png index 968d3d1c..3afb9aa2 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Lime.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Lime.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Magenta.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Magenta.png index 6a4e9c04..ea3e30a5 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Magenta.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Magenta.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/MagmaCube.png b/src/main/resources/assets/adventurebackpack/textures/backpack/MagmaCube.png index 4440add2..ea4f2630 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/MagmaCube.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/MagmaCube.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Melon.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Melon.png index 35bfe764..3997f7b8 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Melon.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Melon.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Mooshroom.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Mooshroom.png index 2f90db60..d32ad915 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Mooshroom.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Mooshroom.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Nether.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Nether.png index c5de2740..1247a6b5 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Nether.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Nether.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Obsidian.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Obsidian.png index f3d721a7..90b53487 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Obsidian.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Obsidian.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Ocelot.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Ocelot.png index 40d29152..8cc157a2 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Ocelot.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Ocelot.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Orange.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Orange.png index 47593b96..30ac43bb 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Orange.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Orange.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Overworld.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Overworld.png new file mode 100644 index 00000000..7cb7d4c5 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Overworld.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Pig.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Pig.png index 6746ae97..d77d3769 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Pig.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Pig.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Pigman.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Pigman.png index df1bc59e..f6b80fff 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Pigman.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Pigman.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Pink.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Pink.png index bc32164b..c3354430 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Pink.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Pink.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Pumpkin.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Pumpkin.png index 8eaff714..aa038175 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Pumpkin.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Pumpkin.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Purple.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Purple.png index f5beb730..7ff44333 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Purple.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Purple.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Quartz.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Quartz.png index 198fc2df..ba8e127f 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Quartz.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Quartz.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Rainbow.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Rainbow.png index 535a5d4b..5dfeefd2 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Rainbow.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Rainbow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Red.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Red.png index 1da47afd..5cbb7a3f 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Red.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Red.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/RedMushroom.png b/src/main/resources/assets/adventurebackpack/textures/backpack/RedMushroom.png index 9a5ce743..c35e03bb 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/RedMushroom.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/RedMushroom.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Redstone.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Redstone.png index 57d3f5df..56c463c1 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Redstone.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Redstone.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Sandstone.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Sandstone.png index 54b57dc8..3494cf1e 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Sandstone.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Sandstone.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Sheep.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Sheep.png index 2a29ff9d..8642ea7b 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Sheep.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Sheep.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Silver.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Silver.png index 2688bc6e..bda8c762 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Silver.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Silver.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Skeleton.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Skeleton.png index de49b115..de92bdc9 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Skeleton.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Skeleton.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Slime.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Slime.png index 7dad4de4..bb8173a4 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Slime.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Slime.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Snow.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Snow.png index a7f1a467..e39a21b5 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Snow.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Snow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Spider.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Spider.png index c9a5e2d4..1ee2c885 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Spider.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Spider.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Sponge.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Sponge.png index b37c2c44..90d8edc8 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Sponge.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Sponge.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Squid.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Squid.png new file mode 100644 index 00000000..0d083048 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Squid.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Standard.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Standard.png index 1ec47343..68a68055 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Standard.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Standard.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Sunflower.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Sunflower.png new file mode 100644 index 00000000..9ae27365 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Sunflower.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Villager.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Villager.png new file mode 100644 index 00000000..93ad92d9 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack/Villager.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/White.png b/src/main/resources/assets/adventurebackpack/textures/backpack/White.png index 1b26996a..f54dc5f5 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/White.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/White.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Wither.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Wither.png index 33e8fd04..1f2e041a 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Wither.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Wither.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/WitherSkeleton.png b/src/main/resources/assets/adventurebackpack/textures/backpack/WitherSkeleton.png index 4fa95b54..5498cb01 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/WitherSkeleton.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/WitherSkeleton.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Wolf.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Wolf.png index 0d90e810..b656f7fb 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Wolf.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Wolf.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Yellow.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Yellow.png index 7a479ecd..6ee8af33 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Yellow.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Yellow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Zombie.png b/src/main/resources/assets/adventurebackpack/textures/backpack/Zombie.png index 5b24d024..baa94dc0 100644 Binary files a/src/main/resources/assets/adventurebackpack/textures/backpack/Zombie.png and b/src/main/resources/assets/adventurebackpack/textures/backpack/Zombie.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Base.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Base.png similarity index 100% rename from src/main/resources/assets/adventurebackpack/textures/backpack/Base.png rename to src/main/resources/assets/adventurebackpack/textures/backpack_old/Base.png diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Black.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Black.png new file mode 100644 index 00000000..258ca94c Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Black.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Blaze.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Blaze.png new file mode 100644 index 00000000..ff0c3666 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Blaze.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Blue.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Blue.png new file mode 100644 index 00000000..8af5182e Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Blue.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Bookshelf.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Bookshelf.png new file mode 100644 index 00000000..97d809c0 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Bookshelf.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Brown.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Brown.png new file mode 100644 index 00000000..f2a1adc1 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Brown.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/BrownMushroom.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/BrownMushroom.png new file mode 100644 index 00000000..54fc2120 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/BrownMushroom.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cactus.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cactus.png new file mode 100644 index 00000000..1cba7db2 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cactus.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cake.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cake.png new file mode 100644 index 00000000..18b2868f Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cake.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Chest.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Chest.png new file mode 100644 index 00000000..32fb8892 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Chest.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Chicken.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Chicken.png new file mode 100644 index 00000000..880a27ac Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Chicken.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Coal.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Coal.png new file mode 100644 index 00000000..3dc6782b Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Coal.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cookie.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cookie.png new file mode 100644 index 00000000..148121ca Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cookie.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cow.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cow.png new file mode 100644 index 00000000..4e8d694f Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Creeper.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Creeper.png new file mode 100644 index 00000000..3179c5cd Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Creeper.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cyan.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cyan.png new file mode 100644 index 00000000..f0d468dc Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Cyan.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Deluxe.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Deluxe.png new file mode 100644 index 00000000..86496574 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Deluxe.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Diamond.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Diamond.png new file mode 100644 index 00000000..a071d76b Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Diamond.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Dragon.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Dragon.png new file mode 100644 index 00000000..16a99829 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Dragon.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Egg.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Egg.png new file mode 100644 index 00000000..5ce08e25 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Egg.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Electric.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Electric.png new file mode 100644 index 00000000..da547e03 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Electric.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Emerald.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Emerald.png new file mode 100644 index 00000000..b5d1c06e Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Emerald.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/End.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/End.png new file mode 100644 index 00000000..6be05ca6 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/End.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Enderman.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Enderman.png new file mode 100644 index 00000000..78fd477f Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Enderman.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Ghast.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Ghast.png new file mode 100644 index 00000000..6d648aa9 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Ghast.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Glowstone.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Glowstone.png new file mode 100644 index 00000000..95c11298 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Glowstone.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Gold.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Gold.png new file mode 100644 index 00000000..bbc9423e Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Gold.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Gray.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Gray.png new file mode 100644 index 00000000..e066871a Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Gray.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Green.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Green.png new file mode 100644 index 00000000..d5140309 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Green.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Haybale.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Haybale.png new file mode 100644 index 00000000..e0f9a0b1 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Haybale.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Iron.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Iron.png new file mode 100644 index 00000000..57adb846 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Iron.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Lapis.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Lapis.png new file mode 100644 index 00000000..8be76aad Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Lapis.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Leather.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Leather.png new file mode 100644 index 00000000..10cac5a4 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Leather.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/LightBlue.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/LightBlue.png new file mode 100644 index 00000000..f08527f0 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/LightBlue.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/LightGray.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/LightGray.png new file mode 100644 index 00000000..18e04fd6 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/LightGray.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Lime.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Lime.png new file mode 100644 index 00000000..968d3d1c Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Lime.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Magenta.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Magenta.png new file mode 100644 index 00000000..6a4e9c04 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Magenta.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/MagmaCube.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/MagmaCube.png new file mode 100644 index 00000000..4440add2 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/MagmaCube.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Melon.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Melon.png new file mode 100644 index 00000000..35bfe764 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Melon.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Mooshroom.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Mooshroom.png new file mode 100644 index 00000000..2f90db60 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Mooshroom.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Nether.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Nether.png new file mode 100644 index 00000000..c5de2740 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Nether.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Obsidian.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Obsidian.png new file mode 100644 index 00000000..f3d721a7 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Obsidian.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Ocelot.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Ocelot.png new file mode 100644 index 00000000..40d29152 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Ocelot.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Orange.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Orange.png new file mode 100644 index 00000000..47593b96 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Orange.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pig.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pig.png new file mode 100644 index 00000000..6746ae97 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pig.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pigman.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pigman.png new file mode 100644 index 00000000..df1bc59e Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pigman.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pink.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pink.png new file mode 100644 index 00000000..bc32164b Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pink.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pumpkin.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pumpkin.png new file mode 100644 index 00000000..8eaff714 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Pumpkin.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Purple.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Purple.png new file mode 100644 index 00000000..f5beb730 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Purple.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Quartz.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Quartz.png new file mode 100644 index 00000000..5bc9f604 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Quartz.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Rainbow.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Rainbow.png new file mode 100644 index 00000000..535a5d4b Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Rainbow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Red.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Red.png new file mode 100644 index 00000000..1da47afd Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Red.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/RedMushroom.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/RedMushroom.png new file mode 100644 index 00000000..9a5ce743 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/RedMushroom.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Redstone.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Redstone.png new file mode 100644 index 00000000..57d3f5df Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Redstone.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sandstone.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sandstone.png new file mode 100644 index 00000000..54b57dc8 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sandstone.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sheep.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sheep.png new file mode 100644 index 00000000..2a29ff9d Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sheep.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Silver.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Silver.png new file mode 100644 index 00000000..2688bc6e Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Silver.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Skeleton.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Skeleton.png new file mode 100644 index 00000000..de49b115 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Skeleton.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Slime.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Slime.png new file mode 100644 index 00000000..7dad4de4 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Slime.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Snow.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Snow.png new file mode 100644 index 00000000..a7f1a467 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Snow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Spider.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Spider.png new file mode 100644 index 00000000..c9a5e2d4 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Spider.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sponge.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sponge.png new file mode 100644 index 00000000..b37c2c44 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Sponge.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Standard.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Standard.png new file mode 100644 index 00000000..1ec47343 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Standard.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack/Standard2.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Standard2.png similarity index 100% rename from src/main/resources/assets/adventurebackpack/textures/backpack/Standard2.png rename to src/main/resources/assets/adventurebackpack/textures/backpack_old/Standard2.png diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/White.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/White.png new file mode 100644 index 00000000..1b26996a Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/White.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Wither.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Wither.png new file mode 100644 index 00000000..33e8fd04 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Wither.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/WitherSkeleton.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/WitherSkeleton.png new file mode 100644 index 00000000..4fa95b54 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/WitherSkeleton.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Wolf.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Wolf.png new file mode 100644 index 00000000..0d90e810 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Wolf.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Yellow.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Yellow.png new file mode 100644 index 00000000..7a479ecd Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Yellow.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/backpack_old/Zombie.png b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Zombie.png new file mode 100644 index 00000000..5b24d024 Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/backpack_old/Zombie.png differ diff --git a/src/main/resources/assets/adventurebackpack/textures/gui/guiBackpackNew.png b/src/main/resources/assets/adventurebackpack/textures/gui/guiBackpackNew.png new file mode 100644 index 00000000..9fd1515d Binary files /dev/null and b/src/main/resources/assets/adventurebackpack/textures/gui/guiBackpackNew.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 0ea335d1..60b7e584 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "adventurebackpack", "name": "Adventure Backpack", "description": "Useful and pretty backpacks for Minecraft", - "version": "1.7.10-0.6.6d", + "version": "1.7.10-0.7.0", "mcversion": "1.7.10", "url": "", "updateUrl": "",