Merge pull request #28 from psxlover/master

Several bugfixes.
This commit is contained in:
SirSengir 2012-05-27 00:39:14 -07:00
commit cd9cd11134
10 changed files with 100 additions and 94 deletions

View file

@ -32,7 +32,7 @@ public class GuiAutoCrafting extends GuiBuildCraft {
@Override @Override
protected void drawGuiContainerForegroundLayer() { protected void drawGuiContainerForegroundLayer() {
String title = StringUtil.localize("tile.autoWorkBenchBlock"); String title = StringUtil.localize("tile.autoWorkbenchBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
} }

View file

@ -10,9 +10,7 @@
package net.minecraft.src.buildcraft.core; package net.minecraft.src.buildcraft.core;
import java.io.File; import java.io.File;
import java.util.List;
import net.minecraft.src.AxisAlignedBB;
import net.minecraft.src.Block; import net.minecraft.src.Block;
import net.minecraft.src.EntityItem; import net.minecraft.src.EntityItem;
import net.minecraft.src.EntityPlayer; import net.minecraft.src.EntityPlayer;
@ -55,9 +53,13 @@ public class CoreProxy {
public static void sendToPlayers(Packet packet, World w, int x, int y, public static void sendToPlayers(Packet packet, World w, int x, int y,
int z, int maxDistance, NetworkMod mod) { int z, int maxDistance, NetworkMod mod) {
if (packet != null) { if (packet != null) {
List<EntityPlayerMP> players = w.getEntitiesWithinAABB(EntityPlayerMP.class, AxisAlignedBB.getBoundingBoxFromPool(x - maxDistance, y - maxDistance, z - maxDistance, x + maxDistance, y + maxDistance, z + maxDistance)); for (int j = 0; j < w.playerEntities.size(); j++) {
for (EntityPlayerMP player: players) { EntityPlayerMP player = (EntityPlayerMP)w.playerEntities.get(j);
player.playerNetServerHandler.sendPacket(packet);
if (Math.abs(player.posX - x) <= maxDistance
&& Math.abs(player.posY - y) <= maxDistance
&& Math.abs(player.posZ - z) <= maxDistance)
player.playerNetServerHandler.sendPacket(packet);
} }
} }
} }

View file

@ -62,7 +62,7 @@ item.PipeItemsStripes=Gestreiftes Rohr
item.PipeStructureCobblestone=Strukturrohr item.PipeStructureCobblestone=Strukturrohr
tile.miningWellBlock=Minenschacht tile.miningWellBlock=Minenschacht
tile.plainPipeBlock=Minenrohr tile.plainPipeBlock=Minenrohr
tile.autoWorkBenchBlock=Automatische Werkbank tile.autoWorkbenchBlock=Automatische Werkbank
tile.machineBlock=Steinbruch tile.machineBlock=Steinbruch
tile.markerBlock=Markstein tile.markerBlock=Markstein
tile.fillerBlock=F\u00fcller tile.fillerBlock=F\u00fcller

View file

@ -61,7 +61,7 @@ item.PipeItemsStripes=Stripes Transport Pipe
item.PipeStructureCobblestone=Cobblestone Structure Pipe item.PipeStructureCobblestone=Cobblestone Structure Pipe
tile.miningWellBlock=Mining Well tile.miningWellBlock=Mining Well
tile.plainPipeBlock=Mining Pipe tile.plainPipeBlock=Mining Pipe
tile.autoWorkBenchBlock=Autocrafting Table tile.autoWorkbenchBlock=Autocrafting Table
tile.machineBlock=Quarry tile.machineBlock=Quarry
tile.markerBlock=Land Mark tile.markerBlock=Land Mark
tile.fillerBlock=Filler tile.fillerBlock=Filler

View file

@ -62,7 +62,7 @@ item.PipeItemsStripes=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u04
item.PipeStructureCobblestone=\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0443\u0431\u0430 item.PipeStructureCobblestone=\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0443\u0431\u0430
tile.miningWellBlock=\u0411\u0443\u0440\u043e\u0432\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 tile.miningWellBlock=\u0411\u0443\u0440\u043e\u0432\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430
tile.plainPipeBlock=\u0428\u0430\u0445\u0442\u0435\u0440\u0441\u043a\u0430\u044f \u0442\u0440\u0443\u0431\u0430 tile.plainPipeBlock=\u0428\u0430\u0445\u0442\u0435\u0440\u0441\u043a\u0430\u044f \u0442\u0440\u0443\u0431\u0430
tile.autoWorkBenchBlock=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0435\u0440\u0441\u0442\u0430\u043a tile.autoWorkbenchBlock=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0435\u0440\u0441\u0442\u0430\u043a
tile.machineBlock=\u041a\u0430\u0440\u044c\u0435\u0440 tile.machineBlock=\u041a\u0430\u0440\u044c\u0435\u0440
tile.markerBlock=\u041c\u0435\u0442\u043a\u0430 tile.markerBlock=\u041c\u0435\u0442\u043a\u0430
tile.pumpBlock=\u041f\u043e\u043c\u043f\u0430 tile.pumpBlock=\u041f\u043e\u043c\u043f\u0430

View file

@ -5,66 +5,66 @@ gui.building.resources=Byggmaterial
gui.del=Radera gui.del=Radera
gui.filling.resources=Fyllningsmaterial gui.filling.resources=Fyllningsmaterial
gui.inventory=Inventarie gui.inventory=Inventarie
gui.lock=Lås gui.lock=L\u00c3\u00a5s
gui.needed=Behövd gui.needed=Beh\u00c3\u00b6vd
gui.unlock=Lås upp gui.unlock=L\u00c3\u00a5s upp
item.bucketFuel=Bränslehink item.bucketFuel=Br\u00c3\u00a4nslehink
item.bucketOil=Olje Hink item.bucketOil=Olje Hink
item.woodenGearItem=Träkugghjul item.woodenGearItem=Tr\u00c3\u00a4kugghjul
item.stoneGearItem=Stenkugghjul item.stoneGearItem=Stenkugghjul
item.ironGearItem=Järnkugghjul item.ironGearItem=J\u00c3\u00a4rnkugghjul
item.goldGearItem=Guldkugghjul item.goldGearItem=Guldkugghjul
item.diamondGearItem=Diamantkugghjul item.diamondGearItem=Diamantkugghjul
item.templateItem=Mall item.templateItem=Mall
item.wrenchItem=Skiftnyckel item.wrenchItem=Skiftnyckel
item.fuel=Bränsle item.fuel=Br\u00c3\u00a4nsle
item.pipeWaterproof=Rörvattentätning item.pipeWaterproof=R\u00c3\u00b6rvattent\u00c3\u00a4tning
item.pipeGate.0=Grind item.pipeGate.0=Grind
item.pipeGate.1=Järn OCH Grind item.pipeGate.1=J\u00c3\u00a4rn OCH Grind
item.pipeGate.2=Järn ELLER Grind item.pipeGate.2=J\u00c3\u00a4rn ELLER Grind
item.pipeGate.3=Guld OCH Grind item.pipeGate.3=Guld OCH Grind
item.pipeGate.4=Guld ELLER Grind item.pipeGate.4=Guld ELLER Grind
item.pipeGate.5=Diamant OCH Grind item.pipeGate.5=Diamant OCH Grind
item.pipeGate.6=Diamant ELLER Grind item.pipeGate.6=Diamant ELLER Grind
item.pipeGateAutarchic.0=Primär Grind item.pipeGateAutarchic.0=Prim\u00c3\u00a4r Grind
item.pipeGateAutarchic.1=Primär Järn OCH Grind item.pipeGateAutarchic.1=Prim\u00c3\u00a4r J\u00c3\u00a4rn OCH Grind
item.pipeGateAutarchic.2=Primär Järn ELLER Grind item.pipeGateAutarchic.2=Prim\u00c3\u00a4r J\u00c3\u00a4rn ELLER Grind
item.pipeGateAutarchic.3=Primär Guld OCH Grind item.pipeGateAutarchic.3=Prim\u00c3\u00a4r Guld OCH Grind
item.pipeGateAutarchic.4=Primär Guld ELLER Grind item.pipeGateAutarchic.4=Prim\u00c3\u00a4r Guld ELLER Grind
item.pipeGateAutarchic.5=Primär Diamant OCH Grind item.pipeGateAutarchic.5=Prim\u00c3\u00a4r Diamant OCH Grind
item.pipeGateAutarchic.6=Primär Diamant ELLER Grind item.pipeGateAutarchic.6=Prim\u00c3\u00a4r Diamant ELLER Grind
item.redPipeWire=Röd Rörledning item.redPipeWire=R\u00c3\u00b6d R\u00c3\u00b6rledning
item.bluePipeWire=Blå Rörledning item.bluePipeWire=Bl\u00c3\u00a5 R\u00c3\u00b6rledning
item.greenPipeWire=Grön Rörledning item.greenPipeWire=Gr\u00c3\u00b6n R\u00c3\u00b6rledning
item.yellowPipeWire=Gul Rörledning item.yellowPipeWire=Gul R\u00c3\u00b6rledning
item.redstoneChipset.0=Rödsten Chipset item.redstoneChipset.0=R\u00c3\u00b6dsten Chipset
item.redstoneChipset.1=Rödsten Järn Chipset item.redstoneChipset.1=R\u00c3\u00b6dsten J\u00c3\u00a4rn Chipset
item.redstoneChipset.2=Rödsten Guld Chipset item.redstoneChipset.2=R\u00c3\u00b6dsten Guld Chipset
item.redstoneChipset.3=Rödsten Diamant Chipset item.redstoneChipset.3=R\u00c3\u00b6dsten Diamant Chipset
item.redstoneChipset.4=Pulserande Chipset item.redstoneChipset.4=Pulserande Chipset
item.blueprintItem=Ritning item.blueprintItem=Ritning
item.PipeItemsWood=Trä Transport Rör item.PipeItemsWood=Tr\u00c3\u00a4 Transport R\u00c3\u00b6r
item.PipeItemsCobblestone=Kullersten Transport Rör item.PipeItemsCobblestone=Kullersten Transport R\u00c3\u00b6r
item.PipeItemsStone=Sten Transport Rör item.PipeItemsStone=Sten Transport R\u00c3\u00b6r
item.PipeItemsIron=Järn Transport Rör item.PipeItemsIron=J\u00c3\u00a4rn Transport R\u00c3\u00b6r
item.PipeItemsGold=Guld Transport Rör item.PipeItemsGold=Guld Transport R\u00c3\u00b6r
item.PipeItemsDiamond=Diamant Transport Rör item.PipeItemsDiamond=Diamant Transport R\u00c3\u00b6r
item.PipeItemsObsidian=Obsidian Transport Rör item.PipeItemsObsidian=Obsidian Transport R\u00c3\u00b6r
item.PipeLiquidsWood=Vattentätt Trä Rör item.PipeLiquidsWood=Vattent\u00c3\u00a4tt Tr\u00c3\u00a4 R\u00c3\u00b6r
item.PipeLiquidsCobblestone=Vattentätt Kullerstens Rör item.PipeLiquidsCobblestone=Vattent\u00c3\u00a4tt Kullerstens R\u00c3\u00b6r
item.PipeLiquidsStone=Vattentätt Sten Rör item.PipeLiquidsStone=Vattent\u00c3\u00a4tt Sten R\u00c3\u00b6r
item.PipeLiquidsIron=Vattentätt Järn Rör item.PipeLiquidsIron=Vattent\u00c3\u00a4tt J\u00c3\u00a4rn R\u00c3\u00b6r
item.PipeLiquidsGold=Vattentätt Guld Rör item.PipeLiquidsGold=Vattent\u00c3\u00a4tt Guld R\u00c3\u00b6r
item.PipePowerWood=Konduktivt Trä Rör item.PipePowerWood=Konduktivt Tr\u00c3\u00a4 R\u00c3\u00b6r
item.PipePowerStone=Konduktivt Sten Rör item.PipePowerStone=Konduktivt Sten R\u00c3\u00b6r
item.PipePowerGold=Konduktivt Guld Rör item.PipePowerGold=Konduktivt Guld R\u00c3\u00b6r
item.PipeItemsStripes=Randigt Transport Rör item.PipeItemsStripes=Randigt Transport R\u00c3\u00b6r
item.PipeStructureCobblestone=Kullerstens Struktur Rör item.PipeStructureCobblestone=Kullerstens Struktur R\u00c3\u00b6r
tile.miningWellBlock=Gruv Borr tile.miningWellBlock=Gruv Borr
tile.plainPipeBlock=Gruv Rör tile.plainPipeBlock=Gruv R\u00c3\u00b6r
tile.autoWorkBenchBlock=Automatiskt Arbetsbänk tile.autoWorkbenchBlock=Automatiskt Arbetsb\u00c3\u00a4nk
tile.machineBlock=Stenbrott tile.machineBlock=Stenbrott
tile.markerBlock=Land Märke tile.markerBlock=Land M\u00c3\u00a4rke
tile.fillerBlock=Fyllare tile.fillerBlock=Fyllare
tile.builderBlock=Byggare tile.builderBlock=Byggare
tile.architectBlock=Architektbord tile.architectBlock=Architektbord
@ -73,10 +73,10 @@ tile.tankBlock=Tank
tile.refineryBlock=Raffinaderi tile.refineryBlock=Raffinaderi
tile.libraryBlock=Ritnings Bibliotek tile.libraryBlock=Ritnings Bibliotek
tile.laserBlock=Laser tile.laserBlock=Laser
tile.assemblyTableBlock=Monterings Bänk tile.assemblyTableBlock=Monterings B\u00c3\u00a4nk
tile.pathMarkerBlock=Väg Markör tile.pathMarkerBlock=V\u00c3\u00a4g Mark\u00c3\u00b6r
tile.blockHopper=Hopper tile.blockHopper=Hopper
tile.pumpBlock=Pump tile.pumpBlock=Pump
tile.engineWood=Rödsten Motor tile.engineWood=R\u00c3\u00b6dsten Motor
tile.engineStone=Ång Motor tile.engineStone=\u00c3\u0085ng Motor
tile.engineIron=Förbrännings Motor tile.engineIron=F\u00c3\u00b6rbr\u00c3\u00a4nnings Motor

View file

@ -198,7 +198,7 @@ public class BuildCraftCore {
try { try {
PowerFramework.currentFramework = (PowerFramework) Class PowerFramework.currentFramework = (PowerFramework) Class
.forName(prefix + "buildcraft.energy.PneumaticPowerFramework") .forName(prefix + "buildcraft.energy.PneumaticPowerFramework")
.getConstructor(null).newInstance(null); .getConstructor().newInstance();
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -209,8 +209,8 @@ public class BuildCraftCore {
className = className.replace("net.minecraft.src.", ""); className = className.replace("net.minecraft.src.", "");
PowerFramework.currentFramework = (PowerFramework) Class PowerFramework.currentFramework = (PowerFramework) Class
.forName(prefix + className).getConstructor(null) .forName(prefix + className).getConstructor()
.newInstance(null); .newInstance();
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
PowerFramework.currentFramework = new RedstonePowerFramework(); PowerFramework.currentFramework = new RedstonePowerFramework();

View file

@ -73,6 +73,9 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
((TileMarker) a).removeFromWorld(); ((TileMarker) a).removeFromWorld();
} }
if (!APIProxy.isClient(worldObj) && box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
}
sendNetworkUpdate(); sendNetworkUpdate();
} }
} }
@ -84,10 +87,6 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
public void updateEntity () { public void updateEntity () {
super.updateEntity(); super.updateEntity();
if (box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
}
if (done) { if (done) {
if (lastMode == Mode.Loop) { if (lastMode == Mode.Loop) {
done = false; done = false;

View file

@ -6,7 +6,6 @@
* License 1.0, or MMPL. Please check the contents of the license located in * License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt * http://www.mod-buildcraft.com/MMPL-1.0.txt
*/ */
package net.minecraft.src.buildcraft.factory; package net.minecraft.src.buildcraft.factory;
import net.minecraft.src.EntityPlayer; import net.minecraft.src.EntityPlayer;
@ -26,17 +25,18 @@ public class ContainerRefinery extends BuildCraftContainer {
TileRefinery refinery; TileRefinery refinery;
public ContainerRefinery(InventoryPlayer inventory, TileRefinery refinery) { public ContainerRefinery(InventoryPlayer inventory, TileRefinery refinery) {
super (3); super(3);
for (int l = 0; l < 3; l++) { for (int l = 0; l < 3; l++) {
for (int k1 = 0; k1 < 9; k1++) { for (int k1 = 0; k1 < 9; k1++) {
addSlot(new Slot(inventory, k1 + l * 9 + 9, 8 + k1 * 18, addSlot(new Slot(inventory, k1 + l * 9 + 9, 8 + k1 * 18,
123 + l * 18)); 123 + l * 18));
} }
} }
for (int i1 = 0; i1 < 9; i1++) for (int i1 = 0; i1 < 9; i1++) {
addSlot(new Slot(inventory, i1, 8 + i1 * 18, 181)); addSlot(new Slot(inventory, i1, 8 + i1 * 18, 181));
}
this.refinery = refinery; this.refinery = refinery;
} }
@ -49,23 +49,25 @@ public class ContainerRefinery extends BuildCraftContainer {
/* SETTING AND GETTING FILTERS */ /* SETTING AND GETTING FILTERS */
/** /**
* @param slot * @param slot
* @param liquidId * @ param liquidId
* @param liquidMeta (for future use) param liquidMeta (for future use)
*/ */
public void setFilter(int slot, int liquidId, int liquidMeta) { public void setFilter(int slot, int liquidId, int liquidMeta) {
refinery.setFilter(slot, liquidId); refinery.setFilter(slot, liquidId);
PacketPayload payload = new PacketPayload(3, 0, 0); if (APIProxy.isRemote()) {
payload.intPayload[0] = slot; PacketPayload payload = new PacketPayload(3, 0, 0);
payload.intPayload[1] = liquidId; payload.intPayload[0] = slot;
payload.intPayload[2] = liquidMeta; payload.intPayload[1] = liquidId;
CoreProxy.sendToServer(new PacketUpdate(PacketIds.REFINERY_FILTER_SET, refinery.xCoord, refinery.yCoord, refinery.zCoord, payload).getPacket()); payload.intPayload[2] = liquidMeta;
CoreProxy.sendToServer(new PacketUpdate(PacketIds.REFINERY_FILTER_SET, refinery.xCoord, refinery.yCoord, refinery.zCoord, payload).getPacket());
}
} }
public ItemStack getFilter(int slot) { public ItemStack getFilter(int slot) {
int liquidId = refinery.getFilter(slot); int liquidId = refinery.getFilter(slot);
if(liquidId > 0) if (liquidId > 0)
return new ItemStack(liquidId, 0, 0); return new ItemStack(liquidId, 0, 0);
else else
return null; return null;
@ -79,9 +81,9 @@ public class ContainerRefinery extends BuildCraftContainer {
@Override @Override
public void updateCraftingResults() { public void updateCraftingResults() {
super.updateCraftingResults(); super.updateCraftingResults();
for(int i = 0; i < crafters.size(); i++) for (int i = 0; i < crafters.size(); i++) {
refinery.sendGUINetworkData(this, (ICrafting)crafters.get(i)); refinery.sendGUINetworkData(this, (ICrafting) crafters.get(i));
} }
}
} }

View file

@ -81,7 +81,10 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor,
public void readFromNBT(NBTTagCompound nbttagcompound) { public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound); super.readFromNBT(nbttagcompound);
pipe = BlockGenericPipe.createPipe(nbttagcompound.getInteger("pipeId")); int key = nbttagcompound.getInteger("pipeId");
if (key > 0) {
pipe = BlockGenericPipe.createPipe(key);
}
if (pipe != null) { if (pipe != null) {
pipe.setTile(this); pipe.setTile(this);