Created
October 4, 2011 12:51
-
-
Save Flow86/1261563 to your computer and use it in GitHub Desktop.
Full 2.2.x patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/factory/RenderTank.java b/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/factory/RenderTank.java | |
index bcfa6c2..bbf27e4 100755 | |
--- a/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/factory/RenderTank.java | |
+++ b/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/factory/RenderTank.java | |
@@ -10,8 +10,6 @@ package net.minecraft.src.buildcraft.factory; | |
import java.util.HashMap; | |
-import org.lwjgl.opengl.GL11; | |
- | |
import net.minecraft.src.Block; | |
import net.minecraft.src.GLAllocation; | |
import net.minecraft.src.Item; | |
@@ -23,11 +21,13 @@ import net.minecraft.src.buildcraft.core.RenderEntityBlock.BlockInterface; | |
import net.minecraft.src.forge.ITextureProvider; | |
import net.minecraft.src.forge.MinecraftForgeClient; | |
+import org.lwjgl.opengl.GL11; | |
+ | |
public class RenderTank extends TileEntitySpecialRenderer { | |
final static private int displayStages = 100; | |
- private HashMap<Integer, int []> stage = new HashMap<Integer, int []> (); | |
+ private final HashMap<Integer, int []> stage = new HashMap<Integer, int []> (); | |
private int [] getDisplayLists(int liquidId) { | |
@@ -100,7 +100,10 @@ public class RenderTank extends TileEntitySpecialRenderer { | |
GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); | |
- GL11.glCallList(d[(int) ((float) tank.getLiquidQuantity() / (float) (tank.getCapacity()) * (float) (displayStages - 1))]); | |
+ int fill = (int) ((float) tank.getLiquidQuantity() / (float) (tank.getCapacity()) * (displayStages - 1)); | |
+ if(fill >= displayStages) | |
+ fill = displayStages-1; | |
+ GL11.glCallList(d[fill]); | |
GL11.glEnable(2896 /*GL_LIGHTING*/); | |
GL11.glPopMatrix(); | |
diff --git a/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/RenderPipe.java b/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/RenderPipe.java | |
index 64b16f7..ce82d57 100755 | |
--- a/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/RenderPipe.java | |
+++ b/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/RenderPipe.java | |
@@ -10,8 +10,6 @@ package net.minecraft.src.buildcraft.transport; | |
import java.util.HashMap; | |
-import org.lwjgl.opengl.GL11; | |
- | |
import net.minecraft.src.Block; | |
import net.minecraft.src.BuildCraftCore; | |
import net.minecraft.src.GLAllocation; | |
@@ -33,6 +31,8 @@ import net.minecraft.src.buildcraft.transport.PipeTransportLiquids.LiquidBuffer; | |
import net.minecraft.src.forge.ITextureProvider; | |
import net.minecraft.src.forge.MinecraftForgeClient; | |
+import org.lwjgl.opengl.GL11; | |
+ | |
public class RenderPipe extends TileEntitySpecialRenderer { | |
final static private int maxPower = 1000; | |
@@ -46,7 +46,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { | |
public int [] centerVertical = new int [displayLiquidStages]; | |
} | |
- private HashMap<Integer, DisplayLiquidList> displayLiquidLists = new HashMap<Integer, DisplayLiquidList>(); | |
+ private final HashMap<Integer, DisplayLiquidList> displayLiquidLists = new HashMap<Integer, DisplayLiquidList>(); | |
private final int [] angleY = {0, 0, 270, 90, 0, 180}; | |
private final int [] angleZ = {90, 270, 0, 0, 0, 0}; | |
@@ -56,7 +56,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { | |
public int [] displayPowerList = new int [displayPowerStages]; | |
public double [] displayPowerLimits = new double [displayPowerStages]; | |
- private RenderBlocks renderBlocks; | |
+ private final RenderBlocks renderBlocks; | |
public RenderPipe() { | |
renderBlocks = new RenderBlocks(); | |
@@ -178,7 +178,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { | |
float minSize = 0.005F; | |
- float unit = (size - minSize) / 2F / (float) displayPowerStages; | |
+ float unit = (size - minSize) / 2F / displayPowerStages; | |
block.minY = 0.5 - (minSize / 2F) - unit * s; | |
block.maxY = 0.5 + (minSize / 2F) + unit * s; | |
@@ -283,7 +283,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { | |
} | |
int stage = (int) ((float) liq.getSide(i) | |
- / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (float) (displayLiquidStages - 1)); | |
+ / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); | |
GL11.glPushMatrix(); | |
int list = 0; | |
@@ -319,7 +319,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { | |
if (d != null) { | |
int stage = (int) ((float) liq.getCenter() | |
- / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (float) (displayLiquidStages - 1)); | |
+ / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); | |
if (above) { | |
GL11.glCallList(d.centerVertical[stage]); | |
@@ -446,10 +446,10 @@ public class RenderPipe extends TileEntitySpecialRenderer { | |
MinecraftForgeClient.bindTexture("/gui/items.png"); | |
} | |
Tessellator tessellator = Tessellator.instance; | |
- float f6 = (float) ((i % 16) * 16 + 0) / 256F; | |
- float f8 = (float) ((i % 16) * 16 + 16) / 256F; | |
- float f10 = (float) ((i / 16) * 16 + 0) / 256F; | |
- float f11 = (float) ((i / 16) * 16 + 16) / 256F; | |
+ float f6 = ((i % 16) * 16 + 0) / 256F; | |
+ float f8 = ((i % 16) * 16 + 16) / 256F; | |
+ float f10 = ((i / 16) * 16 + 0) / 256F; | |
+ float f11 = ((i / 16) * 16 + 16) / 256F; | |
float f12 = 1.0F; | |
float f13 = 0.5F; | |
float f14 = 0.25F; | |
diff --git a/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java b/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java | |
index 585d4d4..5db5662 100644 | |
--- a/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java | |
+++ b/buildcraft/buildcraft_client/src/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java | |
@@ -28,18 +28,18 @@ public class TileEntityPickupFX extends EntityFX | |
public TileEntityPickupFX(World world, EntityItem entity, TileEntity entity1) | |
{ | |
super(world, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ); | |
- field_678_p = 0; | |
- field_677_q = 0; | |
+ age = 0; | |
+ maxAge = 0; | |
field_675_a = entity; | |
field_679_o = entity1; | |
- field_677_q = 3; | |
+ maxAge = 3; | |
yDestination = Utils.getPipeFloorOf(entity.item); | |
} | |
public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) | |
{ | |
- float f6 = ((float)field_678_p + f) / (float)field_677_q; | |
+ float f6 = ((float)age + f) / (float)maxAge; | |
f6 *= f6; | |
double d = field_675_a.posX; | |
double d1 = field_675_a.posY; | |
@@ -68,8 +68,8 @@ public class TileEntityPickupFX extends EntityFX | |
public void onUpdate() | |
{ | |
- field_678_p++; | |
- if(field_678_p == field_677_q) | |
+ age++; | |
+ if(age == maxAge) | |
{ | |
setEntityDead(); | |
} | |
@@ -82,6 +82,6 @@ public class TileEntityPickupFX extends EntityFX | |
private Entity field_675_a; | |
private TileEntity field_679_o; | |
- private int field_678_p; | |
- private int field_677_q; | |
+ private int age; | |
+ private int maxAge; | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/devel/BlockCheat.java b/buildcraft/common/net/minecraft/src/buildcraft/devel/BlockCheat.java | |
index dc608b3..8a4086b 100644 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/devel/BlockCheat.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/devel/BlockCheat.java | |
@@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.devel; | |
import net.minecraft.src.Block; | |
import net.minecraft.src.BlockChest; | |
+import net.minecraft.src.BuildCraftBuilders; | |
import net.minecraft.src.BuildCraftCore; | |
import net.minecraft.src.BuildCraftEnergy; | |
import net.minecraft.src.BuildCraftFactory; | |
@@ -67,29 +68,17 @@ public class BlockCheat extends BlockChest { | |
// inv.setInventorySlotContents(ind++, new ItemStack | |
// (BuildCraftFactory.miningWellBlock, 64)); | |
inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftFactory.quarryBlock, 64)); | |
- inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.diamondGearItem, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftFactory.autoWorkbenchBlock, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftBuilders.fillerBlock, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftBuilders.markerBlock, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftBuilders.builderBlock, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftBuilders.templateBlock, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftBuilders.templateItem, 1)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftCore.goldGearItem, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftCore.ironGearItem, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftCore.stoneGearItem, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftCore.woodenGearItem, 64)); | |
- // inv.setInventorySlotContents(ind++, new ItemStack | |
- // (BuildCraftCore.diamondGearItem, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftFactory.autoWorkbenchBlock, 64)); | |
+ inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.fillerBlock, 64)); | |
+ inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.markerBlock, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.builderBlock, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.templateBlock, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.templateItem, 1)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.goldGearItem, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.ironGearItem, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.stoneGearItem, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.woodenGearItem, 64)); | |
+ // inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.diamondGearItem, 64)); | |
inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftEnergy.engineBlock, 64, 0)); | |
inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftEnergy.engineBlock, 64, 1)); | |
inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftEnergy.engineBlock, 64, 2)); | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/energy/Engine.java b/buildcraft/common/net/minecraft/src/buildcraft/energy/Engine.java | |
index 4005b3c..8397089 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/energy/Engine.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/energy/Engine.java | |
@@ -21,7 +21,7 @@ public abstract class Engine { | |
public @TileNetworkData Orientations orientation; | |
public @TileNetworkData int energy; | |
- public int maxEnergyExtracted = 1; | |
+ public int maxEnergyExtracted = 10; | |
protected TileEngine tile; | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/energy/EngineWood.java b/buildcraft/common/net/minecraft/src/buildcraft/energy/EngineWood.java | |
index 2f7a82e..5bfdbea 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/energy/EngineWood.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/energy/EngineWood.java | |
@@ -48,7 +48,7 @@ public class EngineWood extends Engine { | |
if (tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord)) { | |
if ((tile.worldObj.getWorldTime() % 20) == 0) { | |
- energy++; | |
+ addEnergy(1); | |
} | |
} | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/factory/BlockPump.java b/buildcraft/common/net/minecraft/src/buildcraft/factory/BlockPump.java | |
index 1a44a7e..14c1232 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/factory/BlockPump.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/factory/BlockPump.java | |
@@ -21,9 +21,7 @@ public class BlockPump extends BlockContainer implements ITextureProvider { | |
public BlockPump(int i) { | |
super(i, Material.iron); | |
- | |
- setHardness(5F); | |
- // TODO Auto-generated constructor stub | |
+ setHardness(1F); | |
} | |
@Override | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/factory/TilePump.java b/buildcraft/common/net/minecraft/src/buildcraft/factory/TilePump.java | |
index 3ad0f21..3fb5bf9 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/factory/TilePump.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/factory/TilePump.java | |
@@ -12,7 +12,6 @@ import java.util.LinkedList; | |
import java.util.TreeMap; | |
import java.util.TreeSet; | |
- | |
import net.minecraft.src.BuildCraftCore; | |
import net.minecraft.src.NBTTagCompound; | |
import net.minecraft.src.Packet230ModLoader; | |
@@ -33,7 +32,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
EntityBlock tube; | |
- private TreeMap<Integer, LinkedList<BlockIndex>> blocksToPump = new TreeMap<Integer, LinkedList<BlockIndex>> (); | |
+ private final TreeMap<Integer, LinkedList<BlockIndex>> blocksToPump = new TreeMap<Integer, LinkedList<BlockIndex>> (); | |
public @TileNetworkData int internalLiquid; | |
public @TileNetworkData double tubeY = Double.NaN; | |
@@ -44,7 +43,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
public TilePump () { | |
powerProvider = BuildCraftCore.powerFramework.createPowerProvider(); | |
- powerProvider.configure(20, 10, 10, 10, 100); | |
+ powerProvider.configure(20, 5, 10, 5, 100); | |
} | |
// TODO, manage this by different levels (pump what's above first...) | |
@@ -76,7 +75,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
if (internalLiquid == 0 || liquidId == liquidToPump) { | |
liquidId = liquidToPump; | |
- if (powerProvider.useEnergy(10, 10, true) == 10) { | |
+ if (powerProvider.useEnergy(5, 5, true) == 5) { | |
index = getNextIndexToPump(true); | |
worldObj.setBlockWithNotify(index.i, index.j, index.k, 0); | |
internalLiquid = internalLiquid += BuildCraftCore.BUCKET_VOLUME; | |
@@ -128,6 +127,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
} | |
} | |
+ @Override | |
public void initialize () { | |
tube = new EntityBlock(worldObj); | |
tube.texture = 6 * 16 + 6; | |
@@ -288,7 +288,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
if (tube != null) { | |
nbttagcompound.setFloat("tubeY", (float) tube.posY); | |
} else { | |
- nbttagcompound.setFloat("tubeY", (float) yCoord); | |
+ nbttagcompound.setFloat("tubeY", yCoord); | |
} | |
nbttagcompound.setInteger("liquidId", liquidId); | |
@@ -314,12 +314,14 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
// TODO Auto-generated method stub | |
} | |
+ @Override | |
public void handleDescriptionPacket (Packet230ModLoader packet) { | |
super.handleDescriptionPacket(packet); | |
setTubePosition(); | |
} | |
+ @Override | |
public void handleUpdatePacket (Packet230ModLoader packet) { | |
super.handleDescriptionPacket(packet); | |
@@ -337,6 +339,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { | |
} | |
} | |
+ @Override | |
public void destroy () { | |
if (tube != null) { | |
APIProxy.removeEntity(tube); | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/factory/TileRefinery.java b/buildcraft/common/net/minecraft/src/buildcraft/factory/TileRefinery.java | |
index 749c283..9a46f58 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/factory/TileRefinery.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/factory/TileRefinery.java | |
@@ -244,7 +244,12 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, | |
decreaseAnimation(); | |
return; | |
} | |
- | |
+ | |
+ if(result.liquidId == slot1.liquidId) | |
+ slot1.quantity -= result.fill(Orientations.Unknown, slot1.quantity, slot1.liquidId, true); | |
+ if(result.liquidId == slot2.liquidId) | |
+ slot2.quantity -= result.fill(Orientations.Unknown, slot2.quantity, slot2.liquidId, true); | |
+ | |
isActive = true; | |
if (powerProvider.energyStored >= currentRecipe.energy) { | |
@@ -290,6 +295,7 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, | |
recipes.add(r); | |
} | |
+ @Override | |
public void readFromNBT(NBTTagCompound nbttagcompound) { | |
super.readFromNBT(nbttagcompound); | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java | |
index 740bcdc..df6dc95 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java | |
@@ -43,6 +43,7 @@ public class BlockGenericPipe extends BlockContainer implements | |
} | |
+ @Override | |
public int getRenderType() { | |
return BuildCraftCore.pipeModel; | |
} | |
@@ -52,6 +53,7 @@ public class BlockGenericPipe extends BlockContainer implements | |
return false; | |
} | |
+ @Override | |
public boolean renderAsNormalBlock() { | |
return false; | |
} | |
@@ -148,6 +150,7 @@ public class BlockGenericPipe extends BlockContainer implements | |
(double) j + yMax, (double) k + zMax); | |
} | |
+ @Override | |
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, | |
int j, int k) { | |
return getCollisionBoundingBoxFromPool(world, i, j, k); | |
@@ -192,6 +195,7 @@ public class BlockGenericPipe extends BlockContainer implements | |
return r; | |
} | |
+ @Override | |
public void onBlockRemoval(World world, int i, int j, int k) { | |
Utils.preDestroyBlock(world, i, j, k); | |
@@ -208,6 +212,7 @@ public class BlockGenericPipe extends BlockContainer implements | |
return new TileGenericPipe(); | |
} | |
+ @Override | |
public void dropBlockAsItemWithChance(World world, int i, int j, int k, | |
int l, float f) { | |
if(APIProxy.isClient(world)) | |
@@ -257,20 +262,24 @@ public class BlockGenericPipe extends BlockContainer implements | |
getPipe (world, i, j, k).onNeighborBlockChange(); | |
} | |
+ @Override | |
public void onBlockPlaced(World world, int i, int j, int k, int l) { | |
super.onBlockPlaced(world, i, j, k, l); | |
getPipe (world, i, j, k).onBlockPlaced(); | |
} | |
+ @Override | |
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { | |
super.blockActivated(world, i, j, k, entityplayer); | |
return getPipe (world, i, j, k).blockActivated (world, i, j, k, entityplayer); | |
} | |
+ @Override | |
public void prepareTextureFor (IBlockAccess blockAccess, int i, int j, int k, Orientations connection) { | |
getPipe (blockAccess, i, j, k).prepareTextureFor(connection); | |
} | |
+ @Override | |
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { | |
return getPipe (iblockaccess, i, j, k).getBlockTexture(); | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/ItemPipe.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/ItemPipe.java | |
index b26087a..707efbd 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/ItemPipe.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/ItemPipe.java | |
@@ -76,7 +76,7 @@ public class ItemPipe extends Item implements ITextureProvider { | |
Block.blocksList[blockID].onBlockPlaced(world, i, j, k, l); | |
Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer); | |
// To move to a proxt | |
- // world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, block.stepSound.func_1145_d(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); | |
+ // world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, block.stepSound.stepSoundDir2(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); | |
itemstack.stackSize--; | |
} | |
return true; | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java | |
index 6a2d8da..dcd5345 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java | |
@@ -26,7 +26,9 @@ public class PipeLogicIron extends PipeLogic { | |
yCoord, zCoord); | |
if (currentPower != lastPower) { | |
- switchPosition(); | |
+ // only switch once | |
+ if(currentPower) | |
+ switchPosition(); | |
lastPower = currentPower; | |
} | |
@@ -110,8 +112,13 @@ public class PipeLogicIron extends PipeLogic { | |
@Override | |
public boolean outputOpen(Orientations to) { | |
- return to.ordinal() == worldObj | |
- .getBlockMetadata(xCoord, yCoord, zCoord); | |
+ int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); | |
+ if (metadata > 5) { | |
+ metadata = 0; | |
+ worldObj.setBlockMetadata(xCoord, yCoord, zCoord, metadata); | |
+ } | |
+ | |
+ return to.ordinal() == metadata; | |
} | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java | |
index 638294e..4894584 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java | |
@@ -126,6 +126,22 @@ public class PipeTransportItems extends PipeTransport { | |
} | |
} | |
+ if(result.size() == 0) { | |
+ boolean output = true; | |
+ for (int o = 0; o < 6; ++o) { | |
+ Position newPos = new Position(pos); | |
+ newPos.orientation = Orientations.values()[o]; | |
+ newPos.moveForwards(1.0); | |
+ TileEntity tile = worldObj.getBlockTileEntity((int)newPos.x, (int)newPos.y, (int)newPos.z); | |
+ | |
+ if(container.pipe.isPipeConnected(tile) && !container.pipe.outputOpen(Orientations.values()[o])) | |
+ output = false; | |
+ } | |
+ // we have a pipe, but no open output | |
+ if(!output) | |
+ result.add(pos.orientation.reverse()); | |
+ } | |
+ | |
if (this.container.pipe instanceof IPipeTransportItemsHook) { | |
result = ((IPipeTransportItemsHook) this.container.pipe) | |
.filterPossibleMovements(result, pos, item); | |
@@ -194,6 +210,8 @@ public class PipeTransportItems extends PipeTransport { | |
entitiesToLoad.clear(); | |
performRemoval(); | |
+ LinkedList<EntityData> toReinsert = new LinkedList<EntityData>(); | |
+ | |
for (EntityData data : travelingEntities.values()) { | |
Position motion = new Position (0, 0, 0, data.orientation); | |
motion.moveForwards(data.item.speed); | |
@@ -214,14 +232,36 @@ public class PipeTransportItems extends PipeTransport { | |
if (nextOrientation == Orientations.Unknown) { | |
scheduleRemoval(data.item); | |
+ boolean reverse = false; | |
+ for (int o = 0; o < 6; ++o) { | |
+ if (Orientations.values()[o] != data.orientation.reverse() | |
+ && container.pipe.outputOpen(Orientations.values()[o])) { | |
+ Position p = new Position(data.item.posX, data.item.posY, data.item.posZ); | |
+ p.orientation = Orientations.values()[o]; | |
+ p.moveForwards(1.0); | |
+ | |
+ if (Utils.checkPipesConnections(worldObj, (int) p.x, (int) p.y, (int) p.z, xCoord, yCoord, | |
+ zCoord)) { | |
+ TileEntity entity = worldObj.getBlockTileEntity((int) p.x, (int) p.y, (int) p.z); | |
+ if (entity instanceof IInventory) { | |
+ if (!new StackUtil(data.item.item).checkAvailableSlot((IInventory) entity, false, | |
+ p.orientation.reverse())) | |
+ reverse = true; | |
+ } | |
+ } | |
+ } | |
+ } | |
- EntityItem dropped = data.item.toEntityItem(data.orientation); | |
- | |
- if (dropped != null) { | |
- // On SMP, the client side doesn't actually drops | |
- // items | |
+ if(reverse) | |
+ toReinsert.add(data); | |
+ else { | |
+ EntityItem dropped = data.item.toEntityItem(data.orientation); | |
- onDropped(dropped); | |
+ if (dropped != null) { | |
+ // On SMP, the client side doesn't actually drops | |
+ // items | |
+ onDropped(dropped); | |
+ } | |
} | |
} else { | |
data.orientation = nextOrientation; | |
@@ -258,14 +298,7 @@ public class PipeTransportItems extends PipeTransport { | |
data.item.remove(); | |
} else { | |
- data.item.item = utils.items; | |
- EntityItem dropped = data.item.toEntityItem(data.orientation); | |
- | |
- if (dropped != null) { | |
- // On SMP, the client side doesn't actually drops | |
- // items | |
- onDropped(dropped); | |
- } | |
+ toReinsert.add(data); | |
} | |
} | |
} else { | |
@@ -283,6 +316,11 @@ public class PipeTransportItems extends PipeTransport { | |
} | |
performRemoval(); | |
+ | |
+ for (EntityData data : toReinsert) { | |
+ data.orientation = data.orientation.reverse(); | |
+ entityEntering(data.item, data.orientation); | |
+ } | |
} | |
public boolean middleReached(EntityData entity) { | |
@@ -315,6 +353,7 @@ public class PipeTransportItems extends PipeTransport { | |
return new Position (xCoord, yCoord, zCoord); | |
} | |
+ @Override | |
public void readFromNBT(NBTTagCompound nbttagcompound) { | |
super.readFromNBT(nbttagcompound); | |
@@ -342,7 +381,8 @@ public class PipeTransportItems extends PipeTransport { | |
} | |
} | |
- public void writeToNBT(NBTTagCompound nbttagcompound) { | |
+ @Override | |
+ public void writeToNBT(NBTTagCompound nbttagcompound) { | |
super.writeToNBT(nbttagcompound); | |
NBTTagList nbttaglist = new NBTTagList(); | |
@@ -451,7 +491,7 @@ public class PipeTransportItems extends PipeTransport { | |
packet.dataFloat [0] = (float) item.posX; | |
packet.dataFloat [1] = (float) item.posY; | |
packet.dataFloat [2] = (float) item.posZ; | |
- packet.dataFloat [3] = (float) item.speed; | |
+ packet.dataFloat [3] = item.speed; | |
return packet; | |
} | |
@@ -468,6 +508,7 @@ public class PipeTransportItems extends PipeTransport { | |
} | |
+ @Override | |
public boolean isPipeConnected(TileEntity tile) { | |
return tile instanceof TileGenericPipe | |
|| tile instanceof IPipeEntry | |
@@ -475,6 +516,7 @@ public class PipeTransportItems extends PipeTransport { | |
|| (tile instanceof IMachine && ((IMachine) tile).manageSolids()); | |
} | |
+ @Override | |
public boolean acceptItems() { | |
return true; | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java | |
index 5b11bc0..7d6250b 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java | |
@@ -26,7 +26,6 @@ import net.minecraft.src.buildcraft.core.TileNetworkData; | |
import net.minecraft.src.buildcraft.core.Utils; | |
public class PipeTransportLiquids extends PipeTransport implements ILiquidContainer { | |
- | |
/** | |
* The amount of liquid contained by a pipe section. For simplicity, all | |
* pipe sections are assumed to be of the same volume. | |
@@ -266,7 +265,7 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
// Computed at each update | |
boolean isOutput [] = new boolean [] {false, false, false, false, false, false}; | |
- private SafeTimeTracker timeTracker = new SafeTimeTracker(); | |
+ private final SafeTimeTracker timeTracker = new SafeTimeTracker(); | |
public PipeTransportLiquids() { | |
@@ -277,6 +276,13 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
center = new LiquidBuffer(6); | |
} | |
+ | |
+ public PipeTransportLiquids(int travelDelay, int flowRate) { | |
+ this(); | |
+ | |
+ this.travelDelay = travelDelay; | |
+ this.flowRate = flowRate; | |
+ } | |
public boolean canReceiveLiquid(Position p) { | |
TileEntity entity = worldObj.getBlockTileEntity((int) p.x, (int) p.y, | |
@@ -298,6 +304,7 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
return false; | |
} | |
+ @Override | |
public void updateEntity() { | |
if (APIProxy.isClient(worldObj)) { | |
return; | |
@@ -315,6 +322,7 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
} | |
} | |
+ @Override | |
public void readFromNBT(NBTTagCompound nbttagcompound) { | |
super.readFromNBT(nbttagcompound); | |
@@ -335,6 +343,7 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
nbttagcompound.setTag("center", sub); | |
} | |
+ @Override | |
public void writeToNBT(NBTTagCompound nbttagcompound) { | |
super.writeToNBT(nbttagcompound); | |
@@ -361,6 +370,7 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
/** | |
* Fills the pipe, and return the amount of liquid that has been used. | |
*/ | |
+ @Override | |
public int fill(Orientations from, int quantity, int id, boolean doFill) { | |
isInput[from.ordinal()] = true; | |
@@ -476,6 +486,7 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
return 0; | |
} | |
+ @Override | |
public int empty(int quantityMax, boolean doEmpty) { | |
return 0; | |
} | |
@@ -490,16 +501,19 @@ public class PipeTransportLiquids extends PipeTransport implements ILiquidContai | |
pos.moveForwards(1); | |
- if (!canReceiveLiquid(pos)) { | |
- side[i].reset (); | |
+ if (!Utils.checkPipesConnections(worldObj, (int) pos.x, (int) pos.y, | |
+ (int) pos.z, xCoord, yCoord, zCoord)) { | |
+ side[i].reset(); | |
} | |
} | |
} | |
+ @Override | |
public int getLiquidId() { | |
return center.liquidId; | |
} | |
+ @Override | |
public boolean isPipeConnected(TileEntity tile) { | |
return tile instanceof TileGenericPipe | |
|| tile instanceof ILiquidContainer | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsGold.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsGold.java | |
index 1357be2..8aa00bf 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsGold.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsGold.java | |
@@ -15,10 +15,7 @@ import net.minecraft.src.buildcraft.transport.PipeTransportLiquids; | |
public class PipeLiquidsGold extends Pipe { | |
public PipeLiquidsGold(int itemID) { | |
- super(new PipeTransportLiquids(), new PipeLogicGold(), itemID); | |
- | |
- ((PipeTransportLiquids) transport).flowRate = 80; | |
- ((PipeTransportLiquids) transport).travelDelay = 2; | |
+ super(new PipeTransportLiquids(2, 80), new PipeLogicGold(), itemID); | |
} | |
@Override | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsIron.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsIron.java | |
index 623442e..723536d 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsIron.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsIron.java | |
@@ -15,8 +15,8 @@ import net.minecraft.src.buildcraft.transport.PipeTransportLiquids; | |
public class PipeLiquidsIron extends Pipe { | |
- private int baseTexture = 7 * 16 + 3; | |
- private int plainTexture = 1 * 16 + 3; | |
+ private final int baseTexture = 7 * 16 + 3; | |
+ private final int plainTexture = 1 * 16 + 3; | |
private int nextTexture = baseTexture; | |
public PipeLiquidsIron(int itemID) { | |
@@ -42,5 +42,4 @@ public class PipeLiquidsIron extends Pipe { | |
public int getBlockTexture() { | |
return nextTexture; | |
} | |
- | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java | |
index 7914ca5..3a6216e 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java | |
@@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.transport.pipes; | |
import net.minecraft.src.Block; | |
import net.minecraft.src.BuildCraftCore; | |
+import net.minecraft.src.NBTTagCompound; | |
import net.minecraft.src.TileEntity; | |
import net.minecraft.src.World; | |
import net.minecraft.src.buildcraft.api.IPowerReceptor; | |
@@ -21,16 +22,20 @@ import net.minecraft.src.buildcraft.core.TileNetworkData; | |
import net.minecraft.src.buildcraft.transport.Pipe; | |
import net.minecraft.src.buildcraft.transport.PipeLogicWood; | |
import net.minecraft.src.buildcraft.transport.PipeTransportLiquids; | |
+import net.minecraft.src.buildcraft.transport.TileGenericPipe; | |
public class PipeLiquidsWood extends Pipe implements IPowerReceptor { | |
public @TileNetworkData int liquidToExtract; | |
private PowerProvider powerProvider; | |
- private int baseTexture = 7 * 16 + 0; | |
- private int plainTexture = 1 * 16 + 15; | |
+ private final int baseTexture = 7 * 16 + 0; | |
+ private final int plainTexture = 1 * 16 + 15; | |
private int nextTexture = baseTexture; | |
+ public int defaultTravelDelay; | |
+ public int defaultFlowRate; | |
+ | |
long lastMining = 0; | |
boolean lastPower = false; | |
@@ -40,11 +45,15 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor { | |
powerProvider = BuildCraftCore.powerFramework.createPowerProvider(); | |
powerProvider.configure(50, 1, 1, 1, 1); | |
powerProvider.configurePowerPerdition(1, 1); | |
+ | |
+ defaultTravelDelay = ((PipeTransportLiquids) transport).travelDelay; | |
+ defaultFlowRate = ((PipeTransportLiquids) transport).flowRate; | |
} | |
/** | |
* Extracts a random piece of item outside of a nearby chest. | |
*/ | |
+ @Override | |
public void doWork () { | |
if (powerProvider.energyStored <= 0) { | |
return; | |
@@ -125,9 +134,44 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor { | |
liquidToExtract -= extracted; | |
} | |
} | |
+ | |
+ boolean hasGold = false; | |
+ for (int i = 0; i < 6; ++i) { | |
+ Position p = new Position(xCoord, yCoord, zCoord, Orientations.values()[i]); | |
+ | |
+ p.moveForwards(1.0); | |
+ | |
+ TileEntity t = worldObj.getBlockTileEntity((int) p.x, (int) p.y, (int) p.z); | |
+ if(t != null && t instanceof TileGenericPipe) | |
+ { | |
+ TileGenericPipe tp = (TileGenericPipe)t; | |
+ if(tp.pipe instanceof PipeLiquidsGold) { | |
+ ((PipeTransportLiquids) transport).flowRate = ((PipeTransportLiquids)tp.pipe.transport).flowRate; | |
+ ((PipeTransportLiquids) transport).travelDelay = ((PipeTransportLiquids)tp.pipe.transport).travelDelay; | |
+ } | |
+ } | |
+ } | |
+ if(!hasGold) { | |
+ ((PipeTransportLiquids) transport).flowRate = defaultFlowRate; | |
+ ((PipeTransportLiquids) transport).travelDelay = defaultTravelDelay; | |
+ } | |
} | |
@Override | |
+ public void writeToNBT(NBTTagCompound nbttagcompound) { | |
+ int flowRate = ((PipeTransportLiquids) transport).flowRate; | |
+ int travelDelay = ((PipeTransportLiquids) transport).travelDelay; | |
+ | |
+ ((PipeTransportLiquids) transport).flowRate = defaultFlowRate; | |
+ ((PipeTransportLiquids) transport).travelDelay = defaultTravelDelay; | |
+ | |
+ super.writeToNBT(nbttagcompound); | |
+ | |
+ ((PipeTransportLiquids) transport).flowRate = flowRate; | |
+ ((PipeTransportLiquids) transport).travelDelay = travelDelay; | |
+ } | |
+ | |
+ @Override | |
public void prepareTextureFor(Orientations connection) { | |
if (connection == Orientations.Unknown) { | |
nextTexture = baseTexture; | |
diff --git a/buildcraft/common/net/minecraft/src/mod_BuildCraftDevel.java b/buildcraft/common/net/minecraft/src/mod_BuildCraftDevel.java | |
index a8349a2..98e03ac 100644 | |
--- a/buildcraft/common/net/minecraft/src/mod_BuildCraftDevel.java | |
+++ b/buildcraft/common/net/minecraft/src/mod_BuildCraftDevel.java | |
@@ -28,6 +28,7 @@ public class mod_BuildCraftDevel extends BaseModMp { | |
CraftingManager craftingmanager = CraftingManager.getInstance(); | |
cheatBlock = new BlockCheat(Integer.parseInt(cheatId.value)); | |
+ cheatBlock.setBlockName("Buildcraft Cheatchest"); | |
ModLoader.RegisterBlock(cheatBlock); | |
craftingmanager.addRecipe(new ItemStack(cheatBlock, 1), new Object[] { | |
"# ", " ", Character.valueOf('#'), Block.dirt }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment