diff --git a/build.gradle b/build.gradle index 421f07bbd..91b386c2e 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-0.0.1.4" +version = "1.7.10-0.0.2.0" group = "ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java index 2b8c8f933..e33ea433d 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java @@ -67,6 +67,39 @@ public class ContainerFeeder extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + final int inventoryStart = 1; + final int inventoryEnd = inventoryStart+26; + final int hotbarStart = inventoryEnd+1; + final int hotbarEnd = hotbarStart+8; + + Slot theSlot = (Slot)this.inventorySlots.get(slot); + if(theSlot.getHasStack()){ + ItemStack currentStack = theSlot.getStack(); + ItemStack newStack = currentStack.copy(); + + if(slot <= hotbarEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, 0, 1, false); + } + + if(slot <= hotbarEnd && slot >= hotbarStart){ + this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false); + } + + else if(slot <= inventoryEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false); + } + + else if(slot < inventoryStart){ + this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false); + } + + if(newStack.stackSize == 0) theSlot.putStack(null); + else theSlot.onSlotChanged(); + if(newStack.stackSize == currentStack.stackSize) return null; + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } return null; } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java index 34060b20a..d923304b1 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java @@ -11,6 +11,8 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.tileentity.TileEntityFurnace; public class ContainerFurnaceDouble extends Container{ @@ -27,8 +29,8 @@ public class ContainerFurnaceDouble extends Container{ this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_COAL, 80, 21)); this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_1, 51, 21)); - this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21)); this.addSlotToContainer(new SlotOutput(this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_1, 51, 69)); + this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21)); this.addSlotToContainer(new SlotOutput(this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69)); for (int i = 0; i < 3; i++){ @@ -84,6 +86,46 @@ public class ContainerFurnaceDouble extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + final int inventoryStart = 5; + final int inventoryEnd = inventoryStart+26; + final int hotbarStart = inventoryEnd+1; + final int hotbarEnd = hotbarStart+8; + + Slot theSlot = (Slot)this.inventorySlots.get(slot); + if(theSlot.getHasStack()){ + ItemStack currentStack = theSlot.getStack(); + ItemStack newStack = currentStack.copy(); + + if(slot <= hotbarEnd && slot >= inventoryStart){ + if(FurnaceRecipes.smelting().getSmeltingResult(currentStack) != null){ + this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1+1, false); + this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+2, false); + } + + if(TileEntityFurnace.getItemBurnTime(currentStack) > 0){ + this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_COAL, TileEntityFurnaceDouble.SLOT_COAL+1, false); + } + } + + if(slot <= hotbarEnd && slot >= hotbarStart){ + this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false); + } + + else if(slot <= inventoryEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false); + } + + else if(slot < inventoryStart){ + this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false); + } + + if(newStack.stackSize == 0) theSlot.putStack(null); + else theSlot.onSlotChanged(); + if(newStack.stackSize == currentStack.stackSize) return null; + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } return null; } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java index 6ddf263dd..27ee0269b 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java @@ -38,6 +38,39 @@ public class ContainerGiantChest extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + final int inventoryStart = 117; + final int inventoryEnd = inventoryStart+26; + final int hotbarStart = inventoryEnd+1; + final int hotbarEnd = hotbarStart+8; + + Slot theSlot = (Slot)this.inventorySlots.get(slot); + if(theSlot.getHasStack()){ + ItemStack currentStack = theSlot.getStack(); + ItemStack newStack = currentStack.copy(); + + if(slot <= hotbarEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, 0, 117, false); + } + + if(slot <= hotbarEnd && slot >= hotbarStart){ + this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false); + } + + else if(slot <= inventoryEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false); + } + + else if(slot < inventoryStart){ + this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false); + } + + if(newStack.stackSize == 0) theSlot.putStack(null); + else theSlot.onSlotChanged(); + if(newStack.stackSize == currentStack.stackSize) return null; + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } return null; } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java index 9185bcc14..2718c0dc2 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java @@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.inventory; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.inventory.slot.SlotOutput; +import ellpeck.actuallyadditions.recipe.GrinderRecipes; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityGrinder; import net.minecraft.entity.player.EntityPlayer; @@ -11,6 +12,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; public class ContainerGrinder extends Container{ @@ -90,6 +92,46 @@ public class ContainerGrinder extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + final int inventoryStart = this.isDouble ? 7 : 4; + final int inventoryEnd = inventoryStart+26; + final int hotbarStart = inventoryEnd+1; + final int hotbarEnd = hotbarStart+8; + + Slot theSlot = (Slot)this.inventorySlots.get(slot); + if(theSlot.getHasStack()){ + ItemStack currentStack = theSlot.getStack(); + ItemStack newStack = currentStack.copy(); + + if(slot <= hotbarEnd && slot >= inventoryStart){ + if(GrinderRecipes.instance().getOutput(currentStack, false) != null){ + this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false); + if(this.isDouble) this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false); + } + + if(TileEntityFurnace.getItemBurnTime(currentStack) > 0){ + this.mergeItemStack(newStack, TileEntityGrinder.SLOT_COAL, TileEntityGrinder.SLOT_COAL+1, false); + } + } + + if(slot <= hotbarEnd && slot >= hotbarStart){ + this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false); + } + + else if(slot <= inventoryEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false); + } + + else if(slot < inventoryStart){ + this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false); + } + + if(newStack.stackSize == 0) theSlot.putStack(null); + else theSlot.onSlotChanged(); + if(newStack.stackSize == currentStack.stackSize) return null; + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } return null; } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java index cd969c79a..f71db1cc6 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java @@ -87,6 +87,39 @@ public class ContainerInputter extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + final int inventoryStart = 1; + final int inventoryEnd = inventoryStart+26; + final int hotbarStart = inventoryEnd+1; + final int hotbarEnd = hotbarStart+8; + + Slot theSlot = (Slot)this.inventorySlots.get(slot); + if(theSlot.getHasStack()){ + ItemStack currentStack = theSlot.getStack(); + ItemStack newStack = currentStack.copy(); + + if(slot <= hotbarEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, 0, 1, false); + } + + if(slot <= hotbarEnd && slot >= hotbarStart){ + this.mergeItemStack(newStack, inventoryStart, inventoryEnd, false); + } + + else if(slot <= inventoryEnd && slot >= inventoryStart){ + this.mergeItemStack(newStack, hotbarStart, hotbarEnd, false); + } + + else if(slot < inventoryStart){ + this.mergeItemStack(newStack, inventoryStart, hotbarEnd, false); + } + + if(newStack.stackSize == 0) theSlot.putStack(null); + else theSlot.onSlotChanged(); + if(newStack.stackSize == currentStack.stackSize) return null; + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } return null; } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java index 8d99ee171..e82771d7d 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java @@ -92,11 +92,11 @@ public class GuiInputter extends GuiContainer{ this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.put"), guiLeft + 22 + 3, guiTop + 32, 4210752); this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 3, guiTop + 32, 4210752); - this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 3, guiTop + 45 + 1, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 24, guiTop + 66 + 1, 4210752); + this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 1, guiTop + 45 + 3, 4210752); + this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 24 + 3, guiTop + 66 + 3, 4210752); - this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 3, guiTop + 45 + 1, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 109, guiTop + 66 + 1, 4210752); + this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 1, guiTop + 45 + 3, 4210752); + this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 109 + 3, guiTop + 66 + 3, 4210752); } @Override @@ -142,7 +142,7 @@ public class GuiInputter extends GuiContainer{ else if (!this.enabled) color = 10526880; else if (this.field_146123_n) color = 16777120; - this.drawCenteredString(renderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height-3) / 2, color); + this.drawCenteredString(renderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height-8) / 2, color); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java index 848ec16db..45f7e2e7f 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java @@ -64,8 +64,11 @@ public class TileEntityInputter extends TileEntityInventoryBase{ } } else{ - this.setInventorySlotContents(0, theStack.copy()); - theInventory.setInventorySlotContents(theSlotToPull, null); + ItemStack toBePut = theStack.copy(); + if(theInventory.getInventoryStackLimit() < toBePut.stackSize) toBePut.stackSize = theInventory.getInventoryStackLimit(); + this.setInventorySlotContents(0, toBePut); + if(theStack.stackSize == toBePut.stackSize) theInventory.setInventorySlotContents(theSlotToPull, null); + else theStack.stackSize -= toBePut.stackSize; } } } @@ -103,8 +106,11 @@ public class TileEntityInputter extends TileEntityInventoryBase{ } } else{ - theInventory.setInventorySlotContents(theSlotToPut, this.slots[0].copy()); - this.slots[0] = null; + ItemStack toBePut = this.slots[0].copy(); + if(theInventory.getInventoryStackLimit() < toBePut.stackSize) toBePut.stackSize = theInventory.getInventoryStackLimit(); + theInventory.setInventorySlotContents(theSlotToPut, toBePut); + if(this.slots[0].stackSize == toBePut.stackSize) this.slots[0] = null; + else this.slots[0].stackSize -= toBePut.stackSize; } } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/Util.java b/src/main/java/ellpeck/actuallyadditions/util/Util.java index 4f7dde362..8753a6768 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/Util.java +++ b/src/main/java/ellpeck/actuallyadditions/util/Util.java @@ -18,7 +18,7 @@ import org.lwjgl.input.Keyboard; @SuppressWarnings("unused") public class Util{ - public static final String VERSION = "1.7.10-0.0.1.4"; + public static final String VERSION = "1.7.10-0.0.2.0"; public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 8230b2dfb..1bb628af6 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -100,6 +100,7 @@ tooltip.actuallyadditions.blockGrinder.desc.4=build the Double Crusher! tooltip.actuallyadditions.blockGrinderDouble.desc.1=Crushes Ores into Dusts! tooltip.actuallyadditions.blockGrinderDouble.desc.2=You get two Dusts per Ore and Extras! tooltip.actuallyadditions.blockGrinderDouble.desc.3=Can crush two Ores simultaneously! +tooltip.actuallyadditions.blockFurnaceDouble.desc=Smelts two things simultaneously! tooltip.actuallyadditions.blockInputter.desc.1=Its real name is %sObfuscated%s! tooltip.actuallyadditions.blockInputter.desc.2=Acts like a more advanced Hopper tooltip.actuallyadditions.blockInputter.desc.3=Configurable: diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemAxeEmerald.png b/src/main/resources/assets/actuallyadditions/textures/items/itemAxeEmerald.png index fec125b91..2851f3894 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemAxeEmerald.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemAxeEmerald.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodCheese.png b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodCheese.png index 7559422df..68e490b82 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodCheese.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodCheese.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolate.png b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolate.png index 2ced8770d..8f0419c6a 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolate.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolate.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolateCake.png b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolateCake.png index 151e7f612..b02269b06 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolateCake.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodChocolateCake.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodPizza.png b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodPizza.png index fcd882dab..16807d009 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemFoodPizza.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemFoodPizza.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemHoeEmerald.png b/src/main/resources/assets/actuallyadditions/textures/items/itemHoeEmerald.png index 5f1e91f50..f1ea5b795 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemHoeEmerald.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemHoeEmerald.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemPickaxeEmerald.png b/src/main/resources/assets/actuallyadditions/textures/items/itemPickaxeEmerald.png index 019cb6be4..7e1bb9635 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemPickaxeEmerald.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemPickaxeEmerald.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemShovelEmerald.png b/src/main/resources/assets/actuallyadditions/textures/items/itemShovelEmerald.png index b99441550..c6284f2fe 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemShovelEmerald.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemShovelEmerald.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemSwordEmerald.png b/src/main/resources/assets/actuallyadditions/textures/items/itemSwordEmerald.png index ea44f7d0f..c6e62d13e 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemSwordEmerald.png and b/src/main/resources/assets/actuallyadditions/textures/items/itemSwordEmerald.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 43eb6a5c1..5c7d6769d 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "ActuallyAdditions", "name": "Actually Additions", "description": "A bunch of random stuff added to your Game to make it even more fun, exciting and add some more variety!", - "version": "0.0.1.4", + "version": "0.0.2.0", "mcversion": "1.7.10", "url": "https://github.com/Ellpeck/ActuallyAdditions", "updateUrl": "",