diff --git a/buildcraft_resources/build.number b/buildcraft_resources/build.number index b257b265..ff518170 100644 --- a/buildcraft_resources/build.number +++ b/buildcraft_resources/build.number @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Fri May 03 16:39:34 CEST 2013 -build.number=25 +#Sat May 11 12:43:18 CEST 2013 +build.number=29 diff --git a/buildcraft_resources/build.xml b/buildcraft_resources/build.xml index 5e3197ca..2fa44729 100644 --- a/buildcraft_resources/build.xml +++ b/buildcraft_resources/build.xml @@ -17,7 +17,7 @@ - + @@ -30,6 +30,12 @@ + + + + + + @@ -94,8 +100,18 @@ + + + + + + + + + + diff --git a/buildcraft_resources/changelog/3.5.2 b/buildcraft_resources/changelog/3.5.2 new file mode 100644 index 00000000..74ae640f --- /dev/null +++ b/buildcraft_resources/changelog/3.5.2 @@ -0,0 +1,11 @@ + +#3.5.2 + +- Added: Pipe plugs. (Krapht) +- Added: Config option to disable oil springs. (CovertJaguar) +- Changed: Some more tweaks to oil spawn. Oil lakes now also spawn in taiga biomes. (CovertJaguar) +- Changed: Fire is now considered a soft block. (CovertJaguar) +- Changed: Pipes with missing info are now deleted. (CovertJaguar) +- Changed: Vanilla ISided support for extraction pipes. (h/t immibis) +- Bugfix: Filler flatten pattern no longer stopped by flowers. (CovertJaguar) +- Bugfix: Possibly fixed power pipe load issues. (CovertJaguar) \ No newline at end of file diff --git a/buildcraft_resources/mcmod.info b/buildcraft_resources/mcmod.info index 540e88ed..a11c4a8f 100644 --- a/buildcraft_resources/mcmod.info +++ b/buildcraft_resources/mcmod.info @@ -2,11 +2,11 @@ { "modid": "BuildCraft|Core", "name": "BuildCraft", + "version": "@VERSION@", + "mcversion": "", "description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more!", - "version": "", "credits": "Created by SpaceToad", "logoFile": "/gfx/buildcraft/logo.png", - "mcversion": "", "url": "http://www.mod-buildcraft.com/", "updateUrl": "", "authors": [ "SpaceToad", "BuildCraft Team" ], @@ -19,11 +19,11 @@ { "modid": "BuildCraft|Builders", "name": "BC Builders", + "version": "@VERSION@", + "mcversion": "", "description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Builders Component)", - "version": "", "credits": "Created by SpaceToad", "logoFile": "/gfx/buildcraft/logo.png", - "mcversion": "", "url": "http://www.mod-buildcraft.com/", "updateUrl": "", "authors": [ "SpaceToad", "BuildCraft Team" ], @@ -36,11 +36,11 @@ { "modid": "BuildCraft|Energy", "name": "BC Energy", + "version": "@VERSION@", + "mcversion": "", "description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Energy Component)", - "version": "", "credits": "Created by SpaceToad", "logoFile": "/gfx/buildcraft/logo.png", - "mcversion": "", "url": "http://www.mod-buildcraft.com/", "updateUrl": "", "authors": [ "SpaceToad", "BuildCraft Team" ], @@ -53,11 +53,11 @@ { "modid": "BuildCraft|Factory", "name": "BC Factory", + "version": "@VERSION@", + "mcversion": "", "description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Factory Component)", - "version": "", "credits": "Created by SpaceToad", "logoFile": "/gfx/buildcraft/logo.png", - "mcversion": "", "url": "http://www.mod-buildcraft.com/", "updateUrl": "", "authors": [ "SpaceToad", "BuildCraft Team" ], @@ -70,11 +70,11 @@ { "modid": "BuildCraft|Silicon", "name": "BC Silicon", + "version": "@VERSION@", + "mcversion": "", "description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Silicon Component)", - "version": "", "credits": "Created by SpaceToad", "logoFile": "/gfx/buildcraft/logo.png", - "mcversion": "", "url": "http://www.mod-buildcraft.com/", "updateUrl": "", "authors": [ "SpaceToad", "BuildCraft Team" ], @@ -87,11 +87,11 @@ { "modid": "BuildCraft|Transport", "name": "BC Transport", + "version": "@VERSION@", + "mcversion": "", "description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Transport Component)", - "version": "", "credits": "Created by SpaceToad", "logoFile": "/gfx/buildcraft/logo.png", - "mcversion": "", "url": "http://www.mod-buildcraft.com/", "updateUrl": "", "authors": [ "SpaceToad", "BuildCraft Team" ], diff --git a/common/buildcraft/core/inventory/InventoryWrapper.java b/common/buildcraft/core/inventory/InventoryWrapper.java index 7f74c780..26c483c8 100644 --- a/common/buildcraft/core/inventory/InventoryWrapper.java +++ b/common/buildcraft/core/inventory/InventoryWrapper.java @@ -1,5 +1,6 @@ package buildcraft.core.inventory; +import buildcraft.core.utils.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -29,12 +30,14 @@ public abstract class InventoryWrapper implements ISidedInventory { @Override public boolean isStackValidForSlot(int slotIndex, ItemStack itemstack) { return inventory.isStackValidForSlot(slotIndex, itemstack); } /* STATIC HELPER */ - public static ISidedInventory getWrappedInventory(IInventory inventory) { + public static ISidedInventory getWrappedInventory(Object inventory) { if(inventory instanceof ISidedInventory) return (ISidedInventory)inventory; else if(inventory instanceof net.minecraftforge.common.ISidedInventory) return new InventoryWrapperForge((net.minecraftforge.common.ISidedInventory)inventory); + else if(inventory instanceof IInventory) + return new InventoryWrapperSimple(Utils.getInventory((IInventory)inventory)); else - return new InventoryWrapperSimple(inventory); + return null; } } diff --git a/common/buildcraft/core/triggers/TriggerInventory.java b/common/buildcraft/core/triggers/TriggerInventory.java index ec41d8f4..d3133681 100644 --- a/common/buildcraft/core/triggers/TriggerInventory.java +++ b/common/buildcraft/core/triggers/TriggerInventory.java @@ -10,13 +10,12 @@ package buildcraft.core.triggers; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.ISidedInventory; import buildcraft.api.gates.ITriggerParameter; -import buildcraft.core.utils.SidedInventoryAdapter; -import buildcraft.core.utils.Utils; +import buildcraft.core.inventory.InventoryWrapper; public class TriggerInventory extends BCTrigger { @@ -63,11 +62,7 @@ public class TriggerInventory extends BCTrigger { } if (tile instanceof IInventory) { - IInventory inv = Utils.getInventory(((IInventory) tile)); - if (side != ForgeDirection.UNKNOWN && inv instanceof ISidedInventory) { - inv = new SidedInventoryAdapter((ISidedInventory) inv, side); - } - + ISidedInventory inv = InventoryWrapper.getWrappedInventory(tile); int invSize = inv.getSizeInventory(); if (invSize <= 0) @@ -76,7 +71,7 @@ public class TriggerInventory extends BCTrigger { boolean foundItems = false; boolean foundSpace = false; - for (int i = 0; i < invSize; ++i) { + for (int i : inv.getAccessibleSlotsFromSide(side.ordinal())) { ItemStack stack = inv.getStackInSlot(i); boolean slotEmpty = stack == null || stack.stackSize == 0; diff --git a/common/buildcraft/core/utils/SidedInventoryAdapter.java b/common/buildcraft/core/utils/SidedInventoryAdapter.java deleted file mode 100644 index 00b1ff76..00000000 --- a/common/buildcraft/core/utils/SidedInventoryAdapter.java +++ /dev/null @@ -1,91 +0,0 @@ -package buildcraft.core.utils; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.ISidedInventory; - -/** - * This class is responsible for abstracting an ISidedInventory as a normal IInventory - * - * @author Krapht - * - */ -public class SidedInventoryAdapter implements IInventory { - - private final ISidedInventory _sidedInventory; - private final ForgeDirection _side; - private final int _slotOffset; - - public SidedInventoryAdapter(ISidedInventory sidedInventory, ForgeDirection side) { - _sidedInventory = sidedInventory; - _side = side; - _slotOffset = _sidedInventory.getStartInventorySide(side); - } - - @Override - public int getSizeInventory() { - return _sidedInventory.getSizeInventorySide(_side); - } - - @Override - public ItemStack getStackInSlot(int i) { - return _sidedInventory.getStackInSlot(i + _slotOffset); - } - - @Override - public ItemStack decrStackSize(int i, int j) { - return _sidedInventory.decrStackSize(i + _slotOffset, j); - } - - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - _sidedInventory.setInventorySlotContents(i + _slotOffset, itemstack); - } - - @Override - public String getInvName() { - return _sidedInventory.getInvName(); - } - - @Override - public int getInventoryStackLimit() { - return _sidedInventory.getInventoryStackLimit(); - } - - @Override - public void onInventoryChanged() { - _sidedInventory.onInventoryChanged(); - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return _sidedInventory.isUseableByPlayer(entityplayer); - } - - @Override - public void openChest() { - _sidedInventory.openChest(); - } - - @Override - public void closeChest() { - _sidedInventory.closeChest(); - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return _sidedInventory.getStackInSlotOnClosing(slot + _slotOffset); - } - - @Override - public boolean isInvNameLocalized() { - return false; - } - - @Override - public boolean isStackValidForSlot(int i, ItemStack itemstack) { - return true; - } -} diff --git a/common/buildcraft/factory/TileAutoWorkbench.java b/common/buildcraft/factory/TileAutoWorkbench.java index 80da29d1..f35af3b8 100644 --- a/common/buildcraft/factory/TileAutoWorkbench.java +++ b/common/buildcraft/factory/TileAutoWorkbench.java @@ -14,21 +14,21 @@ import java.util.LinkedList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.ISidedInventory; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; import buildcraft.api.core.Position; import buildcraft.api.inventory.ISpecialInventory; +import buildcraft.core.inventory.InventoryWrapper; import buildcraft.core.inventory.TransactorRoundRobin; import buildcraft.core.proxy.CoreProxy; import buildcraft.core.utils.CraftingHelper; -import buildcraft.core.utils.SidedInventoryAdapter; import buildcraft.core.utils.Utils; public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { @@ -281,45 +281,42 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { return null; } - IInventory inventory = null; - if (tile instanceof ISidedInventory){ - inventory = new SidedInventoryAdapter((ISidedInventory) tile, direction.getOpposite()); - } else if (tile instanceof IInventory) { - inventory = Utils.getInventory((IInventory) tile); - } + ISidedInventory inventory = InventoryWrapper.getWrappedInventory(tile); + if (inventory == null) + return null; - if (inventory == null) return null; - - for (int j = 0; j < inventory.getSizeInventory(); ++j) { + for (int j : inventory.getAccessibleSlotsFromSide(direction.ordinal())) { ItemStack stack = inventory.getStackInSlot(j); + if(stack == null) + continue; + if(stack.stackSize <= 0) + continue; + if(!inventory.canExtractItem(j, stack, direction.ordinal())) + continue; + if(stack.itemID != itemStack.itemID) + continue; - if (stack != null) { - if (stack.stackSize > 0) { - if (stack.itemID == itemStack.itemID) { - if (!stack.isItemStackDamageable()) { - if (stack.itemID == itemStack.itemID && stack.getItemDamage() == itemStack.getItemDamage()) { - inventory.decrStackSize(j, 1); + if (!stack.isItemStackDamageable()) { + if (stack.itemID == itemStack.itemID && stack.getItemDamage() == itemStack.getItemDamage()) { + inventory.decrStackSize(j, 1); - StackPointer result = new StackPointer(); - result.inventory = inventory; - result.index = j; - result.item = stack; + StackPointer result = new StackPointer(); + result.inventory = inventory; + result.index = j; + result.item = stack; - return result; - } - } else { - if (stack.itemID == itemStack.itemID) { - inventory.decrStackSize(j, 1); + return result; + } + } else { + if (stack.itemID == itemStack.itemID) { + inventory.decrStackSize(j, 1); - StackPointer result = new StackPointer(); - result.inventory = inventory; - result.index = j; - result.item = stack; + StackPointer result = new StackPointer(); + result.inventory = inventory; + result.index = j; + result.item = stack; - return result; - } - } - } + return result; } } } diff --git a/common/buildcraft/factory/TileHopper.java b/common/buildcraft/factory/TileHopper.java index 75ed908e..15d9ad06 100644 --- a/common/buildcraft/factory/TileHopper.java +++ b/common/buildcraft/factory/TileHopper.java @@ -108,10 +108,7 @@ public class TileHopper extends TileBuildCraft implements IInventory { } @Override - public boolean isStackValidForSlot(int i, ItemStack itemstack) - { - + public boolean isStackValidForSlot(int i, ItemStack itemstack) { return true; - } }