From e78fcf297cba3d82430d197e63793bcc231e86af Mon Sep 17 00:00:00 2001 From: Kyprus Date: Thu, 7 Jun 2012 20:13:31 -0400 Subject: [PATCH] Code cleanup attempt #2 --- .../src/buildcraft/api/APIProxy.java | 3 +- .../builders/ClientBuilderHook.java | 13 +- .../buildcraft/builders/CraftingTemplate.java | 3 +- .../builders/GuiBlueprintLibrary.java | 42 +- .../src/buildcraft/builders/GuiBuilder.java | 15 +- .../src/buildcraft/builders/GuiFiller.java | 24 +- .../src/buildcraft/builders/GuiHandler.java | 3 +- .../src/buildcraft/builders/GuiTemplate.java | 12 +- .../src/buildcraft/core/CoreProxy.java | 27 +- .../buildcraft/core/GuiAdvancedInterface.java | 20 +- .../src/buildcraft/core/GuiBuildCraft.java | 32 +- .../buildcraft/core/RenderEntityBlock.java | 58 +-- .../src/buildcraft/core/RenderLaser.java | 9 +- .../src/buildcraft/core/RenderRobot.java | 12 +- .../src/buildcraft/core/RenderVoid.java | 3 +- .../src/buildcraft/core/TextureLiquidsFX.java | 11 +- .../core/network/ConnectionHandler.java | 10 +- .../core/network/PacketHandler.java | 6 +- .../buildcraft/energy/ContainerEngine.java | 3 +- .../energy/GuiCombustionEngine.java | 30 +- .../src/buildcraft/energy/GuiEngine.java | 23 +- .../src/buildcraft/energy/GuiHandler.java | 3 +- .../src/buildcraft/energy/GuiSteamEngine.java | 9 +- .../src/buildcraft/energy/RenderEngine.java | 30 +- .../src/buildcraft/energy/TextureFuelFX.java | 5 +- .../src/buildcraft/energy/TextureOilFX.java | 3 +- .../buildcraft/energy/TextureOilFlowFX.java | 13 +- .../buildcraft/factory/BlockMachineRoot.java | 6 +- .../buildcraft/factory/GuiAutoCrafting.java | 6 +- .../src/buildcraft/factory/GuiHandler.java | 6 +- .../src/buildcraft/factory/GuiHopper.java | 3 +- .../src/buildcraft/factory/GuiRefinery.java | 13 +- .../src/buildcraft/factory/ModelFrustum.java | 91 ++-- .../src/buildcraft/factory/RenderHopper.java | 18 +- .../buildcraft/factory/RenderRefinery.java | 30 +- .../src/buildcraft/factory/RenderTank.java | 15 +- .../factory/network/ConnectionHandler.java | 10 +- .../factory/network/PacketHandler.java | 3 +- .../buildcraft/silicon/GuiAssemblyTable.java | 32 +- .../src/buildcraft/silicon/GuiHandler.java | 6 +- .../silicon/network/ConnectionHandler.java | 10 +- .../silicon/network/PacketHandler.java | 9 +- .../buildcraft/transport/GuiDiamondPipe.java | 24 +- .../transport/GuiGateInterface.java | 57 +-- .../src/buildcraft/transport/GuiHandler.java | 3 +- .../src/buildcraft/transport/RenderPipe.java | 100 ++--- .../transport/TileEntityPickupFX.java | 9 +- .../buildcraft/transport/TransportProxy.java | 6 +- .../transport/network/ConnectionHandler.java | 10 +- .../transport/network/PacketHandler.java | 15 +- .../net/minecraft/src/mod_BuildCraftCore.java | 399 ++++++------------ .../minecraft/src/mod_BuildCraftDevel.java | 9 +- .../minecraft/src/mod_BuildCraftEnergy.java | 22 +- .../minecraft/src/mod_BuildCraftFactory.java | 25 +- .../minecraft/src/mod_BuildCraftSilicon.java | 48 +-- .../src/mod_BuildCraftTransport.java | 71 +--- .../src/buildcraft/api/APIProxy.java | 15 +- .../buildcraft/builders/BuildersProxy.java | 4 +- .../buildcraft/builders/CraftingTemplate.java | 27 +- .../src/buildcraft/builders/GuiHandler.java | 23 +- .../src/buildcraft/core/CoreProxy.java | 41 +- .../core/network/ConnectionHandler.java | 7 +- .../core/network/PacketHandler.java | 3 +- .../buildcraft/energy/ContainerEngine.java | 3 +- .../src/buildcraft/energy/GuiHandler.java | 11 +- .../src/buildcraft/factory/GuiHandler.java | 19 +- .../factory/network/ConnectionHandler.java | 7 +- .../factory/network/PacketHandler.java | 27 +- .../src/buildcraft/silicon/GuiHandler.java | 11 +- .../silicon/network/ConnectionHandler.java | 3 +- .../silicon/network/PacketHandler.java | 21 +- .../src/buildcraft/transport/GuiHandler.java | 11 +- .../buildcraft/transport/TransportProxy.java | 2 +- .../transport/network/ConnectionHandler.java | 3 +- .../transport/network/PacketHandler.java | 60 +-- .../minecraft/src/mod_BuildCraftBuilders.java | 15 +- .../net/minecraft/src/mod_BuildCraftCore.java | 27 +- .../minecraft/src/mod_BuildCraftEnergy.java | 22 +- .../minecraft/src/mod_BuildCraftFactory.java | 13 +- .../minecraft/src/mod_BuildCraftSilicon.java | 63 +-- .../src/mod_BuildCraftTransport.java | 15 +- .../minecraft/src/BuildCraftBlockUtil.java | 6 +- .../net/minecraft/src/BuildCraftBuilders.java | 235 ++++------- common/net/minecraft/src/BuildCraftCore.java | 200 ++++----- .../net/minecraft/src/BuildCraftEnergy.java | 112 ++--- .../net/minecraft/src/BuildCraftFactory.java | 120 ++---- .../net/minecraft/src/BuildCraftSilicon.java | 209 ++++----- .../minecraft/src/BuildCraftTransport.java | 306 +++++--------- .../minecraft/src/buildcraft/api/Action.java | 1 + .../src/buildcraft/api/BlockSignature.java | 4 +- .../src/buildcraft/api/BptBlock.java | 35 +- .../src/buildcraft/api/BuildCraftAPI.java | 34 +- .../src/buildcraft/api/EntityPassiveItem.java | 27 +- .../src/buildcraft/api/IActionProvider.java | 3 +- .../src/buildcraft/api/IBlockPipe.java | 3 +- .../buildcraft/api/ILegacyPipeConnection.java | 4 +- .../src/buildcraft/api/IPipeConnection.java | 1 + .../src/buildcraft/api/ITriggerProvider.java | 3 +- .../src/buildcraft/api/IronEngineFuel.java | 1 + .../src/buildcraft/api/ItemSignature.java | 1 + .../src/buildcraft/api/LiquidData.java | 3 +- .../src/buildcraft/api/LiquidSlot.java | 1 + .../src/buildcraft/api/Position.java | 7 +- .../src/buildcraft/api/PowerFramework.java | 6 +- .../src/buildcraft/api/PowerProvider.java | 7 +- .../src/buildcraft/api/RefineryRecipe.java | 4 +- .../buildcraft/api/bptblocks/BptBlockBed.java | 9 +- .../api/bptblocks/BptBlockCustomStack.java | 3 +- .../api/bptblocks/BptBlockDelegate.java | 12 +- .../api/bptblocks/BptBlockDirt.java | 9 +- .../api/bptblocks/BptBlockDoor.java | 15 +- .../api/bptblocks/BptBlockIgnore.java | 3 +- .../api/bptblocks/BptBlockIgnoreMeta.java | 6 +- .../api/bptblocks/BptBlockInventory.java | 3 +- .../api/bptblocks/BptBlockLever.java | 3 +- .../api/bptblocks/BptBlockLiquid.java | 9 +- .../api/bptblocks/BptBlockPiston.java | 3 +- .../api/bptblocks/BptBlockPumpkin.java | 6 +- .../bptblocks/BptBlockRedstoneRepeater.java | 3 +- .../bptblocks/BptBlockRotateInventory.java | 6 +- .../api/bptblocks/BptBlockRotateMeta.java | 9 +- .../api/bptblocks/BptBlockSign.java | 3 +- .../api/bptblocks/BptBlockStairs.java | 6 +- .../api/bptblocks/BptBlockUtils.java | 18 +- .../api/bptblocks/BptBlockWallSide.java | 3 +- .../buildcraft/api/filler/IFillerPattern.java | 4 +- .../src/buildcraft/api/tools/IToolWrench.java | 1 + .../buildcraft/builders/BlockArchitect.java | 24 +- .../builders/BlockBlueprintLibrary.java | 18 +- .../src/buildcraft/builders/BlockBuilder.java | 21 +- .../src/buildcraft/builders/BlockFiller.java | 9 +- .../src/buildcraft/builders/BlockMarker.java | 36 +- .../buildcraft/builders/BlockPathMarker.java | 6 +- .../buildcraft/builders/BptBlockFiller.java | 15 +- .../builders/ContainerBlueprintLibrary.java | 6 +- .../buildcraft/builders/CraftingBuilder.java | 6 +- .../buildcraft/builders/CraftingFiller.java | 9 +- .../builders/CraftingTemplateRoot.java | 6 +- .../buildcraft/builders/FillerFillAll.java | 6 +- .../builders/FillerFillPyramid.java | 9 +- .../buildcraft/builders/FillerFillStairs.java | 15 +- .../buildcraft/builders/FillerFillWalls.java | 21 +- .../buildcraft/builders/FillerFlattener.java | 11 +- .../buildcraft/builders/FillerPattern.java | 17 +- .../buildcraft/builders/FillerRegistry.java | 23 +- .../buildcraft/builders/FillerRemover.java | 3 +- .../src/buildcraft/builders/IBuilderHook.java | 3 +- .../src/buildcraft/builders/ItemBptBase.java | 7 +- .../buildcraft/builders/TileArchitect.java | 33 +- .../builders/TileBlueprintLibrary.java | 24 +- .../src/buildcraft/builders/TileBuilder.java | 55 +-- .../src/buildcraft/builders/TileFiller.java | 15 +- .../src/buildcraft/builders/TileMarker.java | 72 ++-- .../buildcraft/builders/TilePathMarker.java | 24 +- .../minecraft/src/buildcraft/core/Box.java | 23 +- .../src/buildcraft/core/BptBase.java | 30 +- .../src/buildcraft/core/BptBlueprint.java | 61 +-- .../src/buildcraft/core/BptBuilderBase.java | 3 +- .../buildcraft/core/BptBuilderBlueprint.java | 119 +++--- .../buildcraft/core/BptBuilderTemplate.java | 9 +- .../src/buildcraft/core/BptItem.java | 6 +- .../src/buildcraft/core/BptPlayerIndex.java | 10 +- .../src/buildcraft/core/BptRootIndex.java | 12 +- .../src/buildcraft/core/BptSlot.java | 10 +- .../src/buildcraft/core/BptTemplate.java | 6 +- .../core/BuildCraftConfiguration.java | 68 +-- .../buildcraft/core/BuildCraftContainer.java | 6 +- .../src/buildcraft/core/ClassMapping.java | 88 ++-- .../buildcraft/core/DefaultAreaProvider.java | 3 +- .../core/DefaultTriggerProvider.java | 6 +- .../src/buildcraft/core/EntityBlock.java | 6 +- .../src/buildcraft/core/EntityLaser.java | 12 +- .../src/buildcraft/core/EntityRobot.java | 31 +- .../minecraft/src/buildcraft/core/GuiIds.java | 1 + .../src/buildcraft/core/IBptContributor.java | 6 +- .../buildcraft/core/ItemRedstoneChipset.java | 3 +- .../src/buildcraft/core/ItemWrench.java | 3 +- .../src/buildcraft/core/PersistentWorld.java | 3 +- .../core/RedstonePowerProvider.java | 9 +- .../src/buildcraft/core/StackUtil.java | 39 +- .../buildcraft/core/SurroundingInventory.java | 12 +- .../src/buildcraft/core/TileBuildCraft.java | 15 +- .../src/buildcraft/core/TriggerInventory.java | 16 +- .../core/TriggerLiquidContainer.java | 10 +- .../minecraft/src/buildcraft/core/Utils.java | 101 ++--- .../buildcraft/core/network/EntityIds.java | 1 + .../core/network/ISynchronizedTile.java | 1 + .../core/network/IndexInPayload.java | 1 + .../core/network/PacketCoordinates.java | 3 +- .../buildcraft/core/network/PacketIds.java | 1 + .../core/network/PacketPayload.java | 22 +- .../core/network/PacketPipeDescription.java | 3 +- .../network/PacketPipeTransportContent.java | 3 +- .../core/network/PacketSlotChange.java | 6 +- .../buildcraft/core/network/PacketUpdate.java | 6 +- .../core/network/TilePacketWrapper.java | 12 +- .../buildcraft/core/utils/INBTTagable.java | 1 + .../buildcraft/core/utils/InventoryUtil.java | 9 +- .../buildcraft/core/utils/Localization.java | 9 +- .../buildcraft/core/utils/SessionVars.java | 1 + .../core/utils/SidedInventoryAdapter.java | 3 +- .../core/utils/SimpleInventory.java | 9 +- .../src/buildcraft/core/utils/StringUtil.java | 1 + .../src/buildcraft/devel/BlockCheat.java | 147 +++---- .../src/buildcraft/energy/BlockEngine.java | 18 +- .../buildcraft/energy/BlockOilFlowing.java | 23 +- .../src/buildcraft/energy/BlockOilStill.java | 3 +- .../src/buildcraft/energy/BlockPollution.java | 3 +- .../src/buildcraft/energy/BptBlockEngine.java | 15 +- .../energy/ContainerEngineRoot.java | 6 +- .../src/buildcraft/energy/Engine.java | 6 +- .../src/buildcraft/energy/EngineIron.java | 27 +- .../src/buildcraft/energy/EngineStone.java | 21 +- .../buildcraft/energy/IEngineProvider.java | 1 + .../buildcraft/energy/OilBucketHandler.java | 3 +- .../src/buildcraft/energy/OilPopulate.java | 50 +-- .../energy/PneumaticPowerProvider.java | 6 +- .../src/buildcraft/energy/TileEngine.java | 52 +-- .../factory/BlockAutoWorkbench.java | 8 +- .../src/buildcraft/factory/BlockFrame.java | 144 ++----- .../src/buildcraft/factory/BlockHopper.java | 6 +- .../buildcraft/factory/BlockMiningWell.java | 15 +- .../buildcraft/factory/BlockPlainPipe.java | 9 +- .../src/buildcraft/factory/BlockQuarry.java | 15 +- .../src/buildcraft/factory/BlockRefinery.java | 35 +- .../src/buildcraft/factory/BlockTank.java | 18 +- .../factory/BptBlockAutoWorkbench.java | 12 +- .../src/buildcraft/factory/BptBlockFrame.java | 3 +- .../buildcraft/factory/BptBlockRefinery.java | 9 +- .../src/buildcraft/factory/BptBlockTank.java | 6 +- .../factory/ContainerAutoWorkbench.java | 20 +- .../buildcraft/factory/ContainerHopper.java | 3 +- .../buildcraft/factory/ContainerRefinery.java | 8 +- .../factory/EntityMechanicalArm.java | 9 +- .../buildcraft/factory/TankBucketHandler.java | 3 +- .../buildcraft/factory/TileAssemblyTable.java | 46 +- .../buildcraft/factory/TileAutoWorkbench.java | 50 +-- .../src/buildcraft/factory/TileHopper.java | 6 +- .../src/buildcraft/factory/TileMachine.java | 3 +- .../buildcraft/factory/TileMiningWell.java | 23 +- .../src/buildcraft/factory/TilePump.java | 67 +-- .../src/buildcraft/factory/TileQuarry.java | 93 ++-- .../src/buildcraft/factory/TileRefinery.java | 29 +- .../src/buildcraft/factory/TileTank.java | 36 +- .../silicon/BlockAssemblyTable.java | 9 +- .../silicon/ContainerAssemblyTable.java | 6 +- .../src/buildcraft/silicon/TileLaser.java | 17 +- .../transport/BlockGenericPipe.java | 120 ++---- .../buildcraft/transport/BptBlockPipe.java | 43 +- .../transport/BptItemPipeDiamond.java | 15 +- .../buildcraft/transport/BptItemPipeIron.java | 6 +- .../transport/BptItemPipeWodden.java | 6 +- .../transport/CraftingDiamondPipe.java | 6 +- .../transport/CraftingGateInterface.java | 116 ++--- .../buildcraft/transport/EnergyPulser.java | 3 +- .../src/buildcraft/transport/EntityData.java | 1 + .../src/buildcraft/transport/GateVanilla.java | 36 +- .../transport/IItemTravelingHook.java | 3 +- .../transport/IPipeTransportItemsHook.java | 4 +- .../transport/IPipeTransportLiquidsHook.java | 1 + .../transport/IPipeTransportPowerHook.java | 1 + .../src/buildcraft/transport/ItemGate.java | 3 +- .../src/buildcraft/transport/ItemPipe.java | 6 +- .../src/buildcraft/transport/LegacyTile.java | 6 +- .../src/buildcraft/transport/Pipe.java | 96 ++--- .../transport/PipeLogicCobblestone.java | 3 +- .../transport/PipeLogicDiamond.java | 36 +- .../buildcraft/transport/PipeLogicIron.java | 24 +- .../buildcraft/transport/PipeLogicStone.java | 3 +- .../transport/PipeLogicStripes.java | 3 +- .../buildcraft/transport/PipeLogicWood.java | 18 +- .../transport/PipeTransportItems.java | 145 +++---- .../transport/PipeTransportLiquids.java | 47 +-- .../transport/PipeTransportPower.java | 58 +-- .../buildcraft/transport/TileGenericPipe.java | 61 +-- .../transport/TriggerPipeContents.java | 12 +- .../transport/TriggerRedstoneInput.java | 6 +- .../transport/pipes/PipeItemsDiamond.java | 9 +- .../transport/pipes/PipeItemsGold.java | 10 +- .../transport/pipes/PipeItemsObsidian.java | 45 +- .../transport/pipes/PipeItemsStone.java | 3 +- .../transport/pipes/PipeItemsStripes.java | 37 +- .../transport/pipes/PipeItemsWood.java | 53 +-- .../transport/pipes/PipeLiquidsWood.java | 29 +- .../transport/pipes/PipePowerWood.java | 6 +- 285 files changed, 2441 insertions(+), 4439 deletions(-) diff --git a/buildcraft_client/net/minecraft/src/buildcraft/api/APIProxy.java b/buildcraft_client/net/minecraft/src/buildcraft/api/APIProxy.java index bf4a76e8..67d0cc88 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/api/APIProxy.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/api/APIProxy.java @@ -35,8 +35,7 @@ public class APIProxy { entity.setDead(); if (entity.worldObj instanceof WorldClient) - ((WorldClient) entity.worldObj) - .removeEntityFromWorld(entity.entityId); + ((WorldClient) entity.worldObj).removeEntityFromWorld(entity.entityId); } public static Random createNewRandom(World world) { diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/ClientBuilderHook.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/ClientBuilderHook.java index 9ccedd10..049dbb6c 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/ClientBuilderHook.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/ClientBuilderHook.java @@ -12,17 +12,12 @@ import net.minecraft.src.buildcraft.core.CoreProxy; public class ClientBuilderHook implements IBuilderHook { @Override - public void rootIndexInitialized(BptRootIndex rootBptIndex) - throws IOException { - if (!APIProxy.isServerSide() - && !APIProxy - .isClient(ModLoader.getMinecraftInstance().theWorld)) { + public void rootIndexInitialized(BptRootIndex rootBptIndex) throws IOException { + if (!APIProxy.isServerSide() && !APIProxy.isClient(ModLoader.getMinecraftInstance().theWorld)) { // If we're on a SSP game, then pre-load the player list - BptPlayerIndex playerIndex = new BptPlayerIndex( - CoreProxy.playerName() + ".list", rootBptIndex); - BuildCraftBuilders.playerLibrary.put(CoreProxy.playerName(), - playerIndex); + BptPlayerIndex playerIndex = new BptPlayerIndex(CoreProxy.playerName() + ".list", rootBptIndex); + BuildCraftBuilders.playerLibrary.put(CoreProxy.playerName(), playerIndex); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/CraftingTemplate.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/CraftingTemplate.java index 8bdab534..d2cdd894 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/CraftingTemplate.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/CraftingTemplate.java @@ -24,8 +24,7 @@ class CraftingTemplate extends CraftingTemplateRoot { for (int i = 0; i < crafters.size(); i++) { ICrafting icrafting = (ICrafting) crafters.get(i); if (computingTime != template.computingTime) - icrafting.updateCraftingInventoryInfo(this, 0, - template.computingTime); + icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); } computingTime = template.computingTime; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBlueprintLibrary.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBlueprintLibrary.java index 4e98629f..71507435 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBlueprintLibrary.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBlueprintLibrary.java @@ -65,12 +65,10 @@ public class GuiBlueprintLibrary extends GuiBuildCraft { controlList.add(nextPageButton); // if (library.owner.equals(player.username)) { - deleteButton = new GuiButton(2, j + 100, k + 114, 25, 20, - StringUtil.localize("gui.del")); + deleteButton = new GuiButton(2, j + 100, k + 114, 25, 20, StringUtil.localize("gui.del")); controlList.add(deleteButton); - lockButton = new GuiButton(3, j + 127, k + 114, 40, 20, - StringUtil.localize("gui.lock")); + lockButton = new GuiButton(3, j + 127, k + 114, 40, 20, StringUtil.localize("gui.lock")); controlList.add(lockButton); if (library.locked) @@ -91,8 +89,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft { if (bpt == library.selected) { int l1 = 8; int i2 = 24; - drawGradientRect(l1, i2 + 9 * c, l1 + 88, i2 + 9 * (c + 1), - 0x80ffffff, 0x80ffffff); + drawGradientRect(l1, i2 + 9 * c, l1 + 88, i2 + 9 * (c + 1), 0x80ffffff, 0x80ffffff); } String name = bpt.getName(); @@ -108,8 +105,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { int i = 0; // if (library.owner.equals(player.username)) { - i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/builders/gui/library_rw.png"); + i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/library_rw.png"); // } else { // i = mc.renderEngine // .getTexture("/net/minecraft/src/buildcraft/builders/gui/library_r.png"); @@ -131,14 +127,12 @@ public class GuiBlueprintLibrary extends GuiBuildCraft { if (container.contents.size() == 0) container.contents = library.getNextPage(null); else - container.contents = library.getNextPage(index - .prevBpt(container.contents.getFirst().file.getName())); + container.contents = library.getNextPage(index.prevBpt(container.contents.getFirst().file.getName())); computeInput = false; } - drawTexturedModalRect(j + 128 + 22 - inP, k + 61, 176 + 22 - inP, 16, - inP, 16); + drawTexturedModalRect(j + 128 + 22 - inP, k + 61, 176 + 22 - inP, 16, inP, 16); drawTexturedModalRect(j + 128, k + 78, 176, 0, outP, 16); } @@ -158,38 +152,28 @@ public class GuiBlueprintLibrary extends GuiBuildCraft { if (ySlot >= 0 && ySlot <= 11) if (ySlot < container.contents.size()) library.selected = container.contents.get(ySlot); - } else if (nextPageButton.mousePressed( - ModLoader.getMinecraftInstance(), i, j)) { + } else if (nextPageButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) { if (container.contents.size() > 0) - container.contents = library.getNextPage(container.contents - .getLast().file.getName()); + container.contents = library.getNextPage(container.contents.getLast().file.getName()); else container.contents = library.getNextPage(null); - } else if (prevPageButton.mousePressed( - ModLoader.getMinecraftInstance(), i, j)) { + } else if (prevPageButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) { if (container.contents.size() > 0) - container.contents = library.getPrevPage(container.contents - .getFirst().file.getName()); + container.contents = library.getPrevPage(container.contents.getFirst().file.getName()); else container.contents = library.getNextPage(null); - } else if (lockButton != null - && lockButton.mousePressed(ModLoader.getMinecraftInstance(), i, - j)) { + } else if (lockButton != null && lockButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) { library.locked = !library.locked; if (library.locked) lockButton.displayString = StringUtil.localize("gui.unlock"); else lockButton.displayString = StringUtil.localize("gui.lock"); - } else if (deleteButton != null - && deleteButton.mousePressed(ModLoader.getMinecraftInstance(), - i, j)) + } else if (deleteButton != null && deleteButton.mousePressed(ModLoader.getMinecraftInstance(), i, j)) if (library.selected != null) { index.deleteBluePrint(library.selected.file.getName()); if (container.contents.size() > 0) - container.contents = library.getNextPage(index - .prevBpt(container.contents.getFirst().file - .getName())); + container.contents = library.getNextPage(index.prevBpt(container.contents.getFirst().file.getName())); else container.contents = library.getNextPage(null); diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBuilder.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBuilder.java index a074bed5..5aea0f50 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBuilder.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiBuilder.java @@ -43,14 +43,11 @@ public class GuiBuilder extends GuiAdvancedInterface { String title = StringUtil.localize("tile.builderBlock"); fontRenderer.drawString(title, getCenteredOffset(title), 12, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.building.resources"), - 8, 60, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, - ySize - 97, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.building.resources"), 8, 60, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040); if (builder.isBuildingBlueprint()) - fontRenderer.drawString(StringUtil.localize("gui.needed"), 185, 7, - 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.needed"), 185, 7, 0x404040); drawForegroundSelection(); } @@ -63,12 +60,10 @@ public class GuiBuilder extends GuiAdvancedInterface { int realXSize = 0; if (builder.isBuildingBlueprint()) { - i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/builders/gui/builder_blueprint.png"); + i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/builder_blueprint.png"); realXSize = 256; } else { - i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/builders/gui/builder.png"); + i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/builder.png"); realXSize = 176; } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiFiller.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiFiller.java index a8a12897..f3da438f 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiFiller.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiFiller.java @@ -32,10 +32,8 @@ public class GuiFiller extends GuiBuildCraft { protected void drawGuiContainerForegroundLayer() { String title = StringUtil.localize("tile.fillerBlock"); fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.filling.resources"), - 8, 74, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, 142, - 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.filling.resources"), 8, 74, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, 142, 0x404040); if (filler.currentPattern != null) drawForegroundSelection(filler.currentPattern.getName()); @@ -44,33 +42,28 @@ public class GuiFiller extends GuiBuildCraft { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/builders/gui/filler.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/filler.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); if (filler.currentPattern != null) { - i = mc.renderEngine.getTexture(filler.currentPattern - .getTextureFile()); + i = mc.renderEngine.getTexture(filler.currentPattern.getTextureFile()); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int textureI = filler.currentPattern.getTextureIndex() >> 4; - int textureJ = filler.currentPattern.getTextureIndex() - textureI - * 16; + int textureJ = filler.currentPattern.getTextureIndex() - textureI * 16; - drawTexturedModalRect(guiLeft + patternSymbolX, guiTop - + patternSymbolY, 16 * textureJ, 16 * textureI, 16, 16); + drawTexturedModalRect(guiLeft + patternSymbolX, guiTop + patternSymbolY, 16 * textureJ, 16 * textureI, 16, 16); } } public boolean intersectsWith(int i, int j) { - if (i >= patternSymbolX && i <= patternSymbolX + 16 - && j >= patternSymbolY && j <= patternSymbolY + 16) + if (i >= patternSymbolX && i <= patternSymbolX + 16 && j >= patternSymbolY && j <= patternSymbolY + 16) return true; return false; @@ -85,8 +78,7 @@ public class GuiFiller extends GuiBuildCraft { int i2 = (lastX - guiLeft) + 12; int k2 = lastY - guiTop - 12; int l2 = fontRenderer.getStringWidth(tag); - drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3, - 0xc0000000, 0xc0000000); + drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3, 0xc0000000, 0xc0000000); fontRenderer.drawStringWithShadow(tag, i2, k2, -1); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiHandler.java index 76618ef2..0b36cec4 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiHandler.java @@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiTemplate.java b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiTemplate.java index cade0d1d..1d667aa1 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiTemplate.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/builders/GuiTemplate.java @@ -35,10 +35,8 @@ public class GuiTemplate extends GuiBuildCraft { @Override protected void drawGuiContainerForegroundLayer() { - fontRenderer.drawString(template.getInvName(), - getCenteredOffset(template.getInvName()), 6, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, - ySize - 152, 0x404040); + fontRenderer.drawString(template.getInvName(), getCenteredOffset(template.getInvName()), 6, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 152, 0x404040); if (editMode && ((new Date()).getTime() / 100) % 8 >= 4) fontRenderer.drawString(template.name + "|", 51, 62, 0x404040); @@ -48,8 +46,7 @@ public class GuiTemplate extends GuiBuildCraft { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/builders/gui/template_gui.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/builders/gui/template_gui.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int j = (width - xSize) / 2; @@ -84,8 +81,7 @@ public class GuiTemplate extends GuiBuildCraft { return; } else if (c == 8) { if (template.name.length() > 0) - template.name = template.name.substring(0, - template.name.length() - 1); + template.name = template.name.substring(0, template.name.length() - 1); return; } else if (Character.isLetterOrDigit(c) || c == ' ') { diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/CoreProxy.java b/buildcraft_client/net/minecraft/src/buildcraft/core/CoreProxy.java index 1ccadf72..779eb6fc 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/CoreProxy.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/CoreProxy.java @@ -31,6 +31,7 @@ import net.minecraft.src.forge.NetworkMod; import cpw.mods.fml.client.SpriteHelper; public class CoreProxy { + private static boolean registeredOverrideTextureMap = false; public static String getCurrentLanguage() { @@ -44,12 +45,10 @@ public class CoreProxy { public static void registerBlock(Block block) { Item.itemsList[block.blockID] = null; - Item.itemsList[block.blockID] = new ItemBlockBuildCraft( - block.blockID - 256, block.getBlockName()); + Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getBlockName()); } - public static void registerTileEntity( - @SuppressWarnings("rawtypes") Class clas, String ident) { + public static void registerTileEntity(@SuppressWarnings("rawtypes") Class clas, String ident) { ModLoader.registerTileEntity(clas, ident); } @@ -57,8 +56,7 @@ public class CoreProxy { * public static void registerGUI(BaseModMp basemod, int id) { * ModLoaderMp.registerGUI(basemod, id); } */ - public static void onCraftingPickup(World world, EntityPlayer player, - ItemStack stack) { + public static void onCraftingPickup(World world, EntityPlayer player, ItemStack stack) { stack.onCrafting(world, player, stack.stackSize); } @@ -74,13 +72,9 @@ public class CoreProxy { return new File(Minecraft.getMinecraftDir(), "/buildcraft/"); } - public static void sendToPlayers(Packet packet, World w, int x, int y, - int z, int maxDistance, NetworkMod mod) { - } + public static void sendToPlayers(Packet packet, World w, int x, int y, int z, int maxDistance, NetworkMod mod) {} - public static void sendToPlayer(EntityPlayer entityplayer, - BuildCraftPacket packet) { - } + public static void sendToPlayer(EntityPlayer entityplayer, BuildCraftPacket packet) {} public static void sendToServer(Packet packet) { // ModLoaderMp.sendPacket(mod, packet); @@ -105,12 +99,10 @@ public class CoreProxy { char[] map = new char[256]; // every slot is free! Arrays.fill(map, '1'); - SpriteHelper.registerSpriteMapForFile( - BuildCraftCore.externalBuildCraftTexture, new String(map)); + SpriteHelper.registerSpriteMapForFile(BuildCraftCore.externalBuildCraftTexture, new String(map)); registeredOverrideTextureMap = true; } - return ModLoader.addOverride(BuildCraftCore.externalBuildCraftTexture, - pathToTexture) + 256; + return ModLoader.addOverride(BuildCraftCore.externalBuildCraftTexture, pathToTexture) + 256; } public static long getHash(IBlockAccess iBlockAccess) { @@ -118,8 +110,7 @@ public class CoreProxy { return 0; } - public static void TakenFromCrafting(EntityPlayer entityplayer, - ItemStack itemstack, IInventory iinventory) { + public static void TakenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory) { ModLoader.takenFromCrafting(entityplayer, itemstack, iinventory); } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/GuiAdvancedInterface.java b/buildcraft_client/net/minecraft/src/buildcraft/core/GuiAdvancedInterface.java index 2f66d2fc..b190d41d 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/GuiAdvancedInterface.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/GuiAdvancedInterface.java @@ -10,6 +10,7 @@ import org.lwjgl.opengl.GL11; public abstract class GuiAdvancedInterface extends GuiBuildCraft { public abstract class AdvancedSlot { + final public int x, y; public AdvancedSlot(int x, int y) { @@ -19,8 +20,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { public String getDescription() { if (getItemStack() != null) - return getItemStack().getItem().getItemDisplayName( - getItemStack()); + return getItemStack().getItem().getItemDisplayName(getItemStack()); else return ""; } @@ -52,8 +52,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { int textureI = getTextureIndex() >> 4; int textureJ = getTextureIndex() - textureI * 16; - drawTexturedModalRect(cornerX + x, cornerY + y, - 16 * textureJ, 16 * textureI, 16, 16); + drawTexturedModalRect(cornerX + x, cornerY + y, 16 * textureJ, 16 * textureI, 16, 16); } } @@ -63,16 +62,15 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { int cornerY = (height - ySize) / 2; itemRenderer.zLevel = 200F; - itemRenderer.renderItemIntoGUI(fontRenderer, mc.renderEngine, - item, cornerX + x, cornerY + y); - itemRenderer.renderItemOverlayIntoGUI(fontRenderer, - mc.renderEngine, item, cornerX + x, cornerY + y); + itemRenderer.renderItemIntoGUI(fontRenderer, mc.renderEngine, item, cornerX + x, cornerY + y); + itemRenderer.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, item, cornerX + x, cornerY + y); itemRenderer.zLevel = 0.0F; } } } public class ItemSlot extends AdvancedSlot { + public ItemStack stack; public ItemSlot(int x, int y) { @@ -132,8 +130,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { GL11.glEnable(32826 /* GL_RESCALE_NORMAL_EXT */); int i1 = 240; int k1 = 240; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, - i1 / 1.0F, k1 / 1.0F); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, i1 / 1.0F, k1 / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); for (int s = 0; s < slots.length; ++s) { @@ -165,8 +162,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft { int i2 = (lastX - cornerX) + 12; int k2 = lastY - cornerY - 12; int l2 = fontRenderer.getStringWidth(s); - drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3, - 0xc0000000, 0xc0000000); + drawGradientRect(i2 - 3, k2 - 3, i2 + l2 + 3, k2 + 8 + 3, 0xc0000000, 0xc0000000); fontRenderer.drawStringWithShadow(s, i2, k2, -1); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/GuiBuildCraft.java b/buildcraft_client/net/minecraft/src/buildcraft/core/GuiBuildCraft.java index ab3e73ae..e40f8ece 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/GuiBuildCraft.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/GuiBuildCraft.java @@ -25,8 +25,7 @@ public abstract class GuiBuildCraft extends GuiContainer { public void add(Ledger ledger) { this.ledgers.add(ledger); - if (SessionVars.getOpenedLedger() != null - && ledger.getClass().equals(SessionVars.getOpenedLedger())) + if (SessionVars.getOpenedLedger() != null && ledger.getClass().equals(SessionVars.getOpenedLedger())) ledger.setFullyOpen(); } @@ -80,9 +79,7 @@ public abstract class GuiBuildCraft extends GuiContainer { String tooltip = ledger.getTooltip(); int textWidth = fontRenderer.getStringWidth(tooltip); - drawGradientRect(startX - 3, startY - 3, - startX + textWidth + 3, startY + 8 + 3, 0xc0000000, - 0xc0000000); + drawGradientRect(startX - 3, startY - 3, startX + textWidth + 3, startY + 8 + 3, 0xc0000000, 0xc0000000); fontRenderer.drawStringWithShadow(tooltip, startX, startY, -1); } } @@ -95,8 +92,7 @@ public abstract class GuiBuildCraft extends GuiContainer { // Default action only if the mouse click was not handled by the // ledger itself. - if (ledger != null - && !ledger.handleMouseClicked(x, y, mouseButton)) { + if (ledger != null && !ledger.handleMouseClicked(x, y, mouseButton)) { for (Ledger other : ledgers) if (other != ledger && other.isOpen()) @@ -113,6 +109,7 @@ public abstract class GuiBuildCraft extends GuiContainer { * Side ledger for guis */ protected abstract class Ledger { + private boolean open; protected int overlayColor = 0xffffff; @@ -155,11 +152,9 @@ public abstract class GuiBuildCraft extends GuiContainer { return false; } - public boolean intersectsWith(int mouseX, int mouseY, int shiftX, - int shiftY) { + public boolean intersectsWith(int mouseX, int mouseY, int shiftX, int shiftY) { - if (mouseX >= shiftX && mouseX <= shiftX + currentWidth - && mouseY >= shiftY && mouseY <= shiftY + getHeight()) + if (mouseX >= shiftX && mouseX <= shiftX + currentWidth && mouseY >= shiftY && mouseY <= shiftY + getHeight()) return true; return false; @@ -203,15 +198,12 @@ public abstract class GuiBuildCraft extends GuiContainer { GL11.glColor4f(colorR, colorG, colorB, 1.0F); mc.renderEngine.bindTexture(texture); - drawTexturedModalRect(x, y, 0, 256 - currentHeight, 4, - currentHeight); - drawTexturedModalRect(x + 4, y, 256 - currentWidth + 4, 0, - currentWidth - 4, 4); + drawTexturedModalRect(x, y, 0, 256 - currentHeight, 4, currentHeight); + drawTexturedModalRect(x + 4, y, 256 - currentWidth + 4, 0, currentWidth - 4, 4); // Add in top left corner again drawTexturedModalRect(x, y, 0, 0, 4, 4); - drawTexturedModalRect(x + 4, y + 4, 256 - currentWidth + 4, - 256 - currentHeight + 4, currentWidth - 4, + drawTexturedModalRect(x + 4, y + 4, 256 - currentWidth + 4, 256 - currentHeight + 4, currentWidth - 4, currentHeight - 4); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); @@ -224,8 +216,7 @@ public abstract class GuiBuildCraft extends GuiContainer { mc.renderEngine.bindTexture(tex); int textureRow = iconIndex >> 4; int textureColumn = iconIndex - 16 * textureRow; - drawTexturedModalRect(x, y, 16 * textureColumn, 16 * textureRow, - 16, 16); + drawTexturedModalRect(x, y, 16 * textureColumn, 16 * textureRow, 16, 16); } } @@ -241,8 +232,7 @@ public abstract class GuiBuildCraft extends GuiContainer { initLedgers(container.inventory); } - protected void initLedgers(IInventory inventory) { - } + protected void initLedgers(IInventory inventory) {} @Override protected void drawGuiContainerForegroundLayer() { diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderEntityBlock.java b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderEntityBlock.java index 10d82deb..f8382d76 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderEntityBlock.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderEntityBlock.java @@ -23,6 +23,7 @@ import org.lwjgl.opengl.GL11; public class RenderEntityBlock extends Render { public static class BlockInterface { + public double minX; public double minY; public double minZ; @@ -41,18 +42,15 @@ public class RenderEntityBlock extends Render { return texture; } - public float getBlockBrightness(IBlockAccess iblockaccess, int i, - int j, int k) { + public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) { return baseBlock.getBlockBrightness(iblockaccess, i, j, k); } } - public RenderEntityBlock() { - } + public RenderEntityBlock() {} @Override - public void doRender(Entity entity, double i, double j, double k, float f, - float f1) { + public void doRender(Entity entity, double i, double j, double k, float f, float f1) { doRenderBlock((EntityBlock) entity, i, j, k); } @@ -82,15 +80,13 @@ public class RenderEntityBlock extends Render { util.maxZ = (remainZ > 1.0 ? 1.0 : remainZ); GL11.glPushMatrix(); - GL11.glTranslatef((float) i + 0.5F, (float) j + 0.5F, - (float) k + 0.5F); + GL11.glTranslatef((float) i + 0.5F, (float) j + 0.5F, (float) k + 0.5F); GL11.glRotatef(entity.rotationX, 1, 0, 0); GL11.glRotatef(entity.rotationY, 0, 1, 0); GL11.glRotatef(entity.rotationZ, 0, 0, 1); GL11.glTranslatef(iBase, jBase, kBase); - MinecraftForgeClient - .bindTexture(BuildCraftCore.customBuildCraftTexture); + MinecraftForgeClient.bindTexture(BuildCraftCore.customBuildCraftTexture); int lightX, lightY, lightZ; @@ -99,16 +95,14 @@ public class RenderEntityBlock extends Render { lightZ = (int) (Math.floor(entity.posZ) + kBase); GL11.glDisable(2896 /* GL_LIGHTING */); - renderBlock(util, world, lightX, lightY, lightZ, false, - true); + renderBlock(util, world, lightX, lightY, lightZ, false, true); GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); } } - public static void renderBlock(BlockInterface block, - IBlockAccess blockAccess, int i, int j, int k, boolean doLight, + public static void renderBlock(BlockInterface block, IBlockAccess blockAccess, int i, int j, int k, boolean doLight, boolean doTessellating) { float f = 0.5F; float f1 = 1.0F; @@ -130,8 +124,7 @@ public class RenderEntityBlock extends Render { tessellator.setColorOpaque_F(f * f5, f * f5, f * f5); } - renderBottomFace(block, -0.5D, -0.5D, -0.5D, - block.getBlockTextureFromSide(0)); + renderBottomFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(0)); if (doLight) { f5 = block.getBlockBrightness(blockAccess, i, j, k); @@ -140,8 +133,7 @@ public class RenderEntityBlock extends Render { tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5); } - renderTopFace(block, -0.5D, -0.5D, -0.5D, - block.getBlockTextureFromSide(1)); + renderTopFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(1)); if (doLight) { f5 = block.getBlockBrightness(blockAccess, i, j, k); @@ -150,8 +142,7 @@ public class RenderEntityBlock extends Render { tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5); } - renderEastFace(block, -0.5D, -0.5D, -0.5D, - block.getBlockTextureFromSide(2)); + renderEastFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(2)); if (doLight) { f5 = block.getBlockBrightness(blockAccess, i, j, k); @@ -160,8 +151,7 @@ public class RenderEntityBlock extends Render { tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5); } - renderWestFace(block, -0.5D, -0.5D, -0.5D, - block.getBlockTextureFromSide(3)); + renderWestFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(3)); if (doLight) { f5 = block.getBlockBrightness(blockAccess, i, j, k); @@ -170,8 +160,7 @@ public class RenderEntityBlock extends Render { tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5); } - renderNorthFace(block, -0.5D, -0.5D, -0.5D, - block.getBlockTextureFromSide(4)); + renderNorthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(4)); if (doLight) { f5 = block.getBlockBrightness(blockAccess, i, j, k); @@ -180,15 +169,13 @@ public class RenderEntityBlock extends Render { tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5); } - renderSouthFace(block, -0.5D, -0.5D, -0.5D, - block.getBlockTextureFromSide(5)); + renderSouthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(5)); if (doTessellating) tessellator.draw(); } - public static void renderBottomFace(BlockInterface block, double d, - double d1, double d2, int i) { + public static void renderBottomFace(BlockInterface block, double d, double d1, double d2, int i) { Tessellator tessellator = Tessellator.instance; int j = (i & 0xf) << 4; @@ -217,8 +204,7 @@ public class RenderEntityBlock extends Render { tessellator.addVertexWithUV(d8, d9, d11, d4, d6); } - public static void renderTopFace(BlockInterface block, double d, double d1, - double d2, int i) { + public static void renderTopFace(BlockInterface block, double d, double d1, double d2, int i) { Tessellator tessellator = Tessellator.instance; int j = (i & 0xf) << 4; @@ -247,8 +233,7 @@ public class RenderEntityBlock extends Render { tessellator.addVertexWithUV(d7, d9, d11, d3, d6); } - public static void renderEastFace(BlockInterface block, double d, - double d1, double d2, int i) { + public static void renderEastFace(BlockInterface block, double d, double d1, double d2, int i) { Tessellator tessellator = Tessellator.instance; int j = (i & 0xf) << 4; @@ -278,8 +263,7 @@ public class RenderEntityBlock extends Render { tessellator.addVertexWithUV(d8, d10, d12, d4, d6); } - public static void renderWestFace(BlockInterface block, double d, - double d1, double d2, int i) { + public static void renderWestFace(BlockInterface block, double d, double d1, double d2, int i) { Tessellator tessellator = Tessellator.instance; int j = (i & 0xf) << 4; @@ -309,8 +293,7 @@ public class RenderEntityBlock extends Render { tessellator.addVertexWithUV(d9, d11, d12, d4, d5); } - public static void renderNorthFace(BlockInterface block, double d, - double d1, double d2, int i) { + public static void renderNorthFace(BlockInterface block, double d, double d1, double d2, int i) { Tessellator tessellator = Tessellator.instance; int j = (i & 0xf) << 4; @@ -340,8 +323,7 @@ public class RenderEntityBlock extends Render { tessellator.addVertexWithUV(d8, d9, d12, d4, d6); } - public static void renderSouthFace(BlockInterface block, double d, - double d1, double d2, int i) { + public static void renderSouthFace(BlockInterface block, double d, double d1, double d2, int i) { Tessellator tessellator = Tessellator.instance; int j = (i & 0xf) << 4; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderLaser.java b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderLaser.java index df90a84f..14304af1 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderLaser.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderLaser.java @@ -10,8 +10,7 @@ import org.lwjgl.opengl.GL11; public class RenderLaser extends Render { - protected ModelBase model = new ModelBase() { - }; + protected ModelBase model = new ModelBase() {}; private ModelRenderer box; public RenderLaser() { @@ -23,15 +22,13 @@ public class RenderLaser extends Render { } @Override - public void doRender(Entity entity, double x, double y, double z, float f, - float f1) { + public void doRender(Entity entity, double x, double y, double z, float f, float f1) { doRender((EntityLaser) entity, x, y, z, f, f1); entity.setAngles(45, 180); } - private void doRender(EntityLaser laser, double x, double y, double z, - float f, float f1) { + private void doRender(EntityLaser laser, double x, double y, double z, float f, float f1) { if (laser.hidden) return; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderRobot.java b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderRobot.java index f070da0d..b6d89318 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderRobot.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderRobot.java @@ -10,8 +10,7 @@ import org.lwjgl.opengl.GL11; public class RenderRobot extends Render { - protected ModelBase model = new ModelBase() { - }; + protected ModelBase model = new ModelBase() {}; private ModelRenderer box; public RenderRobot() { @@ -23,20 +22,17 @@ public class RenderRobot extends Render { } @Override - public void doRender(Entity entity, double x, double y, double z, float f, - float f1) { + public void doRender(Entity entity, double x, double y, double z, float f, float f1) { doRender((EntityRobot) entity, x, y, z, f, f1); } - private void doRender(EntityRobot laser, double x, double y, double z, - float f, float f1) { + private void doRender(EntityRobot laser, double x, double y, double z, float f, float f1) { GL11.glPushMatrix(); GL11.glDisable(2896 /* GL_LIGHTING */); GL11.glTranslated(x, y, z); - MinecraftForgeClient - .bindTexture("/net/minecraft/src/buildcraft/core/gui/robot.png"); + MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/core/gui/robot.png"); float factor = (float) (1.0 / 16.0); diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderVoid.java b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderVoid.java index 79517399..2f0ad2fe 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/RenderVoid.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/RenderVoid.java @@ -15,8 +15,7 @@ import net.minecraft.src.Render; public class RenderVoid extends Render { @Override - public void doRender(Entity entity, double d, double d1, double d2, - float f, float f1) { + public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { // TODO Auto-generated method stub } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/TextureLiquidsFX.java b/buildcraft_client/net/minecraft/src/buildcraft/core/TextureLiquidsFX.java index 8eec939d..714d65a9 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/TextureLiquidsFX.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/TextureLiquidsFX.java @@ -14,11 +14,12 @@ import net.minecraft.src.forge.MinecraftForgeClient; import cpw.mods.fml.client.FMLTextureFX; public class TextureLiquidsFX extends FMLTextureFX { + private final int redMin, redMax, greenMin, greenMax, blueMin, blueMax; private final String texture; - public TextureLiquidsFX(int redMin, int redMax, int greenMin, int greenMax, - int blueMin, int blueMax, int spriteIndex, String texture) { + public TextureLiquidsFX(int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax, int spriteIndex, + String texture) { super(spriteIndex); this.redMin = redMin; @@ -59,15 +60,13 @@ public class TextureLiquidsFX extends FMLTextureFX { var3 += this.red[r + g * tileSizeBase]; } - this.green[i + j * tileSizeBase] = var3 / 3.3F - + this.blue[i + j * tileSizeBase] * 0.8F; + this.green[i + j * tileSizeBase] = var3 / 3.3F + this.blue[i + j * tileSizeBase] * 0.8F; } } for (int i = 0; i < tileSizeBase; ++i) { for (int j = 0; j < tileSizeBase; ++j) { - this.blue[i + j * tileSizeBase] += this.alpha[i + j - * tileSizeBase] * 0.05F; + this.blue[i + j * tileSizeBase] += this.alpha[i + j * tileSizeBase] * 0.05F; if (this.blue[i + j * tileSizeBase] < 0.0F) this.blue[i + j * tileSizeBase] = 0.0F; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java index c157ddfd..e24c10a8 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java @@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler { @Override public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, - new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); + MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); } @Override - public void onLogin(NetworkManager network, Packet1Login login) { - } + public void onLogin(NetworkManager network, Packet1Login login) {} @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { - } + public void onDisconnect(NetworkManager network, String message, Object[] args) {} } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/core/network/PacketHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/core/network/PacketHandler.java index 9ea3a1e7..8f9c6a74 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/core/network/PacketHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/core/network/PacketHandler.java @@ -13,11 +13,9 @@ import net.minecraft.src.forge.IPacketHandler; public class PacketHandler implements IPacketHandler { @Override - public void onPacketData(NetworkManager network, String channel, - byte[] bytes) { + public void onPacketData(NetworkManager network, String channel, byte[] bytes) { - DataInputStream data = new DataInputStream(new ByteArrayInputStream( - bytes)); + DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes)); try { NetClientHandler net = (NetClientHandler) network.getNetHandler(); diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/ContainerEngine.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/ContainerEngine.java index 2c8cccd1..41e4a835 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/ContainerEngine.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/ContainerEngine.java @@ -13,8 +13,7 @@ import net.minecraft.src.InventoryPlayer; public class ContainerEngine extends ContainerEngineRoot { - public ContainerEngine(InventoryPlayer inventoryplayer, - TileEngine tileEngine) { + public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) { super(inventoryplayer, tileEngine); // TODO Auto-generated constructor stub } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiCombustionEngine.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiCombustionEngine.java index 1880951f..7f49f687 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiCombustionEngine.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiCombustionEngine.java @@ -20,8 +20,7 @@ import org.lwjgl.opengl.GL11; public class GuiCombustionEngine extends GuiEngine { - public GuiCombustionEngine(InventoryPlayer inventoryplayer, - TileEngine tileEngine) { + public GuiCombustionEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) { super(new ContainerEngine(inventoryplayer, tileEngine)); } @@ -30,14 +29,12 @@ public class GuiCombustionEngine extends GuiEngine { super.drawGuiContainerForegroundLayer(); String title = StringUtil.localize("tile.engineIron"); 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); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int j = (width - xSize) / 2; @@ -48,21 +45,17 @@ public class GuiCombustionEngine extends GuiEngine { EngineIron engineIron = ((EngineIron) engine.engine); if (engine.getScaledBurnTime(58) > 0) - displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), - engineIron.liquidId); + displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.liquidId); if (engineIron.getScaledCoolant(58) > 0) - displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), - engineIron.coolantId); + displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.coolantId); } - private void displayGauge(int j, int k, int line, int col, int squaled, - int liquidId) { + private void displayGauge(int j, int k, int line, int col, int squaled, int liquidId) { Object o = null; int liquidImgIndex = 0; - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) { + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) { o = Block.blocksList[liquidId]; liquidImgIndex = Block.blocksList[liquidId].blockIndexInTexture; } else if (Item.itemsList[liquidId] != null) { @@ -74,8 +67,7 @@ public class GuiCombustionEngine extends GuiEngine { return; if (o instanceof ITextureProvider) - MinecraftForgeClient.bindTexture(((ITextureProvider) o) - .getTextureFile()); + MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile()); else MinecraftForgeClient.bindTexture("/terrain.png"); @@ -95,16 +87,14 @@ public class GuiCombustionEngine extends GuiEngine { squaled = 0; } - drawTexturedModalRect(j + col, k + line + 58 - x - start, - imgColumn * 16, imgLine * 16, 16, 16 - (16 - x)); + drawTexturedModalRect(j + col, k + line + 58 - x - start, imgColumn * 16, imgLine * 16, 16, 16 - (16 - x)); start = start + 16; if (x == 0 || squaled == 0) break; } - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/energy/gui/combustion_engine_gui.png"); mc.renderEngine.bindTexture(i); drawTexturedModalRect(j + col, k + line, 176, 0, 16, 60); diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiEngine.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiEngine.java index 61d84262..12dfa0ce 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiEngine.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiEngine.java @@ -33,22 +33,13 @@ public abstract class GuiEngine extends GuiBuildCraft { if (!isFullyOpened()) return; - fontRenderer.drawStringWithShadow( - StringUtil.localize("gui.energy"), x + 22, y + 8, - headerColour); - fontRenderer.drawStringWithShadow( - StringUtil.localize("gui.currentOutput") + ":", x + 22, - y + 20, subheaderColour); - fontRenderer.drawString(engine.getCurrentOutput() + " MJ/t", - x + 22, y + 32, textColour); - fontRenderer.drawStringWithShadow(StringUtil.localize("gui.stored") - + ":", x + 22, y + 44, subheaderColour); - fontRenderer.drawString(engine.getEnergyStored() + " MJ", x + 22, - y + 56, textColour); - fontRenderer.drawStringWithShadow(StringUtil.localize("gui.heat") - + ":", x + 22, y + 68, subheaderColour); - fontRenderer.drawString(((double) engine.getHeat() / (double) 10) - + " °C", x + 22, y + 80, textColour); + fontRenderer.drawStringWithShadow(StringUtil.localize("gui.energy"), x + 22, y + 8, headerColour); + fontRenderer.drawStringWithShadow(StringUtil.localize("gui.currentOutput") + ":", x + 22, y + 20, subheaderColour); + fontRenderer.drawString(engine.getCurrentOutput() + " MJ/t", x + 22, y + 32, textColour); + fontRenderer.drawStringWithShadow(StringUtil.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour); + fontRenderer.drawString(engine.getEnergyStored() + " MJ", x + 22, y + 56, textColour); + fontRenderer.drawStringWithShadow(StringUtil.localize("gui.heat") + ":", x + 22, y + 68, subheaderColour); + fontRenderer.drawString(((double) engine.getHeat() / (double) 10) + " °C", x + 22, y + 80, textColour); } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiHandler.java index 86003e38..b5a7eefc 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiHandler.java @@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiSteamEngine.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiSteamEngine.java index 1748b3f2..56a0e7f1 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiSteamEngine.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/GuiSteamEngine.java @@ -25,14 +25,12 @@ public class GuiSteamEngine extends GuiEngine { super.drawGuiContainerForegroundLayer(); String title = StringUtil.localize("tile.engineStone"); 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); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/energy/gui/steam_engine_gui.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/energy/gui/steam_engine_gui.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int j = (width - xSize) / 2; @@ -43,8 +41,7 @@ public class GuiSteamEngine extends GuiEngine { if (engine.getScaledBurnTime(12) > 0) { int l = engine.getScaledBurnTime(12); - drawTexturedModalRect(j + 80, (k + 24 + 12) - l, 176, 12 - l, 14, - l + 2); + drawTexturedModalRect(j + 80, (k + 24 + 12) - l, 176, 12 - l, 14, l + 2); } } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/RenderEngine.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/RenderEngine.java index eb8e0323..e967c195 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/RenderEngine.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/RenderEngine.java @@ -22,11 +22,9 @@ import net.minecraft.src.forge.MinecraftForgeClient; import org.lwjgl.opengl.GL11; -public class RenderEngine extends TileEntitySpecialRenderer implements - IInventoryRenderer { +public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer { - private ModelBase model = new ModelBase() { - }; + private ModelBase model = new ModelBase() {}; private ModelRenderer box; private ModelRenderer trunk; @@ -73,18 +71,15 @@ public class RenderEngine extends TileEntitySpecialRenderer implements } @Override - public void renderTileEntityAt(TileEntity tileentity, double x, double y, - double z, float f) { + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { Engine engine = ((IEngineProvider) tileentity).getEngine(); if (engine != null) - render(engine.getEnergyStage(), engine.progress, - engine.orientation, engine.getTextureFile(), x, y, z); + render(engine.getEnergyStage(), engine.progress, engine.orientation, engine.getTextureFile(), x, y, z); } - private void render(EnergyStage energy, float progress, - Orientations orientation, String baseTexture, double x, double y, + private void render(EnergyStage energy, float progress, Orientations orientation, String baseTexture, double x, double y, double z) { if (BuildCraftCore.render == RenderMode.NoDynamic) @@ -154,26 +149,21 @@ public class RenderEngine extends TileEntitySpecialRenderer implements box.render(factor); - GL11.glTranslatef(translate[0] * translatefact, translate[1] - * translatefact, translate[2] * translatefact); + GL11.glTranslatef(translate[0] * translatefact, translate[1] * translatefact, translate[2] * translatefact); movingBox.render(factor); - GL11.glTranslatef(-translate[0] * translatefact, -translate[1] - * translatefact, -translate[2] * translatefact); + GL11.glTranslatef(-translate[0] * translatefact, -translate[1] * translatefact, -translate[2] * translatefact); - MinecraftForgeClient - .bindTexture("/net/minecraft/src/buildcraft/energy/gui/chamber.png"); + MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/energy/gui/chamber.png"); float chamberf = 2F / 16F; for (int i = 0; i <= step + 2; i += 2) { chamber.render(factor); - GL11.glTranslatef(translate[0] * chamberf, translate[1] * chamberf, - translate[2] * chamberf); + GL11.glTranslatef(translate[0] * chamberf, translate[1] * chamberf, translate[2] * chamberf); } for (int i = 0; i <= step + 2; i += 2) - GL11.glTranslatef(-translate[0] * chamberf, -translate[1] - * chamberf, -translate[2] * chamberf); + GL11.glTranslatef(-translate[0] * chamberf, -translate[1] * chamberf, -translate[2] * chamberf); String texture = ""; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureFuelFX.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureFuelFX.java index 30727cff..dbb74218 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureFuelFX.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureFuelFX.java @@ -16,8 +16,7 @@ import net.minecraft.src.forge.ITextureProvider; public class TextureFuelFX extends TextureLiquidsFX { public TextureFuelFX() { - super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel - .getIconFromDamage(0), - ((ITextureProvider) BuildCraftEnergy.fuel).getTextureFile()); + super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel.getIconFromDamage(0), ((ITextureProvider) BuildCraftEnergy.fuel) + .getTextureFile()); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFX.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFX.java index 1d0bffcc..2f699ab7 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFX.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFX.java @@ -16,8 +16,7 @@ import net.minecraft.src.forge.ITextureProvider; public class TextureOilFX extends TextureLiquidsFX { public TextureOilFX() { - super(10, 31, 10, 31, 10, 31, - BuildCraftEnergy.oilStill.blockIndexInTexture, + super(10, 31, 10, 31, 10, 31, BuildCraftEnergy.oilStill.blockIndexInTexture, ((ITextureProvider) BuildCraftEnergy.oilStill).getTextureFile()); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFlowFX.java b/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFlowFX.java index 96c15dd2..14b1cb0b 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFlowFX.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/energy/TextureOilFlowFX.java @@ -18,6 +18,7 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLTextureFX; public class TextureOilFlowFX extends FMLTextureFX { + public TextureOilFlowFX() { super(BuildCraftEnergy.oilMoving.blockIndexInTexture + 1); @@ -37,8 +38,7 @@ public class TextureOilFlowFX extends FMLTextureFX { @Override public void bindImage(RenderEngine renderengine) { - GL11.glBindTexture(3553, - renderengine.getTexture(BuildCraftCore.customBuildCraftTexture)); + GL11.glBindTexture(3553, renderengine.getTexture(BuildCraftCore.customBuildCraftTexture)); } @Override @@ -53,14 +53,12 @@ public class TextureOilFlowFX extends FMLTextureFX { f += field_1138_g[k1 + i2 * tileSizeBase]; } - field_1137_h[i + k * tileSizeBase] = f / 3.2F - + field_1136_i[i + k * tileSizeBase] * 0.8F; + field_1137_h[i + k * tileSizeBase] = f / 3.2F + field_1136_i[i + k * tileSizeBase] * 0.8F; } for (int j = 0; j < tileSizeBase; j++) for (int l = 0; l < tileSizeBase; l++) { - field_1136_i[j + l * tileSizeBase] += field_1135_j[j + l - * tileSizeBase] * 0.05F; + field_1136_i[j + l * tileSizeBase] += field_1135_j[j + l * tileSizeBase] * 0.05F; if (field_1136_i[j + l * tileSizeBase] < 0.0F) field_1136_i[j + l * tileSizeBase] = 0.0F; field_1135_j[j + l * tileSizeBase] -= 0.3F; @@ -72,8 +70,7 @@ public class TextureOilFlowFX extends FMLTextureFX { field_1137_h = field_1138_g; field_1138_g = af; for (int i1 = 0; i1 < tileSizeSquare; i1++) { - float f1 = field_1138_g[i1 - field_1134_k * tileSizeBase - & tileSizeSquareMask]; + float f1 = field_1138_g[i1 - field_1134_k * tileSizeBase & tileSizeSquareMask]; if (f1 > 1.0F) f1 = 1.0F; if (f1 < 0.0F) diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/BlockMachineRoot.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/BlockMachineRoot.java index 2d9ca665..4c731502 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/BlockMachineRoot.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/BlockMachineRoot.java @@ -23,15 +23,13 @@ public abstract class BlockMachineRoot extends BlockContainer { } @Override - public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, - int k) { + public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) { for (int x = i - 1; x <= i + 1; ++x) for (int y = j - 1; y <= j + 1; ++y) for (int z = k - 1; z <= k + 1; ++z) { TileEntity tile = iblockaccess.getBlockTileEntity(x, y, z); - if (tile instanceof IMachine - && ((IMachine) tile).isActive()) + if (tile instanceof IMachine && ((IMachine) tile).isActive()) return super.getBlockBrightness(iblockaccess, i, j, k) + 0.5F; } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiAutoCrafting.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiAutoCrafting.java index 182a668c..05177c73 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiAutoCrafting.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiAutoCrafting.java @@ -18,8 +18,7 @@ import org.lwjgl.opengl.GL11; public class GuiAutoCrafting extends GuiBuildCraft { - public GuiAutoCrafting(InventoryPlayer inventoryplayer, World world, - TileAutoWorkbench tile) { + public GuiAutoCrafting(InventoryPlayer inventoryplayer, World world, TileAutoWorkbench tile) { super(new ContainerAutoWorkbench(inventoryplayer, tile)); } @@ -33,8 +32,7 @@ public class GuiAutoCrafting extends GuiBuildCraft { protected void drawGuiContainerForegroundLayer() { String title = StringUtil.localize("tile.autoWorkbenchBlock"); 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); } @Override diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHandler.java index a4f707d1..50420a19 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHandler.java @@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; @@ -22,8 +21,7 @@ public class GuiHandler implements IGuiHandler { case GuiIds.AUTO_CRAFTING_TABLE: if (!(tile instanceof TileAutoWorkbench)) return null; - return new GuiAutoCrafting(player.inventory, world, - (TileAutoWorkbench) tile); + return new GuiAutoCrafting(player.inventory, world, (TileAutoWorkbench) tile); case GuiIds.REFINERY: if (!(tile instanceof TileRefinery)) diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHopper.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHopper.java index 6f6379b1..e16dbd24 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHopper.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiHopper.java @@ -14,8 +14,7 @@ public class GuiHopper extends GuiContainer { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_gui.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_gui.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int j = (width - xSize) / 2; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiRefinery.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiRefinery.java index e0735c26..bed02282 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiRefinery.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/GuiRefinery.java @@ -43,16 +43,14 @@ public class GuiRefinery extends GuiAdvancedInterface { fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRenderer.drawString("->", 63, 59, 0x404040); fontRenderer.drawString("<-", 106, 59, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, - (ySize - 96) + 2, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); drawForegroundSelection(); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/factory/gui/refinery_filter.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/factory/gui/refinery_filter.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int j = (width - xSize) / 2; @@ -78,9 +76,7 @@ public class GuiRefinery extends GuiAdvancedInterface { slot = slots[position]; if (slot != null) { - int liquidId = BuildCraftAPI - .getLiquidForFilledItem(mc.thePlayer.inventory - .getItemStack()); + int liquidId = BuildCraftAPI.getLiquidForFilledItem(mc.thePlayer.inventory.getItemStack()); container.setFilter(position, liquidId, 0); } @@ -102,8 +98,7 @@ public class GuiRefinery extends GuiAdvancedInterface { if (filter1 != null) liquid1Id = filter1.itemID; - RefineryRecipe recipe = BuildCraftAPI.findRefineryRecipe(liquid0Id, - BuildCraftAPI.BUCKET_VOLUME, liquid1Id, + RefineryRecipe recipe = BuildCraftAPI.findRefineryRecipe(liquid0Id, BuildCraftAPI.BUCKET_VOLUME, liquid1Id, BuildCraftAPI.BUCKET_VOLUME); if (recipe != null) diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/ModelFrustum.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/ModelFrustum.java index c49e6f3d..9859c4b4 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/ModelFrustum.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/ModelFrustum.java @@ -6,6 +6,7 @@ import net.minecraft.src.Tessellator; import net.minecraft.src.TexturedQuad; public class ModelFrustum { + /** * The (x,y,z) vertex positions and (u,v) texture coordinates for each of * the 8 points on a cube @@ -34,10 +35,8 @@ public class ModelFrustum { public final float posZ2; public String field_40673_g; - public ModelFrustum(ModelRenderer par1ModelRenderer, int textureOffsetX, - int textureOffsetY, float originX, float originY, float originZ, - int bottomWidth, int bottomDepth, int topWidth, int topDepth, - int height, float scaleFactor) { + public ModelFrustum(ModelRenderer par1ModelRenderer, int textureOffsetX, int textureOffsetY, float originX, float originY, + float originZ, int bottomWidth, int bottomDepth, int topWidth, int topDepth, int height, float scaleFactor) { this.posX1 = originX; this.posY1 = originY; this.posZ1 = originZ; @@ -45,21 +44,15 @@ public class ModelFrustum { this.vertexPositions = new PositionTextureVertex[8]; this.quadList = new TexturedQuad[6]; - float bottomDeltaX = bottomWidth > topWidth ? 0 - : (topWidth - bottomWidth) / 2f; - float topDeltaX = bottomWidth > topWidth ? (bottomWidth - topWidth) / 2f - : 0; + float bottomDeltaX = bottomWidth > topWidth ? 0 : (topWidth - bottomWidth) / 2f; + float topDeltaX = bottomWidth > topWidth ? (bottomWidth - topWidth) / 2f : 0; - float bottomDeltaZ = bottomDepth > topDepth ? 0 - : (topDepth - bottomDepth) / 2f; - float topDeltaZ = bottomDepth > topDepth ? (bottomDepth - topDepth) / 2f - : 0; + float bottomDeltaZ = bottomDepth > topDepth ? 0 : (topDepth - bottomDepth) / 2f; + float topDeltaZ = bottomDepth > topDepth ? (bottomDepth - topDepth) / 2f : 0; - float targetX = originX - + Math.max((float) bottomWidth, (float) topWidth); + float targetX = originX + Math.max((float) bottomWidth, (float) topWidth); float targetY = originY + height; - float targetZ = originZ - + Math.max((float) bottomDepth, (float) topDepth); + float targetZ = originZ + Math.max((float) bottomDepth, (float) topDepth); this.posX2 = targetX; this.posY2 = targetY; @@ -78,23 +71,19 @@ public class ModelFrustum { originX = var14; } - PositionTextureVertex var23 = new PositionTextureVertex(originX - + bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F, 0.0F); - PositionTextureVertex var15 = new PositionTextureVertex(targetX - - bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F, 8.0F); - PositionTextureVertex var16 = new PositionTextureVertex(targetX - - topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 8.0F); - PositionTextureVertex var17 = new PositionTextureVertex(originX - + topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 0.0F); + PositionTextureVertex var23 = new PositionTextureVertex(originX + bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F, + 0.0F); + PositionTextureVertex var15 = new PositionTextureVertex(targetX - bottomDeltaX, originY, originZ + bottomDeltaZ, 0.0F, + 8.0F); + PositionTextureVertex var16 = new PositionTextureVertex(targetX - topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 8.0F); + PositionTextureVertex var17 = new PositionTextureVertex(originX + topDeltaX, targetY, originZ + topDeltaZ, 8.0F, 0.0F); - PositionTextureVertex var18 = new PositionTextureVertex(originX - + bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F, 0.0F); - PositionTextureVertex var19 = new PositionTextureVertex(targetX - - bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F, 8.0F); - PositionTextureVertex var20 = new PositionTextureVertex(targetX - - topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 8.0F); - PositionTextureVertex var21 = new PositionTextureVertex(originX - + topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 0.0F); + PositionTextureVertex var18 = new PositionTextureVertex(originX + bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F, + 0.0F); + PositionTextureVertex var19 = new PositionTextureVertex(targetX - bottomDeltaX, originY, targetZ - bottomDeltaZ, 0.0F, + 8.0F); + PositionTextureVertex var20 = new PositionTextureVertex(targetX - topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 8.0F); + PositionTextureVertex var21 = new PositionTextureVertex(originX + topDeltaX, targetY, targetZ - topDeltaZ, 8.0F, 0.0F); this.vertexPositions[0] = var23; this.vertexPositions[1] = var15; this.vertexPositions[2] = var16; @@ -107,36 +96,24 @@ public class ModelFrustum { int depth = Math.max(bottomDepth, topDepth); int width = Math.max(bottomWidth, topWidth); - this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { - var19, var15, var16, var20 }, textureOffsetX + depth + width, - textureOffsetY + depth, textureOffsetX + depth + width + depth, - textureOffsetY + depth + height, + this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { var19, var15, var16, var20 }, textureOffsetX + depth + + width, textureOffsetY + depth, textureOffsetX + depth + width + depth, textureOffsetY + depth + height, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { - var23, var18, var21, var17 }, textureOffsetX, textureOffsetY - + depth, textureOffsetX + depth, textureOffsetY + depth - + height, par1ModelRenderer.textureWidth, + this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { var23, var18, var21, var17 }, textureOffsetX, + textureOffsetY + depth, textureOffsetX + depth, textureOffsetY + depth + height, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { - var19, var18, var23, var15 }, textureOffsetX + depth, - textureOffsetY, textureOffsetX + depth + width, textureOffsetY - + depth, par1ModelRenderer.textureWidth, + this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { var19, var18, var23, var15 }, textureOffsetX + depth, + textureOffsetY, textureOffsetX + depth + width, textureOffsetY + depth, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { - var16, var17, var21, var20 }, textureOffsetX + depth + width, - textureOffsetY + depth, textureOffsetX + depth + width + width, - textureOffsetY, par1ModelRenderer.textureWidth, - par1ModelRenderer.textureHeight); - this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { - var15, var23, var17, var16 }, textureOffsetX + depth, - textureOffsetY + depth, textureOffsetX + depth + width, - textureOffsetY + depth + height, + this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { var16, var17, var21, var20 }, textureOffsetX + depth + + width, textureOffsetY + depth, textureOffsetX + depth + width + width, textureOffsetY, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { - var18, var19, var20, var21 }, textureOffsetX + depth + width - + depth, textureOffsetY + depth, textureOffsetX + depth + width - + depth + width, textureOffsetY + depth + height, + this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { var15, var23, var17, var16 }, textureOffsetX + depth, + textureOffsetY + depth, textureOffsetX + depth + width, textureOffsetY + depth + height, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { var18, var19, var20, var21 }, textureOffsetX + depth + + width + depth, textureOffsetY + depth, textureOffsetX + depth + width + depth + width, textureOffsetY + depth + + height, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); if (par1ModelRenderer.mirror) { for (int var22 = 0; var22 < this.quadList.length; ++var22) { diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderHopper.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderHopper.java index 5c6dacba..a00e8bf4 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderHopper.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderHopper.java @@ -12,11 +12,9 @@ import net.minecraft.src.forge.MinecraftForgeClient; import org.lwjgl.opengl.GL11; -public class RenderHopper extends TileEntitySpecialRenderer implements - IInventoryRenderer { +public class RenderHopper extends TileEntitySpecialRenderer implements IInventoryRenderer { - private ModelBase model = new ModelBase() { - }; + private ModelBase model = new ModelBase() {}; private final ModelRenderer top; private final ModelFrustum middle; @@ -28,8 +26,7 @@ public class RenderHopper extends TileEntitySpecialRenderer implements top.rotationPointX = 8F; top.rotationPointY = 8F; top.rotationPointZ = 8F; - middle = new ModelFrustum(top, 32, 0, 0, 3, 0, 8, 8, 16, 16, 7, - 1F / 16F); + middle = new ModelFrustum(top, 32, 0, 0, 3, 0, 8, 8, 16, 16, 7, 1F / 16F); bottom = new ModelRenderer(model, 0, 23); bottom.addBox(-3F, -8F, -3F, 6, 3, 6); bottom.rotationPointX = 8F; @@ -43,8 +40,7 @@ public class RenderHopper extends TileEntitySpecialRenderer implements } @Override - public void renderTileEntityAt(TileEntity var1, double x, double y, - double z, float f) { + public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float f) { render(x, y, z); } @@ -56,12 +52,10 @@ public class RenderHopper extends TileEntitySpecialRenderer implements GL11.glDisable(GL11.GL_LIGHTING); GL11.glTranslated(x, y, z); - MinecraftForgeClient - .bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper.png"); + MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper.png"); top.render((float) (1.0 / 16.0)); bottom.render((float) (1.0 / 16.0)); - MinecraftForgeClient - .bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_middle.png"); + MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/factory/gui/hopper_middle.png"); middle.render(Tessellator.instance, 1F / 16F); GL11.glEnable(GL11.GL_LIGHTING); diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderRefinery.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderRefinery.java index 1f47eb4f..e4a3ed49 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderRefinery.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderRefinery.java @@ -27,16 +27,14 @@ import net.minecraft.src.forge.MinecraftForgeClient; import org.lwjgl.opengl.GL11; -public class RenderRefinery extends TileEntitySpecialRenderer implements - IInventoryRenderer { +public class RenderRefinery extends TileEntitySpecialRenderer implements IInventoryRenderer { static final float factor = (float) (1.0 / 16.0); private ModelRenderer tank; private ModelRenderer magnet[] = new ModelRenderer[4]; - private ModelBase model = new ModelBase() { - }; + private ModelBase model = new ModelBase() {}; public RenderRefinery() { @@ -75,8 +73,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements BlockInterface block = new BlockInterface(); // Retrieve the texture depending on type of item. - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) block.texture = Block.blocksList[liquidId].blockIndexInTexture; else if (Item.itemsList[liquidId] != null) @@ -115,8 +112,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements } @Override - public void renderTileEntityAt(TileEntity tileentity, double x, double y, - double z, float f) { + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { render((TileRefinery) tileentity, x, y, z); } @@ -141,8 +137,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements anim = tile.getAnimationStage(); - switch (tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, - tile.zCoord)) { + switch (tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord)) { case 2: angle = 90; break; @@ -177,8 +172,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements GL11.glRotatef(angle, 0, 1, 0); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - MinecraftForgeClient - .bindTexture("/net/minecraft/src/buildcraft/factory/gui/refinery.png"); + MinecraftForgeClient.bindTexture("/net/minecraft/src/buildcraft/factory/gui/refinery.png"); GL11.glTranslatef(-4F * factor, 0, -4F * factor); tank.render(factor); GL11.glTranslatef(4F * factor, 0, 4F * factor); @@ -220,8 +214,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements if (list1 != null) { setTextureFor(liquid1); - GL11.glCallList(list1[(int) ((float) qty1 - / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]); + GL11.glCallList(list1[(int) ((float) qty1 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]); } } GL11.glTranslatef(4F * factor, 0, 4F * factor); @@ -232,8 +225,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements if (list2 != null) { setTextureFor(liquid2); - GL11.glCallList(list2[(int) ((float) qty2 - / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]); + GL11.glCallList(list2[(int) ((float) qty2 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]); } } GL11.glTranslatef(4F * factor, 0, -4F * factor); @@ -257,15 +249,13 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements public void setTextureFor(int liquidId) { Object o = null; - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) o = Block.blocksList[liquidId]; else o = Item.itemsList[liquidId]; if (o instanceof ITextureProvider) - MinecraftForgeClient.bindTexture(((ITextureProvider) o) - .getTextureFile()); + MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile()); else MinecraftForgeClient.bindTexture("/terrain.png"); } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderTank.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderTank.java index 629918a5..79108812 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderTank.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/RenderTank.java @@ -39,8 +39,7 @@ public class RenderTank extends TileEntitySpecialRenderer { stage.put(liquidId, d); BlockInterface block = new BlockInterface(); - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) block.texture = Block.blocksList[liquidId].blockIndexInTexture; else block.texture = Item.itemsList[liquidId].getIconFromDamage(0); @@ -66,8 +65,7 @@ public class RenderTank extends TileEntitySpecialRenderer { } @Override - public void renderTileEntityAt(TileEntity tileentity, double x, double y, - double z, float f) { + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { TileTank tank = ((TileTank) tileentity); @@ -83,22 +81,19 @@ public class RenderTank extends TileEntitySpecialRenderer { Object o = null; - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) o = Block.blocksList[liquidId]; else o = Item.itemsList[liquidId]; if (o instanceof ITextureProvider) - MinecraftForgeClient.bindTexture(((ITextureProvider) o) - .getTextureFile()); + MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile()); else MinecraftForgeClient.bindTexture("/terrain.png"); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); - GL11.glCallList(d[(int) ((float) tank.getLiquidQuantity() - / (float) (tank.getTankCapacity()) * (displayStages - 1))]); + GL11.glCallList(d[(int) ((float) tank.getLiquidQuantity() / (float) (tank.getTankCapacity()) * (displayStages - 1))]); GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java index d291f0b5..b6551da8 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java @@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler { @Override public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, - new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); + MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); } @Override - public void onLogin(NetworkManager network, Packet1Login login) { - } + public void onLogin(NetworkManager network, Packet1Login login) {} @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { - } + public void onDisconnect(NetworkManager network, String message, Object[] args) {} } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/factory/network/PacketHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/factory/network/PacketHandler.java index e22e5104..a2a0acf6 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/factory/network/PacketHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/factory/network/PacketHandler.java @@ -6,7 +6,6 @@ import net.minecraft.src.forge.IPacketHandler; public class PacketHandler implements IPacketHandler { @Override - public void onPacketData(NetworkManager network, String channel, byte[] data) { - } + public void onPacketData(NetworkManager network, String channel, byte[] data) {} } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiAssemblyTable.java b/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiAssemblyTable.java index 2f01367f..6f3c403a 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiAssemblyTable.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiAssemblyTable.java @@ -50,8 +50,7 @@ public class GuiAssemblyTable extends GuiAdvancedInterface { } } - public GuiAssemblyTable(IInventory playerInventory, - TileAssemblyTable assemblyTable) { + public GuiAssemblyTable(IInventory playerInventory, TileAssemblyTable assemblyTable) { super(new ContainerAssemblyTable(playerInventory, assemblyTable)); this.playerInventory = playerInventory; @@ -72,14 +71,12 @@ public class GuiAssemblyTable extends GuiAdvancedInterface { updateRecipes(); // Request current selection from server - CoreProxy.sendToServer(new PacketCoordinates( - PacketIds.SELECTION_ASSEMBLY_GET, assemblyTable.xCoord, + CoreProxy.sendToServer(new PacketCoordinates(PacketIds.SELECTION_ASSEMBLY_GET, assemblyTable.xCoord, assemblyTable.yCoord, assemblyTable.zCoord).getPacket()); } public void updateRecipes() { - LinkedList potentialRecipes = assemblyTable - .getPotentialOutputs(); + LinkedList potentialRecipes = assemblyTable.getPotentialOutputs(); Iterator cur = potentialRecipes.iterator(); for (int p = 0; p < 8; ++p) @@ -93,16 +90,14 @@ public class GuiAssemblyTable extends GuiAdvancedInterface { protected void drawGuiContainerForegroundLayer() { String title = StringUtil.localize("tile.assemblyTableBlock"); fontRenderer.drawString(title, getCenteredOffset(title), 15, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, - ySize - 97, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040); drawForegroundSelection(); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/factory/gui/assembly_table.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/factory/gui/assembly_table.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int cornerX = (width - xSize) / 2; @@ -115,17 +110,14 @@ public class GuiAssemblyTable extends GuiAdvancedInterface { RecipeSlot slot = (RecipeSlot) slots[s]; if (assemblyTable.isAssembling(slot.recipe)) - drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 196, - 1, 16, 16); + drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 196, 1, 16, 16); else if (assemblyTable.isPlanned(slot.recipe)) - drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 177, - 1, 16, 16); + drawTexturedModalRect(cornerX + slot.x, cornerY + slot.y, 177, 1, 16, 16); } int height = (int) assemblyTable.getCompletionRatio(70); - drawTexturedModalRect(cornerX + 95, cornerY + 36 + 70 - height, 176, - 18, 4, height); + drawTexturedModalRect(cornerX + 95, cornerY + 36 + 70 - height, 176, 18, 4, height); drawBackgroundSlots(); } @@ -158,12 +150,10 @@ public class GuiAssemblyTable extends GuiAdvancedInterface { ContainerAssemblyTable container = (ContainerAssemblyTable) inventorySlots; if (APIProxy.isRemote()) { - PacketPayload payload = TileAssemblyTable.selectionMessageWrapper - .toPayload(container.x, container.y, container.z, - message); + PacketPayload payload = TileAssemblyTable.selectionMessageWrapper.toPayload(container.x, container.y, + container.z, message); - PacketUpdate packet = new PacketUpdate( - PacketIds.SELECTION_ASSEMBLY, payload); + PacketUpdate packet = new PacketUpdate(PacketIds.SELECTION_ASSEMBLY, payload); packet.posX = assemblyTable.xCoord; packet.posY = assemblyTable.yCoord; packet.posZ = assemblyTable.zCoord; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiHandler.java index 05eaea80..1639dad7 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/silicon/GuiHandler.java @@ -10,8 +10,7 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; @@ -23,8 +22,7 @@ public class GuiHandler implements IGuiHandler { case GuiIds.ASSEMBLY_TABLE: if (!(tile instanceof TileAssemblyTable)) return null; - return new GuiAssemblyTable(player.inventory, - (TileAssemblyTable) tile); + return new GuiAssemblyTable(player.inventory, (TileAssemblyTable) tile); default: return null; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java index ec2be1ed..3df9a4e5 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java @@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler { @Override public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, - new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); + MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); } @Override - public void onLogin(NetworkManager network, Packet1Login login) { - } + public void onLogin(NetworkManager network, Packet1Login login) {} @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { - } + public void onDisconnect(NetworkManager network, String message, Object[] args) {} } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java index 2a41fafb..5da86f77 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java @@ -17,11 +17,9 @@ import net.minecraft.src.forge.IPacketHandler; public class PacketHandler implements IPacketHandler { @Override - public void onPacketData(NetworkManager network, String channel, - byte[] bytes) { + public void onPacketData(NetworkManager network, String channel, byte[] bytes) { - DataInputStream data = new DataInputStream(new ByteArrayInputStream( - bytes)); + DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes)); try { NetClientHandler net = (NetClientHandler) network.getNetHandler(); @@ -47,8 +45,7 @@ public class PacketHandler implements IPacketHandler { GuiAssemblyTable gui = (GuiAssemblyTable) screen; SelectionMessage message = new SelectionMessage(); - TileAssemblyTable.selectionMessageWrapper.fromPayload(message, - packet.payload); + TileAssemblyTable.selectionMessageWrapper.fromPayload(message, packet.payload); gui.handleSelectionMessage(message); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiDiamondPipe.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiDiamondPipe.java index 9750d42d..5abdc040 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiDiamondPipe.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiDiamondPipe.java @@ -25,8 +25,7 @@ public class GuiDiamondPipe extends GuiAdvancedInterface { IInventory playerInventory; TileGenericPipe filterInventory; - public GuiDiamondPipe(IInventory playerInventory, - TileGenericPipe filterInventory) { + public GuiDiamondPipe(IInventory playerInventory, TileGenericPipe filterInventory) { super(new CraftingDiamondPipe(playerInventory, filterInventory)); this.playerInventory = playerInventory; this.filterInventory = filterInventory; @@ -38,25 +37,21 @@ public class GuiDiamondPipe extends GuiAdvancedInterface { for (int k = 0; k < 6; k++) for (int j1 = 0; j1 < 9; j1++) { int id = k * 9 + j1; - slots[id] = new IInventorySlot(8 + j1 * 18, 18 + k * 18, - filterInventory, j1 + k * 9); + slots[id] = new IInventorySlot(8 + j1 * 18, 18 + k * 18, filterInventory, j1 + k * 9); } } @Override protected void drawGuiContainerForegroundLayer() { - fontRenderer.drawString(filterInventory.getInvName(), - getCenteredOffset(filterInventory.getInvName()), 6, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, - ySize - 97, 0x404040); + fontRenderer.drawString(filterInventory.getInvName(), getCenteredOffset(filterInventory.getInvName()), 6, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040); drawForegroundSelection(); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine - .getTexture("/net/minecraft/src/buildcraft/transport/gui/filter.png"); + int i = mc.renderEngine.getTexture("/net/minecraft/src/buildcraft/transport/gui/filter.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(i); int j = (width - xSize) / 2; @@ -87,18 +82,15 @@ public class GuiDiamondPipe extends GuiAdvancedInterface { ItemStack newStack; if (playerStack != null) - newStack = new ItemStack(playerStack.itemID, 1, - playerStack.getItemDamage()); + newStack = new ItemStack(playerStack.itemID, 1, playerStack.getItemDamage()); else newStack = null; filterInventory.setInventorySlotContents(position, newStack); if (APIProxy.isRemote()) { - PacketSlotChange packet = new PacketSlotChange( - PacketIds.DIAMOND_PIPE_SELECT, filterInventory.xCoord, - filterInventory.yCoord, filterInventory.zCoord, - position, newStack); + PacketSlotChange packet = new PacketSlotChange(PacketIds.DIAMOND_PIPE_SELECT, filterInventory.xCoord, + filterInventory.yCoord, filterInventory.zCoord, position, newStack); CoreProxy.sendToServer(packet.getPacket()); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiGateInterface.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiGateInterface.java index 669589c3..7ce2fbc1 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiGateInterface.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiGateInterface.java @@ -176,8 +176,7 @@ public class GuiGateInterface extends GuiAdvancedInterface { slots = new AdvancedSlot[2]; slots[0] = new TriggerSlot(65, 54, pipe, 0); slots[1] = new ActionSlot(99, 54, pipe, 0); - } else if (pipe.gate.kind == GateKind.AND_2 - || pipe.gate.kind == GateKind.OR_2) { + } else if (pipe.gate.kind == GateKind.AND_2 || pipe.gate.kind == GateKind.OR_2) { nbEntries = 2; slots = new AdvancedSlot[4]; @@ -186,60 +185,49 @@ public class GuiGateInterface extends GuiAdvancedInterface { slots[1] = new TriggerSlot(65, 64, pipe, 1); slots[2] = new ActionSlot(99, 46, pipe, 0); slots[3] = new ActionSlot(99, 64, pipe, 1); - } else if (pipe.gate.kind == GateKind.AND_3 - || pipe.gate.kind == GateKind.OR_3) { + } else if (pipe.gate.kind == GateKind.AND_3 || pipe.gate.kind == GateKind.OR_3) { nbEntries = 4; slots = new AdvancedSlot[12]; for (int k = 0; k < 4; ++k) { - slots[position] = new TriggerSlot(60, 36 + 18 * k, pipe, - position); + slots[position] = new TriggerSlot(60, 36 + 18 * k, pipe, position); position++; } for (int k = 0; k < 4; ++k) { - slots[position] = new ActionSlot(112, 36 + 18 * k, pipe, - position - 4); + slots[position] = new ActionSlot(112, 36 + 18 * k, pipe, position - 4); position++; } for (int k = 0; k < 4; ++k) { - slots[position] = new TriggerParameterSlot(78, 36 + 18 * k, - pipe, position - 8); + slots[position] = new TriggerParameterSlot(78, 36 + 18 * k, pipe, position - 8); position++; } - } else if (pipe.gate.kind == GateKind.AND_4 - || pipe.gate.kind == GateKind.OR_4) { + } else if (pipe.gate.kind == GateKind.AND_4 || pipe.gate.kind == GateKind.OR_4) { nbEntries = 8; slots = new AdvancedSlot[24]; for (int k = 0; k < 4; ++k) { - slots[position] = new TriggerSlot(8, 36 + 18 * k, pipe, - position); + slots[position] = new TriggerSlot(8, 36 + 18 * k, pipe, position); position++; - slots[position] = new TriggerSlot(100, 36 + 18 * k, pipe, - position); + slots[position] = new TriggerSlot(100, 36 + 18 * k, pipe, position); position++; } for (int k = 0; k < 4; ++k) { - slots[position] = new ActionSlot(60, 36 + 18 * k, pipe, - position - 8); + slots[position] = new ActionSlot(60, 36 + 18 * k, pipe, position - 8); position++; - slots[position] = new ActionSlot(152, 36 + 18 * k, pipe, - position - 8); + slots[position] = new ActionSlot(152, 36 + 18 * k, pipe, position - 8); position++; } for (int k = 0; k < 4; ++k) { - slots[position] = new TriggerParameterSlot(26, 36 + 18 * k, - pipe, position - 16); + slots[position] = new TriggerParameterSlot(26, 36 + 18 * k, pipe, position - 16); position++; - slots[position] = new TriggerParameterSlot(118, 36 + 18 * k, - pipe, position - 16); + slots[position] = new TriggerParameterSlot(118, 36 + 18 * k, pipe, position - 16); position++; } } @@ -251,8 +239,7 @@ public class GuiGateInterface extends GuiAdvancedInterface { String name = _container.getGateName(); fontRenderer.drawString(name, getCenteredOffset(name), 15, 0x404040); - fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, - ySize - 97, 0x404040); + fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040); drawForegroundSelection(); } @@ -280,29 +267,24 @@ public class GuiGateInterface extends GuiAdvancedInterface { if (_container.getGateOrdinal() >= GateKind.AND_3.ordinal()) { TriggerParameter parameter = null; - if (slots[s + nbEntries * 2] != null - && slots[s + nbEntries * 2].isDefined()) - parameter = ((TriggerParameterSlot) slots[s + nbEntries - * 2]).getTriggerParameter(); + if (slots[s + nbEntries * 2] != null && slots[s + nbEntries * 2].isDefined()) + parameter = ((TriggerParameterSlot) slots[s + nbEntries * 2]).getTriggerParameter(); if (_container.isNearbyTriggerActive(trigger, parameter)) { mc.renderEngine.bindTexture(texture); - drawTexturedModalRect(cornerX + slot.x + 35, cornerY - + slot.y + 6, 176, 18, 18, 4); + drawTexturedModalRect(cornerX + slot.x + 35, cornerY + slot.y + 6, 176, 18, 18, 4); } if (trigger == null || !trigger.hasParameter()) { mc.renderEngine.bindTexture(texture); - drawTexturedModalRect(cornerX + slot.x + 17, cornerY - + slot.y - 1, 176, 0, 18, 18); + drawTexturedModalRect(cornerX + slot.x + 17, cornerY + slot.y - 1, 176, 0, 18, 18); } } else if (_container.isNearbyTriggerActive(trigger, null)) { mc.renderEngine.bindTexture(texture); - drawTexturedModalRect(cornerX + slot.x + 17, cornerY - + slot.y + 6, 176, 18, 18, 4); + drawTexturedModalRect(cornerX + slot.x + 17, cornerY + slot.y + 6, 176, 18, 18, 4); } } } @@ -398,8 +380,7 @@ public class GuiGateInterface extends GuiAdvancedInterface { if (param != null) { param.set(mc.thePlayer.inventory.getItemStack()); - _container.setTriggerParameter(position - nbEntries * 2, - param, true); + _container.setTriggerParameter(position - nbEntries * 2, param, true); } } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiHandler.java index bc3358a0..0e961dc1 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/GuiHandler.java @@ -9,8 +9,7 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (!world.blockExists(x, y, z)) return null; diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java index 75828eb4..766e2b81 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java @@ -49,6 +49,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { private final static EntityItem dummyEntityItem = new EntityItem(null); private class DisplayLiquidList { + public int[] sideHorizontal = new int[displayLiquidStages]; public int[] sideVertical = new int[displayLiquidStages]; public int[] centerHorizontal = new int[displayLiquidStages]; @@ -79,8 +80,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { displayLiquidLists.put(liquidId, d); BlockInterface block = new BlockInterface(); - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) block.texture = Block.blocksList[liquidId].blockIndexInTexture; else block.texture = Item.itemsList[liquidId].getIconFromDamage(0); @@ -205,13 +205,11 @@ public class RenderPipe extends TileEntitySpecialRenderer { for (int i = 0; i < displayPowerStages; ++i) displayPowerLimits[displayPowerStages - i - 1] = maxPower - - Math.sqrt(maxPower * maxPower / (displayPowerStages - 1) - * i); + - Math.sqrt(maxPower * maxPower / (displayPowerStages - 1) * i); } @Override - public void renderTileEntityAt(TileEntity tileentity, double x, double y, - double z, float f) { + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { if (BuildCraftCore.render == RenderMode.NoDynamic) return; @@ -239,8 +237,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glDisable(2896 /* GL_LIGHTING */); - MinecraftForgeClient - .bindTexture(BuildCraftCore.customBuildCraftTexture); + MinecraftForgeClient.bindTexture(BuildCraftCore.customBuildCraftTexture); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); @@ -284,14 +281,12 @@ public class RenderPipe extends TileEntitySpecialRenderer { for (int i = 0; i < 6; ++i) if (liq.getSide(i) > 0) { - DisplayLiquidList d = getListFromBuffer(liq.side[i], - pipe.worldObj); + DisplayLiquidList d = getListFromBuffer(liq.side[i], pipe.worldObj); if (d == null) continue; - int stage = (int) ((float) liq.getSide(i) - / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); + int stage = (int) ((float) liq.getSide(i) / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); GL11.glPushMatrix(); int list = 0; @@ -326,8 +321,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { DisplayLiquidList d = getListFromBuffer(liq.center, pipe.worldObj); if (d != null) { - int stage = (int) ((float) liq.getCenter() - / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); + int stage = (int) ((float) liq.getCenter() / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); if (above) GL11.glCallList(d.centerVertical[stage]); @@ -351,15 +345,13 @@ public class RenderPipe extends TileEntitySpecialRenderer { Object o = null; - if (liquidId < Block.blocksList.length - && Block.blocksList[liquidId] != null) + if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) o = Block.blocksList[liquidId]; else o = Item.itemsList[liquidId]; if (o instanceof ITextureProvider) - MinecraftForgeClient.bindTexture(((ITextureProvider) o) - .getTextureFile()); + MinecraftForgeClient.bindTexture(((ITextureProvider) o).getTextureFile()); else MinecraftForgeClient.bindTexture("/terrain.png"); @@ -370,12 +362,9 @@ public class RenderPipe extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glDisable(2896 /* GL_LIGHTING */); - for (EntityData data : ((PipeTransportItems) pipe.transport).travelingEntities - .values()) - doRenderItem(data.item, x + data.item.posX - pipe.xCoord, y - + data.item.posY - pipe.yCoord, z + data.item.posZ - - pipe.zCoord, pipe.worldObj.getLightBrightness( - pipe.xCoord, pipe.yCoord, pipe.zCoord)); + for (EntityData data : ((PipeTransportItems) pipe.transport).travelingEntities.values()) + doRenderItem(data.item, x + data.item.posX - pipe.xCoord, y + data.item.posY - pipe.yCoord, z + data.item.posZ + - pipe.zCoord, pipe.worldObj.getLightBrightness(pipe.xCoord, pipe.yCoord, pipe.zCoord)); GL11.glEnable(2896 /* GL_LIGHTING */); GL11.glPopMatrix(); @@ -383,8 +372,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { private Random random = new Random(); - public void doRenderItem(EntityPassiveItem entityitem, double d, double d1, - double d2, float f1) { + public void doRenderItem(EntityPassiveItem entityitem, double d, double d1, double d2, float f1) { if (entityitem == null || entityitem.item == null) return; @@ -405,8 +393,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glEnable(32826 /* GL_RESCALE_NORMAL_EXT */); - IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer( - itemstack, ItemRenderType.ENTITY); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, ItemRenderType.ENTITY); if (customRenderer != null) { @@ -430,21 +417,16 @@ public class RenderPipe extends TileEntitySpecialRenderer { RenderPipe.dummyEntityItem.item = itemstack; - customRenderer.renderItem(ItemRenderType.ENTITY, itemstack, - renderBlocks, RenderPipe.dummyEntityItem); + customRenderer.renderItem(ItemRenderType.ENTITY, itemstack, renderBlocks, RenderPipe.dummyEntityItem); GL11.glPopMatrix(); } - } else if (itemstack.itemID < Block.blocksList.length - && Block.blocksList[itemstack.itemID] != null - && RenderBlocks - .renderItemIn3d(Block.blocksList[itemstack.itemID] - .getRenderType())) { + } else if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null + && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) { GL11.glTranslatef(0, 0.25F, 0); // BC SPECIFIC loadTexture("/terrain.png"); - ForgeHooksClient - .overrideTexture(Block.blocksList[itemstack.itemID]); + ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]); float f4 = 0.25F; int j = Block.blocksList[itemstack.itemID].getRenderType(); if (j == 1 || j == 19 || j == 12 || j == 2) @@ -457,15 +439,12 @@ public class RenderPipe extends TileEntitySpecialRenderer { if (k > 0) { float f6 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; float f9 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; - float f11 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) - / f4; + float f11 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4; GL11.glTranslatef(f6, f9, f11); } float f7 = 1.0F; - renderBlocks.renderBlockAsItem( - Block.blocksList[itemstack.itemID], - itemstack.getItemDamage(), f7); + renderBlocks.renderBlockAsItem(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), f7); GL11.glPopMatrix(); } @@ -474,23 +453,18 @@ public class RenderPipe extends TileEntitySpecialRenderer { if (itemstack.getItem().requiresMultipleRenderPasses()) { GL11.glScalef(0.5F, 0.5F, 0.5F); - this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", - Item.itemsList[itemstack.itemID])); + this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID])); for (int i = 0; i <= 1; ++i) { - int iconIndex = itemstack.getItem().func_46057_a( - itemstack.getItemDamage(), i); + int iconIndex = itemstack.getItem().func_46057_a(itemstack.getItemDamage(), i); float scale = 1.0F; if (true) { - int var17 = Item.itemsList[itemstack.itemID] - .getColorFromDamage(itemstack.getItemDamage(), - i); + int var17 = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage(), i); float var18 = (var17 >> 16 & 255) / 255.0F; float var19 = (var17 >> 8 & 255) / 255.0F; float var20 = (var17 & 255) / 255.0F; - GL11.glColor4f(var18 * scale, var19 * scale, var20 - * scale, 1.0F); + GL11.glColor4f(var18 * scale, var19 * scale, var20 * scale, 1.0F); } this.drawItem(iconIndex, quantity); @@ -499,15 +473,12 @@ public class RenderPipe extends TileEntitySpecialRenderer { GL11.glScalef(0.5F, 0.5F, 0.5F); int i = itemstack.getIconIndex(); - if (itemstack.itemID < Block.blocksList.length - && Block.blocksList[itemstack.itemID] != null) { + if (itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null) { loadTexture("/terrain.png"); - ForgeHooksClient - .overrideTexture(Block.blocksList[itemstack.itemID]); + ForgeHooksClient.overrideTexture(Block.blocksList[itemstack.itemID]); } else { loadTexture("/gui/items.png"); - ForgeHooksClient - .overrideTexture(Item.itemsList[itemstack.itemID]); + ForgeHooksClient.overrideTexture(Item.itemsList[itemstack.itemID]); } drawItem(i, quantity); @@ -538,18 +509,13 @@ public class RenderPipe extends TileEntitySpecialRenderer { GL11.glTranslatef(var12, var13, var14); } - GL11.glRotatef(180.0F - RenderManager.instance.playerViewY, 0.0F, - 1.0F, 0.0F); + GL11.glRotatef(180.0F - RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 1.0F, 0.0F); - tesselator.addVertexWithUV((0.0F - var9), (0.0F - var10), 0.0D, - var4, var7); - tesselator.addVertexWithUV((var8 - var9), (0.0F - var10), 0.0D, - var5, var7); - tesselator.addVertexWithUV((var8 - var9), (1.0F - var10), 0.0D, - var5, var6); - tesselator.addVertexWithUV((0.0F - var9), (1.0F - var10), 0.0D, - var4, var6); + tesselator.addVertexWithUV((0.0F - var9), (0.0F - var10), 0.0D, var4, var7); + tesselator.addVertexWithUV((var8 - var9), (0.0F - var10), 0.0D, var5, var7); + tesselator.addVertexWithUV((var8 - var9), (1.0F - var10), 0.0D, var5, var6); + tesselator.addVertexWithUV((0.0F - var9), (1.0F - var10), 0.0D, var4, var6); tesselator.draw(); GL11.glPopMatrix(); } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java index 272df443..cf3789df 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/TileEntityPickupFX.java @@ -26,8 +26,7 @@ public class TileEntityPickupFX extends EntityFX { private double yDestination; public TileEntityPickupFX(World world, EntityItem entity, TileEntity entity1) { - super(world, entity.posX, entity.posY, entity.posZ, entity.motionX, - entity.motionY, entity.motionZ); + super(world, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ); field_678_p = 0; field_677_q = 0; field_675_a = entity; @@ -38,8 +37,7 @@ public class TileEntityPickupFX extends EntityFX { } @Override - public void renderParticle(Tessellator tessellator, float f, float f1, - float f2, float f3, float f4, float f5) { + public void renderParticle(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) { float f6 = (field_678_p + f) / field_677_q; f6 *= f6; double d = field_675_a.posX; @@ -61,8 +59,7 @@ public class TileEntityPickupFX extends EntityFX { GL11.glColor4f(f7, f7, f7, 1.0F); if (RenderManager.instance.renderEngine != null) - RenderManager.instance.renderEntityWithPosYaw(field_675_a, - (float) d6, (float) d7, (float) d8, + RenderManager.instance.renderEntityWithPosYaw(field_675_a, (float) d6, (float) d7, (float) d8, field_675_a.rotationYaw, f); } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/TransportProxy.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/TransportProxy.java index af2310e6..6f060801 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/TransportProxy.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/TransportProxy.java @@ -16,10 +16,8 @@ import net.minecraft.src.World; public class TransportProxy { - static public void obsidianPipePickup(World world, EntityItem item, - TileEntity tile) { - ModLoader.getMinecraftInstance().effectRenderer - .addEffect(new TileEntityPickupFX(world, item, tile)); + static public void obsidianPipePickup(World world, EntityItem item, TileEntity tile) { + ModLoader.getMinecraftInstance().effectRenderer.addEffect(new TileEntityPickupFX(world, item, tile)); } } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java index 425fd1f2..49ee9fca 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java @@ -10,17 +10,13 @@ public class ConnectionHandler implements IConnectionHandler { @Override public void onConnect(NetworkManager network) { - MessageManager.getInstance().registerChannel(network, - new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); + MessageManager.getInstance().registerChannel(network, new PacketHandler(), DefaultProps.NET_CHANNEL_NAME); } @Override - public void onLogin(NetworkManager network, Packet1Login login) { - } + public void onLogin(NetworkManager network, Packet1Login login) {} @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { - } + public void onDisconnect(NetworkManager network, String message, Object[] args) {} } diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/network/PacketHandler.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/network/PacketHandler.java index 790d5573..1ce9620e 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/network/PacketHandler.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/network/PacketHandler.java @@ -25,11 +25,9 @@ import net.minecraft.src.forge.IPacketHandler; public class PacketHandler implements IPacketHandler { @Override - public void onPacketData(NetworkManager network, String channel, - byte[] bytes) { + public void onPacketData(NetworkManager network, String channel, byte[] bytes) { - DataInputStream data = new DataInputStream(new ByteArrayInputStream( - bytes)); + DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes)); try { NetClientHandler net = (NetClientHandler) network.getNetHandler(); @@ -125,8 +123,7 @@ public class PacketHandler implements IPacketHandler { if (!world.blockExists(packet.posX, packet.posY, packet.posZ)) return; - TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, - packet.posZ); + TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, packet.posZ); if (!(entity instanceof ISynchronizedTile)) return; @@ -145,8 +142,7 @@ public class PacketHandler implements IPacketHandler { if (!world.blockExists(packet.posX, packet.posY, packet.posZ)) return; - TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, - packet.posZ); + TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, packet.posZ); if (!(entity instanceof TileGenericPipe)) return; @@ -172,8 +168,7 @@ public class PacketHandler implements IPacketHandler { if (!world.blockExists(packet.posX, packet.posY, packet.posZ)) return; - TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, - packet.posZ); + TileEntity entity = world.getBlockTileEntity(packet.posX, packet.posY, packet.posZ); if (!(entity instanceof TileGenericPipe)) return; diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftCore.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftCore.java index 0b106704..9dd4f01f 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftCore.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftCore.java @@ -46,6 +46,7 @@ public class mod_BuildCraftCore extends NetworkMod { BuildCraftCore proxy = new BuildCraftCore(); public static class EntityRenderIndex { + public EntityRenderIndex(Block block, int damage) { this.block = block; this.damage = damage; @@ -84,12 +85,9 @@ public class mod_BuildCraftCore extends NetworkMod { if (!initialized) { initializeMarkerMatrix(); - MinecraftForgeClient - .preloadTexture(BuildCraftCore.customBuildCraftTexture); - MinecraftForgeClient - .preloadTexture(BuildCraftCore.customBuildCraftSprites); - MinecraftForgeClient - .preloadTexture(BuildCraftCore.externalBuildCraftTexture); + MinecraftForgeClient.preloadTexture(BuildCraftCore.customBuildCraftTexture); + MinecraftForgeClient.preloadTexture(BuildCraftCore.customBuildCraftSprites); + MinecraftForgeClient.preloadTexture(BuildCraftCore.externalBuildCraftTexture); initialized = true; } @@ -121,8 +119,7 @@ public class mod_BuildCraftCore extends NetworkMod { } @Override - public boolean renderWorldBlock(RenderBlocks renderblocks, - IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) { + public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) { if (block.getRenderType() == BuildCraftCore.blockByEntityModel) { // renderblocks.renderStandardBlock(block, i, j, k); @@ -133,26 +130,21 @@ public class mod_BuildCraftCore extends NetworkMod { if (Block.lightValue[block.blockID] > 0) f = 1.0F; tessellator.setColorOpaque_F(f, f, f); - renderMarkerWithMeta(iblockaccess, block, i, j, k, - iblockaccess.getBlockMetadata(i, j, k)); + renderMarkerWithMeta(iblockaccess, block, i, j, k, iblockaccess.getBlockMetadata(i, j, k)); } else if (block.getRenderType() == BuildCraftCore.pipeModel) { - PersistentTile tile = PersistentWorld.getWorld(iblockaccess) - .getTile(new BlockIndex(i, j, k)); + PersistentTile tile = PersistentWorld.getWorld(iblockaccess).getTile(new BlockIndex(i, j, k)); if (tile == null || !(tile instanceof IPipe)) legacyPipeRender(renderblocks, iblockaccess, i, j, k, block, l); else - pipeRender(renderblocks, iblockaccess, tile.tile, (IPipe) tile, - block, l); + pipeRender(renderblocks, iblockaccess, tile.tile, (IPipe) tile, block, l); } else if (block.getRenderType() == BuildCraftCore.oilModel) renderblocks.renderBlockFluids(block, i, j, k); return true; } - private void pipeRender(RenderBlocks renderblocks, - IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, - Block block, int l) { + private void pipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, Block block, int l) { ITileBufferHolder holder = (ITileBufferHolder) tile; float minSize = Utils.pipeMinPos; @@ -161,113 +153,84 @@ public class mod_BuildCraftCore extends NetworkMod { pipe.setDrawingState(DrawingState.DrawingPipe); pipe.prepareTextureFor(Orientations.Unknown); - block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, - maxSize); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, maxSize); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); - if (Utils - .checkPipesConnections(tile, holder.getTile(Orientations.XNeg))) { + if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.XNeg))) { pipe.prepareTextureFor(Orientations.XNeg); - block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, - maxSize); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, maxSize); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (Utils - .checkPipesConnections(tile, holder.getTile(Orientations.XPos))) { + if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.XPos))) { pipe.prepareTextureFor(Orientations.XPos); - block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, - maxSize); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, maxSize); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (Utils - .checkPipesConnections(tile, holder.getTile(Orientations.YNeg))) { + if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.YNeg))) { pipe.prepareTextureFor(Orientations.YNeg); - block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, - maxSize); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, maxSize); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (Utils - .checkPipesConnections(tile, holder.getTile(Orientations.YPos))) { + if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.YPos))) { pipe.prepareTextureFor(Orientations.YPos); - block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, - maxSize); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, maxSize); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (Utils - .checkPipesConnections(tile, holder.getTile(Orientations.ZNeg))) { + if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZNeg))) { pipe.prepareTextureFor(Orientations.ZNeg); - block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, - minSize); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, minSize); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (Utils - .checkPipesConnections(tile, holder.getTile(Orientations.ZPos))) { + if (Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZPos))) { pipe.prepareTextureFor(Orientations.ZPos); - block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, - 1.0F); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, 1.0F); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); pipe.prepareTextureFor(Orientations.Unknown); - MinecraftForgeClient - .bindTexture(BuildCraftCore.customBuildCraftTexture); + MinecraftForgeClient.bindTexture(BuildCraftCore.customBuildCraftTexture); if (pipe.isWired(IPipe.WireColor.Red)) { pipe.setDrawingState(DrawingState.DrawingRedWire); - pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, - l, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMinPos, - IPipe.WireColor.Red); + pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMinPos, Utils.pipeMaxPos, + Utils.pipeMinPos, IPipe.WireColor.Red); } if (pipe.isWired(IPipe.WireColor.Blue)) { pipe.setDrawingState(DrawingState.DrawingBlueWire); - pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, - l, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos, - IPipe.WireColor.Blue); + pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMaxPos, Utils.pipeMaxPos, + Utils.pipeMaxPos, IPipe.WireColor.Blue); } if (pipe.isWired(IPipe.WireColor.Green)) { pipe.setDrawingState(DrawingState.DrawingGreenWire); - pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, - l, Utils.pipeMaxPos, Utils.pipeMinPos, Utils.pipeMinPos, - IPipe.WireColor.Green); + pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMaxPos, Utils.pipeMinPos, + Utils.pipeMinPos, IPipe.WireColor.Green); } if (pipe.isWired(IPipe.WireColor.Yellow)) { pipe.setDrawingState(DrawingState.DrawingYellowWire); - pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, - l, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, - IPipe.WireColor.Yellow); + pipeRedstoneRender(renderblocks, iblockaccess, tile, pipe, block, l, Utils.pipeMinPos, Utils.pipeMinPos, + Utils.pipeMaxPos, IPipe.WireColor.Yellow); } if (pipe.hasInterface()) - pipeInterfaceRender(renderblocks, iblockaccess, tile, pipe, block, - l); + pipeInterfaceRender(renderblocks, iblockaccess, tile, pipe, block, l); } - private boolean isConnectedWiredPipe(IPipe pipe, TileEntity tile2, - IPipe.WireColor color) { + private boolean isConnectedWiredPipe(IPipe pipe, TileEntity tile2, IPipe.WireColor color) { return pipe.isWireConnectedTo(tile2, color); } - private void pipeRedstoneRender(RenderBlocks renderblocks, - IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, - Block block, int l, float cx, float cy, float cz, - IPipe.WireColor color) { + private void pipeRedstoneRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, + Block block, int l, float cx, float cy, float cz, IPipe.WireColor color) { ITileBufferHolder holder = (ITileBufferHolder) tile; @@ -354,56 +317,41 @@ public class mod_BuildCraftCore extends NetworkMod { // Z render if (minZ != Utils.pipeMinPos || maxZ != Utils.pipeMaxPos || !found) { - block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, - cy == Utils.pipeMinPos ? cy - 0.05F : cy, minZ, - cx == Utils.pipeMinPos ? cx : cx + 0.05F, - cy == Utils.pipeMinPos ? cy : cy + 0.05F, maxZ); + block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, cy == Utils.pipeMinPos ? cy - 0.05F : cy, minZ, + cx == Utils.pipeMinPos ? cx : cx + 0.05F, cy == Utils.pipeMinPos ? cy : cy + 0.05F, maxZ); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } // X render if (minX != Utils.pipeMinPos || maxX != Utils.pipeMaxPos || !found) { - block.setBlockBounds(minX, - cy == Utils.pipeMinPos ? cy - 0.05F : cy, - cz == Utils.pipeMinPos ? cz - 0.05F : cz, maxX, - cy == Utils.pipeMinPos ? cy : cy + 0.05F, - cz == Utils.pipeMinPos ? cz : cz + 0.05F); + block.setBlockBounds(minX, cy == Utils.pipeMinPos ? cy - 0.05F : cy, cz == Utils.pipeMinPos ? cz - 0.05F : cz, maxX, + cy == Utils.pipeMinPos ? cy : cy + 0.05F, cz == Utils.pipeMinPos ? cz : cz + 0.05F); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } // Y render if (minY != Utils.pipeMinPos || maxY != Utils.pipeMaxPos || !found) { - block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, - minY, cz == Utils.pipeMinPos ? cz - 0.05F : cz, - cx == Utils.pipeMinPos ? cx : cx + 0.05F, maxY, - cz == Utils.pipeMinPos ? cz : cz + 0.05F); + block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, minY, cz == Utils.pipeMinPos ? cz - 0.05F : cz, + cx == Utils.pipeMinPos ? cx : cx + 0.05F, maxY, cz == Utils.pipeMinPos ? cz : cz + 0.05F); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } if (center || !found) { - block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, - cy == Utils.pipeMinPos ? cy - 0.05F : cy, - cz == Utils.pipeMinPos ? cz - 0.05F : cz, - cx == Utils.pipeMinPos ? cx : cx + 0.05F, - cy == Utils.pipeMinPos ? cy : cy + 0.05F, - cz == Utils.pipeMinPos ? cz : cz + 0.05F); + block.setBlockBounds(cx == Utils.pipeMinPos ? cx - 0.05F : cx, cy == Utils.pipeMinPos ? cy - 0.05F : cy, + cz == Utils.pipeMinPos ? cz - 0.05F : cz, cx == Utils.pipeMinPos ? cx : cx + 0.05F, + cy == Utils.pipeMinPos ? cy : cy + 0.05F, cz == Utils.pipeMinPos ? cz : cz + 0.05F); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } } - private void pipeInterfaceRender(RenderBlocks renderblocks, - IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, + private void pipeInterfaceRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, TileEntity tile, IPipe pipe, Block block, int l) { ITileBufferHolder holder = (ITileBufferHolder) tile; @@ -413,182 +361,133 @@ public class mod_BuildCraftCore extends NetworkMod { float min = Utils.pipeMinPos + 0.05F; float max = Utils.pipeMaxPos - 0.05F; - if (!Utils.checkPipesConnections(tile, - holder.getTile(Orientations.XNeg))) { - block.setBlockBounds(Utils.pipeMinPos - 0.10F, min, min, - Utils.pipeMinPos, max, max); + if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.XNeg))) { + block.setBlockBounds(Utils.pipeMinPos - 0.10F, min, min, Utils.pipeMinPos, max, max); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (!Utils.checkPipesConnections(tile, - holder.getTile(Orientations.XPos))) { - block.setBlockBounds(Utils.pipeMaxPos, min, min, - Utils.pipeMaxPos + 0.10F, max, max); + if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.XPos))) { + block.setBlockBounds(Utils.pipeMaxPos, min, min, Utils.pipeMaxPos + 0.10F, max, max); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (!Utils.checkPipesConnections(tile, - holder.getTile(Orientations.YNeg))) { - block.setBlockBounds(min, Utils.pipeMinPos - 0.10F, min, max, - Utils.pipeMinPos, max); + if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.YNeg))) { + block.setBlockBounds(min, Utils.pipeMinPos - 0.10F, min, max, Utils.pipeMinPos, max); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (!Utils.checkPipesConnections(tile, - holder.getTile(Orientations.YPos))) { - block.setBlockBounds(min, Utils.pipeMaxPos, min, max, - Utils.pipeMaxPos + 0.10F, max); + if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.YPos))) { + block.setBlockBounds(min, Utils.pipeMaxPos, min, max, Utils.pipeMaxPos + 0.10F, max); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (!Utils.checkPipesConnections(tile, - holder.getTile(Orientations.ZNeg))) { - block.setBlockBounds(min, min, Utils.pipeMinPos - 0.10F, max, max, - Utils.pipeMinPos); + if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZNeg))) { + block.setBlockBounds(min, min, Utils.pipeMinPos - 0.10F, max, max, Utils.pipeMinPos); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } - if (!Utils.checkPipesConnections(tile, - holder.getTile(Orientations.ZPos))) { - block.setBlockBounds(min, min, Utils.pipeMaxPos, max, max, - Utils.pipeMaxPos + 0.10F); + if (!Utils.checkPipesConnections(tile, holder.getTile(Orientations.ZPos))) { + block.setBlockBounds(min, min, Utils.pipeMaxPos, max, max, Utils.pipeMaxPos + 0.10F); - renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, - tile.zCoord); + renderblocks.renderStandardBlock(block, tile.xCoord, tile.yCoord, tile.zCoord); } } - private void legacyPipeRender(RenderBlocks renderblocks, - IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) { + private void legacyPipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) { float minSize = Utils.pipeMinPos; float maxSize = Utils.pipeMaxPos; - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.Unknown); - block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, - maxSize); + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.Unknown); + block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, maxSize); renderblocks.renderStandardBlock(block, i, j, k); - if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i - 1, j, - k)) { - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.XNeg); - block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, - maxSize); + if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i - 1, j, k)) { + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.XNeg); + block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, maxSize); renderblocks.renderStandardBlock(block, i, j, k); } - if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i + 1, j, - k)) { - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.XPos); - block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, - maxSize); + if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i + 1, j, k)) { + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.XPos); + block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, maxSize); renderblocks.renderStandardBlock(block, i, j, k); } - if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j - 1, - k)) { - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.YNeg); - block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, - maxSize); + if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j - 1, k)) { + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.YNeg); + block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, maxSize); renderblocks.renderStandardBlock(block, i, j, k); } - if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j + 1, - k)) { - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.YPos); - block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, - maxSize); + if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j + 1, k)) { + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.YPos); + block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, maxSize); renderblocks.renderStandardBlock(block, i, j, k); } - if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j, - k - 1)) { - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.ZNeg); - block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, - minSize); + if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j, k - 1)) { + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.ZNeg); + block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, minSize); renderblocks.renderStandardBlock(block, i, j, k); } - if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j, - k + 1)) { - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.ZPos); - block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, - 1.0F); + if (Utils.checkLegacyPipesConnections(iblockaccess, i, j, k, i, j, k + 1)) { + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.ZPos); + block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, 1.0F); renderblocks.renderStandardBlock(block, i, j, k); } block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, - Orientations.Unknown); + ((IBlockPipe) block).prepareTextureFor(iblockaccess, i, j, k, Orientations.Unknown); } RenderItem itemRenderer = new RenderItem(); @Override - public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, - int j) { + public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) { if (block.getRenderType() == BuildCraftCore.blockByEntityModel) { EntityRenderIndex index = new EntityRenderIndex(block, i); if (blockByEntityRenders.containsKey(index)) - blockByEntityRenders.get(index).inventoryRender(-0.5, -0.5, - -0.5, 0, 0); + blockByEntityRenders.get(index).inventoryRender(-0.5, -0.5, -0.5, 0, 0); } else if (block.getRenderType() == BuildCraftCore.markerModel) { // Do nothing here... } else if (block.getRenderType() == BuildCraftCore.pipeModel) { Tessellator tessellator = Tessellator.instance; - block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, - Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); + block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); block.setBlockBoundsForItemRender(); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); - renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(0, i)); + renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(1, i)); + renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); - renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(2, i)); + renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(3, i)); + renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); - renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(4, i)); + renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(5, i)); + renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, i)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); @@ -610,8 +509,7 @@ public class mod_BuildCraftCore extends NetworkMod { } public static void initializeMarkerMatrix() { - double frontXBase[][] = { { -0.0625, -0.0625, -0.0625, -0.0625 }, - { 1, 0, 0, 1 }, { -0.5, -0.5, 0.5, 0.5 } }; + double frontXBase[][] = { { -0.0625, -0.0625, -0.0625, -0.0625 }, { 1, 0, 0, 1 }, { -0.5, -0.5, 0.5, 0.5 } }; frontX[3] = safeClone(frontXBase); rotateFace(frontX[3]); @@ -627,8 +525,7 @@ public class mod_BuildCraftCore extends NetworkMod { rotateFace(frontX[0]); rotateFace(frontX[0]); - double frontZBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, { 1, 0, 0, 1 }, - { 0.0625, 0.0625, 0.0625, 0.0625 } }; + double frontZBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, { 1, 0, 0, 1 }, { 0.0625, 0.0625, 0.0625, 0.0625 } }; frontZ[5] = safeClone(frontZBase); @@ -644,9 +541,7 @@ public class mod_BuildCraftCore extends NetworkMod { rotateFace(frontZ[0]); rotateFace(frontZ[0]); - double frontYBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, - { -0.0625, -0.0625, -0.0625, -0.0625 }, - { 0.5, -0.5, -0.5, 0.5 } }; + double frontYBase[][] = { { -0.5, -0.5, 0.5, 0.5 }, { -0.0625, -0.0625, -0.0625, -0.0625 }, { 0.5, -0.5, -0.5, 0.5 } }; frontY[4] = safeClone(frontYBase); rotateFace(frontY[4]); @@ -664,8 +559,7 @@ public class mod_BuildCraftCore extends NetworkMod { } - public void renderMarkerWithMeta(IBlockAccess iblockaccess, Block block, - double x, double y, double z, int meta) { + public void renderMarkerWithMeta(IBlockAccess iblockaccess, Block block, double x, double y, double z, int meta) { Tessellator tessellator = Tessellator.instance; int xCoord = (int) x; @@ -736,63 +630,39 @@ public class mod_BuildCraftCore extends NetworkMod { d8 = f2 + 0.0234375D; if (meta == 5 || meta == 4 || meta == 3 || meta == 0) { - tessellator.addVertexWithUV(x + frontX[m][0][0], y - + frontX[m][1][0], z + frontX[m][2][0], f, f2); - tessellator.addVertexWithUV(x + frontX[m][0][1], y - + frontX[m][1][1], z + frontX[m][2][1], f, f3); - tessellator.addVertexWithUV(x + frontX[m][0][2], y - + frontX[m][1][2], z + frontX[m][2][2], f1, f3); - tessellator.addVertexWithUV(x + frontX[m][0][3], y - + frontX[m][1][3], z + frontX[m][2][3], f1, f2); + tessellator.addVertexWithUV(x + frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], f, f2); + tessellator.addVertexWithUV(x + frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], f, f3); + tessellator.addVertexWithUV(x + frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], f1, f3); + tessellator.addVertexWithUV(x + frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], f1, f2); - tessellator.addVertexWithUV(x - frontX[m][0][3], y - + frontX[m][1][3], z + frontX[m][2][3], f1, f2); - tessellator.addVertexWithUV(x - frontX[m][0][2], y - + frontX[m][1][2], z + frontX[m][2][2], f1, f3); - tessellator.addVertexWithUV(x - frontX[m][0][1], y - + frontX[m][1][1], z + frontX[m][2][1], f, f3); - tessellator.addVertexWithUV(x - frontX[m][0][0], y - + frontX[m][1][0], z + frontX[m][2][0], f, f2); + tessellator.addVertexWithUV(x - frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], f1, f2); + tessellator.addVertexWithUV(x - frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], f1, f3); + tessellator.addVertexWithUV(x - frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], f, f3); + tessellator.addVertexWithUV(x - frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], f, f2); } if (meta == 5 || meta == 2 || meta == 1 || meta == 0) { - tessellator.addVertexWithUV(x + frontZ[m][0][0], y - + frontZ[m][1][0], z + frontZ[m][2][0], f, f2); - tessellator.addVertexWithUV(x + frontZ[m][0][1], y - + frontZ[m][1][1], z + frontZ[m][2][1], f, f3); - tessellator.addVertexWithUV(x + frontZ[m][0][2], y - + frontZ[m][1][2], z + frontZ[m][2][2], f1, f3); - tessellator.addVertexWithUV(x + frontZ[m][0][3], y - + frontZ[m][1][3], z + frontZ[m][2][3], f1, f2); + tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z + frontZ[m][2][0], f, f2); + tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z + frontZ[m][2][1], f, f3); + tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z + frontZ[m][2][2], f1, f3); + tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z + frontZ[m][2][3], f1, f2); - tessellator.addVertexWithUV(x + frontZ[m][0][3], y - + frontZ[m][1][3], z - frontZ[m][2][3], f1, f2); - tessellator.addVertexWithUV(x + frontZ[m][0][2], y - + frontZ[m][1][2], z - frontZ[m][2][2], f1, f3); - tessellator.addVertexWithUV(x + frontZ[m][0][1], y - + frontZ[m][1][1], z - frontZ[m][2][1], f, f3); - tessellator.addVertexWithUV(x + frontZ[m][0][0], y - + frontZ[m][1][0], z - frontZ[m][2][0], f, f2); + tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z - frontZ[m][2][3], f1, f2); + tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z - frontZ[m][2][2], f1, f3); + tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z - frontZ[m][2][1], f, f3); + tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z - frontZ[m][2][0], f, f2); } if (meta == 4 || meta == 3 || meta == 2 || meta == 1) { - tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 - + frontY[m][1][0], z + frontY[m][2][0], f, f2); - tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 - + frontY[m][1][1], z + frontY[m][2][1], f, f3); - tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 - + frontY[m][1][2], z + frontY[m][2][2], f1, f3); - tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 - + frontY[m][1][3], z + frontY[m][2][3], f1, f2); + tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 + frontY[m][1][0], z + frontY[m][2][0], f, f2); + tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 + frontY[m][1][1], z + frontY[m][2][1], f, f3); + tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 + frontY[m][1][2], z + frontY[m][2][2], f1, f3); + tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 + frontY[m][1][3], z + frontY[m][2][3], f1, f2); - tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 - - frontY[m][1][3], z + frontY[m][2][3], f1, f2); - tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 - - frontY[m][1][2], z + frontY[m][2][2], f1, f3); - tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 - - frontY[m][1][1], z + frontY[m][2][1], f, f3); - tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 - - frontY[m][1][0], z + frontY[m][2][0], f, f2); + tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 - frontY[m][1][3], z + frontY[m][2][3], f1, f2); + tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 - frontY[m][1][2], z + frontY[m][2][2], f1, f3); + tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 - frontY[m][1][1], z + frontY[m][2][1], f, f3); + tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 - frontY[m][1][0], z + frontY[m][2][0], f, f2); } } @@ -816,8 +686,7 @@ public class mod_BuildCraftCore extends NetworkMod { if (d.getTime() - lastReport > 10000) { lastReport = d.getTime(); int bytes = ClassMapping.report(); - System.out.println("BuildCraft bandwidth = " + (bytes / 10) - + " bytes / second"); + System.out.println("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second"); System.out.println(); } } diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftDevel.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftDevel.java index 29ddecb0..1d7d2183 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftDevel.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftDevel.java @@ -26,15 +26,13 @@ public class mod_BuildCraftDevel extends NetworkMod { mod_BuildCraftCore.initialize(); - Property cheatId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("cheat.id", 255); + Property cheatId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("cheat.id", 255); CraftingManager craftingmanager = CraftingManager.getInstance(); cheatBlock = new BlockCheat(Integer.parseInt(cheatId.value)); ModLoader.registerBlock(cheatBlock); - craftingmanager.addRecipe(new ItemStack(cheatBlock, 1), new Object[] { - "# ", " ", Character.valueOf('#'), Block.dirt }); + craftingmanager.addRecipe(new ItemStack(cheatBlock, 1), new Object[] { "# ", " ", Character.valueOf('#'), Block.dirt }); BuildCraftCore.mainConfiguration.save(); } @@ -45,8 +43,7 @@ public class mod_BuildCraftDevel extends NetworkMod { } @Override - public void load() { - } + public void load() {} @Override public boolean clientSideRequired() { diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftEnergy.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftEnergy.java index 3aa75e65..6bcb50c0 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftEnergy.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftEnergy.java @@ -33,26 +33,18 @@ public class mod_BuildCraftEnergy extends NetworkMod { super.modsLoaded(); BuildCraftEnergy.initialize(); - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex( - BuildCraftEnergy.engineBlock, 0), new RenderEngine( + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 0), new RenderEngine( "/net/minecraft/src/buildcraft/energy/gui/base_wood.png")); - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex( - BuildCraftEnergy.engineBlock, 1), new RenderEngine( + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 1), new RenderEngine( "/net/minecraft/src/buildcraft/energy/gui/base_stone.png")); - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex( - BuildCraftEnergy.engineBlock, 2), new RenderEngine( + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 2), new RenderEngine( "/net/minecraft/src/buildcraft/energy/gui/base_iron.png")); - ModLoader.getMinecraftInstance().renderEngine - .registerTextureFX(new TextureOilFX()); - ModLoader.getMinecraftInstance().renderEngine - .registerTextureFX(new TextureFuelFX()); - ModLoader.getMinecraftInstance().renderEngine - .registerTextureFX(new TextureOilFlowFX()); + ModLoader.getMinecraftInstance().renderEngine.registerTextureFX(new TextureOilFX()); + ModLoader.getMinecraftInstance().renderEngine.registerTextureFX(new TextureFuelFX()); + ModLoader.getMinecraftInstance().renderEngine.registerTextureFX(new TextureOilFlowFX()); - ModLoader.registerTileEntity(TileEngine.class, - "net.minecraft.src.buildcraft.energy.Engine", - new RenderEngine()); + ModLoader.registerTileEntity(TileEngine.class, "net.minecraft.src.buildcraft.energy.Engine", new RenderEngine()); // CoreProxy.registerGUI(this, // Utils.packetIdToInt(PacketIds.EngineSteamGUI)); diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftFactory.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftFactory.java index e4ca50b0..028f305d 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftFactory.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftFactory.java @@ -42,30 +42,21 @@ public class mod_BuildCraftFactory extends NetworkMod { // CoreProxy.registerGUI(this, // Utils.packetIdToInt(PacketIds.AutoCraftingGUI)); - ModLoader.registerTileEntity(TileTank.class, - "net.minecraft.src.buildcraft.factory.TileTank", - new RenderTank()); + ModLoader.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank", new RenderTank()); - ModLoader.registerTileEntity(TileRefinery.class, - "net.minecraft.src.buildcraft.factory.Refinery", + ModLoader.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery", new RenderRefinery()); + + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.refineryBlock, 0), new RenderRefinery()); - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex( - BuildCraftFactory.refineryBlock, 0), new RenderRefinery()); + ModLoader.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper", new RenderHopper()); - ModLoader.registerTileEntity(TileHopper.class, - "net.minecraft.src.buildcraft.factory.TileHopper", - new RenderHopper()); - - mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex( - BuildCraftFactory.hopperBlock, 0), new RenderHopper()); + mod_BuildCraftCore.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftFactory.hopperBlock, 0), new RenderHopper()); // Detect the presence of NEI and add overlay for the Autocrafting Table try { - Class neiRenderer = Class - .forName("codechicken.nei.DefaultOverlayRenderer"); - Method method = neiRenderer.getMethod("registerGuiOverlay", - Class.class, String.class, int.class, int.class); + Class neiRenderer = Class.forName("codechicken.nei.DefaultOverlayRenderer"); + Method method = neiRenderer.getMethod("registerGuiOverlay", Class.class, String.class, int.class, int.class); method.invoke(null, GuiAutoCrafting.class, "crafting", 5, 11); ModLoader.getLogger().fine("NEI detected, adding NEI overlay"); } catch (Exception e) { diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftSilicon.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftSilicon.java index 4d5cbeff..309aa1be 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftSilicon.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftSilicon.java @@ -43,8 +43,7 @@ public class mod_BuildCraftSilicon extends NetworkMod { } @Override - public boolean renderWorldBlock(RenderBlocks renderblocks, - IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) { + public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block block, int l) { int meta = iblockaccess.getBlockMetadata(x, y, z); @@ -57,8 +56,7 @@ public class mod_BuildCraftSilicon extends NetworkMod { block.setBlockBounds(0.0F, 0.0F, 0.0F, 4F / 16F, 1, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F, - 11F / 16F, 11F / 16F); + block.setBlockBounds(4F / 16F, 5F / 16F, 5F / 16F, 13F / 16F, 11F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == Orientations.XNeg.ordinal()) { renderblocks.uvRotateEast = 1; @@ -69,8 +67,7 @@ public class mod_BuildCraftSilicon extends NetworkMod { block.setBlockBounds(1F - 4F / 16F, 0.0F, 0.0F, 1, 1, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F, - 1F - 4F / 16F, 11F / 16F, 11F / 16F); + block.setBlockBounds(1F - 13F / 16F, 5F / 16F, 5F / 16F, 1F - 4F / 16F, 11F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == Orientations.ZNeg.ordinal()) { renderblocks.uvRotateSouth = 1; @@ -79,8 +76,7 @@ public class mod_BuildCraftSilicon extends NetworkMod { block.setBlockBounds(0.0F, 0.0F, 1F - 4F / 16F, 1, 1, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F, - 11F / 16F, 1F - 4F / 16F); + block.setBlockBounds(5F / 16F, 5F / 16F, 1F - 13F / 16F, 11F / 16F, 11F / 16F, 1F - 4F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == Orientations.ZPos.ordinal()) { renderblocks.uvRotateSouth = 2; @@ -91,8 +87,7 @@ public class mod_BuildCraftSilicon extends NetworkMod { block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 1, 4F / 16F); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F, - 11F / 16F, 13F / 16F); + block.setBlockBounds(5F / 16F, 5F / 16F, 4F / 16F, 11F / 16F, 11F / 16F, 13F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == Orientations.YNeg.ordinal()) { renderblocks.uvRotateEast = 3; @@ -103,15 +98,13 @@ public class mod_BuildCraftSilicon extends NetworkMod { block.setBlockBounds(0.0F, 1.0F - 4F / 16F, 0.0F, 1.0F, 1.0F, 1.0F); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F, - 1F - 4F / 16F, 11F / 16F); + block.setBlockBounds(5F / 16F, 1F - 13F / 16F, 5F / 16F, 11F / 16F, 1F - 4F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } else if (meta == Orientations.YPos.ordinal()) { block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 4F / 16F, 1); renderblocks.renderStandardBlock(block, x, y, z); - block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, - 13F / 16F, 11F / 16F); + block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F); renderblocks.renderStandardBlock(block, x, y, z); } @@ -128,17 +121,14 @@ public class mod_BuildCraftSilicon extends NetworkMod { } @Override - public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, - int j) { - block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, - Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); + public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) { + block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1, 4F / 16F, 1); renderBlockInInv(renderblocks, block, 0); - block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, - 13F / 16F, 11F / 16F); + block.setBlockBounds(5F / 16F, 4F / 16F, 5F / 16F, 11F / 16F, 13F / 16F, 11F / 16F); renderBlockInInv(renderblocks, block, 1); GL11.glTranslatef(0.5F, 0.5F, 0.5F); @@ -149,38 +139,32 @@ public class mod_BuildCraftSilicon extends NetworkMod { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); - renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(0, i)); + renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(1, i)); + renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); - renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(2, i)); + renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(3, i)); + renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); - renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(4, i)); + renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, - block.getBlockTextureFromSideAndMetadata(5, i)); + renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, i)); tessellator.draw(); } diff --git a/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java b/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java index dd88a2f3..4e45798c 100644 --- a/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java +++ b/buildcraft_client/net/minecraft/src/mod_BuildCraftTransport.java @@ -19,8 +19,7 @@ import net.minecraft.src.forge.NetworkMod; import org.lwjgl.opengl.GL11; -public class mod_BuildCraftTransport extends NetworkMod implements - IItemRenderer { +public class mod_BuildCraftTransport extends NetworkMod implements IItemRenderer { public static mod_BuildCraftTransport instance; @@ -36,48 +35,28 @@ public class mod_BuildCraftTransport extends NetworkMod implements // CoreProxy.registerGUI(this, // Utils.packetIdToInt(PacketIds.DiamondPipeGUI)); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsWood.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsCobblestone.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsStone.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsIron.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsGold.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsDiamond.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsObsidian.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsCobblestone.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStone.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsIron.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsGold.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDiamond.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeLiquidsWood.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeLiquidsCobblestone.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeLiquidsStone.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeLiquidsIron.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeLiquidsGold.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsWood.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsCobblestone.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsStone.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsIron.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeLiquidsGold.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipePowerWood.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipePowerStone.shiftedIndex, this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipePowerGold.shiftedIndex, this); - MinecraftForgeClient - .registerItemRenderer( - BuildCraftTransport.pipeStructureCobblestone.shiftedIndex, - this); - MinecraftForgeClient.registerItemRenderer( - BuildCraftTransport.pipeItemsStipes.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerWood.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerStone.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerGold.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeStructureCobblestone.shiftedIndex, this); + MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStipes.shiftedIndex, this); } - public static void registerTilePipe(Class clas, - String name) { + public static void registerTilePipe(Class clas, String name) { ModLoader.registerTileEntity(clas, name, new RenderPipe()); } @@ -97,20 +76,17 @@ public class mod_BuildCraftTransport extends NetworkMod implements return false; } - private void renderPipeItem(RenderBlocks render, ItemStack item, - float translateX, float translateY, float translateZ) { + private void renderPipeItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { // GL11.glBindTexture(GL11.GL_TEXTURE_2D, 10); Tessellator tessellator = Tessellator.instance; Block block = BuildCraftTransport.genericPipeBlock; - int textureID = ((ItemPipe) Item.itemsList[item.itemID]) - .getTextureIndex(); + int textureID = ((ItemPipe) Item.itemsList[item.itemID]).getTextureIndex(); if (textureID > 255) textureID -= 256; - block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, - Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); + block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); block.setBlockBoundsForItemRender(); GL11.glTranslatef(translateX, translateY, translateZ); tessellator.startDrawingQuads(); @@ -209,8 +185,7 @@ public class mod_BuildCraftTransport extends NetworkMod implements } @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return true; } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/api/APIProxy.java b/buildcraft_server/net/minecraft/src/buildcraft/api/APIProxy.java index 7a486cfd..e11ed6bc 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/api/APIProxy.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/api/APIProxy.java @@ -17,30 +17,29 @@ import net.minecraft.src.World; public class APIProxy { - public static boolean isClient (World world) { + public static boolean isClient(World world) { return false; } - public static boolean isServerSide () { + public static boolean isServerSide() { return true; } public static boolean isRemote() { return false; } - - public static void removeEntity (Entity entity) { + + public static void removeEntity(Entity entity) { entity.setDead(); } - public static Random createNewRandom (World world) { - return new Random (world.getSeed()); + public static Random createNewRandom(World world) { + return new Random(world.getSeed()); } - public static EntityPlayer createNewPlayer (World world) { + public static EntityPlayer createNewPlayer(World world) { return new EntityPlayer(world) { - }; } } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/builders/BuildersProxy.java b/buildcraft_server/net/minecraft/src/buildcraft/builders/BuildersProxy.java index 59db9eef..0392e948 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/builders/BuildersProxy.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/builders/BuildersProxy.java @@ -15,7 +15,7 @@ import net.minecraft.src.World; public class BuildersProxy { public static boolean canPlaceTorch(World world, int i, int j, int k) { - Block block = Block.blocksList [world.getBlockId(i, j, k)]; + Block block = Block.blocksList[world.getBlockId(i, j, k)]; if (block == null || !block.renderAsNormalBlock()) return false; @@ -23,7 +23,7 @@ public class BuildersProxy { return true; } - public static String getOwner (TileBlueprintLibrary library) { + public static String getOwner(TileBlueprintLibrary library) { return library.owner; } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/builders/CraftingTemplate.java b/buildcraft_server/net/minecraft/src/buildcraft/builders/CraftingTemplate.java index df2cedd8..036dfc39 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/builders/CraftingTemplate.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/builders/CraftingTemplate.java @@ -14,27 +14,26 @@ import net.minecraft.src.IInventory; class CraftingTemplate extends CraftingTemplateRoot { - public CraftingTemplate (IInventory playerInventory, TileArchitect template) { - super (playerInventory, template); + public CraftingTemplate(IInventory playerInventory, TileArchitect template) { + super(playerInventory, template); } @Override public void onCraftGuiOpened(ICrafting icrafting) { - super.onCraftGuiOpened(icrafting); - icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); - } + super.onCraftGuiOpened(icrafting); + icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); + } @Override public void updateCraftingResults() { - super.updateCraftingResults(); - for(int i = 0; i < crafters.size(); i++) { - ICrafting icrafting = (ICrafting)crafters.get(i); - if(computingTime != template.computingTime) - icrafting.updateCraftingInventoryInfo(this, 0, - template.computingTime); - } + super.updateCraftingResults(); + for (int i = 0; i < crafters.size(); i++) { + ICrafting icrafting = (ICrafting) crafters.get(i); + if (computingTime != template.computingTime) + icrafting.updateCraftingInventoryInfo(this, 0, template.computingTime); + } - computingTime = template.computingTime; - } + computingTime = template.computingTime; + } } \ No newline at end of file diff --git a/buildcraft_server/net/minecraft/src/buildcraft/builders/GuiHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/builders/GuiHandler.java index 9a947cb3..07ccce51 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/builders/GuiHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/builders/GuiHandler.java @@ -11,35 +11,34 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - switch(ID) { + switch (ID) { case GuiIds.ARCHITECT_TABLE: - if(!(tile instanceof TileArchitect)) + if (!(tile instanceof TileArchitect)) return null; - return new CraftingTemplate(player.inventory, (TileArchitect)tile); + return new CraftingTemplate(player.inventory, (TileArchitect) tile); case GuiIds.BLUEPRINT_LIBRARY: - if(!(tile instanceof TileBlueprintLibrary)) + if (!(tile instanceof TileBlueprintLibrary)) return null; - return new ContainerBlueprintLibrary(player, (TileBlueprintLibrary)tile); + return new ContainerBlueprintLibrary(player, (TileBlueprintLibrary) tile); case GuiIds.BUILDER: - if(!(tile instanceof TileBuilder)) + if (!(tile instanceof TileBuilder)) return null; - return new CraftingBuilder(player.inventory, (TileBuilder)tile); + return new CraftingBuilder(player.inventory, (TileBuilder) tile); case GuiIds.FILLER: - if(!(tile instanceof TileFiller)) + if (!(tile instanceof TileFiller)) return null; - return new CraftingFiller(player.inventory, (TileFiller)tile); + return new CraftingFiller(player.inventory, (TileFiller) tile); default: return null; diff --git a/buildcraft_server/net/minecraft/src/buildcraft/core/CoreProxy.java b/buildcraft_server/net/minecraft/src/buildcraft/core/CoreProxy.java index 65e85aa2..88865d0e 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/core/CoreProxy.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/core/CoreProxy.java @@ -28,20 +28,26 @@ import net.minecraft.src.forge.NetworkMod; public class CoreProxy { - public static String getCurrentLanguage() { return null; } - - /// FIXING GENERAL MLMP AND DEOBFUSCATION DERPINESS + public static String getCurrentLanguage() { + return null; + } + + // / FIXING GENERAL MLMP AND DEOBFUSCATION DERPINESS public static void addName(Object obj, String s) {} + public static void registerBlock(Block block) { Item.itemsList[block.blockID] = null; Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getBlockName()); } + public static void registerTileEntity(Class clas, String ident) { ModLoader.registerTileEntity(clas, ident); } - public static void setField804 (EntityItem item, float value) { + + public static void setField804(EntityItem item, float value) { item.field_432_ae = value; } + public static void onCraftingPickup(World world, EntityPlayer player, ItemStack stack) { stack.onCrafting(world, player, stack.stackSize); } @@ -50,14 +56,12 @@ public class CoreProxy { return new File("BuildCraft.cfg"); } - public static void sendToPlayers(Packet packet, World w, int x, int y, - int z, int maxDistance, NetworkMod mod) { + public static void sendToPlayers(Packet packet, World w, int x, int y, int z, int maxDistance, NetworkMod mod) { if (packet != null) { for (int j = 0; j < w.playerEntities.size(); j++) { - EntityPlayerMP player = (EntityPlayerMP)w.playerEntities.get(j); + EntityPlayerMP player = (EntityPlayerMP) w.playerEntities.get(j); - if (Math.abs(player.posX - x) <= maxDistance - && Math.abs(player.posY - y) <= maxDistance + if (Math.abs(player.posX - x) <= maxDistance && Math.abs(player.posY - y) <= maxDistance && Math.abs(player.posZ - z) <= maxDistance) player.playerNetServerHandler.sendPacket(packet); } @@ -65,10 +69,10 @@ public class CoreProxy { } public static void sendToPlayer(EntityPlayer entityplayer, BuildCraftPacket packet) { - EntityPlayerMP player = (EntityPlayerMP)entityplayer; + EntityPlayerMP player = (EntityPlayerMP) entityplayer; player.playerNetServerHandler.sendPacket(packet.getPacket()); } - + /** * Server side stub. */ @@ -83,7 +87,7 @@ public class CoreProxy { } - public static int addFuel (int id, int dmg) { + public static int addFuel(int id, int dmg) { return ModLoader.addAllFuel(id, dmg); } @@ -91,19 +95,18 @@ public class CoreProxy { return 0; } - public static long getHash (IBlockAccess iBlockAccess) { -// return iBlockAccess.hashCode(); + public static long getHash(IBlockAccess iBlockAccess) { + // return iBlockAccess.hashCode(); return 0; } - public static void TakenFromCrafting(EntityPlayer thePlayer, - ItemStack itemstack, IInventory craftMatrix) { + public static void TakenFromCrafting(EntityPlayer thePlayer, ItemStack itemstack, IInventory craftMatrix) { ModLoader.takenFromCrafting(thePlayer, itemstack, craftMatrix); } - - public static void BindTexture(String texture){ - + + public static void BindTexture(String texture) { + } } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java index 10217129..e24c10a8 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/core/network/ConnectionHandler.java @@ -14,12 +14,9 @@ public class ConnectionHandler implements IConnectionHandler { } @Override - public void onLogin(NetworkManager network, Packet1Login login) { - } + public void onLogin(NetworkManager network, Packet1Login login) {} @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { - } + public void onDisconnect(NetworkManager network, String message, Object[] args) {} } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/core/network/PacketHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/core/network/PacketHandler.java index 440f66f4..4a3cf481 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/core/network/PacketHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/core/network/PacketHandler.java @@ -6,7 +6,6 @@ import net.minecraft.src.forge.IPacketHandler; public class PacketHandler implements IPacketHandler { @Override - public void onPacketData(NetworkManager network, String channel, byte[] data) { - } + public void onPacketData(NetworkManager network, String channel, byte[] data) {} } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/energy/ContainerEngine.java b/buildcraft_server/net/minecraft/src/buildcraft/energy/ContainerEngine.java index 2e8b24d4..762a9367 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/energy/ContainerEngine.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/energy/ContainerEngine.java @@ -14,8 +14,7 @@ import net.minecraft.src.InventoryPlayer; public class ContainerEngine extends ContainerEngineRoot { - public ContainerEngine(InventoryPlayer inventoryplayer, - TileEngine tileEngine) { + public ContainerEngine(InventoryPlayer inventoryplayer, TileEngine tileEngine) { super(inventoryplayer, tileEngine); // TODO Auto-generated constructor stub } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/energy/GuiHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/energy/GuiHandler.java index a0df0ac0..1cca9642 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/energy/GuiHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/energy/GuiHandler.java @@ -11,19 +11,18 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - if(!(tile instanceof TileEngine)) + if (!(tile instanceof TileEngine)) return null; - TileEngine engine = (TileEngine)tile; + TileEngine engine = (TileEngine) tile; - switch(ID) { + switch (ID) { case GuiIds.ENGINE_IRON: return new ContainerEngine(player.inventory, engine); diff --git a/buildcraft_server/net/minecraft/src/buildcraft/factory/GuiHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/factory/GuiHandler.java index 5f8589a2..a87c58a0 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/factory/GuiHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/factory/GuiHandler.java @@ -11,30 +11,29 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - switch(ID) { + switch (ID) { case GuiIds.AUTO_CRAFTING_TABLE: - if(!(tile instanceof TileAutoWorkbench)) + if (!(tile instanceof TileAutoWorkbench)) return null; - return new ContainerAutoWorkbench(player.inventory, (TileAutoWorkbench)tile); + return new ContainerAutoWorkbench(player.inventory, (TileAutoWorkbench) tile); case GuiIds.REFINERY: - if(!(tile instanceof TileRefinery)) + if (!(tile instanceof TileRefinery)) return null; - return new ContainerRefinery(player.inventory, (TileRefinery)tile); - + return new ContainerRefinery(player.inventory, (TileRefinery) tile); + case GuiIds.HOPPER: if (!(tile instanceof TileHopper)) return null; - return new ContainerHopper(player.inventory, (TileHopper)tile); + return new ContainerHopper(player.inventory, (TileHopper) tile); default: return null; diff --git a/buildcraft_server/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java index ace6cf97..b6551da8 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/factory/network/ConnectionHandler.java @@ -14,12 +14,9 @@ public class ConnectionHandler implements IConnectionHandler { } @Override - public void onLogin(NetworkManager network, Packet1Login login) { - } + public void onLogin(NetworkManager network, Packet1Login login) {} @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { - } + public void onDisconnect(NetworkManager network, String message, Object[] args) {} } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/factory/network/PacketHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/factory/network/PacketHandler.java index cb99b034..d02fc122 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/factory/network/PacketHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/factory/network/PacketHandler.java @@ -17,15 +17,14 @@ public class PacketHandler implements IPacketHandler { @Override public void onPacketData(NetworkManager network, String channel, byte[] bytes) { - + DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes)); - try - { - NetServerHandler net = (NetServerHandler)network.getNetHandler(); + try { + NetServerHandler net = (NetServerHandler) network.getNetHandler(); int packetID = data.read(); PacketUpdate packet = new PacketUpdate(); - + switch (packetID) { case PacketIds.REFINERY_FILTER_SET: @@ -35,31 +34,31 @@ public class PacketHandler implements IPacketHandler { } - } catch(Exception ex) { + } catch (Exception ex) { ex.printStackTrace(); } } private TileRefinery getRefinery(World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - if(!(tile instanceof TileRefinery)) + if (!(tile instanceof TileRefinery)) return null; - - return (TileRefinery)tile; + + return (TileRefinery) tile; } - + private void onRefinerySelect(EntityPlayerMP playerEntity, PacketUpdate packet) { TileRefinery tile = getRefinery(playerEntity.worldObj, packet.posX, packet.posY, packet.posZ); - if(tile == null) + if (tile == null) return; - + tile.setFilter(packet.payload.intPayload[0], packet.payload.intPayload[1]); - + } } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/silicon/GuiHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/silicon/GuiHandler.java index 3e572672..4fc135d8 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/silicon/GuiHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/silicon/GuiHandler.java @@ -12,20 +12,19 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - switch(ID) { + switch (ID) { case GuiIds.ASSEMBLY_TABLE: - if(!(tile instanceof TileAssemblyTable)) + if (!(tile instanceof TileAssemblyTable)) return null; - return new ContainerAssemblyTable(player.inventory, (TileAssemblyTable)tile); + return new ContainerAssemblyTable(player.inventory, (TileAssemblyTable) tile); default: return null; diff --git a/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java index 7b71f287..ba9cf2f0 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/ConnectionHandler.java @@ -20,8 +20,7 @@ public class ConnectionHandler implements IConnectionHandler { } @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { + public void onDisconnect(NetworkManager network, String message, Object[] args) { // TODO Auto-generated method stub } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java index b87f267b..3b6625d3 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/silicon/network/PacketHandler.java @@ -20,9 +20,8 @@ public class PacketHandler implements IPacketHandler { public void onPacketData(NetworkManager network, String channel, byte[] bytes) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes)); - try - { - NetServerHandler net = (NetServerHandler)network.getNetHandler(); + try { + NetServerHandler net = (NetServerHandler) network.getNetHandler(); int packetID = data.read(); switch (packetID) { @@ -40,7 +39,7 @@ public class PacketHandler implements IPacketHandler { } - } catch(Exception ex) { + } catch (Exception ex) { ex.printStackTrace(); } @@ -48,25 +47,26 @@ public class PacketHandler implements IPacketHandler { private TileAssemblyTable getAssemblyTable(World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - if(!(tile instanceof TileAssemblyTable)) + if (!(tile instanceof TileAssemblyTable)) return null; - return (TileAssemblyTable)tile; + return (TileAssemblyTable) tile; } /** * Sends the current selection on the assembly table to a player. + * * @param player * @param packet */ private void onAssemblyGetSelection(EntityPlayerMP player, PacketCoordinates packet) { TileAssemblyTable tile = getAssemblyTable(player.worldObj, packet.posX, packet.posY, packet.posZ); - if(tile == null) + if (tile == null) return; tile.sendSelectionTo(player); @@ -74,15 +74,16 @@ public class PacketHandler implements IPacketHandler { /** * Sets the selection on an assembly table according to player request. + * * @param player * @param packet */ private void onAssemblySelect(EntityPlayerMP player, PacketUpdate packet) { TileAssemblyTable tile = getAssemblyTable(player.worldObj, packet.posX, packet.posY, packet.posZ); - if(tile == null) + if (tile == null) return; - + TileAssemblyTable.SelectionMessage message = new TileAssemblyTable.SelectionMessage(); TileAssemblyTable.selectionMessageWrapper.fromPayload(message, packet.payload); tile.handleSelectionMessage(message); diff --git a/buildcraft_server/net/minecraft/src/buildcraft/transport/GuiHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/transport/GuiHandler.java index daed9784..0beb4552 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/transport/GuiHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/transport/GuiHandler.java @@ -11,19 +11,18 @@ import net.minecraft.src.forge.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override - public Object getGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { + public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) + if (!world.blockExists(x, y, z)) return null; TileEntity tile = world.getBlockTileEntity(x, y, z); - if(!(tile instanceof TileGenericPipe)) + if (!(tile instanceof TileGenericPipe)) return null; - TileGenericPipe pipe = (TileGenericPipe)tile; + TileGenericPipe pipe = (TileGenericPipe) tile; - switch(ID) { + switch (ID) { case GuiIds.PIPE_DIAMOND: return new CraftingDiamondPipe(player.inventory, pipe); diff --git a/buildcraft_server/net/minecraft/src/buildcraft/transport/TransportProxy.java b/buildcraft_server/net/minecraft/src/buildcraft/transport/TransportProxy.java index e04b4e4e..6d7a00a6 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/transport/TransportProxy.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/transport/TransportProxy.java @@ -15,7 +15,7 @@ import net.minecraft.src.World; public class TransportProxy { - public static void obsidianPipePickup (World world, EntityItem item, TileEntity tile) { + public static void obsidianPipePickup(World world, EntityItem item, TileEntity tile) { } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java index f48dd4c7..5d117208 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/transport/network/ConnectionHandler.java @@ -20,8 +20,7 @@ public class ConnectionHandler implements IConnectionHandler { } @Override - public void onDisconnect(NetworkManager network, String message, - Object[] args) { + public void onDisconnect(NetworkManager network, String message, Object[] args) { // TODO Auto-generated method stub } diff --git a/buildcraft_server/net/minecraft/src/buildcraft/transport/network/PacketHandler.java b/buildcraft_server/net/minecraft/src/buildcraft/transport/network/PacketHandler.java index 87716ec1..24021d9f 100644 --- a/buildcraft_server/net/minecraft/src/buildcraft/transport/network/PacketHandler.java +++ b/buildcraft_server/net/minecraft/src/buildcraft/transport/network/PacketHandler.java @@ -23,9 +23,8 @@ public class PacketHandler implements IPacketHandler { @Override public void onPacketData(NetworkManager network, String channel, byte[] bytes) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(bytes)); - try - { - NetServerHandler net = (NetServerHandler)network.getNetHandler(); + try { + NetServerHandler net = (NetServerHandler) network.getNetHandler(); int packetID = data.read(); switch (packetID) { @@ -34,68 +33,72 @@ public class PacketHandler implements IPacketHandler { packet.readData(data); onDiamondPipeSelect(net.getPlayerEntity(), packet); break; - + case PacketIds.GATE_REQUEST_INIT: PacketCoordinates packetU = new PacketCoordinates(); packetU.readData(data); onGateInitRequest(net.getPlayerEntity(), packetU); break; - + case PacketIds.GATE_REQUEST_SELECTION: PacketCoordinates packetS = new PacketCoordinates(); packetS.readData(data); onGateSelectionRequest(net.getPlayerEntity(), packetS); break; - + case PacketIds.GATE_SELECTION_CHANGE: PacketUpdate packetC = new PacketUpdate(); packetC.readData(data); onGateSelectionChange(net.getPlayerEntity(), packetC); break; } - } catch(Exception ex) { + } catch (Exception ex) { ex.printStackTrace(); } } /** * Handles selection changes on a gate. + * * @param playerEntity * @param packet */ private void onGateSelectionChange(EntityPlayerMP playerEntity, PacketUpdate packet) { - if(!(playerEntity.craftingInventory instanceof CraftingGateInterface)) + if (!(playerEntity.craftingInventory instanceof CraftingGateInterface)) return; - - ((CraftingGateInterface)playerEntity.craftingInventory).handleSelectionChange(packet); + + ((CraftingGateInterface) playerEntity.craftingInventory).handleSelectionChange(packet); } /** * Handles gate gui (current) selection requests. + * * @param playerEntity * @param packet */ private void onGateSelectionRequest(EntityPlayerMP playerEntity, PacketCoordinates packet) { - if(!(playerEntity.craftingInventory instanceof CraftingGateInterface)) + if (!(playerEntity.craftingInventory instanceof CraftingGateInterface)) return; - - ((CraftingGateInterface)playerEntity.craftingInventory).sendSelection(playerEntity); + + ((CraftingGateInterface) playerEntity.craftingInventory).sendSelection(playerEntity); } /** * Handles received gate gui initialization requests. + * * @param playerEntity * @param packet */ private void onGateInitRequest(EntityPlayerMP playerEntity, PacketCoordinates packet) { - if(!(playerEntity.craftingInventory instanceof CraftingGateInterface)) - return; - - ((CraftingGateInterface)playerEntity.craftingInventory).handleInitRequest(playerEntity); + if (!(playerEntity.craftingInventory instanceof CraftingGateInterface)) + return; + + ((CraftingGateInterface) playerEntity.craftingInventory).handleInitRequest(playerEntity); } /** * Retrieves pipe at specified coordinates if any. + * * @param world * @param x * @param y @@ -103,29 +106,30 @@ public class PacketHandler implements IPacketHandler { * @return */ private TileGenericPipe getPipe(World world, int x, int y, int z) { - if(!world.blockExists(x, y, z)) - return null; - - TileEntity tile = world.getBlockTileEntity(x, y, z); - if(!(tile instanceof TileGenericPipe)) + if (!world.blockExists(x, y, z)) return null; - return (TileGenericPipe)tile; + TileEntity tile = world.getBlockTileEntity(x, y, z); + if (!(tile instanceof TileGenericPipe)) + return null; + + return (TileGenericPipe) tile; } - + /** * Handles selection changes on diamond pipe guis. + * * @param player * @param packet */ private void onDiamondPipeSelect(EntityPlayerMP player, PacketSlotChange packet) { TileGenericPipe pipe = getPipe(player.worldObj, packet.posX, packet.posY, packet.posZ); - if(pipe == null) + if (pipe == null) return; - - if(!(pipe.pipe.logic instanceof PipeLogicDiamond)) + + if (!(pipe.pipe.logic instanceof PipeLogicDiamond)) return; - + pipe.pipe.logic.setInventorySlotContents(packet.slot, packet.stack); } diff --git a/buildcraft_server/net/minecraft/src/mod_BuildCraftBuilders.java b/buildcraft_server/net/minecraft/src/mod_BuildCraftBuilders.java index 3324ecfd..d26fd79a 100644 --- a/buildcraft_server/net/minecraft/src/mod_BuildCraftBuilders.java +++ b/buildcraft_server/net/minecraft/src/mod_BuildCraftBuilders.java @@ -16,7 +16,7 @@ public class mod_BuildCraftBuilders extends NetworkMod { public static mod_BuildCraftBuilders instance; - public mod_BuildCraftBuilders () { + public mod_BuildCraftBuilders() { instance = this; } @@ -26,7 +26,7 @@ public class mod_BuildCraftBuilders extends NetworkMod { } @Override - public void modsLoaded () { + public void modsLoaded() { super.modsLoaded(); BuildCraftBuilders.initialize(); @@ -37,6 +37,13 @@ public class mod_BuildCraftBuilders extends NetworkMod { return DefaultProps.VERSION; } - @Override public boolean clientSideRequired() { return true; } - @Override public boolean serverSideRequired() { return true; } + @Override + public boolean clientSideRequired() { + return true; + } + + @Override + public boolean serverSideRequired() { + return true; + } } diff --git a/buildcraft_server/net/minecraft/src/mod_BuildCraftCore.java b/buildcraft_server/net/minecraft/src/mod_BuildCraftCore.java index ac6a3d1a..4b7452b4 100644 --- a/buildcraft_server/net/minecraft/src/mod_BuildCraftCore.java +++ b/buildcraft_server/net/minecraft/src/mod_BuildCraftCore.java @@ -20,18 +20,18 @@ public class mod_BuildCraftCore extends NetworkMod { public static mod_BuildCraftCore instance; - public mod_BuildCraftCore () { + public mod_BuildCraftCore() { instance = this; } BuildCraftCore proxy = new BuildCraftCore(); - public static void initialize () { - BuildCraftCore.initialize (); + public static void initialize() { + BuildCraftCore.initialize(); } @Override - public void modsLoaded () { + public void modsLoaded() { mod_BuildCraftCore.initialize(); BuildCraftCore.initializeModel(this); ModLoader.setInGameHook(this, true, true); @@ -43,7 +43,7 @@ public class mod_BuildCraftCore extends NetworkMod { @Override public String getVersion() { - return version (); + return version(); } long lastReport = 0; @@ -56,11 +56,11 @@ public class mod_BuildCraftCore extends NetworkMod { if (d.getTime() - lastReport > 10000) { lastReport = d.getTime(); int bytes = ClassMapping.report(); - System.out.println ("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second"); - System.out.println (); + System.out.println("BuildCraft bandwidth = " + (bytes / 10) + " bytes / second"); + System.out.println(); } } - + return true; } @@ -69,7 +69,14 @@ public class mod_BuildCraftCore extends NetworkMod { BuildCraftCore.load(); } - @Override public boolean clientSideRequired() { return true; } - @Override public boolean serverSideRequired() { return true; } + @Override + public boolean clientSideRequired() { + return true; + } + + @Override + public boolean serverSideRequired() { + return true; + } } diff --git a/buildcraft_server/net/minecraft/src/mod_BuildCraftEnergy.java b/buildcraft_server/net/minecraft/src/mod_BuildCraftEnergy.java index 265569fb..092fde25 100644 --- a/buildcraft_server/net/minecraft/src/mod_BuildCraftEnergy.java +++ b/buildcraft_server/net/minecraft/src/mod_BuildCraftEnergy.java @@ -24,12 +24,11 @@ public class mod_BuildCraftEnergy extends NetworkMod { } @Override - public void modsLoaded () { + public void modsLoaded() { super.modsLoaded(); BuildCraftEnergy.initialize(); - ModLoader.registerTileEntity(TileEngine.class, - "net.minecraft.src.buildcraft.energy.Engine"); + ModLoader.registerTileEntity(TileEngine.class, "net.minecraft.src.buildcraft.energy.Engine"); } @Override @@ -38,16 +37,23 @@ public class mod_BuildCraftEnergy extends NetworkMod { } @Override - public void generateSurface(World world, Random random, int i, int j) { - BuildCraftEnergy.generateSurface (world, random, i, j); - } + public void generateSurface(World world, Random random, int i, int j) { + BuildCraftEnergy.generateSurface(world, random, i, j); + } @Override public void load() { BuildCraftEnergy.load(); } - @Override public boolean clientSideRequired() { return true; } - @Override public boolean serverSideRequired() { return true; } + @Override + public boolean clientSideRequired() { + return true; + } + + @Override + public boolean serverSideRequired() { + return true; + } } diff --git a/buildcraft_server/net/minecraft/src/mod_BuildCraftFactory.java b/buildcraft_server/net/minecraft/src/mod_BuildCraftFactory.java index 4fe2032c..af0949f5 100644 --- a/buildcraft_server/net/minecraft/src/mod_BuildCraftFactory.java +++ b/buildcraft_server/net/minecraft/src/mod_BuildCraftFactory.java @@ -21,7 +21,7 @@ public class mod_BuildCraftFactory extends NetworkMod { } @Override - public void modsLoaded () { + public void modsLoaded() { super.modsLoaded(); BuildCraftFactory.initialize(); @@ -37,6 +37,13 @@ public class mod_BuildCraftFactory extends NetworkMod { BuildCraftFactory.load(); } - @Override public boolean clientSideRequired() { return true; } - @Override public boolean serverSideRequired() { return true; } + @Override + public boolean clientSideRequired() { + return true; + } + + @Override + public boolean serverSideRequired() { + return true; + } } diff --git a/buildcraft_server/net/minecraft/src/mod_BuildCraftSilicon.java b/buildcraft_server/net/minecraft/src/mod_BuildCraftSilicon.java index bd13fe2c..ca0db61c 100644 --- a/buildcraft_server/net/minecraft/src/mod_BuildCraftSilicon.java +++ b/buildcraft_server/net/minecraft/src/mod_BuildCraftSilicon.java @@ -23,7 +23,7 @@ public class mod_BuildCraftSilicon extends NetworkMod { } @Override - public void modsLoaded () { + public void modsLoaded() { super.modsLoaded(); BuildCraftTransport.initialize(); @@ -33,34 +33,28 @@ public class mod_BuildCraftSilicon extends NetworkMod { } /* - @Override - public void handlePacket(Packet230ModLoader packet, EntityPlayerMP entityplayermp) { - int x = packet.dataInt[0]; - int y = packet.dataInt[1]; - int z = packet.dataInt[2]; - - TileEntity tile = entityplayermp.worldObj.getBlockTileEntity(x, y, - z); - - switch (PacketIds.values()[packet.packetType]) { - case AssemblyTableSelect: - if (tile instanceof TileAssemblyTable) { - TileAssemblyTable assemblyTable = (TileAssemblyTable) tile; - TileAssemblyTable.SelectionMessage message = new TileAssemblyTable.SelectionMessage(); - - TileAssemblyTable.selectionMessageWrapper.updateFromPacket(message, packet); - - assemblyTable.handleSelectionMessage (message); - } - - break; - case AssemblyTableGetSelection: - if (tile instanceof TileAssemblyTable) { - TileAssemblyTable assemblyTable = (TileAssemblyTable) tile; - assemblyTable.sendSelectionTo(entityplayermp); - } - } - }*/ + * @Override public void handlePacket(Packet230ModLoader packet, + * EntityPlayerMP entityplayermp) { int x = packet.dataInt[0]; int y = + * packet.dataInt[1]; int z = packet.dataInt[2]; + * + * TileEntity tile = entityplayermp.worldObj.getBlockTileEntity(x, y, z); + * + * switch (PacketIds.values()[packet.packetType]) { case + * AssemblyTableSelect: if (tile instanceof TileAssemblyTable) { + * TileAssemblyTable assemblyTable = (TileAssemblyTable) tile; + * TileAssemblyTable.SelectionMessage message = new + * TileAssemblyTable.SelectionMessage(); + * + * TileAssemblyTable.selectionMessageWrapper.updateFromPacket(message, + * packet); + * + * assemblyTable.handleSelectionMessage (message); } + * + * break; case AssemblyTableGetSelection: if (tile instanceof + * TileAssemblyTable) { TileAssemblyTable assemblyTable = + * (TileAssemblyTable) tile; assemblyTable.sendSelectionTo(entityplayermp); + * } } } + */ @Override public String getVersion() { @@ -72,6 +66,13 @@ public class mod_BuildCraftSilicon extends NetworkMod { BuildCraftSilicon.load(); } - @Override public boolean clientSideRequired() { return true; } - @Override public boolean serverSideRequired() { return true; } + @Override + public boolean clientSideRequired() { + return true; + } + + @Override + public boolean serverSideRequired() { + return true; + } } diff --git a/buildcraft_server/net/minecraft/src/mod_BuildCraftTransport.java b/buildcraft_server/net/minecraft/src/mod_BuildCraftTransport.java index 39ea4ffc..69856dfe 100644 --- a/buildcraft_server/net/minecraft/src/mod_BuildCraftTransport.java +++ b/buildcraft_server/net/minecraft/src/mod_BuildCraftTransport.java @@ -21,12 +21,12 @@ public class mod_BuildCraftTransport extends NetworkMod { } @Override - public void modsLoaded () { + public void modsLoaded() { super.modsLoaded(); BuildCraftTransport.initialize(); } - public static void registerTilePipe (Class clas, String name) { + public static void registerTilePipe(Class clas, String name) { ModLoader.registerTileEntity(clas, name); } @@ -40,7 +40,14 @@ public class mod_BuildCraftTransport extends NetworkMod { BuildCraftTransport.load(); } - @Override public boolean clientSideRequired() { return true; } - @Override public boolean serverSideRequired() { return true; } + @Override + public boolean clientSideRequired() { + return true; + } + + @Override + public boolean serverSideRequired() { + return true; + } } diff --git a/common/net/minecraft/src/BuildCraftBlockUtil.java b/common/net/minecraft/src/BuildCraftBlockUtil.java index 463e1776..a35839df 100644 --- a/common/net/minecraft/src/BuildCraftBlockUtil.java +++ b/common/net/minecraft/src/BuildCraftBlockUtil.java @@ -18,8 +18,7 @@ public class BuildCraftBlockUtil { return block.damageDropped(world.getBlockMetadata(i, j, k)); } - public static ArrayList getItemStackFromBlock(World world, - int i, int j, int k) { + public static ArrayList getItemStackFromBlock(World world, int i, int j, int k) { Block block = Block.blocksList[world.getBlockId(i, j, k)]; if (block == null) @@ -34,8 +33,7 @@ public class BuildCraftBlockUtil { int blockId = world.getBlockId(x, y, z); if (blockId != 0 && BuildCraftCore.dropBrokenBlocks) - Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, - world.getBlockMetadata(x, y, z), 0); + Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); world.setBlockWithNotify(x, y, z, 0); } diff --git a/common/net/minecraft/src/BuildCraftBuilders.java b/common/net/minecraft/src/BuildCraftBuilders.java index f3472f9b..08d1e145 100644 --- a/common/net/minecraft/src/BuildCraftBuilders.java +++ b/common/net/minecraft/src/BuildCraftBuilders.java @@ -67,6 +67,7 @@ import net.minecraft.src.forge.MinecraftForge; import net.minecraft.src.forge.Property; public class BuildCraftBuilders { + public static final int LIBRARY_PAGE_SIZE = 12; public static final int MAX_BLUEPRINTS_NAME_SIZE = 88; @@ -94,8 +95,7 @@ public class BuildCraftBuilders { FillerManager.registry = new FillerRegistry(); // Register gui handler - MinecraftForge.setGuiHandler(mod_BuildCraftBuilders.instance, - new GuiHandler()); + MinecraftForge.setGuiHandler(mod_BuildCraftBuilders.instance, new GuiHandler()); } public static void initialize() { @@ -107,40 +107,27 @@ public class BuildCraftBuilders { mod_BuildCraftCore.initialize(); BuildCraftCore.initializeGears(); - Property templateItemId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("templateItem.id", - Configuration.CATEGORY_ITEM, - DefaultProps.TEMPLATE_ITEM_ID); - Property blueprintItemId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("blueprintItem.id", - Configuration.CATEGORY_ITEM, - DefaultProps.BLUEPRINT_ITEM_ID); - Property markerId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("marker.id", DefaultProps.MARKER_ID); - Property pathMarkerId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("pathMarker.id", - DefaultProps.PATH_MARKER_ID); - Property fillerId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("filler.id", DefaultProps.FILLER_ID); - Property builderId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("builder.id", - DefaultProps.BUILDER_ID); - Property architectId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("architect.id", - DefaultProps.ARCHITECT_ID); - Property libraryId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("blueprintLibrary.id", - DefaultProps.BLUEPRINT_LIBRARY_ID); + Property templateItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("templateItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.TEMPLATE_ITEM_ID); + Property blueprintItemId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("blueprintItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.BLUEPRINT_ITEM_ID); + Property markerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("marker.id", DefaultProps.MARKER_ID); + Property pathMarkerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pathMarker.id", + DefaultProps.PATH_MARKER_ID); + Property fillerId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("filler.id", DefaultProps.FILLER_ID); + Property builderId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("builder.id", DefaultProps.BUILDER_ID); + Property architectId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("architect.id", + DefaultProps.ARCHITECT_ID); + Property libraryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("blueprintLibrary.id", + DefaultProps.BLUEPRINT_LIBRARY_ID); BuildCraftCore.mainConfiguration.save(); - templateItem = new ItemBptTemplate( - Integer.parseInt(templateItemId.value)); + templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value)); templateItem.setItemName("templateItem"); CoreProxy.addName(templateItem, "Template"); - blueprintItem = new ItemBptBluePrint( - Integer.parseInt(blueprintItemId.value)); + blueprintItem = new ItemBptBluePrint(Integer.parseInt(blueprintItemId.value)); blueprintItem.setItemName("blueprintItem"); CoreProxy.addName(blueprintItem, "Blueprint"); @@ -148,10 +135,8 @@ public class BuildCraftBuilders { CoreProxy.registerBlock(markerBlock.setBlockName("markerBlock")); CoreProxy.addName(markerBlock, "Land Mark"); - pathMarkerBlock = new BlockPathMarker( - Integer.parseInt(pathMarkerId.value)); - CoreProxy - .registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock")); + pathMarkerBlock = new BlockPathMarker(Integer.parseInt(pathMarkerId.value)); + CoreProxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock")); CoreProxy.addName(pathMarkerBlock, "Path Mark"); fillerBlock = new BlockFiller(Integer.parseInt(fillerId.value)); @@ -166,42 +151,35 @@ public class BuildCraftBuilders { CoreProxy.registerBlock(architectBlock.setBlockName("architectBlock")); CoreProxy.addName(architectBlock, "Architect Table"); - libraryBlock = new BlockBlueprintLibrary( - Integer.parseInt(libraryId.value)); + libraryBlock = new BlockBlueprintLibrary(Integer.parseInt(libraryId.value)); CoreProxy.registerBlock(libraryBlock.setBlockName("libraryBlock")); CoreProxy.addName(libraryBlock, "Blueprint Library"); CoreProxy.registerTileEntity(TileMarker.class, "Marker"); CoreProxy.registerTileEntity(TileFiller.class, "Filler"); - CoreProxy.registerTileEntity(TileBuilder.class, - "net.minecraft.src.builders.TileBuilder"); - CoreProxy.registerTileEntity(TileArchitect.class, - "net.minecraft.src.builders.TileTemplate"); - CoreProxy.registerTileEntity(TilePathMarker.class, - "net.minecraft.src.builders.TilePathMarker"); - CoreProxy.registerTileEntity(TileBlueprintLibrary.class, - "net.minecraft.src.builders.TileBlueprintLibrary"); + CoreProxy.registerTileEntity(TileBuilder.class, "net.minecraft.src.builders.TileBuilder"); + CoreProxy.registerTileEntity(TileArchitect.class, "net.minecraft.src.builders.TileTemplate"); + CoreProxy.registerTileEntity(TilePathMarker.class, "net.minecraft.src.builders.TilePathMarker"); + CoreProxy.registerTileEntity(TileBlueprintLibrary.class, "net.minecraft.src.builders.TileBlueprintLibrary"); // / INIT FILLER PATTERNS - FillerManager.registry.addRecipe(new FillerFillAll(), new Object[] { - "bbb", "bbb", "bbb", Character.valueOf('b'), + FillerManager.registry.addRecipe(new FillerFillAll(), new Object[] { "bbb", "bbb", "bbb", Character.valueOf('b'), new ItemStack(Block.brick, 1) }); - FillerManager.registry.addRecipe(new FillerFlattener(), new Object[] { - " ", "ggg", "bbb", Character.valueOf('g'), Block.glass, - Character.valueOf('b'), Block.brick }); + FillerManager.registry.addRecipe(new FillerFlattener(), new Object[] { " ", "ggg", "bbb", Character.valueOf('g'), + Block.glass, Character.valueOf('b'), Block.brick }); - FillerManager.registry.addRecipe(new FillerRemover(), new Object[] { - "ggg", "ggg", "ggg", Character.valueOf('g'), Block.glass }); + FillerManager.registry.addRecipe(new FillerRemover(), new Object[] { "ggg", "ggg", "ggg", Character.valueOf('g'), + Block.glass }); - FillerManager.registry.addRecipe(new FillerFillWalls(), new Object[] { - "bbb", "b b", "bbb", Character.valueOf('b'), Block.brick }); + FillerManager.registry.addRecipe(new FillerFillWalls(), new Object[] { "bbb", "b b", "bbb", Character.valueOf('b'), + Block.brick }); - FillerManager.registry.addRecipe(new FillerFillPyramid(), new Object[] { - " ", " b ", "bbb", Character.valueOf('b'), Block.brick }); + FillerManager.registry.addRecipe(new FillerFillPyramid(), new Object[] { " ", " b ", "bbb", Character.valueOf('b'), + Block.brick }); - FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[] { - " b", " bb", "bbb", Character.valueOf('b'), Block.brick }); + FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[] { " b", " bb", "bbb", Character.valueOf('b'), + Block.brick }); BuildCraftCore.mainConfiguration.save(); @@ -224,65 +202,45 @@ public class BuildCraftBuilders { new BptBlockDirt(Block.grass.blockID); new BptBlockDirt(Block.tilledField.blockID); - new BptBlockDelegate(Block.torchRedstoneIdle.blockID, - Block.torchRedstoneActive.blockID); - new BptBlockDelegate(Block.stoneOvenActive.blockID, - Block.stoneOvenIdle.blockID); - new BptBlockDelegate(Block.pistonMoving.blockID, - Block.pistonBase.blockID); + new BptBlockDelegate(Block.torchRedstoneIdle.blockID, Block.torchRedstoneActive.blockID); + new BptBlockDelegate(Block.stoneOvenActive.blockID, Block.stoneOvenIdle.blockID); + new BptBlockDelegate(Block.pistonMoving.blockID, Block.pistonBase.blockID); new BptBlockWallSide(Block.torchWood.blockID); new BptBlockWallSide(Block.torchRedstoneActive.blockID); - new BptBlockRotateMeta(Block.ladder.blockID, new int[] { 2, 5, 3, 4 }, - true); - new BptBlockRotateMeta(Block.fenceGate.blockID, - new int[] { 0, 1, 2, 3 }, true); + new BptBlockRotateMeta(Block.ladder.blockID, new int[] { 2, 5, 3, 4 }, true); + new BptBlockRotateMeta(Block.fenceGate.blockID, new int[] { 0, 1, 2, 3 }, true); - new BptBlockRotateInventory(Block.stoneOvenIdle.blockID, new int[] { 2, - 5, 3, 4 }, true); - new BptBlockRotateInventory(Block.chest.blockID, - new int[] { 2, 5, 3, 4 }, true); - new BptBlockRotateInventory(Block.lockedChest.blockID, new int[] { 2, - 5, 3, 4 }, true); - new BptBlockRotateInventory(Block.dispenser.blockID, new int[] { 2, 5, - 3, 4 }, true); + new BptBlockRotateInventory(Block.stoneOvenIdle.blockID, new int[] { 2, 5, 3, 4 }, true); + new BptBlockRotateInventory(Block.chest.blockID, new int[] { 2, 5, 3, 4 }, true); + new BptBlockRotateInventory(Block.lockedChest.blockID, new int[] { 2, 5, 3, 4 }, true); + new BptBlockRotateInventory(Block.dispenser.blockID, new int[] { 2, 5, 3, 4 }, true); new BptBlockInventory(Block.brewingStand.blockID); - new BptBlockRotateMeta(Block.vine.blockID, new int[] { 1, 4, 8, 2 }, - false); - new BptBlockRotateMeta(Block.trapdoor.blockID, - new int[] { 0, 1, 2, 3 }, false); + new BptBlockRotateMeta(Block.vine.blockID, new int[] { 1, 4, 8, 2 }, false); + new BptBlockRotateMeta(Block.trapdoor.blockID, new int[] { 0, 1, 2, 3 }, false); new BptBlockLever(Block.button.blockID); new BptBlockLever(Block.lever.blockID); new BptBlockCustomStack(Block.stone.blockID, new ItemStack(Block.stone)); - new BptBlockCustomStack(Block.redstoneWire.blockID, new ItemStack( - Item.redstone)); - new BptBlockCustomStack(Block.stairDouble.blockID, new ItemStack( - Block.stairSingle, 2)); + new BptBlockCustomStack(Block.redstoneWire.blockID, new ItemStack(Item.redstone)); + new BptBlockCustomStack(Block.stairDouble.blockID, new ItemStack(Block.stairSingle, 2)); new BptBlockCustomStack(Block.cake.blockID, new ItemStack(Item.cake)); new BptBlockCustomStack(Block.crops.blockID, new ItemStack(Item.seeds)); - new BptBlockCustomStack(Block.pumpkinStem.blockID, new ItemStack( - Item.pumpkinSeeds)); - new BptBlockCustomStack(Block.melonStem.blockID, new ItemStack( - Item.melonSeeds)); - new BptBlockCustomStack(Block.glowStone.blockID, new ItemStack( - Block.glowStone)); + new BptBlockCustomStack(Block.pumpkinStem.blockID, new ItemStack(Item.pumpkinSeeds)); + new BptBlockCustomStack(Block.melonStem.blockID, new ItemStack(Item.melonSeeds)); + new BptBlockCustomStack(Block.glowStone.blockID, new ItemStack(Block.glowStone)); new BptBlockRedstoneRepeater(Block.redstoneRepeaterActive.blockID); new BptBlockRedstoneRepeater(Block.redstoneRepeaterIdle.blockID); - new BptBlockLiquid(Block.waterStill.blockID, new ItemStack( - Item.bucketWater)); - new BptBlockLiquid(Block.waterMoving.blockID, new ItemStack( - Item.bucketWater)); - new BptBlockLiquid(Block.lavaStill.blockID, new ItemStack( - Item.bucketLava)); - new BptBlockLiquid(Block.lavaMoving.blockID, new ItemStack( - Item.bucketLava)); + new BptBlockLiquid(Block.waterStill.blockID, new ItemStack(Item.bucketWater)); + new BptBlockLiquid(Block.waterMoving.blockID, new ItemStack(Item.bucketWater)); + new BptBlockLiquid(Block.lavaStill.blockID, new ItemStack(Item.bucketLava)); + new BptBlockLiquid(Block.lavaMoving.blockID, new ItemStack(Item.bucketLava)); new BptBlockIgnoreMeta(Block.rail.blockID); new BptBlockIgnoreMeta(Block.railPowered.blockID); @@ -310,10 +268,8 @@ public class BuildCraftBuilders { // BUILDCRAFT BLOCKS - new BptBlockRotateInventory(architectBlock.blockID, new int[] { 2, 5, - 3, 4 }, true); - new BptBlockRotateInventory(builderBlock.blockID, new int[] { 2, 5, 3, - 4 }, true); + new BptBlockRotateInventory(architectBlock.blockID, new int[] { 2, 5, 3, 4 }, true); + new BptBlockRotateInventory(builderBlock.blockID, new int[] { 2, 5, 3, 4 }, true); new BptBlockInventory(libraryBlock.blockID); @@ -331,65 +287,35 @@ public class BuildCraftBuilders { public static void loadRecipes() { CraftingManager craftingmanager = CraftingManager.getInstance(); - craftingmanager.addRecipe(new ItemStack(templateItem, 1), new Object[] { - "ppp", "pip", "ppp", Character.valueOf('i'), - new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('p'), - Item.paper }); + craftingmanager.addRecipe(new ItemStack(templateItem, 1), new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'), + new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('p'), Item.paper }); - craftingmanager.addRecipe( - new ItemStack(blueprintItem, 1), - new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'), - new ItemStack(Item.dyePowder, 1, 4), - Character.valueOf('p'), Item.paper }); + craftingmanager.addRecipe(new ItemStack(blueprintItem, 1), new Object[] { "ppp", "pip", "ppp", Character.valueOf('i'), + new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('p'), Item.paper }); - craftingmanager.addRecipe(new ItemStack(markerBlock, 1), new Object[] { - "l ", "r ", Character.valueOf('l'), - new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('r'), - Block.torchRedstoneActive }); + craftingmanager.addRecipe(new ItemStack(markerBlock, 1), new Object[] { "l ", "r ", Character.valueOf('l'), + new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('r'), Block.torchRedstoneActive }); - craftingmanager.addRecipe( - new ItemStack(pathMarkerBlock, 1), - new Object[] { "l ", "r ", Character.valueOf('l'), - new ItemStack(Item.dyePowder, 1, 2), - Character.valueOf('r'), Block.torchRedstoneActive }); + craftingmanager.addRecipe(new ItemStack(pathMarkerBlock, 1), new Object[] { "l ", "r ", Character.valueOf('l'), + new ItemStack(Item.dyePowder, 1, 2), Character.valueOf('r'), Block.torchRedstoneActive }); - craftingmanager.addRecipe(new ItemStack(fillerBlock, 1), new Object[] { - "btb", "ycy", "gCg", Character.valueOf('b'), - new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), - markerBlock, Character.valueOf('y'), - new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), - Block.workbench, Character.valueOf('g'), - BuildCraftCore.goldGearItem, Character.valueOf('C'), - Block.chest }); + craftingmanager.addRecipe(new ItemStack(fillerBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'), + new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), + new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), Block.workbench, Character.valueOf('g'), + BuildCraftCore.goldGearItem, Character.valueOf('C'), Block.chest }); - craftingmanager.addRecipe(new ItemStack(builderBlock, 1), new Object[] { - "btb", "ycy", "gCg", Character.valueOf('b'), - new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), - markerBlock, Character.valueOf('y'), - new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), - Block.workbench, Character.valueOf('g'), - BuildCraftCore.diamondGearItem, Character.valueOf('C'), - Block.chest }); + craftingmanager.addRecipe(new ItemStack(builderBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'), + new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), + new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), Block.workbench, Character.valueOf('g'), + BuildCraftCore.diamondGearItem, Character.valueOf('C'), Block.chest }); - craftingmanager - .addRecipe( - new ItemStack(architectBlock, 1), - new Object[] { "btb", "ycy", "gCg", - Character.valueOf('b'), - new ItemStack(Item.dyePowder, 1, 0), - Character.valueOf('t'), markerBlock, - Character.valueOf('y'), - new ItemStack(Item.dyePowder, 1, 11), - Character.valueOf('c'), Block.workbench, - Character.valueOf('g'), - BuildCraftCore.diamondGearItem, - Character.valueOf('C'), - new ItemStack(templateItem, 1) }); + craftingmanager.addRecipe(new ItemStack(architectBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'), + new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), + new ItemStack(Item.dyePowder, 1, 11), Character.valueOf('c'), Block.workbench, Character.valueOf('g'), + BuildCraftCore.diamondGearItem, Character.valueOf('C'), new ItemStack(templateItem, 1) }); - craftingmanager.addRecipe(new ItemStack(libraryBlock, 1), new Object[] { - "bbb", "bBb", "bbb", Character.valueOf('b'), - new ItemStack(blueprintItem), Character.valueOf('B'), - Block.bookShelf }); + craftingmanager.addRecipe(new ItemStack(libraryBlock, 1), new Object[] { "bbb", "bBb", "bbb", Character.valueOf('b'), + new ItemStack(blueprintItem), Character.valueOf('B'), Block.bookShelf }); } public static BptPlayerIndex getPlayerIndex(String name) { @@ -397,8 +323,7 @@ public class BuildCraftBuilders { if (!playerLibrary.containsKey(name)) try { - playerLibrary.put(name, new BptPlayerIndex(name + ".list", - rootIndex)); + playerLibrary.put(name, new BptPlayerIndex(name + ".list", rootIndex)); } catch (IOException e) { e.printStackTrace(); } diff --git a/common/net/minecraft/src/BuildCraftCore.java b/common/net/minecraft/src/BuildCraftCore.java index 128851c4..31af2b16 100644 --- a/common/net/minecraft/src/BuildCraftCore.java +++ b/common/net/minecraft/src/BuildCraftCore.java @@ -90,43 +90,31 @@ public class BuildCraftCore { public static int markerModel; public static int oilModel; - public static Trigger triggerMachineActive = new TriggerMachine( - DefaultProps.TRIGGER_MACHINE_ACTIVE, true); - public static Trigger triggerMachineInactive = new TriggerMachine( - DefaultProps.TRIGGER_MACHINE_INACTIVE, false); - public static Trigger triggerEmptyInventory = new TriggerInventory( - DefaultProps.TRIGGER_EMPTY_INVENTORY, TriggerInventory.State.Empty); - public static Trigger triggerContainsInventory = new TriggerInventory( - DefaultProps.TRIGGER_CONTAINS_INVENTORY, + public static Trigger triggerMachineActive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_ACTIVE, true); + public static Trigger triggerMachineInactive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_INACTIVE, false); + public static Trigger triggerEmptyInventory = new TriggerInventory(DefaultProps.TRIGGER_EMPTY_INVENTORY, + TriggerInventory.State.Empty); + public static Trigger triggerContainsInventory = new TriggerInventory(DefaultProps.TRIGGER_CONTAINS_INVENTORY, TriggerInventory.State.Contains); - public static Trigger triggerSpaceInventory = new TriggerInventory( - DefaultProps.TRIGGER_SPACE_INVENTORY, TriggerInventory.State.Space); - public static Trigger triggerFullInventory = new TriggerInventory( - DefaultProps.TRIGGER_FULL_INVENTORY, TriggerInventory.State.Full); - public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer( - DefaultProps.TRIGGER_EMPTY_LIQUID, + public static Trigger triggerSpaceInventory = new TriggerInventory(DefaultProps.TRIGGER_SPACE_INVENTORY, + TriggerInventory.State.Space); + public static Trigger triggerFullInventory = new TriggerInventory(DefaultProps.TRIGGER_FULL_INVENTORY, + TriggerInventory.State.Full); + public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_EMPTY_LIQUID, TriggerLiquidContainer.State.Empty); - public static Trigger triggerContainsLiquid = new TriggerLiquidContainer( - DefaultProps.TRIGGER_CONTAINS_LIQUID, + public static Trigger triggerContainsLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_CONTAINS_LIQUID, TriggerLiquidContainer.State.Contains); - public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer( - DefaultProps.TRIGGER_SPACE_LIQUID, + public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_SPACE_LIQUID, TriggerLiquidContainer.State.Space); - public static Trigger triggerFullLiquid = new TriggerLiquidContainer( - DefaultProps.TRIGGER_FULL_LIQUID, TriggerLiquidContainer.State.Full); - public static Trigger triggerRedstoneActive = new TriggerRedstoneInput( - DefaultProps.TRIGGER_REDSTONE_ACTIVE, true); - public static Trigger triggerRedstoneInactive = new TriggerRedstoneInput( - DefaultProps.TRIGGER_REDSTONE_INACTIVE, false); + public static Trigger triggerFullLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_FULL_LIQUID, + TriggerLiquidContainer.State.Full); + public static Trigger triggerRedstoneActive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_ACTIVE, true); + public static Trigger triggerRedstoneInactive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_INACTIVE, false); - public static Action actionRedstone = new ActionRedstoneOutput( - DefaultProps.ACTION_REDSTONE); - public static Action actionOn = new ActionMachineControl( - DefaultProps.ACTION_ON, Mode.On); - public static Action actionOff = new ActionMachineControl( - DefaultProps.ACTION_OFF, Mode.Off); - public static Action actionLoop = new ActionMachineControl( - DefaultProps.ACTION_LOOP, Mode.Loop); + public static Action actionRedstone = new ActionRedstoneOutput(DefaultProps.ACTION_REDSTONE); + public static Action actionOn = new ActionMachineControl(DefaultProps.ACTION_ON, Mode.On); + public static Action actionOff = new ActionMachineControl(DefaultProps.ACTION_OFF, Mode.Off); + public static Action actionLoop = new ActionMachineControl(DefaultProps.ACTION_LOOP, Mode.Loop); public static String customBuildCraftTexture = "/net/minecraft/src/buildcraft/core/gui/block_textures.png"; @@ -150,30 +138,25 @@ public class BuildCraftCore { // MinecraftForge.registerEntity(EntityBlock.class, // mod_BuildCraftCore.instance, EntityIds.BLOCK, 64, 10, true); - MinecraftForge.registerEntity(EntityRobot.class, - mod_BuildCraftCore.instance, EntityIds.ROBOT, 64, 3, true); - MinecraftForge.registerEntity(EntityLaser.class, - mod_BuildCraftCore.instance, EntityIds.LASER, 64, 10, false); + MinecraftForge.registerEntity(EntityRobot.class, mod_BuildCraftCore.instance, EntityIds.ROBOT, 64, 3, true); + MinecraftForge.registerEntity(EntityLaser.class, mod_BuildCraftCore.instance, EntityIds.LASER, 64, 10, false); } public static void initialize() { if (initialized) return; - ModLoader.getLogger().fine( - "Starting BuildCraft " + mod_BuildCraftCore.version()); + ModLoader.getLogger().fine("Starting BuildCraft " + mod_BuildCraftCore.version()); ModLoader.getLogger().fine("Copyright (c) SpaceToad, 2011"); ModLoader.getLogger().fine("http://www.mod-buildcraft.com"); - System.out.println("Starting BuildCraft " - + mod_BuildCraftCore.version()); + System.out.println("Starting BuildCraft " + mod_BuildCraftCore.version()); System.out.println("Copyright (c) SpaceToad, 2011-2012"); System.out.println("http://www.mod-buildcraft.com"); initialized = true; - mainConfiguration = new BuildCraftConfiguration(new File( - CoreProxy.getBuildCraftBase(), "config/buildcraft.cfg"), true); + mainConfiguration = new BuildCraftConfiguration(new File(CoreProxy.getBuildCraftBase(), "config/buildcraft.cfg"), true); mainConfiguration.load(); redLaserTexture = 0 * 16 + 2; @@ -181,34 +164,27 @@ public class BuildCraftCore { stripesLaserTexture = 0 * 16 + 3; transparentTexture = 0 * 16 + 0; - Property continuousCurrent = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("current.continuous", - Configuration.CATEGORY_GENERAL, - DefaultProps.CURRENT_CONTINUOUS); + Property continuousCurrent = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("current.continuous", + Configuration.CATEGORY_GENERAL, DefaultProps.CURRENT_CONTINUOUS); continuousCurrent.comment = "set to true for allowing machines to be driven by continuous current"; continuousCurrentModel = Boolean.parseBoolean(continuousCurrent.value); - Property trackNetwork = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("trackNetworkUsage", - Configuration.CATEGORY_GENERAL, false); + Property trackNetwork = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("trackNetworkUsage", + Configuration.CATEGORY_GENERAL, false); trackNetworkUsage = Boolean.parseBoolean(trackNetwork.value); - Property dropBlock = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("dropBrokenBlocks", - Configuration.CATEGORY_GENERAL, true); + Property dropBlock = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("dropBrokenBlocks", + Configuration.CATEGORY_GENERAL, true); dropBlock.comment = "set to false to prevent fillers from dropping blocks."; dropBrokenBlocks = Boolean.parseBoolean(dropBlock.value); - Property powerFrameworkClass = BuildCraftCore.mainConfiguration - .getOrCreateProperty("power.framework", - Configuration.CATEGORY_GENERAL, - "buildcraft.energy.PneumaticPowerFramework"); + Property powerFrameworkClass = BuildCraftCore.mainConfiguration.getOrCreateProperty("power.framework", + Configuration.CATEGORY_GENERAL, "buildcraft.energy.PneumaticPowerFramework"); - Property factor = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("network.updateFactor", - Configuration.CATEGORY_GENERAL, 10); + Property factor = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("network.updateFactor", + Configuration.CATEGORY_GENERAL, 10); factor.comment = "increasing this number will decrease network update frequency, useful for overloaded servers"; updateFactor = Integer.parseInt(factor.value); @@ -221,10 +197,7 @@ public class BuildCraftCore { if (forcePneumaticPower) try { PowerFramework.currentFramework = (PowerFramework) Class - .forName( - prefix - + "buildcraft.energy.PneumaticPowerFramework") - .getConstructor().newInstance(); + .forName(prefix + "buildcraft.energy.PneumaticPowerFramework").getConstructor().newInstance(); } catch (Throwable e) { e.printStackTrace(); } @@ -234,30 +207,25 @@ public class BuildCraftCore { if (className.startsWith("net.minecraft.src.")) className = className.replace("net.minecraft.src.", ""); - PowerFramework.currentFramework = (PowerFramework) Class - .forName(prefix + className).getConstructor() + PowerFramework.currentFramework = (PowerFramework) Class.forName(prefix + className).getConstructor() .newInstance(); } catch (Throwable e) { e.printStackTrace(); PowerFramework.currentFramework = new RedstonePowerFramework(); } - Property wrenchId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("wrench.id", - Configuration.CATEGORY_ITEM, DefaultProps.WRENCH_ID); + Property wrenchId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("wrench.id", Configuration.CATEGORY_ITEM, + DefaultProps.WRENCH_ID); mainConfiguration.save(); initializeGears(); - wrenchItem = (new ItemWrench(Integer.parseInt(wrenchId.value))) - .setIconIndex(0 * 16 + 2).setItemName("wrenchItem"); + wrenchItem = (new ItemWrench(Integer.parseInt(wrenchId.value))).setIconIndex(0 * 16 + 2).setItemName("wrenchItem"); CoreProxy.addName(wrenchItem, "Wrench"); - BuildCraftAPI.liquids.add(new LiquidData(Block.waterStill.blockID, - Block.waterMoving.blockID, Item.bucketWater)); - BuildCraftAPI.liquids.add(new LiquidData(Block.lavaStill.blockID, - Block.lavaMoving.blockID, Item.bucketLava)); + BuildCraftAPI.liquids.add(new LiquidData(Block.waterStill.blockID, Block.waterMoving.blockID, Item.bucketWater)); + BuildCraftAPI.liquids.add(new LiquidData(Block.lavaStill.blockID, Block.lavaMoving.blockID, Item.bucketLava)); BuildCraftAPI.softBlocks[Block.tallGrass.blockID] = true; BuildCraftAPI.softBlocks[Block.snow.blockID] = true; @@ -273,55 +241,41 @@ public class BuildCraftCore { public static void loadRecipes() { CraftingManager craftingmanager = CraftingManager.getInstance(); - craftingmanager.addRecipe(new ItemStack(wrenchItem), new Object[] { - "I I", " G ", " I ", Character.valueOf('I'), Item.ingotIron, - Character.valueOf('G'), stoneGearItem }); + craftingmanager.addRecipe(new ItemStack(wrenchItem), new Object[] { "I I", " G ", " I ", Character.valueOf('I'), + Item.ingotIron, Character.valueOf('G'), stoneGearItem }); - craftingmanager.addRecipe(new ItemStack(woodenGearItem), new Object[] { - " S ", "S S", " S ", Character.valueOf('S'), Item.stick }); + craftingmanager.addRecipe(new ItemStack(woodenGearItem), new Object[] { " S ", "S S", " S ", Character.valueOf('S'), + Item.stick }); - craftingmanager.addRecipe(new ItemStack(stoneGearItem), new Object[] { - " I ", "IGI", " I ", Character.valueOf('I'), Block.cobblestone, - Character.valueOf('G'), woodenGearItem }); + craftingmanager.addRecipe(new ItemStack(stoneGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'), + Block.cobblestone, Character.valueOf('G'), woodenGearItem }); - craftingmanager.addRecipe(new ItemStack(ironGearItem), new Object[] { - " I ", "IGI", " I ", Character.valueOf('I'), Item.ingotIron, - Character.valueOf('G'), stoneGearItem }); + craftingmanager.addRecipe(new ItemStack(ironGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'), + Item.ingotIron, Character.valueOf('G'), stoneGearItem }); - craftingmanager.addRecipe(new ItemStack(goldGearItem), new Object[] { - " I ", "IGI", " I ", Character.valueOf('I'), Item.ingotGold, - Character.valueOf('G'), ironGearItem }); + craftingmanager.addRecipe(new ItemStack(goldGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'), + Item.ingotGold, Character.valueOf('G'), ironGearItem }); - craftingmanager.addRecipe(new ItemStack(diamondGearItem), new Object[] { - " I ", "IGI", " I ", Character.valueOf('I'), Item.diamond, - Character.valueOf('G'), goldGearItem }); + craftingmanager.addRecipe(new ItemStack(diamondGearItem), new Object[] { " I ", "IGI", " I ", Character.valueOf('I'), + Item.diamond, Character.valueOf('G'), goldGearItem }); } public static void initializeGears() { if (gearsInitialized) return; - Property woodenGearId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("woodenGearItem.id", - Configuration.CATEGORY_ITEM, - DefaultProps.WOODEN_GEAR_ID); - Property stoneGearId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("stoneGearItem.id", - Configuration.CATEGORY_ITEM, DefaultProps.STONE_GEAR_ID); - Property ironGearId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("ironGearItem.id", - Configuration.CATEGORY_ITEM, DefaultProps.IRON_GEAR_ID); - Property goldenGearId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("goldenGearItem.id", - Configuration.CATEGORY_ITEM, - DefaultProps.GOLDEN_GEAR_ID); - Property diamondGearId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("diamondGearItem.id", - Configuration.CATEGORY_ITEM, - DefaultProps.DIAMOND_GEAR_ID); - Property modifyWorld = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("modifyWorld", - Configuration.CATEGORY_GENERAL, true); + Property woodenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("woodenGearItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.WOODEN_GEAR_ID); + Property stoneGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("stoneGearItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.STONE_GEAR_ID); + Property ironGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("ironGearItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.IRON_GEAR_ID); + Property goldenGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("goldenGearItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.GOLDEN_GEAR_ID); + Property diamondGearId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("diamondGearItem.id", + Configuration.CATEGORY_ITEM, DefaultProps.DIAMOND_GEAR_ID); + Property modifyWorld = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("modifyWorld", + Configuration.CATEGORY_GENERAL, true); modifyWorld.comment = "set to false if BuildCraft should not generate custom blocks (e.g. oil)"; BuildCraftCore.mainConfiguration.save(); @@ -330,26 +284,24 @@ public class BuildCraftCore { gearsInitialized = true; - woodenGearItem = (new ItemBuildCraft( - Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0) - .setItemName("woodenGearItem"); + woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setItemName( + "woodenGearItem"); CoreProxy.addName(woodenGearItem, "Wooden Gear"); - stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))) - .setIconIndex(1 * 16 + 1).setItemName("stoneGearItem"); + stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setItemName( + "stoneGearItem"); CoreProxy.addName(stoneGearItem, "Stone Gear"); - ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))) - .setIconIndex(1 * 16 + 2).setItemName("ironGearItem"); + ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setItemName( + "ironGearItem"); CoreProxy.addName(ironGearItem, "Iron Gear"); - goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))) - .setIconIndex(1 * 16 + 3).setItemName("goldGearItem"); + goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setItemName( + "goldGearItem"); CoreProxy.addName(goldGearItem, "Gold Gear"); - diamondGearItem = (new ItemBuildCraft( - Integer.parseInt(diamondGearId.value))) - .setIconIndex(1 * 16 + 4).setItemName("diamondGearItem"); + diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setItemName( + "diamondGearItem"); CoreProxy.addName(diamondGearItem, "Diamond Gear"); BuildCraftCore.mainConfiguration.save(); diff --git a/common/net/minecraft/src/BuildCraftEnergy.java b/common/net/minecraft/src/BuildCraftEnergy.java index 6adc3eb6..08f10f9b 100644 --- a/common/net/minecraft/src/BuildCraftEnergy.java +++ b/common/net/minecraft/src/BuildCraftEnergy.java @@ -53,19 +53,16 @@ public class BuildCraftEnergy { private static boolean initialized = false; - public static Trigger triggerBlueEngineHeat = new TriggerEngineHeat( - DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.Blue); - public static Trigger triggerGreenEngineHeat = new TriggerEngineHeat( - DefaultProps.TRIGGER_GREEN_ENGINE_HEAT, EnergyStage.Green); - public static Trigger triggerYellowEngineHeat = new TriggerEngineHeat( - DefaultProps.TRIGGER_YELLOW_ENGINE_HEAT, EnergyStage.Yellow); - public static Trigger triggerRedEngineHeat = new TriggerEngineHeat( - DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red); + public static Trigger triggerBlueEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.Blue); + public static Trigger triggerGreenEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_GREEN_ENGINE_HEAT, + EnergyStage.Green); + public static Trigger triggerYellowEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_YELLOW_ENGINE_HEAT, + EnergyStage.Yellow); + public static Trigger triggerRedEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red); public static void load() { // Register gui handler - MinecraftForge.setGuiHandler(mod_BuildCraftEnergy.instance, - new GuiHandler()); + MinecraftForge.setGuiHandler(mod_BuildCraftEnergy.instance, new GuiHandler()); // MinecraftForge.registerEntity(EntityMechanicalArm.class, // mod_BuildCraftEnergy.instance, EntityIds.MECHANICAL_ARM, 50, 10, @@ -80,46 +77,35 @@ public class BuildCraftEnergy { BuildCraftCore.initialize(); - Property engineId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("engine.id", DefaultProps.ENGINE_ID); - Property oilStillId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("oilStill.id", - DefaultProps.OIL_STILL_ID); - Property oilMovingId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("oilMoving.id", - DefaultProps.OIL_MOVING_ID); - Property bucketOilId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("bucketOil.id", - Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_OIL_ID); - Property bucketFuelId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("bucketFuel.id", - Configuration.CATEGORY_ITEM, - DefaultProps.BUCKET_FUEL_ID); - Property itemFuelId = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("fuel.id", Configuration.CATEGORY_ITEM, - DefaultProps.FUEL_ID); + Property engineId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("engine.id", DefaultProps.ENGINE_ID); + Property oilStillId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilStill.id", + DefaultProps.OIL_STILL_ID); + Property oilMovingId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("oilMoving.id", + DefaultProps.OIL_MOVING_ID); + Property bucketOilId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketOil.id", + Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_OIL_ID); + Property bucketFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bucketFuel.id", + Configuration.CATEGORY_ITEM, DefaultProps.BUCKET_FUEL_ID); + Property itemFuelId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("fuel.id", Configuration.CATEGORY_ITEM, + DefaultProps.FUEL_ID); BuildCraftCore.mainConfiguration.save(); engineBlock = new BlockEngine(Integer.parseInt(engineId.value)); Item.itemsList[engineBlock.blockID] = null; - Item.itemsList[engineBlock.blockID] = (new ItemEngine( - engineBlock.blockID - 256)); + Item.itemsList[engineBlock.blockID] = (new ItemEngine(engineBlock.blockID - 256)); CoreProxy.addName(new ItemStack(engineBlock, 1, 0), "Redstone Engine"); CoreProxy.addName(new ItemStack(engineBlock, 1, 1), "Steam Engine"); - CoreProxy - .addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine"); + CoreProxy.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine"); - oilMoving = (new BlockOilFlowing(Integer.parseInt(oilMovingId.value), - Material.water)).setHardness(100F).setLightOpacity(3) - .setBlockName("oil"); + oilMoving = (new BlockOilFlowing(Integer.parseInt(oilMovingId.value), Material.water)).setHardness(100F) + .setLightOpacity(3).setBlockName("oil"); CoreProxy.addName(oilMoving.setBlockName("oilMoving"), "Oil"); CoreProxy.registerBlock(oilMoving); - oilStill = (new BlockOilStill(Integer.parseInt(oilStillId.value), - Material.water)).setHardness(100F).setLightOpacity(3) + oilStill = (new BlockOilStill(Integer.parseInt(oilStillId.value), Material.water)).setHardness(100F).setLightOpacity(3) .setBlockName("oil"); CoreProxy.addName(oilStill.setBlockName("oilStill"), "Oil"); CoreProxy.registerBlock(oilStill); @@ -129,33 +115,25 @@ public class BuildCraftEnergy { MinecraftForge.registerCustomBucketHandler(new OilBucketHandler()); - bucketOil = (new ItemBucketOil(Integer.parseInt(bucketOilId.value))) - .setItemName("bucketOil").setContainerItem(Item.bucketEmpty); + bucketOil = (new ItemBucketOil(Integer.parseInt(bucketOilId.value))).setItemName("bucketOil").setContainerItem( + Item.bucketEmpty); CoreProxy.addName(bucketOil, "Oil Bucket"); - fuel = new ItemBuildCraft(Integer.parseInt(itemFuelId.value)) - .setItemName("fuel"); + fuel = new ItemBuildCraft(Integer.parseInt(itemFuelId.value)).setItemName("fuel"); CoreProxy.addName(fuel, "Fuel"); - bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)) - .setIconIndex(0 * 16 + 3).setItemName("bucketFuel") + bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setIconIndex(0 * 16 + 3).setItemName("bucketFuel") .setMaxStackSize(1).setContainerItem(Item.bucketEmpty); CoreProxy.addName(bucketFuel, "Fuel Bucket"); - BuildCraftAPI.registerRefineryRecipe(new RefineryRecipe( - oilStill.blockID, 1, 0, 0, 10, fuel.shiftedIndex, 1, 1)); + BuildCraftAPI.registerRefineryRecipe(new RefineryRecipe(oilStill.blockID, 1, 0, 0, 10, fuel.shiftedIndex, 1, 1)); - BuildCraftAPI.ironEngineFuel.put(Block.lavaStill.blockID, - new IronEngineFuel(oilStill.blockID, 1, 20000)); - BuildCraftAPI.ironEngineFuel.put(oilStill.blockID, new IronEngineFuel( - oilStill.blockID, 2, 10000)); - BuildCraftAPI.ironEngineFuel.put(fuel.shiftedIndex, new IronEngineFuel( - fuel.shiftedIndex, 5, 50000)); + BuildCraftAPI.ironEngineFuel.put(Block.lavaStill.blockID, new IronEngineFuel(oilStill.blockID, 1, 20000)); + BuildCraftAPI.ironEngineFuel.put(oilStill.blockID, new IronEngineFuel(oilStill.blockID, 2, 10000)); + BuildCraftAPI.ironEngineFuel.put(fuel.shiftedIndex, new IronEngineFuel(fuel.shiftedIndex, 5, 50000)); - BuildCraftAPI.liquids.add(new LiquidData(oilStill.blockID, - oilMoving.blockID, bucketOil)); - BuildCraftAPI.liquids.add(new LiquidData(fuel.shiftedIndex, 0, - bucketFuel)); + BuildCraftAPI.liquids.add(new LiquidData(oilStill.blockID, oilMoving.blockID, bucketOil)); + BuildCraftAPI.liquids.add(new LiquidData(fuel.shiftedIndex, 0, bucketFuel)); BuildCraftAPI.softBlocks[oilMoving.blockID] = true; BuildCraftAPI.softBlocks[oilStill.blockID] = true; @@ -169,21 +147,15 @@ public class BuildCraftEnergy { public static void loadRecipes() { CraftingManager craftingmanager = CraftingManager.getInstance(); - craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 0), - new Object[] { "www", " g ", "GpG", Character.valueOf('w'), - Block.planks, Character.valueOf('g'), Block.glass, - Character.valueOf('G'), BuildCraftCore.woodenGearItem, - Character.valueOf('p'), Block.pistonBase }); - craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 1), - new Object[] { "www", " g ", "GpG", Character.valueOf('w'), - Block.cobblestone, Character.valueOf('g'), Block.glass, - Character.valueOf('G'), BuildCraftCore.stoneGearItem, - Character.valueOf('p'), Block.pistonBase }); - craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 2), - new Object[] { "www", " g ", "GpG", Character.valueOf('w'), - Item.ingotIron, Character.valueOf('g'), Block.glass, - Character.valueOf('G'), BuildCraftCore.ironGearItem, - Character.valueOf('p'), Block.pistonBase }); + craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 0), new Object[] { "www", " g ", "GpG", Character.valueOf('w'), + Block.planks, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.woodenGearItem, + Character.valueOf('p'), Block.pistonBase }); + craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 1), new Object[] { "www", " g ", "GpG", Character.valueOf('w'), + Block.cobblestone, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.stoneGearItem, + Character.valueOf('p'), Block.pistonBase }); + craftingmanager.addRecipe(new ItemStack(engineBlock, 1, 2), new Object[] { "www", " g ", "GpG", Character.valueOf('w'), + Item.ingotIron, Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.ironGearItem, + Character.valueOf('p'), Block.pistonBase }); } public static void generateSurface(World world, Random random, int i, int j) { diff --git a/common/net/minecraft/src/BuildCraftFactory.java b/common/net/minecraft/src/BuildCraftFactory.java index b3cd4373..14f4243b 100644 --- a/common/net/minecraft/src/BuildCraftFactory.java +++ b/common/net/minecraft/src/BuildCraftFactory.java @@ -40,6 +40,7 @@ import net.minecraft.src.forge.MinecraftForge; import net.minecraft.src.forge.Property; public class BuildCraftFactory { + public static BlockQuarry quarryBlock; public static BlockMiningWell miningWellBlock; public static BlockAutoWorkbench autoWorkbenchBlock; @@ -62,8 +63,7 @@ public class BuildCraftFactory { MinecraftForge.registerConnectionHandler(new ConnectionHandler()); // Register gui handler - MinecraftForge.setGuiHandler(mod_BuildCraftFactory.instance, - new GuiHandler()); + MinecraftForge.setGuiHandler(mod_BuildCraftFactory.instance, new GuiHandler()); // MinecraftForge.registerEntity(EntityMechanicalArm.class, // mod_BuildCraftFactory.instance, EntityIds.MECHANICAL_ARM, 50, 10, @@ -79,53 +79,38 @@ public class BuildCraftFactory { mod_BuildCraftCore.initialize(); BuildCraftCore.initializeGears(); - allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("mining.enabled", - Configuration.CATEGORY_GENERAL, true).value); + allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("mining.enabled", + Configuration.CATEGORY_GENERAL, true).value); - Property minigWellId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("miningWell.id", - DefaultProps.MINING_WELL_ID); - Property plainPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("drill.id", DefaultProps.DRILL_ID); - Property autoWorkbenchId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("autoWorkbench.id", - DefaultProps.AUTO_WORKBENCH_ID); - Property frameId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("frame.id", DefaultProps.FRAME_ID); - Property quarryId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("quarry.id", DefaultProps.QUARRY_ID); - Property pumpId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("pump.id", DefaultProps.PUMP_ID); - Property tankId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("tank.id", DefaultProps.TANK_ID); + Property minigWellId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("miningWell.id", + DefaultProps.MINING_WELL_ID); + Property plainPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("drill.id", DefaultProps.DRILL_ID); + Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("autoWorkbench.id", + DefaultProps.AUTO_WORKBENCH_ID); + Property frameId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("frame.id", DefaultProps.FRAME_ID); + Property quarryId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("quarry.id", DefaultProps.QUARRY_ID); + Property pumpId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pump.id", DefaultProps.PUMP_ID); + Property tankId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("tank.id", DefaultProps.TANK_ID); Property refineryId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("refinery.id", - DefaultProps.REFINERY_ID); - Property hopperId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("hopper.id", DefaultProps.HOPPER_ID); - Property hopperDisable = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("hopper.disabled", "Block Savers", - false); + .getOrCreateBlockIdProperty("refinery.id", DefaultProps.REFINERY_ID); + Property hopperId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("hopper.id", DefaultProps.HOPPER_ID); + Property hopperDisable = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("hopper.disabled", "Block Savers", + false); BuildCraftCore.mainConfiguration.save(); MinecraftForge.registerCustomBucketHandler(new TankBucketHandler()); - miningWellBlock = new BlockMiningWell( - Integer.parseInt(minigWellId.value)); - CoreProxy - .registerBlock(miningWellBlock.setBlockName("miningWellBlock")); + miningWellBlock = new BlockMiningWell(Integer.parseInt(minigWellId.value)); + CoreProxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock")); CoreProxy.addName(miningWellBlock, "Mining Well"); plainPipeBlock = new BlockPlainPipe(Integer.parseInt(plainPipeId.value)); CoreProxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock")); CoreProxy.addName(plainPipeBlock, "Mining Pipe"); - autoWorkbenchBlock = new BlockAutoWorkbench( - Integer.parseInt(autoWorkbenchId.value)); - CoreProxy.registerBlock(autoWorkbenchBlock - .setBlockName("autoWorkbenchBlock")); + autoWorkbenchBlock = new BlockAutoWorkbench(Integer.parseInt(autoWorkbenchId.value)); + CoreProxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock")); CoreProxy.addName(autoWorkbenchBlock, "Automatic Crafting Table"); frameBlock = new BlockFrame(Integer.parseInt(frameId.value)); @@ -158,20 +143,14 @@ public class BuildCraftFactory { CoreProxy.registerTileEntity(TileQuarry.class, "Machine"); CoreProxy.registerTileEntity(TileMiningWell.class, "MiningWell"); CoreProxy.registerTileEntity(TileAutoWorkbench.class, "AutoWorkbench"); - CoreProxy.registerTileEntity(TilePump.class, - "net.minecraft.src.buildcraft.factory.TilePump"); - CoreProxy.registerTileEntity(TileTank.class, - "net.minecraft.src.buildcraft.factory.TileTank"); - CoreProxy.registerTileEntity(TileRefinery.class, - "net.minecraft.src.buildcraft.factory.Refinery"); - CoreProxy.registerTileEntity(TileLaser.class, - "net.minecraft.src.buildcraft.factory.TileLaser"); - CoreProxy.registerTileEntity(TileAssemblyTable.class, - "net.minecraft.src.buildcraft.factory.TileAssemblyTable"); + CoreProxy.registerTileEntity(TilePump.class, "net.minecraft.src.buildcraft.factory.TilePump"); + CoreProxy.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank"); + CoreProxy.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery"); + CoreProxy.registerTileEntity(TileLaser.class, "net.minecraft.src.buildcraft.factory.TileLaser"); + CoreProxy.registerTileEntity(TileAssemblyTable.class, "net.minecraft.src.buildcraft.factory.TileAssemblyTable"); if (!hopperDisabled) { - CoreProxy.registerTileEntity(TileHopper.class, - "net.minecraft.src.buildcraft.factory.TileHopper"); + CoreProxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper"); } drillTexture = 2 * 16 + 1; @@ -192,42 +171,31 @@ public class BuildCraftFactory { if (allowMining) { craftingmanager.addRecipe(new ItemStack(miningWellBlock, 1), - new Object[] { "ipi", "igi", "iPi", Character.valueOf('p'), - Item.redstone, Character.valueOf('i'), - Item.ingotIron, Character.valueOf('g'), - BuildCraftCore.ironGearItem, - Character.valueOf('P'), Item.pickaxeSteel }); + new Object[] { "ipi", "igi", "iPi", Character.valueOf('p'), Item.redstone, Character.valueOf('i'), + Item.ingotIron, Character.valueOf('g'), BuildCraftCore.ironGearItem, Character.valueOf('P'), + Item.pickaxeSteel }); - craftingmanager.addRecipe(new ItemStack(quarryBlock), new Object[] { - "ipi", "gig", "dDd", Character.valueOf('i'), - BuildCraftCore.ironGearItem, Character.valueOf('p'), - Item.redstone, Character.valueOf('g'), - BuildCraftCore.goldGearItem, Character.valueOf('d'), - BuildCraftCore.diamondGearItem, Character.valueOf('D'), + craftingmanager.addRecipe(new ItemStack(quarryBlock), new Object[] { "ipi", "gig", "dDd", Character.valueOf('i'), + BuildCraftCore.ironGearItem, Character.valueOf('p'), Item.redstone, Character.valueOf('g'), + BuildCraftCore.goldGearItem, Character.valueOf('d'), BuildCraftCore.diamondGearItem, Character.valueOf('D'), Item.pickaxeDiamond, }); } - craftingmanager.addRecipe(new ItemStack(autoWorkbenchBlock), - new Object[] { " g ", "gwg", " g ", Character.valueOf('w'), - Block.workbench, Character.valueOf('g'), - BuildCraftCore.woodenGearItem }); + craftingmanager.addRecipe(new ItemStack(autoWorkbenchBlock), new Object[] { " g ", "gwg", " g ", Character.valueOf('w'), + Block.workbench, Character.valueOf('g'), BuildCraftCore.woodenGearItem }); - craftingmanager.addRecipe(new ItemStack(pumpBlock), - new Object[] { "T ", "W ", Character.valueOf('T'), tankBlock, - Character.valueOf('W'), miningWellBlock, }); + craftingmanager.addRecipe(new ItemStack(pumpBlock), new Object[] { "T ", "W ", Character.valueOf('T'), tankBlock, + Character.valueOf('W'), miningWellBlock, }); - craftingmanager.addRecipe(new ItemStack(tankBlock), new Object[] { - "ggg", "g g", "ggg", Character.valueOf('g'), Block.glass, }); + craftingmanager.addRecipe(new ItemStack(tankBlock), new Object[] { "ggg", "g g", "ggg", Character.valueOf('g'), + Block.glass, }); - craftingmanager.addRecipe(new ItemStack(refineryBlock), new Object[] { - " ", "RTR", "TGT", Character.valueOf('T'), tankBlock, - Character.valueOf('G'), BuildCraftCore.diamondGearItem, - Character.valueOf('R'), Block.torchRedstoneActive, }); + craftingmanager.addRecipe(new ItemStack(refineryBlock), new Object[] { " ", "RTR", "TGT", Character.valueOf('T'), + tankBlock, Character.valueOf('G'), BuildCraftCore.diamondGearItem, Character.valueOf('R'), + Block.torchRedstoneActive, }); if (!hopperDisabled) { - craftingmanager.addRecipe(new ItemStack(hopperBlock), new Object[] { - "ICI", "IGI", " I ", Character.valueOf('I'), - Item.ingotIron, Character.valueOf('C'), Block.chest, - Character.valueOf('G'), BuildCraftCore.stoneGearItem }); + craftingmanager.addRecipe(new ItemStack(hopperBlock), new Object[] { "ICI", "IGI", " I ", Character.valueOf('I'), + Item.ingotIron, Character.valueOf('C'), Block.chest, Character.valueOf('G'), BuildCraftCore.stoneGearItem }); } } diff --git a/common/net/minecraft/src/BuildCraftSilicon.java b/common/net/minecraft/src/BuildCraftSilicon.java index 98d82cac..3c1827f2 100644 --- a/common/net/minecraft/src/BuildCraftSilicon.java +++ b/common/net/minecraft/src/BuildCraftSilicon.java @@ -36,8 +36,7 @@ public class BuildCraftSilicon { MinecraftForge.registerConnectionHandler(new ConnectionHandler()); // Register gui handler - MinecraftForge.setGuiHandler(mod_BuildCraftSilicon.instance, - new GuiHandler()); + MinecraftForge.setGuiHandler(mod_BuildCraftSilicon.instance, new GuiHandler()); } public static void initialize() { @@ -48,12 +47,10 @@ public class BuildCraftSilicon { mod_BuildCraftCore.initialize(); - Property laserId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("laser.id", DefaultProps.LASER_ID); + Property laserId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("laser.id", DefaultProps.LASER_ID); - Property assemblyTableId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("assemblyTable.id", - DefaultProps.ASSEMBLY_TABLE_ID); + Property assemblyTableId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("assemblyTable.id", + DefaultProps.ASSEMBLY_TABLE_ID); BuildCraftCore.mainConfiguration.save(); @@ -61,158 +58,101 @@ public class BuildCraftSilicon { CoreProxy.addName(laserBlock.setBlockName("laserBlock"), "Laser"); CoreProxy.registerBlock(laserBlock); - assemblyTableBlock = new BlockAssemblyTable( - Integer.parseInt(assemblyTableId.value)); - CoreProxy.addName( - assemblyTableBlock.setBlockName("assemblyTableBlock"), - "Assembly Table"); + assemblyTableBlock = new BlockAssemblyTable(Integer.parseInt(assemblyTableId.value)); + CoreProxy.addName(assemblyTableBlock.setBlockName("assemblyTableBlock"), "Assembly Table"); CoreProxy.registerBlock(assemblyTableBlock); redstoneChipset = new ItemRedstoneChipset(DefaultProps.REDSTONE_CHIPSET); redstoneChipset.setItemName("redstoneChipset"); // / REDSTONE CHIPSETS - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe( - new ItemStack[] { new ItemStack(Item.redstone) }, 10000, + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone) }, 10000, new ItemStack(redstoneChipset, 1, 0))); - CoreProxy.addName(new ItemStack(redstoneChipset, 1, 0), - "Redstone Chipset"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.redstone), new ItemStack(Item.ingotIron) }, - 20000, new ItemStack(redstoneChipset, 1, 1))); - CoreProxy.addName(new ItemStack(redstoneChipset, 1, 1), - "Redstone Iron Chipset"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.redstone), new ItemStack(Item.ingotGold) }, - 40000, new ItemStack(redstoneChipset, 1, 2))); - CoreProxy.addName(new ItemStack(redstoneChipset, 1, 2), - "Redstone Golden Chipset"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.redstone), new ItemStack(Item.diamond) }, - 80000, new ItemStack(redstoneChipset, 1, 3))); - CoreProxy.addName(new ItemStack(redstoneChipset, 1, 3), - "Redstone Diamond Chipset"); + CoreProxy.addName(new ItemStack(redstoneChipset, 1, 0), "Redstone Chipset"); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone), + new ItemStack(Item.ingotIron) }, 20000, new ItemStack(redstoneChipset, 1, 1))); + CoreProxy.addName(new ItemStack(redstoneChipset, 1, 1), "Redstone Iron Chipset"); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone), + new ItemStack(Item.ingotGold) }, 40000, new ItemStack(redstoneChipset, 1, 2))); + CoreProxy.addName(new ItemStack(redstoneChipset, 1, 2), "Redstone Golden Chipset"); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone), + new ItemStack(Item.diamond) }, 80000, new ItemStack(redstoneChipset, 1, 3))); + CoreProxy.addName(new ItemStack(redstoneChipset, 1, 3), "Redstone Diamond Chipset"); // PULSATING CHIPSETS - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.redstone), new ItemStack(Item.enderPearl) }, - 40000, new ItemStack(redstoneChipset, 2, 4))); - CoreProxy.addName(new ItemStack(redstoneChipset, 1, 4), - "Pulsating Chipset"); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.redstone), + new ItemStack(Item.enderPearl) }, 40000, new ItemStack(redstoneChipset, 2, 4))); + CoreProxy.addName(new ItemStack(redstoneChipset, 1, 4), "Pulsating Chipset"); // / REDSTONE GATES - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe( - new ItemStack[] { new ItemStack(redstoneChipset, 1, 0) }, - 20000, new ItemStack(BuildCraftTransport.pipeGate, 1, 0))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 0), - "Gate"); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 0) }, 20000, + new ItemStack(BuildCraftTransport.pipeGate, 1, 0))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 0), "Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 0), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 10000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 0))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 0), "Autarchic Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 0), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 10000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 0))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 0), "Autarchic Gate"); // / IRON AND GATES + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 1), + new ItemStack(BuildCraftTransport.redPipeWire) }, 40000, new ItemStack(BuildCraftTransport.pipeGate, 1, 1))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 1), "Iron AND Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(redstoneChipset, 1, 1), - new ItemStack(BuildCraftTransport.redPipeWire) }, 40000, - new ItemStack(BuildCraftTransport.pipeGate, 1, 1))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 1), - "Iron AND Gate"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 1), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 1))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 1), "Autarchic Iron AND Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 1), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 1), "Autarchic Iron AND Gate"); // / IRON OR GATES + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 1), + new ItemStack(BuildCraftTransport.redPipeWire) }, 40000, new ItemStack(BuildCraftTransport.pipeGate, 1, 2))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 2), "Iron OR Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(redstoneChipset, 1, 1), - new ItemStack(BuildCraftTransport.redPipeWire) }, 40000, - new ItemStack(BuildCraftTransport.pipeGate, 1, 2))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 2), - "Iron OR Gate"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 2), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 2))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 2), "Autarchic Iron OR Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 2), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 20000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 2), "Autarchic Iron OR Gate"); // / GOLD AND GATES - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(redstoneChipset, 1, 2), - new ItemStack(BuildCraftTransport.redPipeWire), - new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000, + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 2), + new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000, new ItemStack(BuildCraftTransport.pipeGate, 1, 3))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 3), - "Gold AND Gate"); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 3), "Gold AND Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 3), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 3))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 3), "Autarchic Gold AND Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 3), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 3), "Autarchic Gold AND Gate"); // / GOLD OR GATES - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(redstoneChipset, 1, 2), - new ItemStack(BuildCraftTransport.redPipeWire), - new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000, + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 2), + new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire) }, 80000, new ItemStack(BuildCraftTransport.pipeGate, 1, 4))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 4), - "Gold OR Gate"); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 4), "Gold OR Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 4), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 4))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 4), "Autarchic Gold OR Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 4), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 40000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 4), "Autarchic Gold OR Gate"); // / DIAMOND AND GATES - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(redstoneChipset, 1, 3), - new ItemStack(BuildCraftTransport.redPipeWire), - new ItemStack(BuildCraftTransport.bluePipeWire), - new ItemStack(BuildCraftTransport.greenPipeWire), - new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000, + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 3), + new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire), + new ItemStack(BuildCraftTransport.greenPipeWire), new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000, new ItemStack(BuildCraftTransport.pipeGate, 1, 5))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 5), - "Diamond AND Gate"); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 5), "Diamond AND Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 5), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 5))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 5), "Autarchic Diamond AND Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 5), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 5), "Autarchic Diamond AND Gate"); // / DIAMOND OR GATES - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(redstoneChipset, 1, 3), - new ItemStack(BuildCraftTransport.redPipeWire), - new ItemStack(BuildCraftTransport.bluePipeWire), - new ItemStack(BuildCraftTransport.greenPipeWire), - new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000, + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(redstoneChipset, 1, 3), + new ItemStack(BuildCraftTransport.redPipeWire), new ItemStack(BuildCraftTransport.bluePipeWire), + new ItemStack(BuildCraftTransport.greenPipeWire), new ItemStack(BuildCraftTransport.yellowPipeWire) }, 160000, new ItemStack(BuildCraftTransport.pipeGate, 1, 6))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 6), - "Diamond OR Gate"); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGate, 1, 6), "Diamond OR Gate"); BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(BuildCraftTransport.pipeGate, 1, 6), - new ItemStack(redstoneChipset, 1, 4), - new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack( - BuildCraftTransport.pipeGateAutarchic, 1, 6))); - CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, - 1, 6), "Autarchic Diamond OR Gate"); + new ItemStack(BuildCraftTransport.pipeGate, 1, 6), new ItemStack(redstoneChipset, 1, 4), + new ItemStack(redstoneChipset, 1, 1) }, 80000, new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6))); + CoreProxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6), "Autarchic Diamond OR Gate"); - new BptBlockRotateMeta(laserBlock.blockID, new int[] { 2, 5, 3, 4 }, - true); + new BptBlockRotateMeta(laserBlock.blockID, new int[] { 2, 5, 3, 4 }, true); new BptBlockInventory(assemblyTableBlock.blockID); if (BuildCraftCore.loadDefaultRecipes) @@ -223,20 +163,13 @@ public class BuildCraftSilicon { public static void loadRecipes() { CraftingManager craftingmanager = CraftingManager.getInstance(); - craftingmanager.addRecipe(new ItemStack(laserBlock), new Object[] { - "ORR", "DDR", "ORR", Character.valueOf('O'), Block.obsidian, - Character.valueOf('R'), Item.redstone, Character.valueOf('D'), - Item.diamond, }); + craftingmanager.addRecipe(new ItemStack(laserBlock), new Object[] { "ORR", "DDR", "ORR", Character.valueOf('O'), + Block.obsidian, Character.valueOf('R'), Item.redstone, Character.valueOf('D'), Item.diamond, }); - craftingmanager - .addRecipe( - new ItemStack(assemblyTableBlock), - new Object[] { "ORO", "ODO", "OGO", - Character.valueOf('O'), Block.obsidian, - Character.valueOf('R'), Item.redstone, - Character.valueOf('D'), Item.diamond, - Character.valueOf('G'), - BuildCraftCore.diamondGearItem, }); + craftingmanager.addRecipe(new ItemStack(assemblyTableBlock), + new Object[] { "ORO", "ODO", "OGO", Character.valueOf('O'), Block.obsidian, Character.valueOf('R'), + Item.redstone, Character.valueOf('D'), Item.diamond, Character.valueOf('G'), + BuildCraftCore.diamondGearItem, }); } public static void initializeModel(BaseMod mod) { diff --git a/common/net/minecraft/src/BuildCraftTransport.java b/common/net/minecraft/src/BuildCraftTransport.java index 3e0cb24b..919dd356 100644 --- a/common/net/minecraft/src/BuildCraftTransport.java +++ b/common/net/minecraft/src/BuildCraftTransport.java @@ -101,49 +101,35 @@ public class BuildCraftTransport { public static Item pipeStructureCobblestone; public static int groupItemsTrigger; - public static Trigger triggerPipeEmpty = new TriggerPipeContents( - DefaultProps.TRIGGER_PIPE_EMPTY, Kind.Empty); - public static Trigger triggerPipeItems = new TriggerPipeContents( - DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems); - public static Trigger triggerPipeLiquids = new TriggerPipeContents( - DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids); - public static Trigger triggerPipeEnergy = new TriggerPipeContents( - DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy); - public static Trigger triggerRedSignalActive = new TriggerPipeSignal( - DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true, IPipe.WireColor.Red); - public static Trigger triggerRedSignalInactive = new TriggerPipeSignal( - DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false, + public static Trigger triggerPipeEmpty = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_EMPTY, Kind.Empty); + public static Trigger triggerPipeItems = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems); + public static Trigger triggerPipeLiquids = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids); + public static Trigger triggerPipeEnergy = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy); + public static Trigger triggerRedSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true, IPipe.WireColor.Red); - public static Trigger triggerBlueSignalActive = new TriggerPipeSignal( - DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true, IPipe.WireColor.Blue); - public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal( - DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false, + public static Trigger triggerRedSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false, + IPipe.WireColor.Red); + public static Trigger triggerBlueSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true, IPipe.WireColor.Blue); - public static Trigger triggerGreenSignalActive = new TriggerPipeSignal( - DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true, + public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false, + IPipe.WireColor.Blue); + public static Trigger triggerGreenSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true, IPipe.WireColor.Green); - public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal( - DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false, + public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false, IPipe.WireColor.Green); - public static Trigger triggerYellowSignalActive = new TriggerPipeSignal( - DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true, + public static Trigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true, IPipe.WireColor.Yellow); - public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal( - DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false, + public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false, IPipe.WireColor.Yellow); - public static Action actionRedSignal = new ActionSignalOutput( - DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red); - public static Action actionBlueSignal = new ActionSignalOutput( - DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue); - public static Action actionGreenSignal = new ActionSignalOutput( - DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green); - public static Action actionYellowSignal = new ActionSignalOutput( - DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow); - public static Action actionEnergyPulser = new ActionEnergyPulser( - DefaultProps.ACTION_ENERGY_PULSER); + public static Action actionRedSignal = new ActionSignalOutput(DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red); + public static Action actionBlueSignal = new ActionSignalOutput(DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue); + public static Action actionGreenSignal = new ActionSignalOutput(DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green); + public static Action actionYellowSignal = new ActionSignalOutput(DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow); + public static Action actionEnergyPulser = new ActionEnergyPulser(DefaultProps.ACTION_ENERGY_PULSER); private static class PipeRecipe { + boolean isShapeless = false; // pipe recipes come shaped and unshaped. ItemStack result; Object[] input; @@ -156,8 +142,7 @@ public class BuildCraftTransport { MinecraftForge.registerConnectionHandler(new ConnectionHandler()); // Register gui handler - MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance, - new GuiHandler()); + MinecraftForge.setGuiHandler(mod_BuildCraftTransport.instance, new GuiHandler()); } public static void initialize() { @@ -168,131 +153,98 @@ public class BuildCraftTransport { mod_BuildCraftCore.initialize(); - Property loadLegacyPipes = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("loadLegacyPipes", - Configuration.CATEGORY_GENERAL, true); + Property loadLegacyPipes = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("loadLegacyPipes", + Configuration.CATEGORY_GENERAL, true); loadLegacyPipes.comment = "set to true to load pre 2.2.5 worlds pipes"; - Property alwaysConnect = BuildCraftCore.mainConfiguration - .getOrCreateBooleanProperty("pipes.alwaysConnect", - Configuration.CATEGORY_GENERAL, - DefaultProps.PIPES_ALWAYS_CONNECT); + Property alwaysConnect = BuildCraftCore.mainConfiguration.getOrCreateBooleanProperty("pipes.alwaysConnect", + Configuration.CATEGORY_GENERAL, DefaultProps.PIPES_ALWAYS_CONNECT); alwaysConnect.comment = "set to false to deactivate pipe connection rules, true by default"; - Property exclusionList = BuildCraftCore.mainConfiguration - .getOrCreateProperty("woodenPipe.exclusion", - Configuration.CATEGORY_BLOCK, ""); + Property exclusionList = BuildCraftCore.mainConfiguration.getOrCreateProperty("woodenPipe.exclusion", + Configuration.CATEGORY_BLOCK, ""); PipeLogicWood.excludedBlocks = exclusionList.value.split(","); - Property maxItemInPipesProp = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("pipes.maxItems", - Configuration.CATEGORY_GENERAL, 100); + Property maxItemInPipesProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.maxItems", + Configuration.CATEGORY_GENERAL, 100); maxItemInPipesProp.comment = "pipes containing more than this amount of items will explode, not dropping any item"; maxItemsInPipes = Integer.parseInt(maxItemInPipesProp.value); - Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty("pipes.groupItemsTrigger", - Configuration.CATEGORY_GENERAL, 32); + Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipes.groupItemsTrigger", + Configuration.CATEGORY_GENERAL, 32); groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped"; groupItemsTrigger = Integer.parseInt(groupItemsTriggerProp.value); - Property genericPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("pipe.id", - DefaultProps.GENERIC_PIPE_ID); + Property genericPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("pipe.id", + DefaultProps.GENERIC_PIPE_ID); for (int j = 0; j < PipeLogicWood.excludedBlocks.length; ++j) - PipeLogicWood.excludedBlocks[j] = PipeLogicWood.excludedBlocks[j] - .trim(); + PipeLogicWood.excludedBlocks[j] = PipeLogicWood.excludedBlocks[j].trim(); BuildCraftCore.mainConfiguration.save(); - pipeWaterproof = new ItemBuildCraft(DefaultProps.PIPE_WATERPROOF_ID) - .setIconIndex(2 * 16 + 1); + pipeWaterproof = new ItemBuildCraft(DefaultProps.PIPE_WATERPROOF_ID).setIconIndex(2 * 16 + 1); pipeWaterproof.setItemName("pipeWaterproof"); CoreProxy.addName(pipeWaterproof, "Pipe Waterproof"); - genericPipeBlock = new BlockGenericPipe( - Integer.parseInt(genericPipeId.value)); + genericPipeBlock = new BlockGenericPipe(Integer.parseInt(genericPipeId.value)); CoreProxy.registerBlock(genericPipeBlock); // Fixing retro-compatiblity - mod_BuildCraftTransport.registerTilePipe(TileDummyGenericPipe.class, - "net.minecraft.src.buildcraft.GenericPipe"); + mod_BuildCraftTransport.registerTilePipe(TileDummyGenericPipe.class, "net.minecraft.src.buildcraft.GenericPipe"); mod_BuildCraftTransport.registerTilePipe(TileDummyGenericPipe2.class, "net.minecraft.src.buildcraft.transport.TileGenericPipe"); - mod_BuildCraftTransport.registerTilePipe(TileGenericPipe.class, - "net.minecraft.src.buildcraft.transport.GenericPipe"); + mod_BuildCraftTransport.registerTilePipe(TileGenericPipe.class, "net.minecraft.src.buildcraft.transport.GenericPipe"); - pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, - PipeItemsWood.class, "Wooden Transport Pipe", Block.planks, + pipeItemsWood = createPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", Block.planks, Block.glass, Block.planks); - pipeItemsCobblestone = createPipe( - DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, - PipeItemsCobblestone.class, "Cobblestone Transport Pipe", - Block.cobblestone, Block.glass, Block.cobblestone); - pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID, - PipeItemsStone.class, "Stone Transport Pipe", Block.stone, + pipeItemsCobblestone = createPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, + "Cobblestone Transport Pipe", Block.cobblestone, Block.glass, Block.cobblestone); + pipeItemsStone = createPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone, Block.glass, Block.stone); - pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID, - PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, + pipeItemsIron = createPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron); - pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, - PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, + pipeItemsGold = createPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold); - pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, - PipeItemsDiamond.class, "Diamond Transport Pipe", Item.diamond, - Block.glass, Item.diamond); - pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, - PipeItemsObsidian.class, "Obsidian Transport Pipe", + pipeItemsDiamond = createPipe(DefaultProps.PIPE_ITEMS_DIAMOND_ID, PipeItemsDiamond.class, "Diamond Transport Pipe", + Item.diamond, Block.glass, Item.diamond); + pipeItemsObsidian = createPipe(DefaultProps.PIPE_ITEMS_OBSIDIAN_ID, PipeItemsObsidian.class, "Obsidian Transport Pipe", Block.obsidian, Block.glass, Block.obsidian); - pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, - PipeLiquidsWood.class, "Wooden Waterproof Pipe", + pipeLiquidsWood = createPipe(DefaultProps.PIPE_LIQUIDS_WOOD_ID, PipeLiquidsWood.class, "Wooden Waterproof Pipe", pipeWaterproof, pipeItemsWood, null); - pipeLiquidsCobblestone = createPipe( - DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, - PipeLiquidsCobblestone.class, "Cobblestone Waterproof Pipe", - pipeWaterproof, pipeItemsCobblestone, null); - pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID, - PipeLiquidsStone.class, "Stone Waterproof Pipe", + pipeLiquidsCobblestone = createPipe(DefaultProps.PIPE_LIQUIDS_COBBLESTONE_ID, PipeLiquidsCobblestone.class, + "Cobblestone Waterproof Pipe", pipeWaterproof, pipeItemsCobblestone, null); + pipeLiquidsStone = createPipe(DefaultProps.PIPE_LIQUIDS_STONE_ID, PipeLiquidsStone.class, "Stone Waterproof Pipe", pipeWaterproof, pipeItemsStone, null); - pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID, - PipeLiquidsIron.class, "Iron Waterproof Pipe", pipeWaterproof, - pipeItemsIron, null); - pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID, - PipeLiquidsGold.class, "Golden Waterproof Pipe", + pipeLiquidsIron = createPipe(DefaultProps.PIPE_LIQUIDS_IRON_ID, PipeLiquidsIron.class, "Iron Waterproof Pipe", + pipeWaterproof, pipeItemsIron, null); + pipeLiquidsGold = createPipe(DefaultProps.PIPE_LIQUIDS_GOLD_ID, PipeLiquidsGold.class, "Golden Waterproof Pipe", pipeWaterproof, pipeItemsGold, null); // diamond // obsidian - pipePowerWood = createPipe(DefaultProps.PIPE_POWER_WOOD_ID, - PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone, + pipePowerWood = createPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone, pipeItemsWood, null); // cobblestone - pipePowerStone = createPipe(DefaultProps.PIPE_POWER_STONE_ID, - PipePowerStone.class, "Stone Conductive Pipe", Item.redstone, - pipeItemsStone, null); + pipePowerStone = createPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Conductive Pipe", + Item.redstone, pipeItemsStone, null); // iron - pipePowerGold = createPipe(DefaultProps.PIPE_POWER_GOLD_ID, - PipePowerGold.class, "Golden Conductive Pipe", Item.redstone, + pipePowerGold = createPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Conductive Pipe", Item.redstone, pipeItemsGold, null); // diamond // obsidian // Fix name and recipe (Structure pipe insteand of Signal?) - pipeStructureCobblestone = createPipe( - DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, - PipeStructureCobblestone.class, "Cobblestone Structure Pipe", - Block.gravel, pipeItemsCobblestone, null); + pipeStructureCobblestone = createPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class, + "Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone, null); // Fix the recipe - pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID, - PipeItemsStripes.class, "Stripes Transport Pipe", - new ItemStack(Item.dyePowder, 1, 0), Block.glass, - new ItemStack(Item.dyePowder, 1, 11)); + pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID, PipeItemsStripes.class, "Stripes Transport Pipe", + new ItemStack(Item.dyePowder, 1, 0), Block.glass, new ItemStack(Item.dyePowder, 1, 11)); // dockingStationBlock = new // BlockDockingStation(Integer.parseInt(dockingStationId.value)); @@ -306,100 +258,64 @@ public class BuildCraftTransport { for (int j = 0; j < 6; ++j) diamondTextures[j] = 1 * 16 + 6 + j; - redPipeWire = new ItemBuildCraft(DefaultProps.RED_PIPE_WIRE) - .setIconIndex(4 * 16 + 0); + redPipeWire = new ItemBuildCraft(DefaultProps.RED_PIPE_WIRE).setIconIndex(4 * 16 + 0); redPipeWire.setItemName("redPipeWire"); CoreProxy.addName(redPipeWire, "Red Pipe Wire"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.dyePowder, 1, 1), - new ItemStack(Item.redstone, 1), - new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack( - redPipeWire, 8))); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1), + new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8))); - bluePipeWire = new ItemBuildCraft(DefaultProps.BLUE_PIPE_WIRE) - .setIconIndex(4 * 16 + 1); + bluePipeWire = new ItemBuildCraft(DefaultProps.BLUE_PIPE_WIRE).setIconIndex(4 * 16 + 1); bluePipeWire.setItemName("bluePipeWire"); CoreProxy.addName(bluePipeWire, "Blue Pipe Wire"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.dyePowder, 1, 4), - new ItemStack(Item.redstone, 1), - new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack( - bluePipeWire, 8))); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4), + new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8))); - greenPipeWire = new ItemBuildCraft(DefaultProps.GREEN_PIPE_WIRE) - .setIconIndex(4 * 16 + 2); + greenPipeWire = new ItemBuildCraft(DefaultProps.GREEN_PIPE_WIRE).setIconIndex(4 * 16 + 2); greenPipeWire.setItemName("greenPipeWire"); CoreProxy.addName(greenPipeWire, "Green Pipe Wire"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.dyePowder, 1, 2), - new ItemStack(Item.redstone, 1), - new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack( - greenPipeWire, 8))); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2), + new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8))); - yellowPipeWire = new ItemBuildCraft(DefaultProps.YELLOW_PIPE_WIRE) - .setIconIndex(4 * 16 + 3); + yellowPipeWire = new ItemBuildCraft(DefaultProps.YELLOW_PIPE_WIRE).setIconIndex(4 * 16 + 3); yellowPipeWire.setItemName("yellowPipeWire"); CoreProxy.addName(yellowPipeWire, "Yellow Pipe Wire"); - BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { - new ItemStack(Item.dyePowder, 1, 11), - new ItemStack(Item.redstone, 1), - new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack( - yellowPipeWire, 8))); + BuildCraftCore.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11), + new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8))); - pipeGate = new ItemGate(DefaultProps.GATE_ID, 0) - .setIconIndex(2 * 16 + 3); + pipeGate = new ItemGate(DefaultProps.GATE_ID, 0).setIconIndex(2 * 16 + 3); pipeGate.setItemName("pipeGate"); - pipeGateAutarchic = new ItemGate(DefaultProps.GATE_AUTARCHIC_ID, 1) - .setIconIndex(2 * 16 + 3); + pipeGateAutarchic = new ItemGate(DefaultProps.GATE_AUTARCHIC_ID, 1).setIconIndex(2 * 16 + 3); pipeGateAutarchic.setItemName("pipeGateAutarchic"); alwaysConnectPipes = Boolean.parseBoolean(alwaysConnect.value); if (loadLegacyPipes.value.equals("true")) { - Property woodenPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("woodenPipe.id", - DefaultProps.WOODEN_PIPE_ID); - Property stonePipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("stonePipe.id", - DefaultProps.STONE_PIPE_ID); - Property ironPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("ironPipe.id", - DefaultProps.IRON_PIPE_ID); - Property goldenPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("goldenPipe.id", - DefaultProps.GOLDEN_PIPE_ID); - Property diamondPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("diamondPipe.id", - DefaultProps.DIAMOND_PIPE_ID); - Property obsidianPipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("obsidianPipe.id", - DefaultProps.OBSIDIAN_PIPE_ID); - Property cobblestonePipeId = BuildCraftCore.mainConfiguration - .getOrCreateBlockIdProperty("cobblestonePipe.id", - DefaultProps.COBBLESTONE_PIPE_ID); - - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(woodenPipeId.value), pipeItemsWood.shiftedIndex)); - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(stonePipeId.value), pipeItemsStone.shiftedIndex)); - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(ironPipeId.value), pipeItemsIron.shiftedIndex)); - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(goldenPipeId.value), pipeItemsGold.shiftedIndex)); - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(diamondPipeId.value), - pipeItemsDiamond.shiftedIndex)); - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(obsidianPipeId.value), - pipeItemsObsidian.shiftedIndex)); - CoreProxy.registerBlock(new LegacyBlock(Integer - .parseInt(cobblestonePipeId.value), - pipeItemsCobblestone.shiftedIndex)); + Property woodenPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("woodenPipe.id", + DefaultProps.WOODEN_PIPE_ID); + Property stonePipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("stonePipe.id", + DefaultProps.STONE_PIPE_ID); + Property ironPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("ironPipe.id", + DefaultProps.IRON_PIPE_ID); + Property goldenPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("goldenPipe.id", + DefaultProps.GOLDEN_PIPE_ID); + Property diamondPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("diamondPipe.id", + DefaultProps.DIAMOND_PIPE_ID); + Property obsidianPipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("obsidianPipe.id", + DefaultProps.OBSIDIAN_PIPE_ID); + Property cobblestonePipeId = BuildCraftCore.mainConfiguration.getOrCreateBlockIdProperty("cobblestonePipe.id", + DefaultProps.COBBLESTONE_PIPE_ID); + CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(woodenPipeId.value), pipeItemsWood.shiftedIndex)); + CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(stonePipeId.value), pipeItemsStone.shiftedIndex)); + CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(ironPipeId.value), pipeItemsIron.shiftedIndex)); + CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(goldenPipeId.value), pipeItemsGold.shiftedIndex)); + CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(diamondPipeId.value), pipeItemsDiamond.shiftedIndex)); + CoreProxy.registerBlock(new LegacyBlock(Integer.parseInt(obsidianPipeId.value), pipeItemsObsidian.shiftedIndex)); CoreProxy - .registerTileEntity(LegacyTile.class, - "net.buildcraft.src.buildcraft.transport.legacy.LegacyTile"); + .registerBlock(new LegacyBlock(Integer.parseInt(cobblestonePipeId.value), pipeItemsCobblestone.shiftedIndex)); + + CoreProxy.registerTileEntity(LegacyTile.class, "net.buildcraft.src.buildcraft.transport.legacy.LegacyTile"); } BuildCraftCore.mainConfiguration.save(); @@ -422,9 +338,8 @@ public class BuildCraftTransport { CraftingManager craftingmanager = CraftingManager.getInstance(); // Add base recipe for pipe waterproof. - craftingmanager.addRecipe(new ItemStack(pipeWaterproof, 1), - new Object[] { "W ", " ", Character.valueOf('W'), - new ItemStack(Item.dyePowder, 1, 2) }); + craftingmanager.addRecipe(new ItemStack(pipeWaterproof, 1), new Object[] { "W ", " ", Character.valueOf('W'), + new ItemStack(Item.dyePowder, 1, 2) }); // Add pipe recipes for (PipeRecipe p : pipeRecipes) @@ -434,15 +349,12 @@ public class BuildCraftTransport { craftingmanager.addRecipe(p.result, p.input); } - private static Item createPipe(int defaultID, Class clas, - String descr, Object ingredient1, Object ingredient2, - Object ingredient3) { - String name = Character.toLowerCase(clas.getSimpleName().charAt(0)) - + clas.getSimpleName().substring(1); + private static Item createPipe(int defaultID, Class clas, String descr, Object ingredient1, + Object ingredient2, Object ingredient3) { + String name = Character.toLowerCase(clas.getSimpleName().charAt(0)) + clas.getSimpleName().substring(1); - Property prop = BuildCraftCore.mainConfiguration - .getOrCreateIntProperty(name + ".id", - Configuration.CATEGORY_ITEM, defaultID); + Property prop = BuildCraftCore.mainConfiguration.getOrCreateIntProperty(name + ".id", Configuration.CATEGORY_ITEM, + defaultID); int id = Integer.parseInt(prop.value); Item res = BlockGenericPipe.registerPipe(id, clas); @@ -454,10 +366,8 @@ public class BuildCraftTransport { if (ingredient1 != null && ingredient2 != null && ingredient3 != null) { recipe.result = new ItemStack(res, 8); - recipe.input = new Object[] { " ", "ABC", " ", - Character.valueOf('A'), ingredient1, - Character.valueOf('B'), ingredient2, - Character.valueOf('C'), ingredient3 }; + recipe.input = new Object[] { " ", "ABC", " ", Character.valueOf('A'), ingredient1, Character.valueOf('B'), + ingredient2, Character.valueOf('C'), ingredient3 }; pipeRecipes.add(recipe); } else if (ingredient1 != null && ingredient2 != null) { diff --git a/common/net/minecraft/src/buildcraft/api/Action.java b/common/net/minecraft/src/buildcraft/api/Action.java index 39464cf8..2ef43b2b 100644 --- a/common/net/minecraft/src/buildcraft/api/Action.java +++ b/common/net/minecraft/src/buildcraft/api/Action.java @@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.api; public abstract class Action { + public int id; public Action(int id) { diff --git a/common/net/minecraft/src/buildcraft/api/BlockSignature.java b/common/net/minecraft/src/buildcraft/api/BlockSignature.java index 21c26206..9350e116 100644 --- a/common/net/minecraft/src/buildcraft/api/BlockSignature.java +++ b/common/net/minecraft/src/buildcraft/api/BlockSignature.java @@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.api; public class BlockSignature { + public String blockClassName; public String tileClassName; public String blockName; @@ -45,8 +46,7 @@ public class BlockSignature { public String toString() { replaceNullWithStar(); - return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName - + "/" + mod + "/" + modVersion + "/" + customField; + return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName + "/" + mod + "/" + modVersion + "/" + customField; } public void replaceNullWithStar() { diff --git a/common/net/minecraft/src/buildcraft/api/BptBlock.java b/common/net/minecraft/src/buildcraft/api/BptBlock.java index 12868c3f..d1f64b8a 100644 --- a/common/net/minecraft/src/buildcraft/api/BptBlock.java +++ b/common/net/minecraft/src/buildcraft/api/BptBlock.java @@ -66,8 +66,7 @@ public class BptBlock { * requirements are met, they will be removed all at once from the builder, * before calling buildBlock. */ - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { if (slot.blockId != 0) { if (slot.storedRequirements.size() != 0) { requirements.addAll(slot.storedRequirements); @@ -91,11 +90,9 @@ public class BptBlock { * for updating req (with the remaining requirements if any) and stack * (after usage) */ - public void useItem(BptSlotInfo slot, IBptContext context, ItemStack req, - ItemStack stack) { + public void useItem(BptSlotInfo slot, IBptContext context, ItemStack req, ItemStack stack) { if (stack.isItemStackDamageable()) { - if (req.getItemDamage() + stack.getItemDamage() <= stack - .getMaxDamage()) { + if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) { stack.setItemDamage(req.getItemDamage() + stack.getItemDamage()); req.stackSize = 0; } @@ -128,8 +125,7 @@ public class BptBlock { * subprogram is permissive and doesn't take into account metadata. */ public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, - slot.z); + return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); } /** @@ -144,14 +140,11 @@ public class BptBlock { */ public void buildBlock(BptSlotInfo slot, IBptContext context) { // Meta needs to be specified twice, depending on the block behavior - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, slot.meta); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, - slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); + context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta); if (Block.blocksList[slot.blockId] instanceof BlockContainer) { - TileEntity tile = context.world().getBlockTileEntity(slot.x, - slot.y, slot.z); + TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z); slot.cpt.setInteger("x", slot.x); slot.cpt.setInteger("y", slot.y); @@ -180,8 +173,7 @@ public class BptBlock { * By default, if the block is a BlockContainer, tile information will be to * save / load the block. */ - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, - int x, int y, int z) { + public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { if (Block.blocksList[slot.blockId] instanceof BlockContainer) { TileEntity tile = context.world().getBlockTileEntity(x, y, z); @@ -191,9 +183,8 @@ public class BptBlock { } if (Block.blocksList[slot.blockId] != null) { - ArrayList req = Block.blocksList[slot.blockId] - .getBlockDropped(context.world(), x, y, z, context.world() - .getBlockMetadata(x, y, z), 0); + ArrayList req = Block.blocksList[slot.blockId].getBlockDropped(context.world(), x, y, z, context.world() + .getBlockMetadata(x, y, z), 0); if (req != null) { slot.storedRequirements.addAll(req); @@ -252,10 +243,8 @@ public class BptBlock { BlockSignature inst = BuildCraftAPI.getBlockSignature(block); - return starMatch(sig.blockName, inst.blockName) - && starMatch(sig.blockClassName, inst.blockClassName) - && starMatch(sig.tileClassName, inst.tileClassName) - && starMatch(sig.customField, inst.customField) + return starMatch(sig.blockName, inst.blockName) && starMatch(sig.blockClassName, inst.blockClassName) + && starMatch(sig.tileClassName, inst.tileClassName) && starMatch(sig.customField, inst.customField) && starMatch(sig.mod, inst.mod); } diff --git a/common/net/minecraft/src/buildcraft/api/BuildCraftAPI.java b/common/net/minecraft/src/buildcraft/api/BuildCraftAPI.java index 266223c2..1290a92b 100644 --- a/common/net/minecraft/src/buildcraft/api/BuildCraftAPI.java +++ b/common/net/minecraft/src/buildcraft/api/BuildCraftAPI.java @@ -48,8 +48,7 @@ public class BuildCraftAPI { } for (LiquidData d : liquids) { - if (d.filled.itemID == filledItem.itemID - && d.filled.getItemDamage() == filledItem.getItemDamage()) { + if (d.filled.itemID == filledItem.itemID && d.filled.getItemDamage() == filledItem.getItemDamage()) { return d.liquidId; } } @@ -86,17 +85,14 @@ public class BuildCraftAPI { * water...) */ public static boolean softBlock(int blockId) { - return blockId == 0 || softBlocks[blockId] - || Block.blocksList[blockId] == null; + return blockId == 0 || softBlocks[blockId] || Block.blocksList[blockId] == null; } /** * Return true if the block cannot be broken, typically bedrock and lava */ public static boolean unbreakableBlock(int blockId) { - return blockId == Block.bedrock.blockID - || blockId == Block.lavaStill.blockID - || blockId == Block.lavaMoving.blockID; + return blockId == Block.bedrock.blockID || blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID; } @Deprecated @@ -105,8 +101,7 @@ public class BuildCraftAPI { int blockId = world.getBlockId(x, y, z); if (blockId != 0) { - Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, - world.getBlockMetadata(x, y, z), 0); + Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); } world.setBlockWithNotify(x, y, z, 0); @@ -126,8 +121,7 @@ public class BuildCraftAPI { } } - public static RefineryRecipe findRefineryRecipe(int liquid1, int qty1, - int liquid2, int qty2) { + public static RefineryRecipe findRefineryRecipe(int liquid1, int qty1, int liquid2, int qty2) { int l1 = qty1 > 0 ? liquid1 : 0; int l2 = qty2 > 0 ? liquid2 : 0; @@ -147,8 +141,7 @@ public class BuildCraftAPI { continue; } - if ((r.sourceQty2 == 0 && (src2 == 0 || src2 == src1)) - || r.sourceId2 == src2) { + if ((r.sourceQty2 == 0 && (src2 == 0 || src2 == src1)) || r.sourceId2 == src2) { return r; } } @@ -163,8 +156,7 @@ public class BuildCraftAPI { public static ItemSignature getItemSignature(Item item) { ItemSignature sig = new ItemSignature(); - if (item.shiftedIndex >= Block.blocksList.length - + BuildCraftAPI.LAST_ORIGINAL_ITEM) { + if (item.shiftedIndex >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) { sig.itemClassName = item.getClass().getSimpleName(); } @@ -179,13 +171,11 @@ public class BuildCraftAPI { } } - public static LinkedList getNeighborTriggers(Block block, - TileEntity entity) { + public static LinkedList getNeighborTriggers(Block block, TileEntity entity) { LinkedList triggers = new LinkedList(); for (ITriggerProvider provider : triggerProviders) { - LinkedList toAdd = provider.getNeighborTriggers(block, - entity); + LinkedList toAdd = provider.getNeighborTriggers(block, entity); if (toAdd != null) { for (Trigger t : toAdd) { @@ -205,13 +195,11 @@ public class BuildCraftAPI { } } - public static LinkedList getNeighborActions(Block block, - TileEntity entity) { + public static LinkedList getNeighborActions(Block block, TileEntity entity) { LinkedList actions = new LinkedList(); for (IActionProvider provider : actionProviders) { - LinkedList toAdd = provider.getNeighborActions(block, - entity); + LinkedList toAdd = provider.getNeighborActions(block, entity); if (toAdd != null) { for (Action t : toAdd) { diff --git a/common/net/minecraft/src/buildcraft/api/EntityPassiveItem.java b/common/net/minecraft/src/buildcraft/api/EntityPassiveItem.java index 3e20fdb4..911ad9dd 100644 --- a/common/net/minecraft/src/buildcraft/api/EntityPassiveItem.java +++ b/common/net/minecraft/src/buildcraft/api/EntityPassiveItem.java @@ -77,8 +77,7 @@ public class EntityPassiveItem { posZ = z; } - public EntityPassiveItem(World world, double d, double d1, double d2, - ItemStack itemstack) { + public EntityPassiveItem(World world, double d, double d1, double d2, ItemStack itemstack) { this(world, d, d1, d2); this.item = itemstack.copy(); } @@ -88,8 +87,7 @@ public class EntityPassiveItem { posY = nbttagcompound.getDouble("y"); posZ = nbttagcompound.getDouble("z"); speed = nbttagcompound.getFloat("speed"); - item = ItemStack.loadItemStackFromNBT(nbttagcompound - .getCompoundTag("Item")); + item = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Item")); NBTTagList contribList = nbttagcompound.getTagList("contribList"); @@ -104,8 +102,7 @@ public class EntityPassiveItem { } try { - IPassiveItemContribution contrib = ((IPassiveItemContribution) Class - .forName(className).newInstance()); + IPassiveItemContribution contrib = ((IPassiveItemContribution) Class.forName(className).newInstance()); contrib.readFromNBT(cpt); @@ -160,16 +157,12 @@ public class EntityPassiveItem { Position motion = new Position(0, 0, 0, dir); motion.moveForwards(0.1 + speed * 2F); - EntityItem entityitem = new EntityItem(worldObj, posX, posY, posZ, - item); + EntityItem entityitem = new EntityItem(worldObj, posX, posY, posZ, item); float f3 = 0.00F + worldObj.rand.nextFloat() * 0.04F - 0.02F; - entityitem.motionX = (float) worldObj.rand.nextGaussian() * f3 - + motion.x; - entityitem.motionY = (float) worldObj.rand.nextGaussian() * f3 - + motion.y; - entityitem.motionZ = (float) worldObj.rand.nextGaussian() * f3 - + +motion.z; + entityitem.motionX = (float) worldObj.rand.nextGaussian() * f3 + motion.x; + entityitem.motionY = (float) worldObj.rand.nextGaussian() * f3 + motion.y; + entityitem.motionZ = (float) worldObj.rand.nextGaussian() * f3 + +motion.z; worldObj.spawnEntityInWorld(entityitem); remove(); @@ -200,12 +193,10 @@ public class EntityPassiveItem { } public boolean isCorrupted() { - return item == null || item.stackSize <= 0 - || Item.itemsList[item.itemID] == null; + return item == null || item.stackSize <= 0 || Item.itemsList[item.itemID] == null; } - public void addContribution(String key, - IPassiveItemContribution contribution) { + public void addContribution(String key, IPassiveItemContribution contribution) { contributions.put(key, contribution); } diff --git a/common/net/minecraft/src/buildcraft/api/IActionProvider.java b/common/net/minecraft/src/buildcraft/api/IActionProvider.java index d76f2fe2..fce4480e 100644 --- a/common/net/minecraft/src/buildcraft/api/IActionProvider.java +++ b/common/net/minecraft/src/buildcraft/api/IActionProvider.java @@ -19,7 +19,6 @@ public interface IActionProvider { /** * Returns the list of actions available to a gate next to the given block. */ - public abstract LinkedList getNeighborActions(Block block, - TileEntity tile); + public abstract LinkedList getNeighborActions(Block block, TileEntity tile); } diff --git a/common/net/minecraft/src/buildcraft/api/IBlockPipe.java b/common/net/minecraft/src/buildcraft/api/IBlockPipe.java index 1dc5a148..b439fb2e 100644 --- a/common/net/minecraft/src/buildcraft/api/IBlockPipe.java +++ b/common/net/minecraft/src/buildcraft/api/IBlockPipe.java @@ -17,7 +17,6 @@ public interface IBlockPipe { * With special kind of pipes, connectors texture has to vary (e.g. diamond * or iron pipes. */ - public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, - int k, Orientations connection); + public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, int k, Orientations connection); } diff --git a/common/net/minecraft/src/buildcraft/api/ILegacyPipeConnection.java b/common/net/minecraft/src/buildcraft/api/ILegacyPipeConnection.java index 3079eeac..cf412830 100644 --- a/common/net/minecraft/src/buildcraft/api/ILegacyPipeConnection.java +++ b/common/net/minecraft/src/buildcraft/api/ILegacyPipeConnection.java @@ -12,6 +12,6 @@ package net.minecraft.src.buildcraft.api; import net.minecraft.src.IBlockAccess; public interface ILegacyPipeConnection { - public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, - int z1, int x2, int y2, int z2); + + public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2); } diff --git a/common/net/minecraft/src/buildcraft/api/IPipeConnection.java b/common/net/minecraft/src/buildcraft/api/IPipeConnection.java index 5bff805e..8b2a5c88 100644 --- a/common/net/minecraft/src/buildcraft/api/IPipeConnection.java +++ b/common/net/minecraft/src/buildcraft/api/IPipeConnection.java @@ -10,5 +10,6 @@ package net.minecraft.src.buildcraft.api; public interface IPipeConnection { + public boolean isPipeConnected(Orientations with); } diff --git a/common/net/minecraft/src/buildcraft/api/ITriggerProvider.java b/common/net/minecraft/src/buildcraft/api/ITriggerProvider.java index dfada773..e428395f 100644 --- a/common/net/minecraft/src/buildcraft/api/ITriggerProvider.java +++ b/common/net/minecraft/src/buildcraft/api/ITriggerProvider.java @@ -25,7 +25,6 @@ public interface ITriggerProvider { /** * Returns the list of triggers available to a gate next to the given block. */ - public abstract LinkedList getNeighborTriggers(Block block, - TileEntity tile); + public abstract LinkedList getNeighborTriggers(Block block, TileEntity tile); } diff --git a/common/net/minecraft/src/buildcraft/api/IronEngineFuel.java b/common/net/minecraft/src/buildcraft/api/IronEngineFuel.java index a28966b9..7b73535a 100644 --- a/common/net/minecraft/src/buildcraft/api/IronEngineFuel.java +++ b/common/net/minecraft/src/buildcraft/api/IronEngineFuel.java @@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.api; public class IronEngineFuel { + public final int fuelId; public final int powerPerCycle; public final int totalBurningTime; diff --git a/common/net/minecraft/src/buildcraft/api/ItemSignature.java b/common/net/minecraft/src/buildcraft/api/ItemSignature.java index 04943026..36af694d 100644 --- a/common/net/minecraft/src/buildcraft/api/ItemSignature.java +++ b/common/net/minecraft/src/buildcraft/api/ItemSignature.java @@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.api; public class ItemSignature { + public String itemClassName; public String itemName; diff --git a/common/net/minecraft/src/buildcraft/api/LiquidData.java b/common/net/minecraft/src/buildcraft/api/LiquidData.java index 091256a3..4a62c20a 100644 --- a/common/net/minecraft/src/buildcraft/api/LiquidData.java +++ b/common/net/minecraft/src/buildcraft/api/LiquidData.java @@ -34,8 +34,7 @@ public class LiquidData { this.container = new ItemStack(Item.bucketEmpty); } - public LiquidData(int liquidId, int movingLiquidId, ItemStack filled, - ItemStack container) { + public LiquidData(int liquidId, int movingLiquidId, ItemStack filled, ItemStack container) { this.liquidId = liquidId; this.movingLiquidId = movingLiquidId; this.filled = filled; diff --git a/common/net/minecraft/src/buildcraft/api/LiquidSlot.java b/common/net/minecraft/src/buildcraft/api/LiquidSlot.java index 0a756582..934d19b6 100644 --- a/common/net/minecraft/src/buildcraft/api/LiquidSlot.java +++ b/common/net/minecraft/src/buildcraft/api/LiquidSlot.java @@ -10,6 +10,7 @@ package net.minecraft.src.buildcraft.api; public class LiquidSlot { + private int liquidId; private int liquidQty; private int capacity; diff --git a/common/net/minecraft/src/buildcraft/api/Position.java b/common/net/minecraft/src/buildcraft/api/Position.java index cecf5432..3d5af261 100644 --- a/common/net/minecraft/src/buildcraft/api/Position.java +++ b/common/net/minecraft/src/buildcraft/api/Position.java @@ -13,6 +13,7 @@ import net.minecraft.src.NBTTagCompound; import net.minecraft.src.TileEntity; public class Position { + public double x, y, z; public Orientations orientation; @@ -127,13 +128,11 @@ public class Position { } public Position min(Position p) { - return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z - : p.z); + return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z : p.z); } public Position max(Position p) { - return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z - : p.z); + return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z : p.z); } } \ No newline at end of file diff --git a/common/net/minecraft/src/buildcraft/api/PowerFramework.java b/common/net/minecraft/src/buildcraft/api/PowerFramework.java index aa48fb07..68b51d1e 100644 --- a/common/net/minecraft/src/buildcraft/api/PowerFramework.java +++ b/common/net/minecraft/src/buildcraft/api/PowerFramework.java @@ -19,8 +19,7 @@ public abstract class PowerFramework { public abstract PowerProvider createPowerProvider(); - public void loadPowerProvider(IPowerReceptor receptor, - NBTTagCompound compound) { + public void loadPowerProvider(IPowerReceptor receptor, NBTTagCompound compound) { PowerProvider provider = createPowerProvider(); @@ -34,8 +33,7 @@ public abstract class PowerFramework { receptor.setPowerProvider(provider); } - public void savePowerProvider(IPowerReceptor receptor, - NBTTagCompound compound) { + public void savePowerProvider(IPowerReceptor receptor, NBTTagCompound compound) { PowerProvider provider = receptor.getPowerProvider(); diff --git a/common/net/minecraft/src/buildcraft/api/PowerProvider.java b/common/net/minecraft/src/buildcraft/api/PowerProvider.java index 2395ad76..0a693d3a 100644 --- a/common/net/minecraft/src/buildcraft/api/PowerProvider.java +++ b/common/net/minecraft/src/buildcraft/api/PowerProvider.java @@ -30,8 +30,7 @@ public abstract class PowerProvider { public int[] powerSources = { 0, 0, 0, 0, 0, 0 }; - public void configure(int latency, int minEnergyReceived, - int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { + public void configure(int latency, int minEnergyReceived, int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { this.latency = latency; this.minEnergyReceived = minEnergyReceived; this.maxEnergyReceived = maxEnergyReceived; @@ -64,9 +63,7 @@ public abstract class PowerProvider { } } - if (powerLoss > 0 - && energyLossTracker.markTimeIfDelay(tile.worldObj, - powerLossRegularity)) { + if (powerLoss > 0 && energyLossTracker.markTimeIfDelay(tile.worldObj, powerLossRegularity)) { energyStored -= powerLoss; if (energyStored < 0) { diff --git a/common/net/minecraft/src/buildcraft/api/RefineryRecipe.java b/common/net/minecraft/src/buildcraft/api/RefineryRecipe.java index bed728ff..6b6ac9d3 100644 --- a/common/net/minecraft/src/buildcraft/api/RefineryRecipe.java +++ b/common/net/minecraft/src/buildcraft/api/RefineryRecipe.java @@ -20,8 +20,8 @@ public class RefineryRecipe { public final int resultQty; public final int delay; - public RefineryRecipe(int sourceId1, int sourceQty1, int sourceId2, - int sourceQty2, int energy, int resultId, int resultQty, int delay) { + public RefineryRecipe(int sourceId1, int sourceQty1, int sourceId2, int sourceQty2, int energy, int resultId, int resultQty, + int delay) { this.sourceId1 = sourceId1; this.sourceId2 = sourceId2; this.sourceQty1 = sourceQty1; diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockBed.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockBed.java index a5ada621..d928c162 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockBed.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockBed.java @@ -24,8 +24,7 @@ public class BptBlockBed extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { if ((slot.meta & 8) == 0) { requirements.add(new ItemStack(Item.bed)); } @@ -58,8 +57,7 @@ public class BptBlockBed extends BptBlock { return; } - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); int x2 = slot.x; int z2 = slot.z; @@ -79,8 +77,7 @@ public class BptBlockBed extends BptBlock { break; } - context.world().setBlockAndMetadataWithNotify(x2, slot.y, z2, - slot.blockId, slot.meta + 8); + context.world().setBlockAndMetadataWithNotify(x2, slot.y, z2, slot.blockId, slot.meta + 8); } @Override diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockCustomStack.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockCustomStack.java index 52abd026..2b9df3c2 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockCustomStack.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockCustomStack.java @@ -27,8 +27,7 @@ public class BptBlockCustomStack extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(customStack.copy()); } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDelegate.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDelegate.java index def31c80..1a2817a7 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDelegate.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDelegate.java @@ -28,14 +28,12 @@ public class BptBlockDelegate extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { BptSlotInfo newSlot = slot.clone(); slot.blockId = delegateTo; if (BuildCraftAPI.blockBptProps[delegateTo] != null) { - BuildCraftAPI.blockBptProps[delegateTo].addRequirements(newSlot, - context, requirements); + BuildCraftAPI.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements); } else { super.addRequirements(newSlot, context, requirements); } @@ -47,8 +45,7 @@ public class BptBlockDelegate extends BptBlock { slot.blockId = delegateTo; if (BuildCraftAPI.blockBptProps[delegateTo] != null) { - return BuildCraftAPI.blockBptProps[delegateTo].isValid(newSlot, - context); + return BuildCraftAPI.blockBptProps[delegateTo].isValid(newSlot, context); } else { return super.isValid(newSlot, context); } @@ -60,8 +57,7 @@ public class BptBlockDelegate extends BptBlock { slot.blockId = delegateTo; if (BuildCraftAPI.blockBptProps[delegateTo] != null) { - BuildCraftAPI.blockBptProps[delegateTo] - .rotateLeft(newSlot, context); + BuildCraftAPI.blockBptProps[delegateTo].rotateLeft(newSlot, context); } else { super.rotateLeft(newSlot, context); } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDirt.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDirt.java index 29576607..90fe124f 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDirt.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDirt.java @@ -24,22 +24,19 @@ public class BptBlockDirt extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(Block.dirt)); } @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - Block.dirt.blockID, slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta); } @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { int id = context.world().getBlockId(slot.x, slot.y, slot.z); - return id == Block.dirt.blockID || id == Block.grass.blockID - || id == Block.tilledField.blockID; + return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID; } } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDoor.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDoor.java index 48137d6d..0d53d8a2 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDoor.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockDoor.java @@ -27,8 +27,7 @@ public class BptBlockDoor extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { if ((slot.meta & 8) == 0) { requirements.add(stack.copy()); } @@ -62,15 +61,11 @@ public class BptBlockDoor extends BptBlock { @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, slot.meta); - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y + 1, - slot.z, slot.blockId, slot.meta + 8); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8); - context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, - slot.meta + 8); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, - slot.meta); + context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8); + context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta); } } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnore.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnore.java index 13953b8b..ba642419 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnore.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnore.java @@ -23,8 +23,7 @@ public class BptBlockIgnore extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 0, 0)); } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java index bac0451b..c3fbe317 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java @@ -23,14 +23,12 @@ public class BptBlockIgnoreMeta extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 1, 0)); } @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, - slot.z); + return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); } } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockInventory.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockInventory.java index 504c8826..72753c53 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockInventory.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockInventory.java @@ -16,8 +16,7 @@ public class BptBlockInventory extends BptBlock { public void buildBlock(BptSlotInfo slot, IBptContext context) { super.buildBlock(slot, context); - IInventory inv = (IInventory) context.world().getBlockTileEntity( - slot.x, slot.y, slot.z); + IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); for (int i = 0; i < inv.getSizeInventory(); ++i) { inv.setInventorySlotContents(i, null); diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLever.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLever.java index bb2abbe0..420cf9da 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLever.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLever.java @@ -22,8 +22,7 @@ public class BptBlockLever extends BptBlockWallSide { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 1, 0)); } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLiquid.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLiquid.java index 33113343..9a26802c 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLiquid.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockLiquid.java @@ -27,8 +27,7 @@ public class BptBlockLiquid extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { if (slot.meta == 0) { requirements.add(bucketStack.copy()); } @@ -37,8 +36,7 @@ public class BptBlockLiquid extends BptBlock { @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { if (slot.meta == 0) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, - slot.z) + return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0; } else { return true; @@ -58,8 +56,7 @@ public class BptBlockLiquid extends BptBlock { @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { if (slot.meta == 0) { - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, - slot.z, slot.blockId, 0); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, 0); } } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPiston.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPiston.java index 5feded8d..023047bf 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPiston.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPiston.java @@ -22,8 +22,7 @@ public class BptBlockPiston extends BptBlockRotateMeta { public void buildBlock(BptSlotInfo slot, IBptContext context) { int meta = slot.meta & 7; - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, meta); } } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPumpkin.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPumpkin.java index ceeb5f40..19dee769 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPumpkin.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockPumpkin.java @@ -23,15 +23,13 @@ public class BptBlockPumpkin extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 1, 0)); } @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, - slot.z); + return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); } @Override diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java index fd4274d8..a872b791 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java @@ -24,8 +24,7 @@ public class BptBlockRedstoneRepeater extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(Item.redstoneRepeater)); } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateInventory.java index 576aa9f9..9544571c 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateInventory.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateInventory.java @@ -6,8 +6,7 @@ import net.minecraft.src.buildcraft.api.IBptContext; public class BptBlockRotateInventory extends BptBlockRotateMeta { - public BptBlockRotateInventory(int blockId, int[] rotations, - boolean rotateForward) { + public BptBlockRotateInventory(int blockId, int[] rotations, boolean rotateForward) { super(blockId, rotations, rotateForward); } @@ -16,8 +15,7 @@ public class BptBlockRotateInventory extends BptBlockRotateMeta { public void buildBlock(BptSlotInfo slot, IBptContext context) { super.buildBlock(slot, context); - IInventory inv = (IInventory) context.world().getBlockTileEntity( - slot.x, slot.y, slot.z); + IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); for (int i = 0; i < inv.getSizeInventory(); ++i) { inv.setInventorySlotContents(i, null); diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateMeta.java index fd9ce87c..177eb6fc 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateMeta.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockRotateMeta.java @@ -23,8 +23,7 @@ public class BptBlockRotateMeta extends BptBlock { int infoMask = 0; - public BptBlockRotateMeta(int blockId, int[] rotations, - boolean rotateForward) { + public BptBlockRotateMeta(int blockId, int[] rotations, boolean rotateForward) { super(blockId); rot = rotations; @@ -43,15 +42,13 @@ public class BptBlockRotateMeta extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 1, 0)); } @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, - slot.z); + return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); } @Override diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockSign.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockSign.java index a21bb0e7..c39eecd3 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockSign.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockSign.java @@ -31,8 +31,7 @@ public class BptBlockSign extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(Item.sign)); } diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockStairs.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockStairs.java index 5f62e182..2560e668 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockStairs.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockStairs.java @@ -23,15 +23,13 @@ public class BptBlockStairs extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 1, 0)); } @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, - slot.z); + return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); } @Override diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockUtils.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockUtils.java index 70750060..03a9af0d 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockUtils.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockUtils.java @@ -20,8 +20,7 @@ import net.minecraft.src.buildcraft.api.IBptContext; public class BptBlockUtils { - public static void requestInventoryContents(BptSlotInfo slot, - IBptContext context, LinkedList requirements) { + public static void requestInventoryContents(BptSlotInfo slot, IBptContext context, LinkedList requirements) { ItemStack[] stacks = getItemStacks(slot, context); for (ItemStack stack : stacks) { @@ -31,8 +30,7 @@ public class BptBlockUtils { } } - public static void initializeInventoryContents(BptSlotInfo slot, - IBptContext context, IInventory inventory) { + public static void initializeInventoryContents(BptSlotInfo slot, IBptContext context, IInventory inventory) { ItemStack[] stacks = new ItemStack[inventory.getSizeInventory()]; for (int i = 0; i < inventory.getSizeInventory(); ++i) { @@ -42,8 +40,7 @@ public class BptBlockUtils { setItemStacks(slot, context, stacks); } - public static void buildInventoryContents(BptSlotInfo slot, - IBptContext context, IInventory inventory) { + public static void buildInventoryContents(BptSlotInfo slot, IBptContext context, IInventory inventory) { ItemStack[] stacks = getItemStacks(slot, context); for (int i = 0; i < stacks.length; ++i) { @@ -51,8 +48,7 @@ public class BptBlockUtils { } } - public static ItemStack[] getItemStacks(BptSlotInfo slot, - IBptContext context) { + public static ItemStack[] getItemStacks(BptSlotInfo slot, IBptContext context) { NBTTagList list = (NBTTagList) slot.cpt.getTag("inv"); if (list == null) { @@ -62,8 +58,7 @@ public class BptBlockUtils { ItemStack stacks[] = new ItemStack[list.tagCount()]; for (int i = 0; i < list.tagCount(); ++i) { - ItemStack stack = ItemStack - .loadItemStackFromNBT((NBTTagCompound) list.tagAt(i)); + ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i)); if (stack != null && stack.itemID != 0 && stack.stackSize > 0) { stacks[i] = context.mapItemStack(stack); @@ -73,8 +68,7 @@ public class BptBlockUtils { return stacks; } - public static void setItemStacks(BptSlotInfo slot, IBptContext context, - ItemStack[] stacks) { + public static void setItemStacks(BptSlotInfo slot, IBptContext context, ItemStack[] stacks) { NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < stacks.length; ++i) { diff --git a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockWallSide.java b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockWallSide.java index 4ac41a93..5e5bb3ad 100644 --- a/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockWallSide.java +++ b/common/net/minecraft/src/buildcraft/api/bptblocks/BptBlockWallSide.java @@ -23,8 +23,7 @@ public class BptBlockWallSide extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { requirements.add(new ItemStack(slot.blockId, 1, 0)); } diff --git a/common/net/minecraft/src/buildcraft/api/filler/IFillerPattern.java b/common/net/minecraft/src/buildcraft/api/filler/IFillerPattern.java index b1de15df..35f902e6 100644 --- a/common/net/minecraft/src/buildcraft/api/filler/IFillerPattern.java +++ b/common/net/minecraft/src/buildcraft/api/filler/IFillerPattern.java @@ -5,12 +5,12 @@ import net.minecraft.src.TileEntity; import net.minecraft.src.buildcraft.api.IBox; public interface IFillerPattern { + public int getId(); public void setId(int id); - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace); + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace); public String getTextureFile(); diff --git a/common/net/minecraft/src/buildcraft/api/tools/IToolWrench.java b/common/net/minecraft/src/buildcraft/api/tools/IToolWrench.java index 17ec100c..52eb56fb 100644 --- a/common/net/minecraft/src/buildcraft/api/tools/IToolWrench.java +++ b/common/net/minecraft/src/buildcraft/api/tools/IToolWrench.java @@ -7,6 +7,7 @@ import net.minecraft.src.EntityPlayer; * wrench for buildcraft */ public interface IToolWrench { + /*** * Called to ensure that the wrench can be used. To get the ItemStack that * is used, check player.inventory.getCurrentItem() diff --git a/common/net/minecraft/src/buildcraft/builders/BlockArchitect.java b/common/net/minecraft/src/buildcraft/builders/BlockArchitect.java index 729db0d0..43e036e1 100644 --- a/common/net/minecraft/src/buildcraft/builders/BlockArchitect.java +++ b/common/net/minecraft/src/buildcraft/builders/BlockArchitect.java @@ -59,17 +59,14 @@ public class BlockArchitect extends BlockContainer implements ITextureProvider { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { // Drop through if the player is sneaking if (entityplayer.isSneaking()) return false; - Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer - .getCurrentEquippedItem().getItem() : null; - if (equipped instanceof IToolWrench - && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { + Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; + if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { int meta = world.getBlockMetadata(i, j, k); @@ -94,8 +91,7 @@ public class BlockArchitect extends BlockContainer implements ITextureProvider { } else { if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftBuilders.instance, - GuiIds.ARCHITECT_TABLE, world, i, j, k); + entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.ARCHITECT_TABLE, world, i, j, k); return true; } @@ -109,21 +105,17 @@ public class BlockArchitect extends BlockContainer implements ITextureProvider { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, - EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { super.onBlockPlacedBy(world, i, j, k, entityliving); - Orientations orientation = Utils.get2dOrientation(new Position( - entityliving.posX, entityliving.posY, entityliving.posZ), + Orientations orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); - world.setBlockMetadataWithNotify(i, j, k, orientation.reverse() - .ordinal()); + world.setBlockMetadataWithNotify(i, j, k, orientation.reverse().ordinal()); } @SuppressWarnings({ "all" }) - public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, - int l) { + public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { int m = iblockaccess.getBlockMetadata(i, j, k); if (l == 1) { diff --git a/common/net/minecraft/src/buildcraft/builders/BlockBlueprintLibrary.java b/common/net/minecraft/src/buildcraft/builders/BlockBlueprintLibrary.java index 58912c1e..c2816212 100644 --- a/common/net/minecraft/src/buildcraft/builders/BlockBlueprintLibrary.java +++ b/common/net/minecraft/src/buildcraft/builders/BlockBlueprintLibrary.java @@ -24,8 +24,7 @@ import net.minecraft.src.buildcraft.api.APIProxy; import net.minecraft.src.buildcraft.core.GuiIds; import net.minecraft.src.forge.ITextureProvider; -public class BlockBlueprintLibrary extends BlockContainer implements - ITextureProvider { +public class BlockBlueprintLibrary extends BlockContainer implements ITextureProvider { public BlockBlueprintLibrary(int i) { super(i, Material.wood); @@ -38,20 +37,17 @@ public class BlockBlueprintLibrary extends BlockContainer implements } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { // Drop through if the player is sneaking if (entityplayer.isSneaking()) return false; - TileBlueprintLibrary tile = (TileBlueprintLibrary) world - .getBlockTileEntity(i, j, k); + TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k); if (!tile.locked || entityplayer.username.equals(tile.owner)) if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftBuilders.instance, - GuiIds.BLUEPRINT_LIBRARY, world, i, j, k); + entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k); return true; } @@ -73,11 +69,9 @@ public class BlockBlueprintLibrary extends BlockContainer implements } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, - EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { if (entityliving instanceof EntityPlayer) { - TileBlueprintLibrary tile = (TileBlueprintLibrary) world - .getBlockTileEntity(i, j, k); + TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k); tile.owner = ((EntityPlayer) entityliving).username; } diff --git a/common/net/minecraft/src/buildcraft/builders/BlockBuilder.java b/common/net/minecraft/src/buildcraft/builders/BlockBuilder.java index 845f56a2..6442e8f3 100644 --- a/common/net/minecraft/src/buildcraft/builders/BlockBuilder.java +++ b/common/net/minecraft/src/buildcraft/builders/BlockBuilder.java @@ -72,17 +72,14 @@ public class BlockBuilder extends BlockContainer implements ITextureProvider { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { // Drop through if the player is sneaking if (entityplayer.isSneaking()) return false; - Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer - .getCurrentEquippedItem().getItem() : null; - if (equipped instanceof IToolWrench - && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { + Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; + if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { int meta = world.getBlockMetadata(i, j, k); @@ -107,23 +104,19 @@ public class BlockBuilder extends BlockContainer implements ITextureProvider { } else { if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftBuilders.instance, - GuiIds.BUILDER, world, i, j, k); + entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.BUILDER, world, i, j, k); return true; } } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, - EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { super.onBlockPlacedBy(world, i, j, k, entityliving); - Orientations orientation = Utils.get2dOrientation(new Position( - entityliving.posX, entityliving.posY, entityliving.posZ), + Orientations orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); - world.setBlockMetadataWithNotify(i, j, k, orientation.reverse() - .ordinal()); + world.setBlockMetadataWithNotify(i, j, k, orientation.reverse().ordinal()); } @Override diff --git a/common/net/minecraft/src/buildcraft/builders/BlockFiller.java b/common/net/minecraft/src/buildcraft/builders/BlockFiller.java index cd777a9b..706e34a3 100644 --- a/common/net/minecraft/src/buildcraft/builders/BlockFiller.java +++ b/common/net/minecraft/src/buildcraft/builders/BlockFiller.java @@ -44,23 +44,20 @@ public class BlockFiller extends BlockContainer implements ITextureProvider { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { // Drop through if the player is sneaking if (entityplayer.isSneaking()) return false; if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftBuilders.instance, - GuiIds.FILLER, world, i, j, k); + entityplayer.openGui(mod_BuildCraftBuilders.instance, GuiIds.FILLER, world, i, j, k); return true; } @SuppressWarnings({ "all" }) - public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, - int l) { + public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { int m = iblockaccess.getBlockMetadata(i, j, k); if (iblockaccess == null) { diff --git a/common/net/minecraft/src/buildcraft/builders/BlockMarker.java b/common/net/minecraft/src/buildcraft/builders/BlockMarker.java index 96edcae9..60078ad0 100644 --- a/common/net/minecraft/src/buildcraft/builders/BlockMarker.java +++ b/common/net/minecraft/src/buildcraft/builders/BlockMarker.java @@ -38,8 +38,7 @@ public class BlockMarker extends BlockContainer implements ITextureProvider { @SuppressWarnings({ "all" }) // @Override (client only) - public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, - int j, int k) { + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) { int meta = world.getBlockMetadata(i, j, k); double w = 0.15; @@ -47,23 +46,17 @@ public class BlockMarker extends BlockContainer implements ITextureProvider { switch (meta) { case 0: - return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 1 - h, - k + 0.5 - w, i + 0.5 + w, j + 1, k + 0.5 + w); + return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 1 - h, k + 0.5 - w, i + 0.5 + w, j + 1, k + 0.5 + w); case 5: - return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j, k + 0.5 - - w, i + 0.5 + w, j + h, k + 0.5 + w); + return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j, k + 0.5 - w, i + 0.5 + w, j + h, k + 0.5 + w); case 3: - return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 0.5 - - w, k, i + 0.5 + w, j + 0.5 + w, k + h); + return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 0.5 - w, k, i + 0.5 + w, j + 0.5 + w, k + h); case 4: - return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 0.5 - - w, k + 1 - h, i + 0.5 + w, j + 0.5 + w, k + 1); + return AxisAlignedBB.getBoundingBoxFromPool(i + 0.5 - w, j + 0.5 - w, k + 1 - h, i + 0.5 + w, j + 0.5 + w, k + 1); case 1: - return AxisAlignedBB.getBoundingBoxFromPool(i, j + 0.5 - w, k + 0.5 - - w, i + h, j + 0.5 + w, k + 0.5 + w); + return AxisAlignedBB.getBoundingBoxFromPool(i, j + 0.5 - w, k + 0.5 - w, i + h, j + 0.5 + w, k + 0.5 + w); default: - return AxisAlignedBB.getBoundingBoxFromPool(i + 1 - h, j + 0.5 - w, - k + 0.5 - w, i + 1, j + 0.5 + w, k + 0.5 + w); + return AxisAlignedBB.getBoundingBoxFromPool(i + 1 - h, j + 0.5 - w, k + 0.5 - w, i + 1, j + 0.5 + w, k + 0.5 + w); } } @@ -82,8 +75,7 @@ public class BlockMarker extends BlockContainer implements ITextureProvider { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { ((TileMarker) world.getBlockTileEntity(i, j, k)).tryConnection(); return true; } @@ -96,8 +88,7 @@ public class BlockMarker extends BlockContainer implements ITextureProvider { } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, - int j, int k) { + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { return null; } @@ -137,16 +128,14 @@ public class BlockMarker extends BlockContainer implements ITextureProvider { flag = true; } if (flag) { - dropBlockAsItem(world, i, j, k, - BuildCraftBuilders.markerBlock.blockID, 0); + dropBlockAsItem(world, i, j, k, BuildCraftBuilders.markerBlock.blockID, 0); world.setBlockWithNotify(i, j, k, 0); } } } @Override - public MovingObjectPosition collisionRayTrace(World world, int i, int j, - int k, Vec3D vec3d, Vec3D vec3d1) { + public MovingObjectPosition collisionRayTrace(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) { return Block.torchWood.collisionRayTrace(world, i, j, k, vec3d, vec3d1); } @@ -219,8 +208,7 @@ public class BlockMarker extends BlockContainer implements ITextureProvider { private boolean dropTorchIfCantStay(World world, int i, int j, int k) { if (!canPlaceBlockAt(world, i, j, k)) { - dropBlockAsItem(world, i, j, k, - BuildCraftBuilders.markerBlock.blockID, 0); + dropBlockAsItem(world, i, j, k, BuildCraftBuilders.markerBlock.blockID, 0); world.setBlockWithNotify(i, j, k, 0); return false; } else { diff --git a/common/net/minecraft/src/buildcraft/builders/BlockPathMarker.java b/common/net/minecraft/src/buildcraft/builders/BlockPathMarker.java index 5342b654..7ea207f6 100644 --- a/common/net/minecraft/src/buildcraft/builders/BlockPathMarker.java +++ b/common/net/minecraft/src/buildcraft/builders/BlockPathMarker.java @@ -39,10 +39,8 @@ public class BlockPathMarker extends BlockMarker { @SuppressWarnings({ "all" }) // @Override (client only) - public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, - int l) { - TilePathMarker marker = (TilePathMarker) iblockaccess - .getBlockTileEntity(i, j, k); + public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { + TilePathMarker marker = (TilePathMarker) iblockaccess.getBlockTileEntity(i, j, k); if (l == 1 || (marker != null && marker.currentWorldIterator != null)) { return 3 * 16 + 11; diff --git a/common/net/minecraft/src/buildcraft/builders/BptBlockFiller.java b/common/net/minecraft/src/buildcraft/builders/BptBlockFiller.java index 246446f1..62106061 100644 --- a/common/net/minecraft/src/buildcraft/builders/BptBlockFiller.java +++ b/common/net/minecraft/src/buildcraft/builders/BptBlockFiller.java @@ -29,8 +29,7 @@ public class BptBlockFiller extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { ItemStack[] recipeStack = BptBlockUtils.getItemStacks(slot, context); for (int i = 0; i < recipeStack.length; ++i) { @@ -70,11 +69,9 @@ public class BptBlockFiller extends BptBlock { @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world() - .setBlockWithNotify(slot.x, slot.y, slot.z, slot.blockId); + context.world().setBlockWithNotify(slot.x, slot.y, slot.z, slot.blockId); - TileFiller filler = (TileFiller) context.world().getBlockTileEntity( - slot.x, slot.y, slot.z); + TileFiller filler = (TileFiller) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); Box box = new Box(); box.initialize(slot.cpt.getCompoundTag("box")); @@ -101,10 +98,8 @@ public class BptBlockFiller extends BptBlock { } @Override - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, - int x, int y, int z) { - TileFiller filler = (TileFiller) context.world().getBlockTileEntity(x, - y, z); + public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { + TileFiller filler = (TileFiller) context.world().getBlockTileEntity(x, y, z); NBTTagCompound cpt = new NBTTagCompound(); diff --git a/common/net/minecraft/src/buildcraft/builders/ContainerBlueprintLibrary.java b/common/net/minecraft/src/buildcraft/builders/ContainerBlueprintLibrary.java index 236430a8..26cd5736 100644 --- a/common/net/minecraft/src/buildcraft/builders/ContainerBlueprintLibrary.java +++ b/common/net/minecraft/src/buildcraft/builders/ContainerBlueprintLibrary.java @@ -24,8 +24,7 @@ class ContainerBlueprintLibrary extends BuildCraftContainer { IInventory playerInventory; TileBlueprintLibrary library; - public ContainerBlueprintLibrary(EntityPlayer player, - TileBlueprintLibrary library) { + public ContainerBlueprintLibrary(EntityPlayer player, TileBlueprintLibrary library) { super(library); this.playerInventory = player.inventory; this.library = library; @@ -41,8 +40,7 @@ class ContainerBlueprintLibrary extends BuildCraftContainer { // Player inventory for (int l = 0; l < 3; l++) for (int k1 = 0; k1 < 9; k1++) - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 140 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 140 + l * 18)); for (int i1 = 0; i1 < 9; i1++) addSlot(new Slot(playerInventory, i1, 8 + i1 * 18, 198)); diff --git a/common/net/minecraft/src/buildcraft/builders/CraftingBuilder.java b/common/net/minecraft/src/buildcraft/builders/CraftingBuilder.java index a21b2306..b4ea61cf 100644 --- a/common/net/minecraft/src/buildcraft/builders/CraftingBuilder.java +++ b/common/net/minecraft/src/buildcraft/builders/CraftingBuilder.java @@ -28,16 +28,14 @@ class CraftingBuilder extends BuildCraftContainer { for (int k = 0; k < 3; k++) { for (int j1 = 0; j1 < 9; j1++) { - addSlot(new Slot(builder, 1 + j1 + k * 9, 8 + j1 * 18, - 72 + k * 18)); + addSlot(new Slot(builder, 1 + j1 + k * 9, 8 + j1 * 18, 72 + k * 18)); } } for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 9; k1++) { - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 140 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 140 + l * 18)); } } diff --git a/common/net/minecraft/src/buildcraft/builders/CraftingFiller.java b/common/net/minecraft/src/buildcraft/builders/CraftingFiller.java index dabce073..cb925f2d 100644 --- a/common/net/minecraft/src/buildcraft/builders/CraftingFiller.java +++ b/common/net/minecraft/src/buildcraft/builders/CraftingFiller.java @@ -26,22 +26,19 @@ class CraftingFiller extends BuildCraftContainer { for (int k = 0; k < 3; k++) { for (int j1 = 0; j1 < 3; j1++) { - addSlot(new Slot(fillerInventory, j1 + k * 3, 31 + j1 * 18, - 16 + k * 18)); + addSlot(new Slot(fillerInventory, j1 + k * 3, 31 + j1 * 18, 16 + k * 18)); } } for (int k = 0; k < 3; k++) { for (int j1 = 0; j1 < 9; j1++) { - addSlot(new Slot(fillerInventory, 9 + j1 + k * 9, 8 + j1 * 18, - 85 + k * 18)); + addSlot(new Slot(fillerInventory, 9 + j1 + k * 9, 8 + j1 * 18, 85 + k * 18)); } } for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 9; k1++) { - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 153 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 153 + l * 18)); } } diff --git a/common/net/minecraft/src/buildcraft/builders/CraftingTemplateRoot.java b/common/net/minecraft/src/buildcraft/builders/CraftingTemplateRoot.java index bbf4ee63..c8aa77c9 100644 --- a/common/net/minecraft/src/buildcraft/builders/CraftingTemplateRoot.java +++ b/common/net/minecraft/src/buildcraft/builders/CraftingTemplateRoot.java @@ -20,8 +20,7 @@ class CraftingTemplateRoot extends BuildCraftContainer { TileArchitect template; int computingTime = 0; - public CraftingTemplateRoot(IInventory playerInventory, - TileArchitect template) { + public CraftingTemplateRoot(IInventory playerInventory, TileArchitect template) { super(template); this.playerIInventory = playerInventory; this.template = template; @@ -31,8 +30,7 @@ class CraftingTemplateRoot extends BuildCraftContainer { for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 9; k1++) { - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 84 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 84 + l * 18)); } } diff --git a/common/net/minecraft/src/buildcraft/builders/FillerFillAll.java b/common/net/minecraft/src/buildcraft/builders/FillerFillAll.java index 673a43ea..9a595296 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerFillAll.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerFillAll.java @@ -17,8 +17,7 @@ import net.minecraft.src.buildcraft.api.IBox; public class FillerFillAll extends FillerPattern { @Override - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace) { + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace) { int xMin = (int) box.pMin().x; int yMin = (int) box.pMin().y; int zMin = (int) box.pMin().z; @@ -27,8 +26,7 @@ public class FillerFillAll extends FillerPattern { int yMax = (int) box.pMax().y; int zMax = (int) box.pMax().z; - return fill(xMin, yMin, zMin, xMax, yMax, zMax, stackToPlace, - tile.worldObj); + return fill(xMin, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj); } @Override diff --git a/common/net/minecraft/src/buildcraft/builders/FillerFillPyramid.java b/common/net/minecraft/src/buildcraft/builders/FillerFillPyramid.java index 73e10c18..614f86e3 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerFillPyramid.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerFillPyramid.java @@ -17,8 +17,7 @@ import net.minecraft.src.buildcraft.api.IBox; public class FillerFillPyramid extends FillerPattern { @Override - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace) { + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace) { int xMin = (int) box.pMin().x; int yMin = (int) box.pMin().y; int zMin = (int) box.pMin().z; @@ -47,10 +46,8 @@ public class FillerFillPyramid extends FillerPattern { height = yMax; } - while (step <= xSize / 2 && step <= zSize / 2 && height >= yMin - && height <= yMax) { - if (!fill(xMin + step, height, zMin + step, xMax - step, height, - zMax - step, stackToPlace, tile.worldObj)) { + while (step <= xSize / 2 && step <= zSize / 2 && height >= yMin && height <= yMax) { + if (!fill(xMin + step, height, zMin + step, xMax - step, height, zMax - step, stackToPlace, tile.worldObj)) { return false; } diff --git a/common/net/minecraft/src/buildcraft/builders/FillerFillStairs.java b/common/net/minecraft/src/buildcraft/builders/FillerFillStairs.java index b4db1356..e723c955 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerFillStairs.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerFillStairs.java @@ -17,8 +17,7 @@ import net.minecraft.src.buildcraft.api.IBox; public class FillerFillStairs extends FillerPattern { @Override - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace) { + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace) { int xMin = (int) box.pMin().x; int yMin = (int) box.pMin().y; int zMin = (int) box.pMin().z; @@ -119,11 +118,9 @@ public class FillerFillStairs extends FillerPattern { } if (kind == 0) { - while (x2 - x1 + 1 > 0 && z2 - z1 + 1 > 0 && x2 - x1 < sizeX - && z2 - z1 < sizeZ && height >= yMin && height <= yMax) { + while (x2 - x1 + 1 > 0 && z2 - z1 + 1 > 0 && x2 - x1 < sizeX && z2 - z1 < sizeZ && height >= yMin && height <= yMax) { - if (!fill(x1, height, z1, x2, height, z2, stackToPlace, - tile.worldObj)) { + if (!fill(x1, height, z1, x2, height, z2, stackToPlace, tile.worldObj)) { return false; } @@ -142,8 +139,7 @@ public class FillerFillStairs extends FillerPattern { height += heightStep; } } else if (kind == 1) { - while (dimX >= 0 && dimX < sizeX && dimZ >= 0 && dimZ < sizeZ - && height >= yMin && height <= yMax) { + while (dimX >= 0 && dimX < sizeX && dimZ >= 0 && dimZ < sizeZ && height >= yMin && height <= yMax) { if (heightStep == 1) { if (tile.xCoord >= xMax) { @@ -180,8 +176,7 @@ public class FillerFillStairs extends FillerPattern { } - if (!fill(x1, height, z1, x2, height, z2, stackToPlace, - tile.worldObj)) { + if (!fill(x1, height, z1, x2, height, z2, stackToPlace, tile.worldObj)) { return false; } diff --git a/common/net/minecraft/src/buildcraft/builders/FillerFillWalls.java b/common/net/minecraft/src/buildcraft/builders/FillerFillWalls.java index b0479be4..c4fee32f 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerFillWalls.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerFillWalls.java @@ -17,8 +17,7 @@ import net.minecraft.src.buildcraft.api.IBox; public class FillerFillWalls extends FillerPattern { @Override - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace) { + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace) { int xMin = (int) box.pMin().x; int yMin = (int) box.pMin().y; int zMin = (int) box.pMin().z; @@ -27,33 +26,27 @@ public class FillerFillWalls extends FillerPattern { int yMax = (int) box.pMax().y; int zMax = (int) box.pMax().z; - if (!fill(xMin, yMin, zMin, xMax, yMin, zMax, stackToPlace, - tile.worldObj)) { + if (!fill(xMin, yMin, zMin, xMax, yMin, zMax, stackToPlace, tile.worldObj)) { return false; } - if (!fill(xMin, yMin, zMin, xMin, yMax, zMax, stackToPlace, - tile.worldObj)) { + if (!fill(xMin, yMin, zMin, xMin, yMax, zMax, stackToPlace, tile.worldObj)) { return false; } - if (!fill(xMin, yMin, zMin, xMax, yMax, zMin, stackToPlace, - tile.worldObj)) { + if (!fill(xMin, yMin, zMin, xMax, yMax, zMin, stackToPlace, tile.worldObj)) { return false; } - if (!fill(xMax, yMin, zMin, xMax, yMax, zMax, stackToPlace, - tile.worldObj)) { + if (!fill(xMax, yMin, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj)) { return false; } - if (!fill(xMin, yMin, zMax, xMax, yMax, zMax, stackToPlace, - tile.worldObj)) { + if (!fill(xMin, yMin, zMax, xMax, yMax, zMax, stackToPlace, tile.worldObj)) { return false; } - if (!fill(xMin, yMax, zMin, xMax, yMax, zMax, stackToPlace, - tile.worldObj)) { + if (!fill(xMin, yMax, zMin, xMax, yMax, zMax, stackToPlace, tile.worldObj)) { return false; } diff --git a/common/net/minecraft/src/buildcraft/builders/FillerFlattener.java b/common/net/minecraft/src/buildcraft/builders/FillerFlattener.java index 32fad229..4c4f07c8 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerFlattener.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerFlattener.java @@ -18,8 +18,7 @@ import net.minecraft.src.buildcraft.api.IBox; public class FillerFlattener extends FillerPattern { @Override - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace) { + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace) { int xMin = (int) box.pMin().x; int yMin = (int) box.pMin().y; int zMin = (int) box.pMin().z; @@ -46,8 +45,7 @@ public class FillerFlattener extends FillerPattern { for (int x = xMin; x <= xMax; ++x) { for (int z = zMin; z <= zMax; ++z) { if (!blockedColumns[x - xMin][z - zMin]) { - if (!BuildCraftAPI.softBlock(tile.worldObj.getBlockId( - x, y, z))) { + if (!BuildCraftAPI.softBlock(tile.worldObj.getBlockId(x, y, z))) { blockedColumns[x - xMin][z - zMin] = true; } else { found = true; @@ -65,9 +63,8 @@ public class FillerFlattener extends FillerPattern { } if (lastX != Integer.MAX_VALUE && stackToPlace != null) { - stackToPlace.getItem().onItemUse(stackToPlace, - BuildCraftAPI.getBuildCraftPlayer(tile.worldObj), - tile.worldObj, lastX, lastY - 1, lastZ, 1); + stackToPlace.getItem().onItemUse(stackToPlace, BuildCraftAPI.getBuildCraftPlayer(tile.worldObj), tile.worldObj, + lastX, lastY - 1, lastZ, 1); } if (lastX != Integer.MAX_VALUE) { diff --git a/common/net/minecraft/src/buildcraft/builders/FillerPattern.java b/common/net/minecraft/src/buildcraft/builders/FillerPattern.java index c07c68a6..382b5ce9 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerPattern.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerPattern.java @@ -27,8 +27,7 @@ public abstract class FillerPattern implements IFillerPattern { * size if needed. Return true when the iteration process is finished. */ @Override - public abstract boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace); + public abstract boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace); @Override public abstract String getTextureFile(); @@ -46,8 +45,7 @@ public abstract class FillerPattern implements IFillerPattern { return this.id; } - public boolean fill(int xMin, int yMin, int zMin, int xMax, int yMax, - int zMax, ItemStack stackToPlace, World world) { + public boolean fill(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, ItemStack stackToPlace, World world) { boolean found = false; int xSlot = 0, ySlot = 0, zSlot = 0; @@ -66,16 +64,14 @@ public abstract class FillerPattern implements IFillerPattern { } if (found && stackToPlace != null) { - stackToPlace.getItem().onItemUse(stackToPlace, - BuildCraftAPI.getBuildCraftPlayer(world), world, xSlot, - ySlot - 1, zSlot, 1); + stackToPlace.getItem().onItemUse(stackToPlace, BuildCraftAPI.getBuildCraftPlayer(world), world, xSlot, ySlot - 1, + zSlot, 1); } return !found; } - public boolean empty(int xMin, int yMin, int zMin, int xMax, int yMax, - int zMax, World world) { + public boolean empty(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, World world) { boolean found = false; int lastX = Integer.MAX_VALUE, lastY = Integer.MAX_VALUE, lastZ = Integer.MAX_VALUE; @@ -84,8 +80,7 @@ public abstract class FillerPattern implements IFillerPattern { for (int x = xMin; x <= xMax; ++x) { for (int z = zMin; z <= zMax; ++z) { if (!BuildCraftAPI.softBlock(world.getBlockId(x, y, z)) - && !BuildCraftAPI.unbreakableBlock(world - .getBlockId(x, y, z))) { + && !BuildCraftAPI.unbreakableBlock(world.getBlockId(x, y, z))) { found = true; lastX = x; lastY = y; diff --git a/common/net/minecraft/src/buildcraft/builders/FillerRegistry.java b/common/net/minecraft/src/buildcraft/builders/FillerRegistry.java index ddaa3d95..99e4720b 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerRegistry.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerRegistry.java @@ -22,13 +22,13 @@ import net.minecraft.src.buildcraft.api.filler.IFillerRegistry; public class FillerRegistry implements IFillerRegistry { static class ShapedPatternRecipe { + private int recipeWidth; private int recipeHeight; private ItemStack recipeItems[]; private IFillerPattern recipeOutput; - public ShapedPatternRecipe(int i, int j, ItemStack aitemstack[], - IFillerPattern pattern) { + public ShapedPatternRecipe(int i, int j, ItemStack aitemstack[], IFillerPattern pattern) { recipeWidth = i; recipeHeight = j; recipeItems = aitemstack; @@ -51,37 +51,30 @@ public class FillerRegistry implements IFillerRegistry { return false; } - private boolean func_21137_a(IInventory inventorycrafting, int i, - int j, boolean flag) { + private boolean func_21137_a(IInventory inventorycrafting, int i, int j, boolean flag) { for (int k = 0; k < 3; k++) { for (int l = 0; l < 3; l++) { int i1 = k - i; int j1 = l - j; ItemStack itemstack = null; - if (i1 >= 0 && j1 >= 0 && i1 < recipeWidth - && j1 < recipeHeight) { + if (i1 >= 0 && j1 >= 0 && i1 < recipeWidth && j1 < recipeHeight) { if (flag) { - itemstack = recipeItems[(recipeWidth - i1 - 1) + j1 - * recipeWidth]; + itemstack = recipeItems[(recipeWidth - i1 - 1) + j1 * recipeWidth]; } else { itemstack = recipeItems[i1 + j1 * recipeWidth]; } } - ItemStack itemstack1 = inventorycrafting.getStackInSlot(k - + l * 3); + ItemStack itemstack1 = inventorycrafting.getStackInSlot(k + l * 3); if (itemstack1 == null && itemstack == null) { continue; } - if (itemstack1 == null && itemstack != null - || itemstack1 != null && itemstack == null) { + if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) { return false; } if (itemstack.itemID != itemstack1.itemID) { return false; } - if (itemstack.getItemDamage() != -1 - && itemstack.getItemDamage() != itemstack1 - .getItemDamage()) { + if (itemstack.getItemDamage() != -1 && itemstack.getItemDamage() != itemstack1.getItemDamage()) { return false; } } diff --git a/common/net/minecraft/src/buildcraft/builders/FillerRemover.java b/common/net/minecraft/src/buildcraft/builders/FillerRemover.java index a9593ef6..7b9f1bce 100644 --- a/common/net/minecraft/src/buildcraft/builders/FillerRemover.java +++ b/common/net/minecraft/src/buildcraft/builders/FillerRemover.java @@ -17,8 +17,7 @@ import net.minecraft.src.buildcraft.api.IBox; public class FillerRemover extends FillerPattern { @Override - public boolean iteratePattern(TileEntity tile, IBox box, - ItemStack stackToPlace) { + public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace) { int xMin = (int) box.pMin().x; int yMin = (int) box.pMin().y; int zMin = (int) box.pMin().z; diff --git a/common/net/minecraft/src/buildcraft/builders/IBuilderHook.java b/common/net/minecraft/src/buildcraft/builders/IBuilderHook.java index fe68edbf..af8c5cda 100644 --- a/common/net/minecraft/src/buildcraft/builders/IBuilderHook.java +++ b/common/net/minecraft/src/buildcraft/builders/IBuilderHook.java @@ -6,7 +6,6 @@ import net.minecraft.src.buildcraft.core.BptRootIndex; public interface IBuilderHook { - public void rootIndexInitialized(BptRootIndex rootBptIndex) - throws IOException; + public void rootIndexInitialized(BptRootIndex rootBptIndex) throws IOException; } diff --git a/common/net/minecraft/src/buildcraft/builders/ItemBptBase.java b/common/net/minecraft/src/buildcraft/builders/ItemBptBase.java index b6aeb955..5feb6b0d 100644 --- a/common/net/minecraft/src/buildcraft/builders/ItemBptBase.java +++ b/common/net/minecraft/src/buildcraft/builders/ItemBptBase.java @@ -34,16 +34,13 @@ public abstract class ItemBptBase extends ItemBuildCraft { @SuppressWarnings({ "all" }) // @Override (client only) public void addInformation(ItemStack itemstack, List list) { - BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint( - itemstack.getItemDamage()); + BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint(itemstack.getItemDamage()); if (bpt != null) { list.add(bpt.getName()); } } @Override - public void onUpdate(ItemStack itemstack, World world, Entity entity, - int i, boolean flag) { - } + public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {} } diff --git a/common/net/minecraft/src/buildcraft/builders/TileArchitect.java b/common/net/minecraft/src/buildcraft/builders/TileArchitect.java index b5eee633..1c83393d 100644 --- a/common/net/minecraft/src/buildcraft/builders/TileArchitect.java +++ b/common/net/minecraft/src/buildcraft/builders/TileArchitect.java @@ -63,8 +63,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory { super.initialize(); if (!box.isInitialized()) { - IAreaProvider a = Utils.getNearbyAreaProvider(worldObj, xCoord, - yCoord, zCoord); + IAreaProvider a = Utils.getNearbyAreaProvider(worldObj, xCoord, yCoord, zCoord); if (a != null) { box.initialize(a); @@ -104,8 +103,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory { result.anchorY = yCoord - box.yMin; result.anchorZ = zCoord - box.zMin; - Orientations o = Orientations.values()[worldObj.getBlockMetadata( - xCoord, yCoord, zCoord)].reverse(); + Orientations o = Orientations.values()[worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].reverse(); if (o == Orientations.XPos) { // Do nothing @@ -122,14 +120,11 @@ public class TileArchitect extends TileBuildCraft implements IInventory { ItemStack stack = items[0].copy(); - if (result.equals(BuildCraftBuilders.getBptRootIndex().getBluePrint( - lastBptId))) { - result = BuildCraftBuilders.getBptRootIndex().getBluePrint( - lastBptId); + if (result.equals(BuildCraftBuilders.getBptRootIndex().getBluePrint(lastBptId))) { + result = BuildCraftBuilders.getBptRootIndex().getBluePrint(lastBptId); stack.setItemDamage(lastBptId); } else { - int bptId = BuildCraftBuilders.getBptRootIndex().storeBluePrint( - result); + int bptId = BuildCraftBuilders.getBptRootIndex().storeBluePrint(result); stack.setItemDamage(bptId); lastBptId = bptId; } @@ -153,11 +148,9 @@ public class TileArchitect extends TileBuildCraft implements IInventory { for (int y = box.yMin; y <= box.yMax; ++y) { for (int z = box.zMin; z <= box.zMax; ++z) { if (worldObj.getBlockId(x, y, z) != 0) { - result.setBlockId(x - box.xMin, y - box.yMin, z - - box.zMin, mask1); + result.setBlockId(x - box.xMin, y - box.yMin, z - box.zMin, mask1); } else { - result.setBlockId(x - box.xMin, y - box.yMin, z - - box.zMin, mask0); + result.setBlockId(x - box.xMin, y - box.yMin, z - box.zMin, mask0); } } } @@ -167,8 +160,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory { } private BptBase createBptBlueprint() { - BptBlueprint result = new BptBlueprint(box.sizeX(), box.sizeY(), - box.sizeZ()); + BptBlueprint result = new BptBlueprint(box.sizeX(), box.sizeY(), box.sizeZ()); BptContext context = new BptContext(worldObj, result, box); @@ -258,8 +250,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory { NBTTagList nbttaglist = nbttagcompound.getTagList("Items"); items = new ItemStack[getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); i++) { - NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist - .tagAt(i); + NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i); int j = nbttagcompound1.getByte("Slot") & 0xff; if (j >= 0 && j < items.length) { items[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); @@ -313,8 +304,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory { if (!box.isInitialized()) { return; } else if (!isComputing) { - if (items[0] != null && items[0].getItem() instanceof ItemBptBase - && items[1] == null) { + if (items[0] != null && items[0].getItem() instanceof ItemBptBase && items[1] == null) { isComputing = true; computingTime = 0; } else { @@ -322,8 +312,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory { computingTime = 0; } } else { - if (items[0] == null - || !(items[0].getItem() instanceof ItemBptBase)) { + if (items[0] == null || !(items[0].getItem() instanceof ItemBptBase)) { isComputing = false; computingTime = 0; } diff --git a/common/net/minecraft/src/buildcraft/builders/TileBlueprintLibrary.java b/common/net/minecraft/src/buildcraft/builders/TileBlueprintLibrary.java index d8897745..b78937e3 100644 --- a/common/net/minecraft/src/buildcraft/builders/TileBlueprintLibrary.java +++ b/common/net/minecraft/src/buildcraft/builders/TileBlueprintLibrary.java @@ -29,8 +29,7 @@ public class TileBlueprintLibrary extends TileEntity implements IInventory { public LinkedList getNextPage(String after) { LinkedList result = new LinkedList(); - BptPlayerIndex index = BuildCraftBuilders.getPlayerIndex(BuildersProxy - .getOwner(this)); + BptPlayerIndex index = BuildCraftBuilders.getPlayerIndex(BuildersProxy.getOwner(this)); String it = after; @@ -54,8 +53,7 @@ public class TileBlueprintLibrary extends TileEntity implements IInventory { public LinkedList getPrevPage(String before) { LinkedList result = new LinkedList(); - BptPlayerIndex index = BuildCraftBuilders.getPlayerIndex(BuildersProxy - .getOwner(this)); + BptPlayerIndex index = BuildCraftBuilders.getPlayerIndex(BuildersProxy.getOwner(this)); String it = before; @@ -167,12 +165,10 @@ public class TileBlueprintLibrary extends TileEntity implements IInventory { } @Override - public void openChest() { - } + public void openChest() {} @Override - public void closeChest() { - } + public void closeChest() {} @Override public void updateEntity() { @@ -187,12 +183,10 @@ public class TileBlueprintLibrary extends TileEntity implements IInventory { if (progressIn == 100 && stack[1] == null) { setInventorySlotContents(1, stack[0]); setInventorySlotContents(0, null); - BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint( - stack[1].getItemDamage()); + BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint(stack[1].getItemDamage()); if (bpt != null) { - BptPlayerIndex index = BuildCraftBuilders - .getPlayerIndex(BuildersProxy.getOwner(this)); + BptPlayerIndex index = BuildCraftBuilders.getPlayerIndex(BuildersProxy.getOwner(this)); try { index.addBlueprint(bpt.file); @@ -204,11 +198,9 @@ public class TileBlueprintLibrary extends TileEntity implements IInventory { if (progressOut == 100 && stack[3] == null) { if (selected != null) { - setInventorySlotContents(3, new ItemStack(stack[2].itemID, 1, - selected.position)); + setInventorySlotContents(3, new ItemStack(stack[2].itemID, 1, selected.position)); } else { - setInventorySlotContents(3, - new ItemStack(stack[2].itemID, 1, 0)); + setInventorySlotContents(3, new ItemStack(stack[2].itemID, 1, 0)); } setInventorySlotContents(2, null); } diff --git a/common/net/minecraft/src/buildcraft/builders/TileBuilder.java b/common/net/minecraft/src/buildcraft/builders/TileBuilder.java index 89c3fb23..92d97bc4 100644 --- a/common/net/minecraft/src/buildcraft/builders/TileBuilder.java +++ b/common/net/minecraft/src/buildcraft/builders/TileBuilder.java @@ -44,8 +44,7 @@ import net.minecraft.src.buildcraft.core.TileBuildCraft; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.buildcraft.core.network.PacketUpdate; -public class TileBuilder extends TileBuildCraft implements IBuilderInventory, - IPowerReceptor, IMachine { +public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IPowerReceptor, IMachine { private final ItemStack items[] = new ItemStack[28]; @@ -63,6 +62,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, private EntityRobot builderRobot; private class PathIterator { + public Iterator currentIterator; public double cx, cy, cz; public float ix, iy, iz; @@ -90,8 +90,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, iy = from.j; iz = from.k; - lastDistance = (ix - to.i) * (ix - to.i) + (iy - to.j) - * (iy - to.j) + (iz - to.k) * (iz - to.k); + lastDistance = (ix - to.i) * (ix - to.i) + (iy - to.j) * (iy - to.j) + (iz - to.k) * (iz - to.k); if (Math.abs(dx) > Math.abs(dz)) { if (dx > 0) { @@ -127,8 +126,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, AxisAlignedBB boundingBox = bpt.getBoundingBox(); - if (oldBoundingBox == null - || !collision(oldBoundingBox, boundingBox)) { + if (oldBoundingBox == null || !collision(oldBoundingBox, boundingBox)) { oldBoundingBox = boundingBox; @@ -141,8 +139,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, iy += cy; iz += cz; - double distance = (ix - to.i) * (ix - to.i) + (iy - to.j) - * (iy - to.j) + (iz - to.k) * (iz - to.k); + double distance = (ix - to.i) * (ix - to.i) + (iy - to.j) * (iy - to.j) + (iz - to.k) * (iz - to.k); if (distance > lastDistance) { return null; @@ -203,10 +200,8 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, for (BlockIndex b : path) { worldObj.setBlockWithNotify(b.i, b.j, b.k, 0); - BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem( - worldObj, b.i, b.j, b.k, - BuildCraftBuilders.pathMarkerBlock.blockID, - 0); + BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.i, b.j, b.k, + BuildCraftBuilders.pathMarkerBlock.blockID, 0); } break; @@ -234,8 +229,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, if (previous != null) { EntityLaser laser = new EntityLaser(worldObj); - laser.setPositions(previous.i + 0.5, previous.j + 0.5, - previous.k + 0.5, b.i + 0.5, b.j + 0.5, b.k + 0.5); + laser.setPositions(previous.i + 0.5, previous.j + 0.5, previous.k + 0.5, b.i + 0.5, b.j + 0.5, b.k + 0.5); laser.setTexture("/net/minecraft/src/buildcraft/core/gui/stripes.png"); worldObj.spawnEntityInWorld(laser); pathLasers.add(laser); @@ -245,10 +239,8 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, } } - public BptBuilderBase instanciateBluePrint(int x, int y, int z, - Orientations o) { - BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint( - items[0].getItemDamage()); + public BptBuilderBase instanciateBluePrint(int x, int y, int z, Orientations o) { + BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint(items[0].getItemDamage()); if (bpt == null) { return null; @@ -256,8 +248,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, bpt = bpt.clone(); - BptContext context = new BptContext(worldObj, null, bpt.getBoxForPos(x, - y, z)); + BptContext context = new BptContext(worldObj, null, bpt.getBoxForPos(x, y, z)); if (o == Orientations.XPos) { // Do nothing @@ -275,8 +266,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, if (items[0].getItem() instanceof ItemBptTemplate) { return new BptBuilderTemplate(bpt, worldObj, x, y, z); } else if (items[0].getItem() instanceof ItemBptBluePrint) { - return new BptBuilderBlueprint((BptBlueprint) bpt, worldObj, x, y, - z); + return new BptBuilderBlueprint((BptBlueprint) bpt, worldObj, x, y, z); } else { return null; } @@ -314,9 +304,9 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, box.createLasers(worldObj, LaserKind.Stripes); - builderRobot.scheduleContruction(bluePrintBuilder.getNextBlock( - worldObj, new SurroundingInventory(worldObj, xCoord, - yCoord, zCoord)), bluePrintBuilder.getContext()); + builderRobot.scheduleContruction( + bluePrintBuilder.getNextBlock(worldObj, new SurroundingInventory(worldObj, xCoord, yCoord, zCoord)), + bluePrintBuilder.getContext()); } } @@ -385,10 +375,8 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, done = true; bluePrintBuilder = null; } else { - bluePrintBuilder = instanciateBluePrint(xCoord, yCoord, - zCoord, - Orientations.values()[worldObj.getBlockMetadata( - xCoord, yCoord, zCoord)].reverse()); + bluePrintBuilder = instanciateBluePrint(xCoord, yCoord, zCoord, + Orientations.values()[worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].reverse()); if (bluePrintBuilder != null) { box.initialize(bluePrintBuilder); @@ -588,8 +576,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, super.updateEntity(); - if ((bluePrintBuilder == null || bluePrintBuilder.done) - && box.isInitialized() + if ((bluePrintBuilder == null || bluePrintBuilder.done) && box.isInitialized() && (builderRobot == null || builderRobot.done())) { box.deleteLasers(); @@ -602,8 +589,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, return; } - if (!box.isInitialized() && bluePrintBuilder == null - && builderRobot != null) { + if (!box.isInitialized() && bluePrintBuilder == null && builderRobot != null) { builderRobot.setDead(); builderRobot = null; } @@ -635,8 +621,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, } public boolean isBuildingBlueprint() { - return getStackInSlot(0) != null - && getStackInSlot(0).getItem() instanceof ItemBptBluePrint; + return getStackInSlot(0) != null && getStackInSlot(0).getItem() instanceof ItemBptBluePrint; } public Collection getNeededItems() { diff --git a/common/net/minecraft/src/buildcraft/builders/TileFiller.java b/common/net/minecraft/src/buildcraft/builders/TileFiller.java index b1fdc95c..3e5bf34a 100644 --- a/common/net/minecraft/src/buildcraft/builders/TileFiller.java +++ b/common/net/minecraft/src/buildcraft/builders/TileFiller.java @@ -35,8 +35,7 @@ import net.minecraft.src.buildcraft.core.TileBuildCraft; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.buildcraft.core.network.PacketUpdate; -public class TileFiller extends TileBuildCraft implements ISpecialInventory, - IPowerReceptor, IMachine, IActionReceptor { +public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPowerReceptor, IMachine, IActionReceptor { public @TileNetworkData Box box = new Box(); @@ -65,8 +64,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, super.initialize(); if (!APIProxy.isClient(worldObj)) { - IAreaProvider a = Utils.getNearbyAreaProvider(worldObj, xCoord, - yCoord, zCoord); + IAreaProvider a = Utils.getNearbyAreaProvider(worldObj, xCoord, yCoord, zCoord); if (a != null) { box.initialize(a); @@ -121,8 +119,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, int stackId = 0; for (int s = 9; s < getSizeInventory(); ++s) { - if (getStackInSlot(s) != null - && getStackInSlot(s).stackSize > 0) { + if (getStackInSlot(s) != null && getStackInSlot(s).stackSize > 0) { stack = contents[s]; stackId = s; @@ -163,8 +160,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, return; } - IFillerPattern newPattern = FillerManager.registry - .findMatchingRecipe(this); + IFillerPattern newPattern = FillerManager.registry.findMatchingRecipe(this); if (newPattern == currentPattern) { return; @@ -289,8 +285,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this) { return false; } - return entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, - zCoord + 0.5D) <= 64D; + return entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64D; } @Override diff --git a/common/net/minecraft/src/buildcraft/builders/TileMarker.java b/common/net/minecraft/src/buildcraft/builders/TileMarker.java index 9c3cb1c7..f82a18bf 100644 --- a/common/net/minecraft/src/buildcraft/builders/TileMarker.java +++ b/common/net/minecraft/src/buildcraft/builders/TileMarker.java @@ -28,6 +28,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { private static int maxSize = 64; public static class TileWrapper { + public @TileNetworkData int x, y, z; @@ -69,6 +70,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { } public static class Origin { + public boolean isSet() { return vectO.isSet(); } @@ -76,8 +78,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { public @TileNetworkData TileWrapper vectO = new TileWrapper(); public @TileNetworkData(staticSize = 3) - TileWrapper[] vect = { new TileWrapper(), new TileWrapper(), - new TileWrapper() }; + TileWrapper[] vect = { new TileWrapper(), new TileWrapper(), new TileWrapper() }; public @TileNetworkData int xMin, yMin, zMin, xMax, yMax, zMax; } @@ -102,29 +103,23 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { if (worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { signals = new EntityBlock[6]; if (!origin.isSet() || !origin.vect[0].isSet()) { - signals[0] = Utils.createLaser(worldObj, new Position(xCoord, - yCoord, zCoord), new Position(xCoord + maxSize - 1, + signals[0] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord + maxSize - 1, yCoord, zCoord), LaserKind.Blue); - signals[1] = Utils.createLaser(worldObj, new Position(xCoord - - maxSize + 1, yCoord, zCoord), new Position(xCoord, + signals[1] = Utils.createLaser(worldObj, new Position(xCoord - maxSize + 1, yCoord, zCoord), new Position(xCoord, yCoord, zCoord), LaserKind.Blue); } if (!origin.isSet() || !origin.vect[1].isSet()) { - signals[2] = Utils.createLaser(worldObj, new Position(xCoord, - yCoord, zCoord), new Position(xCoord, yCoord + maxSize - - 1, zCoord), LaserKind.Blue); - signals[3] = Utils.createLaser(worldObj, new Position(xCoord, - yCoord - maxSize + 1, zCoord), new Position(xCoord, + signals[2] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord, yCoord + + maxSize - 1, zCoord), LaserKind.Blue); + signals[3] = Utils.createLaser(worldObj, new Position(xCoord, yCoord - maxSize + 1, zCoord), new Position(xCoord, yCoord, zCoord), LaserKind.Blue); } if (!origin.isSet() || !origin.vect[2].isSet()) { - signals[4] = Utils.createLaser(worldObj, new Position(xCoord, - yCoord, zCoord), new Position(xCoord, yCoord, zCoord - + maxSize - 1), LaserKind.Blue); - signals[5] = Utils.createLaser(worldObj, new Position(xCoord, - yCoord, zCoord - maxSize + 1), new Position(xCoord, + signals[4] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord, yCoord, + zCoord + maxSize - 1), LaserKind.Blue); + signals[5] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord - maxSize + 1), new Position(xCoord, yCoord, zCoord), LaserKind.Blue); } } @@ -145,14 +140,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { if (initVectO != null) { origin = new Origin(); - origin.vectO = new TileWrapper((int) initVectO.x, - (int) initVectO.y, (int) initVectO.z); + origin.vectO = new TileWrapper((int) initVectO.x, (int) initVectO.y, (int) initVectO.z); for (int i = 0; i < 3; ++i) { if (initVect[i] != null) { - linkTo((TileMarker) worldObj.getBlockTileEntity( - (int) initVect[i].x, (int) initVect[i].y, - (int) initVect[i].z), i); + linkTo((TileMarker) worldObj + .getBlockTileEntity((int) initVect[i].x, (int) initVect[i].y, (int) initVect[i].z), + i); } } } @@ -185,12 +179,10 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { for (int j = 1; j < maxSize; ++j) { coords[n] += j; - int blockId = worldObj.getBlockId(coords[0], coords[1], - coords[2]); + int blockId = worldObj.getBlockId(coords[0], coords[1], coords[2]); if (blockId == markerId) { - TileMarker marker = (TileMarker) worldObj - .getBlockTileEntity(coords[0], coords[1], coords[2]); + TileMarker marker = (TileMarker) worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]); if (linkTo(marker, n)) { break; @@ -203,8 +195,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { blockId = worldObj.getBlockId(coords[0], coords[1], coords[2]); if (blockId == markerId) { - TileMarker marker = (TileMarker) worldObj - .getBlockTileEntity(coords[0], coords[1], coords[2]); + TileMarker marker = (TileMarker) worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]); if (linkTo(marker, n)) { break; @@ -229,15 +220,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { origin = new Origin(); marker.origin = origin; origin.vectO = new TileWrapper(xCoord, yCoord, zCoord); - origin.vect[n] = new TileWrapper(marker.xCoord, marker.yCoord, - marker.zCoord); + origin.vect[n] = new TileWrapper(marker.xCoord, marker.yCoord, marker.zCoord); } else if (!origin.isSet()) { origin = marker.origin; origin.vect[n] = new TileWrapper(xCoord, yCoord, zCoord); } else { marker.origin = origin; - origin.vect[n] = new TileWrapper(marker.xCoord, marker.yCoord, - marker.zCoord); + origin.vect[n] = new TileWrapper(marker.xCoord, marker.yCoord, marker.zCoord); } origin.vectO.getMarker(worldObj).createLasers(); @@ -292,8 +281,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { o.zMax = origin.vect[2].z; } - lasers = Utils.createLaserBox(worldObj, o.xMin, o.yMin, o.zMin, o.xMax, - o.yMax, o.zMax, LaserKind.Red); + lasers = Utils.createLaserBox(worldObj, o.xMin, o.yMin, o.zMin, o.xMax, o.yMax, o.zMax, LaserKind.Red); } @Override @@ -405,8 +393,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { signals = null; - if (APIProxy.isServerSide() && markerOrigin != null - && markerOrigin != this) { + if (APIProxy.isServerSide() && markerOrigin != null && markerOrigin != this) { markerOrigin.sendNetworkUpdate(); } } @@ -423,16 +410,15 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { if (m.isSet()) { worldObj.setBlockWithNotify(m.x, m.y, m.z, 0); - BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, m.x, - m.y, m.z, BuildCraftBuilders.markerBlock.blockID, 0); + BuildCraftBuilders.markerBlock + .dropBlockAsItem(worldObj, m.x, m.y, m.z, BuildCraftBuilders.markerBlock.blockID, 0); } } worldObj.setBlockWithNotify(o.vectO.x, o.vectO.y, o.vectO.z, 0); - BuildCraftBuilders.markerBlock - .dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, - BuildCraftBuilders.markerBlock.blockID, 0); + BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, + BuildCraftBuilders.markerBlock.blockID, 0); } @Override @@ -445,8 +431,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { for (int i = 0; i < 3; ++i) { if (nbttagcompound.hasKey("vect" + i)) { - initVect[i] = new Position( - nbttagcompound.getCompoundTag("vect" + i)); + initVect[i] = new Position(nbttagcompound.getCompoundTag("vect" + i)); } } } @@ -465,8 +450,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { for (int i = 0; i < 3; ++i) { if (origin.vect[i].isSet()) { NBTTagCompound vect = new NBTTagCompound(); - new Position(origin.vect[i].x, origin.vect[i].y, - origin.vect[i].z).writeToNBT(vect); + new Position(origin.vect[i].x, origin.vect[i].y, origin.vect[i].z).writeToNBT(vect); nbttagcompound.setTag("vect" + i, vect); } } diff --git a/common/net/minecraft/src/buildcraft/builders/TilePathMarker.java b/common/net/minecraft/src/buildcraft/builders/TilePathMarker.java index f0c7e282..8618f6fe 100644 --- a/common/net/minecraft/src/buildcraft/builders/TilePathMarker.java +++ b/common/net/minecraft/src/buildcraft/builders/TilePathMarker.java @@ -41,8 +41,7 @@ public class TilePathMarker extends TileMarker { public void createLaserAndConnect(TilePathMarker pathMarker) { EntityLaser laser = new EntityLaser(worldObj); - laser.setPositions(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, - pathMarker.xCoord + 0.5, pathMarker.yCoord + 0.5, + laser.setPositions(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, pathMarker.xCoord + 0.5, pathMarker.yCoord + 0.5, pathMarker.zCoord + 0.5); laser.setTexture("/net/minecraft/src/buildcraft/core/gui/laser_1.png"); worldObj.spawnEntityInWorld(laser); @@ -60,8 +59,7 @@ public class TilePathMarker extends TileMarker { } if (currentWorldIterator == null) { - currentWorldIterator = new WorldIteratorRadius(worldObj, xCoord, - yCoord, zCoord, searchSize); + currentWorldIterator = new WorldIteratorRadius(worldObj, xCoord, yCoord, zCoord, searchSize); worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord); } } @@ -96,8 +94,7 @@ public class TilePathMarker extends TileMarker { if (tile instanceof TilePathMarker) { TilePathMarker pathMarker = (TilePathMarker) tile; - if (!pathMarker.isFullyConnected() - && !isLinkedTo(pathMarker)) { + if (!pathMarker.isFullyConnected() && !isLinkedTo(pathMarker)) { createLaserAndConnect(pathMarker); worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord); @@ -116,20 +113,17 @@ public class TilePathMarker extends TileMarker { TilePathMarker nextTile = this; while (nextTile != null) { - BlockIndex b = new BlockIndex(nextTile.xCoord, nextTile.yCoord, - nextTile.zCoord); + BlockIndex b = new BlockIndex(nextTile.xCoord, nextTile.yCoord, nextTile.zCoord); visitedPaths.add(b); res.add(b); if (nextTile.links[0] != null - && !visitedPaths.contains(new BlockIndex( - nextTile.links[0].xCoord, nextTile.links[0].yCoord, + && !visitedPaths.contains(new BlockIndex(nextTile.links[0].xCoord, nextTile.links[0].yCoord, nextTile.links[0].zCoord))) { nextTile = nextTile.links[0]; } else if (nextTile.links[1] != null - && !visitedPaths.contains(new BlockIndex( - nextTile.links[1].xCoord, nextTile.links[1].yCoord, + && !visitedPaths.contains(new BlockIndex(nextTile.links[1].xCoord, nextTile.links[1].yCoord, nextTile.links[1].zCoord))) { nextTile = nextTile.links[1]; } else { @@ -166,8 +160,7 @@ public class TilePathMarker extends TileMarker { if (loadLink0) { TileEntity e0 = worldObj.getBlockTileEntity(x0, y0, z0); - if (links[0] != e0 && links[1] != e0 - && e0 instanceof TilePathMarker) { + if (links[0] != e0 && links[1] != e0 && e0 instanceof TilePathMarker) { createLaserAndConnect((TilePathMarker) e0); } @@ -177,8 +170,7 @@ public class TilePathMarker extends TileMarker { if (loadLink1) { TileEntity e1 = worldObj.getBlockTileEntity(x1, y1, z1); - if (links[0] != e1 && links[1] != e1 - && e1 instanceof TilePathMarker) { + if (links[0] != e1 && links[1] != e1 && e1 instanceof TilePathMarker) { createLaserAndConnect((TilePathMarker) e1); } diff --git a/common/net/minecraft/src/buildcraft/core/Box.java b/common/net/minecraft/src/buildcraft/core/Box.java index fec5a9cd..32cb3306 100644 --- a/common/net/minecraft/src/buildcraft/core/Box.java +++ b/common/net/minecraft/src/buildcraft/core/Box.java @@ -49,8 +49,7 @@ public class Box implements IBox { return initialized; } - public void initialize(int xMin, int yMin, int zMin, int xMax, int yMax, - int zMax) { + public void initialize(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax) { this.xMin = xMin; this.yMin = yMin; @@ -73,18 +72,13 @@ public class Box implements IBox { public void initialize(NBTTagCompound nbttagcompound) { - initialize(nbttagcompound.getInteger("xMin"), - nbttagcompound.getInteger("yMin"), - nbttagcompound.getInteger("zMin"), - nbttagcompound.getInteger("xMax"), - nbttagcompound.getInteger("yMax"), - nbttagcompound.getInteger("zMax")); + initialize(nbttagcompound.getInteger("xMin"), nbttagcompound.getInteger("yMin"), nbttagcompound.getInteger("zMin"), + nbttagcompound.getInteger("xMax"), nbttagcompound.getInteger("yMax"), nbttagcompound.getInteger("zMax")); } public void initialize(int centerX, int centerY, int centerZ, int size) { - initialize(centerX - size, centerY - size, centerZ - size, centerX - + size, centerY + size, centerZ + size); + initialize(centerX - size, centerY - size, centerZ - size, centerX + size, centerY + size, centerZ + size); } @@ -123,8 +117,7 @@ public class Box implements IBox { @Override public boolean contains(int x, int y, int z) { - if (x >= xMin && x <= xMax && y >= yMin && y <= yMax && z >= zMin - && z <= zMax) { + if (x >= xMin && x <= xMax && y >= yMin && y <= yMax && z >= zMin && z <= zMax) { return true; } @@ -217,8 +210,7 @@ public class Box implements IBox { public void createLasers(World world, LaserKind kind) { if (lasers == null) - lasers = Utils.createLaserBox(world, xMin, yMin, zMin, xMax, yMax, - zMax, kind); + lasers = Utils.createLaserBox(world, xMin, yMin, zMin, xMax, yMax, zMax, kind); } @Override @@ -245,8 +237,7 @@ public class Box implements IBox { @Override public String toString() { - return "{" + xMin + ", " + xMax + "}, {" + yMin + ", " + yMax + "}, {" - + zMin + ", " + zMax + "}"; + return "{" + xMin + ", " + xMax + "}, {" + yMin + ", " + yMax + "}, {" + zMin + ", " + zMax + "}"; } } diff --git a/common/net/minecraft/src/buildcraft/core/BptBase.java b/common/net/minecraft/src/buildcraft/core/BptBase.java index 52ddddf6..d974e55f 100644 --- a/common/net/minecraft/src/buildcraft/core/BptBase.java +++ b/common/net/minecraft/src/buildcraft/core/BptBase.java @@ -40,8 +40,7 @@ public abstract class BptBase { protected String version = ""; - public BptBase() { - } + public BptBase() {} public BptBase(int sizeX, int sizeY, int sizeZ) { contents = new BptSlot[sizeX][sizeY][sizeZ]; @@ -80,8 +79,7 @@ public abstract class BptBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBase", - "rotateLeft", t); + ModLoader.getLogger().throwing("BptBase", "rotateLeft", t); } } @@ -114,8 +112,7 @@ public abstract class BptBase { FileOutputStream output = new FileOutputStream(file); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - output, "8859_1")); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, "8859_1")); writer.write("version:" + mod_BuildCraftCore.version()); writer.newLine(); @@ -171,24 +168,20 @@ public abstract class BptBase { BptBase bpt = (BptBase) o; - if (sizeX != bpt.sizeX || sizeY != bpt.sizeY || sizeZ != bpt.sizeZ - || anchorX != bpt.anchorX || anchorY != bpt.anchorY + if (sizeX != bpt.sizeX || sizeY != bpt.sizeY || sizeZ != bpt.sizeZ || anchorX != bpt.anchorX || anchorY != bpt.anchorY || anchorZ != bpt.anchorZ) return false; for (int x = 0; x < contents.length; ++x) for (int y = 0; y < contents[0].length; ++y) for (int z = 0; z < contents[0][0].length; ++z) { - if (contents[x][y][z] != null - && bpt.contents[x][y][z] == null) + if (contents[x][y][z] != null && bpt.contents[x][y][z] == null) return false; - if (contents[x][y][z] == null - && bpt.contents[x][y][z] != null) + if (contents[x][y][z] == null && bpt.contents[x][y][z] != null) return false; - if (contents[x][y][z] == null - && bpt.contents[x][y][z] == null) + if (contents[x][y][z] == null && bpt.contents[x][y][z] == null) continue; if (contents[x][y][z].blockId != bpt.contents[x][y][z].blockId) @@ -206,8 +199,7 @@ public abstract class BptBase { try { FileInputStream input = new FileInputStream(file); - BufferedReader reader = new BufferedReader(new InputStreamReader( - input, "8859_1")); + BufferedReader reader = new BufferedReader(new InputStreamReader(input, "8859_1")); while (true) { String line = reader.readLine(); @@ -333,9 +325,7 @@ public abstract class BptBase { return res; } - public abstract void loadAttribute(BufferedReader reader, String attr, - String val) throws IOException, BptError; + public abstract void loadAttribute(BufferedReader reader, String attr, String val) throws IOException, BptError; - public abstract void saveAttributes(BufferedWriter writer) - throws IOException; + public abstract void saveAttributes(BufferedWriter writer) throws IOException; } diff --git a/common/net/minecraft/src/buildcraft/core/BptBlueprint.java b/common/net/minecraft/src/buildcraft/core/BptBlueprint.java index 9a439229..cb64a457 100644 --- a/common/net/minecraft/src/buildcraft/core/BptBlueprint.java +++ b/common/net/minecraft/src/buildcraft/core/BptBlueprint.java @@ -49,8 +49,7 @@ public class BptBlueprint extends BptBase { idMapping[i] = i; } - public void readFromWorld(IBptContext context, TileEntity anchorTile, - int x, int y, int z) { + public void readFromWorld(IBptContext context, TileEntity anchorTile, int x, int y, int z) { BptSlot slot = new BptSlot(); slot.x = (int) (x - context.surroundingBox().pMin().x); @@ -116,11 +115,9 @@ public class BptBlueprint extends BptBase { for (Integer id : idsToMap) { if (id < Block.blocksList.length && Block.blocksList[id] != null) - writer.write(BuildCraftAPI - .getBlockSignature(Block.blocksList[id]) + "=" + id); + writer.write(BuildCraftAPI.getBlockSignature(Block.blocksList[id]) + "=" + id); else - writer.write(BuildCraftAPI.getItemSignature(Item.itemsList[id]) - + "=" + id); + writer.write(BuildCraftAPI.getItemSignature(Item.itemsList[id]) + "=" + id); writer.newLine(); } @@ -142,8 +139,7 @@ public class BptBlueprint extends BptBase { if (slot.meta != 0) slot.cpt.setInteger("meta", slot.meta); - NBTBase.writeNamedTag(slot.cpt, new BptDataStream( - writer)); + NBTBase.writeNamedTag(slot.cpt, new BptDataStream(writer)); writer.newLine(); } else @@ -161,8 +157,7 @@ public class BptBlueprint extends BptBase { for (int z = 0; z < sizeZ; ++z) { BptSlotInfo slot = contents[x][y][z]; - if (slot != null && slot.blockId != 0 - && slot.storedRequirements.size() > 0) { + if (slot != null && slot.blockId != 0 && slot.storedRequirements.size() > 0) { NBTTagList list = new NBTTagList(); for (ItemStack stack : slot.storedRequirements) { @@ -183,12 +178,9 @@ public class BptBlueprint extends BptBase { } @Override - public void loadAttribute(BufferedReader reader, String attr, String val) - throws IOException, BptError { + public void loadAttribute(BufferedReader reader, String attr, String val) throws IOException, BptError { if ("3.1.0".equals(version)) - throw new BptError( - "Blueprint format 3.1.0 is not supported anymore, can't load " - + file); + throw new BptError("Blueprint format 3.1.0 is not supported anymore, can't load " + file); // blockMap is still tested for being able to load pre 3.1.2 bpts if (attr.equals("blockMap") || attr.equals("idMap")) @@ -216,8 +208,7 @@ public class BptBlueprint extends BptBase { // Items between 256 and Block.blocksList.length may // be item or block - if (i < Block.blocksList.length - && Block.blocksList[i] != null) + if (i < Block.blocksList.length && Block.blocksList[i] != null) continue; if (itemMatch(sig, Item.itemsList[i])) { @@ -228,9 +219,7 @@ public class BptBlueprint extends BptBase { } if (!found) - throw new BptError( - "BLUEPRINT ERROR: can't find item of signature " - + sig + " for " + name); + throw new BptError("BLUEPRINT ERROR: can't find item of signature " + sig + " for " + name); } } else { @@ -242,8 +231,7 @@ public class BptBlueprint extends BptBase { if (handlingBlock == null) handlingBlock = defaultBlock; - if (!handlingBlock.match(Block.blocksList[blockId], - bptSignature)) { + if (!handlingBlock.match(Block.blocksList[blockId], bptSignature)) { boolean found = false; for (int i = 0; i < Block.blocksList.length; ++i) @@ -253,17 +241,14 @@ public class BptBlueprint extends BptBase { if (handlingBlock == null) handlingBlock = defaultBlock; - if (handlingBlock.match(Block.blocksList[i], - bptSignature)) { + if (handlingBlock.match(Block.blocksList[i], bptSignature)) { idMapping[blockId] = i; found = true; } } if (!found) - throw new BptError( - "BLUEPRINT ERROR: can't find block of signature " - + bptSignature + " for " + name); + throw new BptError("BLUEPRINT ERROR: can't find block of signature " + bptSignature + " for " + name); } } } @@ -284,12 +269,9 @@ public class BptBlueprint extends BptBase { slot.y = y; slot.z = z; - slot.cpt = (NBTTagCompound) NBTBase - .readNamedTag(new BptDataStream( - new StringReader(slotStr))); + slot.cpt = (NBTTagCompound) NBTBase.readNamedTag(new BptDataStream(new StringReader(slotStr))); - slot.blockId = mapWorldId(slot.cpt - .getInteger("bId")); + slot.blockId = mapWorldId(slot.cpt.getInteger("bId")); if (slot.cpt.hasKey("meta")) slot.meta = slot.cpt.getInteger("meta"); @@ -307,14 +289,10 @@ public class BptBlueprint extends BptBase { return; if (!reqStr.equals("")) { - NBTTagList list = (NBTTagList) NBTBase - .readNamedTag(new BptDataStream( - new StringReader(reqStr))); + NBTTagList list = (NBTTagList) NBTBase.readNamedTag(new BptDataStream(new StringReader(reqStr))); for (int i = 0; i < list.tagCount(); ++i) { - ItemStack stk = mapItemStack(ItemStack - .loadItemStackFromNBT((NBTTagCompound) list - .tagAt(i))); + ItemStack stk = mapItemStack(ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i))); contents[x][y][z].storedRequirements.add(stk); } @@ -351,13 +329,10 @@ public class BptBlueprint extends BptBase { if (item == null) return false; - if (!"*".equals(sig.itemClassName) - && !item.getClass().getSimpleName().equals(sig.itemClassName)) + if (!"*".equals(sig.itemClassName) && !item.getClass().getSimpleName().equals(sig.itemClassName)) return false; - if (!"*".equals(sig.itemName) - && !item.getItemNameIS(new ItemStack(item)) - .equals(sig.itemName)) + if (!"*".equals(sig.itemName) && !item.getItemNameIS(new ItemStack(item)).equals(sig.itemName)) return false; return true; diff --git a/common/net/minecraft/src/buildcraft/core/BptBuilderBase.java b/common/net/minecraft/src/buildcraft/core/BptBuilderBase.java index 6aef9bd2..9807978e 100644 --- a/common/net/minecraft/src/buildcraft/core/BptBuilderBase.java +++ b/common/net/minecraft/src/buildcraft/core/BptBuilderBase.java @@ -74,8 +74,7 @@ public abstract class BptBuilderBase implements IAreaProvider { } public AxisAlignedBB getBoundingBox() { - return AxisAlignedBB.getBoundingBox(xMin(), yMin(), zMin(), xMax(), - yMax(), zMax()); + return AxisAlignedBB.getBoundingBox(xMin(), yMin(), zMin(), xMax(), yMax(), zMax()); } public void postProcessing(World world) { diff --git a/common/net/minecraft/src/buildcraft/core/BptBuilderBlueprint.java b/common/net/minecraft/src/buildcraft/core/BptBuilderBlueprint.java index 86e864e3..d3ad5629 100644 --- a/common/net/minecraft/src/buildcraft/core/BptBuilderBlueprint.java +++ b/common/net/minecraft/src/buildcraft/core/BptBuilderBlueprint.java @@ -29,30 +29,28 @@ public class BptBuilderBlueprint extends BptBuilderBase { LinkedList postProcessingList = new LinkedList(); - public TreeSet neededItems = new TreeSet( - new Comparator() { + public TreeSet neededItems = new TreeSet(new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - if (o1.stackSize > o2.stackSize) - return -1; - else if (o1.stackSize < o2.stackSize) - return 1; - else if (o1.itemID > o2.itemID) - return -1; - else if (o1.itemID < o2.itemID) - return 1; - else if (o1.getItemDamage() > o2.getItemDamage()) - return -1; - else if (o1.getItemDamage() < o2.getItemDamage()) - return 1; + @Override + public int compare(ItemStack o1, ItemStack o2) { + if (o1.stackSize > o2.stackSize) + return -1; + else if (o1.stackSize < o2.stackSize) + return 1; + else if (o1.itemID > o2.itemID) + return -1; + else if (o1.itemID < o2.itemID) + return 1; + else if (o1.getItemDamage() > o2.getItemDamage()) + return -1; + else if (o1.getItemDamage() < o2.getItemDamage()) + return 1; - return 0; - } - }); + return 0; + } + }); - public BptBuilderBlueprint(BptBlueprint bluePrint, World world, int x, - int y, int z) { + public BptBuilderBlueprint(BptBlueprint bluePrint, World world, int x, int y, int z) { super(bluePrint, world, x, y, z); for (int j = bluePrint.sizeY - 1; j >= 0; --j) @@ -105,8 +103,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { slot.mode = Mode.Build; - if (slot.blockId != 0 - && Block.blocksList[slot.blockId].isOpaqueCube()) + if (slot.blockId != 0 && Block.blocksList[slot.blockId].isOpaqueCube()) primaryList.add(slot); else secondaryList.add(slot); @@ -121,8 +118,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { private void checkDone() { recomputeNeededItems(); - if (clearList.size() == 0 && primaryList.size() == 0 - && secondaryList.size() == 0) + if (clearList.size() == 0 && primaryList.size() == 0 && secondaryList.size() == 0) done = true; else done = false; @@ -165,8 +161,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { return null; } - public BptSlot internalGetNextBlock(World world, IBuilderInventory inv, - LinkedList list) { + public BptSlot internalGetNextBlock(World world, IBuilderInventory inv, LinkedList list) { LinkedList failSlots = new LinkedList(); BptSlot result = null; @@ -181,15 +176,13 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "internalGetBlock", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "internalGetBlock", t); getNext = false; } if (getNext) if (slot.mode == Mode.ClearIfInvalid) { - if (!BuildCraftAPI.softBlock(world.getBlockId(slot.x, - slot.y, slot.z))) { + if (!BuildCraftAPI.softBlock(world.getBlockId(slot.x, slot.y, slot.z))) { result = slot; break; } @@ -227,8 +220,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "checkRequirements", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "checkRequirements", t); } int size = inv.getSizeInventory(); @@ -242,12 +234,9 @@ public class BptBuilderBlueprint extends BptBuilderBase { for (ItemStack reqStk : tmpReq) { for (ItemStack invStk : tmpInv) - if (invStk != null && reqStk.itemID == invStk.itemID - && invStk.stackSize > 0) { + if (invStk != null && reqStk.itemID == invStk.itemID && invStk.stackSize > 0) { - if (!invStk.isItemStackDamageable() - && (reqStk.getItemDamage() != invStk - .getItemDamage())) + if (!invStk.isItemStackDamageable() && (reqStk.getItemDamage() != invStk.getItemDamage())) continue; try { @@ -255,8 +244,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "checkRequirements", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "checkRequirements", t); } if (reqStk.stackSize == 0) @@ -283,8 +271,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "useRequirements", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "useRequirements", t); } @@ -297,12 +284,9 @@ public class BptBuilderBlueprint extends BptBuilderBase { ItemStack invStk = inv.getStackInSlot(i); - if (invStk != null && reqStk.itemID == invStk.itemID - && invStk.stackSize > 0) { + if (invStk != null && reqStk.itemID == invStk.itemID && invStk.stackSize > 0) { - if (!invStk.isItemStackDamageable() - && (reqStk.getItemDamage() != invStk - .getItemDamage())) + if (!invStk.isItemStackDamageable() && (reqStk.getItemDamage() != invStk.getItemDamage())) continue; try { @@ -310,8 +294,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "useRequirements", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "useRequirements", t); } if (invStk.stackSize == 0) @@ -334,23 +317,22 @@ public class BptBuilderBlueprint extends BptBuilderBase { public void recomputeNeededItems() { neededItems.clear(); - TreeMap computeStacks = new TreeMap( - new Comparator() { + TreeMap computeStacks = new TreeMap(new Comparator() { - @Override - public int compare(ItemStack o1, ItemStack o2) { - if (o1.itemID > o2.itemID) - return 1; - else if (o1.itemID < o2.itemID) - return -1; - else if (o1.getItemDamage() > o2.getItemDamage()) - return 1; - else if (o1.getItemDamage() < o2.getItemDamage()) - return -1; + @Override + public int compare(ItemStack o1, ItemStack o2) { + if (o1.itemID > o2.itemID) + return 1; + else if (o1.itemID < o2.itemID) + return -1; + else if (o1.getItemDamage() > o2.getItemDamage()) + return 1; + else if (o1.getItemDamage() < o2.getItemDamage()) + return -1; - return 0; - } - }); + return 0; + } + }); for (BptSlot slot : primaryList) { @@ -361,8 +343,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "recomputeIfNeeded", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "recomputeIfNeeded", t); } for (ItemStack stack : stacks) { @@ -404,8 +385,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { if (stack.isItemStackDamageable()) neededItems.add(new ItemStack(stack.getItem())); else - neededItems.add(new ItemStack(stack.itemID, computeStacks - .get(stack), stack.getItemDamage())); + neededItems.add(new ItemStack(stack.itemID, computeStacks.get(stack), stack.getItemDamage())); } @Override @@ -416,8 +396,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("BptBuilderBlueprint", - "postProcessing", t); + ModLoader.getLogger().throwing("BptBuilderBlueprint", "postProcessing", t); } } diff --git a/common/net/minecraft/src/buildcraft/core/BptBuilderTemplate.java b/common/net/minecraft/src/buildcraft/core/BptBuilderTemplate.java index 78328bde..4163d575 100644 --- a/common/net/minecraft/src/buildcraft/core/BptBuilderTemplate.java +++ b/common/net/minecraft/src/buildcraft/core/BptBuilderTemplate.java @@ -21,8 +21,7 @@ public class BptBuilderTemplate extends BptBuilderBase { LinkedList clearList = new LinkedList(); LinkedList buildList = new LinkedList(); - public BptBuilderTemplate(BptBase bluePrint, World world, int x, int y, - int z) { + public BptBuilderTemplate(BptBase bluePrint, World world, int x, int y, int z) { super(bluePrint, world, x, y, z); for (int j = bluePrint.sizeY - 1; j >= 0; --j) @@ -110,15 +109,13 @@ public class BptBuilderTemplate extends BptBuilderBase { return null; } - public BptSlot internalGetNextBlock(World world, IBuilderInventory inv, - LinkedList list) { + public BptSlot internalGetNextBlock(World world, IBuilderInventory inv, LinkedList list) { BptSlot result = null; while (list.size() > 0) { BptSlot slot = list.getFirst(); - if (BuildCraftAPI.softBlock(slot.blockId) == BuildCraftAPI - .softBlock(world.getBlockId(slot.x, slot.y, slot.z))) + if (BuildCraftAPI.softBlock(slot.blockId) == BuildCraftAPI.softBlock(world.getBlockId(slot.x, slot.y, slot.z))) list.removeFirst(); else if (slot.mode == Mode.ClearIfInvalid) { result = slot; diff --git a/common/net/minecraft/src/buildcraft/core/BptItem.java b/common/net/minecraft/src/buildcraft/core/BptItem.java index ce34e229..42c52dda 100644 --- a/common/net/minecraft/src/buildcraft/core/BptItem.java +++ b/common/net/minecraft/src/buildcraft/core/BptItem.java @@ -17,8 +17,7 @@ import net.minecraft.src.buildcraft.api.IBptContext; public class BptItem { - public void addRequirements(BptSlotInfo slot, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, LinkedList requirements) { } @@ -30,8 +29,7 @@ public class BptItem { } - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, - int x, int y, int z) { + public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { } diff --git a/common/net/minecraft/src/buildcraft/core/BptPlayerIndex.java b/common/net/minecraft/src/buildcraft/core/BptPlayerIndex.java index 3b5865ae..7db41b18 100644 --- a/common/net/minecraft/src/buildcraft/core/BptPlayerIndex.java +++ b/common/net/minecraft/src/buildcraft/core/BptPlayerIndex.java @@ -11,13 +11,13 @@ import java.io.OutputStreamWriter; import java.util.TreeMap; public class BptPlayerIndex { + private TreeMap bluePrintsFile = new TreeMap(); private File baseDir; private File file; - public BptPlayerIndex(String filename, BptRootIndex rootIndex) - throws IOException { + public BptPlayerIndex(String filename, BptRootIndex rootIndex) throws IOException { baseDir = new File(CoreProxy.getBuildCraftBase(), "blueprints/"); file = new File(baseDir, filename); baseDir.mkdir(); @@ -36,8 +36,7 @@ public class BptPlayerIndex { public void loadIndex() throws IOException { FileInputStream input = new FileInputStream(file); - BufferedReader reader = new BufferedReader(new InputStreamReader(input, - "8859_1")); + BufferedReader reader = new BufferedReader(new InputStreamReader(input, "8859_1")); while (true) { String line = reader.readLine(); @@ -63,8 +62,7 @@ public class BptPlayerIndex { public void saveIndex() throws IOException { FileOutputStream output = new FileOutputStream(file); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - output, "8859_1")); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, "8859_1")); for (String line : bluePrintsFile.keySet()) { writer.write(line); diff --git a/common/net/minecraft/src/buildcraft/core/BptRootIndex.java b/common/net/minecraft/src/buildcraft/core/BptRootIndex.java index 31cc0110..c61f761e 100644 --- a/common/net/minecraft/src/buildcraft/core/BptRootIndex.java +++ b/common/net/minecraft/src/buildcraft/core/BptRootIndex.java @@ -45,8 +45,7 @@ public class BptRootIndex { public void loadIndex() throws IOException { FileInputStream input = new FileInputStream(file); - BufferedReader reader = new BufferedReader(new InputStreamReader(input, - "8859_1")); + BufferedReader reader = new BufferedReader(new InputStreamReader(input, "8859_1")); while (true) { String line = reader.readLine(); @@ -89,8 +88,7 @@ public class BptRootIndex { bluePrintsFile.put(maxBpt, newFile); - for (BptPlayerIndex playerIndex : BuildCraftBuilders.playerLibrary - .values()) + for (BptPlayerIndex playerIndex : BuildCraftBuilders.playerLibrary.values()) playerIndex.addBlueprint(newFile); } } @@ -100,8 +98,7 @@ public class BptRootIndex { public void saveIndex() throws IOException { FileOutputStream output = new FileOutputStream(file); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - output, "8859_1")); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, "8859_1")); for (int i = 1; i <= maxBpt; ++i) { File f = bluePrintsFile.get(i); @@ -119,8 +116,7 @@ public class BptRootIndex { public BptBase getBluePrint(int number) { if (!bluePrints.containsKey(number)) if (bluePrintsFile.containsKey(number)) { - BptBase bpt = BptBase.loadBluePrint(bluePrintsFile.get(number), - number); + BptBase bpt = BptBase.loadBluePrint(bluePrintsFile.get(number), number); if (bpt != null) { bluePrints.put(number, bpt); diff --git a/common/net/minecraft/src/buildcraft/core/BptSlot.java b/common/net/minecraft/src/buildcraft/core/BptSlot.java index 76accaf6..f046aa08 100644 --- a/common/net/minecraft/src/buildcraft/core/BptSlot.java +++ b/common/net/minecraft/src/buildcraft/core/BptSlot.java @@ -9,6 +9,7 @@ import net.minecraft.src.buildcraft.api.BuildCraftAPI; import net.minecraft.src.buildcraft.api.IBptContext; public class BptSlot extends BptSlotInfo { + public enum Mode { ClearIfInvalid, Build }; @@ -29,8 +30,7 @@ public class BptSlot extends BptSlotInfo { } public void initializeFromWorld(IBptContext context, int xs, int ys, int zs) { - BuildCraftAPI.blockBptProps[blockId].initializeFromWorld(this, context, - xs, ys, zs); + BuildCraftAPI.blockBptProps[blockId].initializeFromWorld(this, context, xs, ys, zs); } public void postProcessing(IBptContext context) { @@ -40,8 +40,7 @@ public class BptSlot extends BptSlotInfo { public LinkedList getRequirements(IBptContext context) { LinkedList res = new LinkedList(); - BuildCraftAPI.blockBptProps[blockId] - .addRequirements(this, context, res); + BuildCraftAPI.blockBptProps[blockId].addRequirements(this, context, res); return res; } @@ -65,8 +64,7 @@ public class BptSlot extends BptSlotInfo { obj.blockId = blockId; obj.meta = meta; obj.cpt = (NBTTagCompound) cpt.copy(); - obj.storedRequirements = (LinkedList) storedRequirements - .clone(); + obj.storedRequirements = (LinkedList) storedRequirements.clone(); if (stackToUse != null) obj.stackToUse = stackToUse.copy(); diff --git a/common/net/minecraft/src/buildcraft/core/BptTemplate.java b/common/net/minecraft/src/buildcraft/core/BptTemplate.java index 36c54597..df6b5c18 100644 --- a/common/net/minecraft/src/buildcraft/core/BptTemplate.java +++ b/common/net/minecraft/src/buildcraft/core/BptTemplate.java @@ -15,8 +15,7 @@ import java.io.IOException; public class BptTemplate extends BptBase { - public BptTemplate() { - } + public BptTemplate() {} public BptTemplate(int sizeX, int sizeY, int sizeZ) { super(sizeX, sizeY, sizeZ); @@ -55,8 +54,7 @@ public class BptTemplate extends BptBase { contents[x][y][z].x = x; contents[x][y][z].y = y; contents[x][y][z].z = z; - contents[x][y][z].blockId = Integer - .parseInt(mask[maskIndex]); + contents[x][y][z].blockId = Integer.parseInt(mask[maskIndex]); maskIndex++; } diff --git a/common/net/minecraft/src/buildcraft/core/BuildCraftConfiguration.java b/common/net/minecraft/src/buildcraft/core/BuildCraftConfiguration.java index 472dff13..cb7a78c3 100644 --- a/common/net/minecraft/src/buildcraft/core/BuildCraftConfiguration.java +++ b/common/net/minecraft/src/buildcraft/core/BuildCraftConfiguration.java @@ -40,56 +40,28 @@ public class BuildCraftConfiguration extends Configuration { fileinputstream.close(); } - getOrCreateProperty("stonePipe.id", Configuration.CATEGORY_BLOCK, - props.getProperty("stonePipe.blockId")); - getOrCreateProperty("woodenPipe.id", Configuration.CATEGORY_BLOCK, - props.getProperty("woodenPipe.blockId")); - getOrCreateProperty("ironPipe.id", Configuration.CATEGORY_BLOCK, - props.getProperty("ironPipe.blockId")); - getOrCreateProperty("goldenPipe.id", Configuration.CATEGORY_BLOCK, - props.getProperty("goldenPipe.blockId")); - getOrCreateProperty("diamondPipe.id", Configuration.CATEGORY_BLOCK, - props.getProperty("diamondPipe.blockId")); - getOrCreateProperty("obsidianPipe.id", - Configuration.CATEGORY_BLOCK, - props.getProperty("obsidianPipeBlock.blockId")); - getOrCreateProperty("autoWorkbench.id", - Configuration.CATEGORY_BLOCK, - props.getProperty("autoWorkbench.blockId")); - getOrCreateProperty("miningWell.id", Configuration.CATEGORY_BLOCK, - props.getProperty("miningWell.blockId")); - getOrCreateProperty("quarry.id", Configuration.CATEGORY_BLOCK, - props.getProperty("quarry.blockId")); - getOrCreateProperty("drill.id", Configuration.CATEGORY_BLOCK, - props.getProperty("drill.blockId")); - getOrCreateProperty("frame.id", Configuration.CATEGORY_BLOCK, - props.getProperty("frame.blockId")); - getOrCreateProperty("marker.id", Configuration.CATEGORY_BLOCK, - props.getProperty("marker.blockId")); - getOrCreateProperty("filler.id", Configuration.CATEGORY_BLOCK, - props.getProperty("filler.blockId")); + getOrCreateProperty("stonePipe.id", Configuration.CATEGORY_BLOCK, props.getProperty("stonePipe.blockId")); + getOrCreateProperty("woodenPipe.id", Configuration.CATEGORY_BLOCK, props.getProperty("woodenPipe.blockId")); + getOrCreateProperty("ironPipe.id", Configuration.CATEGORY_BLOCK, props.getProperty("ironPipe.blockId")); + getOrCreateProperty("goldenPipe.id", Configuration.CATEGORY_BLOCK, props.getProperty("goldenPipe.blockId")); + getOrCreateProperty("diamondPipe.id", Configuration.CATEGORY_BLOCK, props.getProperty("diamondPipe.blockId")); + getOrCreateProperty("obsidianPipe.id", Configuration.CATEGORY_BLOCK, props.getProperty("obsidianPipeBlock.blockId")); + getOrCreateProperty("autoWorkbench.id", Configuration.CATEGORY_BLOCK, props.getProperty("autoWorkbench.blockId")); + getOrCreateProperty("miningWell.id", Configuration.CATEGORY_BLOCK, props.getProperty("miningWell.blockId")); + getOrCreateProperty("quarry.id", Configuration.CATEGORY_BLOCK, props.getProperty("quarry.blockId")); + getOrCreateProperty("drill.id", Configuration.CATEGORY_BLOCK, props.getProperty("drill.blockId")); + getOrCreateProperty("frame.id", Configuration.CATEGORY_BLOCK, props.getProperty("frame.blockId")); + getOrCreateProperty("marker.id", Configuration.CATEGORY_BLOCK, props.getProperty("marker.blockId")); + getOrCreateProperty("filler.id", Configuration.CATEGORY_BLOCK, props.getProperty("filler.blockId")); - getOrCreateProperty("woodenGearItem.id", - Configuration.CATEGORY_ITEM, - props.getProperty("woodenGearItem.id")); - getOrCreateProperty("stoneGearItem.id", - Configuration.CATEGORY_ITEM, - props.getProperty("stoneGearItem.id")); - getOrCreateProperty("ironGearItem.id", Configuration.CATEGORY_ITEM, - props.getProperty("ironGearItem.id")); - getOrCreateProperty("goldenGearItem.id", - Configuration.CATEGORY_ITEM, - props.getProperty("goldGearItem.id")); - getOrCreateProperty("diamondGearItem.id", - Configuration.CATEGORY_ITEM, - props.getProperty("diamondGearItem.id")); + getOrCreateProperty("woodenGearItem.id", Configuration.CATEGORY_ITEM, props.getProperty("woodenGearItem.id")); + getOrCreateProperty("stoneGearItem.id", Configuration.CATEGORY_ITEM, props.getProperty("stoneGearItem.id")); + getOrCreateProperty("ironGearItem.id", Configuration.CATEGORY_ITEM, props.getProperty("ironGearItem.id")); + getOrCreateProperty("goldenGearItem.id", Configuration.CATEGORY_ITEM, props.getProperty("goldGearItem.id")); + getOrCreateProperty("diamondGearItem.id", Configuration.CATEGORY_ITEM, props.getProperty("diamondGearItem.id")); - getOrCreateProperty("mining.enabled", - Configuration.CATEGORY_GENERAL, - props.getProperty("mining.enabled")); - getOrCreateProperty("current.continuous", - Configuration.CATEGORY_GENERAL, - props.getProperty("current.continous")); + getOrCreateProperty("mining.enabled", Configuration.CATEGORY_GENERAL, props.getProperty("mining.enabled")); + getOrCreateProperty("current.continuous", Configuration.CATEGORY_GENERAL, props.getProperty("current.continous")); cfgfile.delete(); } catch (IOException e) { diff --git a/common/net/minecraft/src/buildcraft/core/BuildCraftContainer.java b/common/net/minecraft/src/buildcraft/core/BuildCraftContainer.java index 607b4c90..44e798f5 100644 --- a/common/net/minecraft/src/buildcraft/core/BuildCraftContainer.java +++ b/common/net/minecraft/src/buildcraft/core/BuildCraftContainer.java @@ -30,11 +30,9 @@ public abstract class BuildCraftContainer extends Container { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (i < inventory.getSizeInventory()) { - if (!mergeItemStack(itemstack1, inventory.getSizeInventory(), - inventorySlots.size(), true)) + if (!mergeItemStack(itemstack1, inventory.getSizeInventory(), inventorySlots.size(), true)) return null; - } else if (!mergeItemStack(itemstack1, 0, - inventory.getSizeInventory(), false)) + } else if (!mergeItemStack(itemstack1, 0, inventory.getSizeInventory(), false)) return null; if (itemstack1.stackSize == 0) slot.putStack(null); diff --git a/common/net/minecraft/src/buildcraft/core/ClassMapping.java b/common/net/minecraft/src/buildcraft/core/ClassMapping.java index df0957e8..27fd1015 100644 --- a/common/net/minecraft/src/buildcraft/core/ClassMapping.java +++ b/common/net/minecraft/src/buildcraft/core/ClassMapping.java @@ -20,6 +20,7 @@ import net.minecraft.src.buildcraft.api.TileNetworkData; public class ClassMapping { public static class Reporter { + Class clas; int occurences = 0; int dataInt = 0; @@ -29,8 +30,8 @@ public class ClassMapping { @Override public String toString() { - String res = clas + ": " + occurences + " times (" + dataInt + ", " - + dataFloat + ", " + dataString + " = " + bytes + ")"; + String res = clas + ": " + occurences + " times (" + dataInt + ", " + dataFloat + ", " + dataString + " = " + bytes + + ")"; return res; } @@ -76,6 +77,7 @@ public class ClassMapping { private Class clas; public static class Indexes { + public Indexes(int initFloat, int initString) { floatIndex = initFloat; stringIndex = initString; @@ -106,8 +108,7 @@ public class ClassMapping { sizeBytes += 2; shortFields.add(f); } else if (fieldClass.equals(int.class)) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); if (updateAnnotation.intKind() == TileNetworkData.UNSIGNED_BYTE) { sizeBytes += 1; @@ -146,12 +147,10 @@ public class ClassMapping { } } if (t instanceof Class && ((Class) t).isArray()) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); if (updateAnnotation.staticSize() == -1) - throw new RuntimeException( - "arrays must be provided with an explicit size"); + throw new RuntimeException("arrays must be provided with an explicit size"); Class fieldClass = (Class) t; @@ -164,8 +163,7 @@ public class ClassMapping { sizeBytes += updateAnnotation.staticSize() * 2; shortArrayFields.add(f); } else if (cptClass.equals(int.class)) { - updateAnnotation = f - .getAnnotation(TileNetworkData.class); + updateAnnotation = f.getAnnotation(TileNetworkData.class); if (updateAnnotation.intKind() == TileNetworkData.UNSIGNED_BYTE) { sizeBytes += updateAnnotation.staticSize(); @@ -188,12 +186,9 @@ public class ClassMapping { // null / // not null. - sizeBytes += updateAnnotation.staticSize() - * mapping.sizeBytes; - sizeFloat += updateAnnotation.staticSize() - * mapping.sizeFloat; - sizeString += updateAnnotation.staticSize() - * mapping.sizeString; + sizeBytes += updateAnnotation.staticSize() * mapping.sizeBytes; + sizeFloat += updateAnnotation.staticSize() * mapping.sizeFloat; + sizeString += updateAnnotation.staticSize() * mapping.sizeString; } } } @@ -204,15 +199,13 @@ public class ClassMapping { } private boolean isSynchronizedField(Field f) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); return updateAnnotation != null; } @SuppressWarnings("rawtypes") - public void setData(Object obj, ByteBuffer byteBuffer, float[] floatValues, - String[] stringValues, Indexes index) + public void setData(Object obj, ByteBuffer byteBuffer, float[] floatValues, String[] stringValues, Indexes index) throws IllegalArgumentException, IllegalAccessException { Reporter r = null; @@ -303,8 +296,7 @@ public class ClassMapping { } for (Field f : doubleArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { floatValues[index.floatIndex] = (float) ((double[]) f.get(obj))[i]; @@ -315,8 +307,7 @@ public class ClassMapping { } for (Field f : shortArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { byteBuffer.writeShort(((short[]) f.get(obj))[i]); @@ -326,8 +317,7 @@ public class ClassMapping { } for (Field f : intArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { byteBuffer.writeInt(((int[]) f.get(obj))[i]); @@ -337,20 +327,17 @@ public class ClassMapping { } for (Field f : booleanArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { - byteBuffer.writeUnsignedByte(((boolean[]) f.get(obj))[i] ? 1 - : 0); + byteBuffer.writeUnsignedByte(((boolean[]) f.get(obj))[i] ? 1 : 0); r.bytes += 1; r.dataInt += 1; } } for (Field f : unsignedByteFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { byteBuffer.writeUnsignedByte(((int[]) f.get(obj))[i]); @@ -360,8 +347,7 @@ public class ClassMapping { } for (ClassMapping c : objectArrayFields) { - TileNetworkData updateAnnotation = c.field - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = c.field.getAnnotation(TileNetworkData.class); Object[] cpts = (Object[]) c.field.get(obj); @@ -382,15 +368,13 @@ public class ClassMapping { r.bytes += 1; r.dataInt += 1; - c.setData(cpts[i], byteBuffer, floatValues, stringValues, - index); + c.setData(cpts[i], byteBuffer, floatValues, stringValues, index); } } } @SuppressWarnings("rawtypes") - public void updateFromData(Object obj, ByteBuffer byteBuffer, - float[] floatValues, String[] stringValues, Indexes index) + public void updateFromData(Object obj, ByteBuffer byteBuffer, float[] floatValues, String[] stringValues, Indexes index) throws IllegalArgumentException, IllegalAccessException { Reporter r = null; @@ -425,9 +409,7 @@ public class ClassMapping { } for (Field f : enumFields) { - f.set(obj, - ((Class) f.getGenericType()).getEnumConstants()[byteBuffer - .readUnsignedByte()]); + f.set(obj, ((Class) f.getGenericType()).getEnumConstants()[byteBuffer.readUnsignedByte()]); r.bytes += 1; r.dataInt += 1; } @@ -471,13 +453,11 @@ public class ClassMapping { index.floatIndex += c.sizeFloat; index.stringIndex += c.sizeString; } else - c.updateFromData(c.field.get(obj), byteBuffer, floatValues, - stringValues, index); + c.updateFromData(c.field.get(obj), byteBuffer, floatValues, stringValues, index); } for (Field f : doubleArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { ((double[]) f.get(obj))[i] = floatValues[index.floatIndex]; @@ -488,8 +468,7 @@ public class ClassMapping { } for (Field f : shortArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { ((short[]) f.get(obj))[i] = byteBuffer.readShort(); @@ -500,8 +479,7 @@ public class ClassMapping { } for (Field f : intArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { ((int[]) f.get(obj))[i] = byteBuffer.readInt(); @@ -512,8 +490,7 @@ public class ClassMapping { } for (Field f : booleanArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { ((boolean[]) f.get(obj))[i] = byteBuffer.readUnsignedByte() == 1; @@ -523,8 +500,7 @@ public class ClassMapping { } for (Field f : unsignedByteArrayFields) { - TileNetworkData updateAnnotation = f - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = f.getAnnotation(TileNetworkData.class); for (int i = 0; i < updateAnnotation.staticSize(); ++i) { ((int[]) f.get(obj))[i] = byteBuffer.readUnsignedByte(); @@ -534,8 +510,7 @@ public class ClassMapping { } for (ClassMapping c : objectArrayFields) { - TileNetworkData updateAnnotation = c.field - .getAnnotation(TileNetworkData.class); + TileNetworkData updateAnnotation = c.field.getAnnotation(TileNetworkData.class); Object[] cpts = (Object[]) c.field.get(obj); @@ -551,8 +526,7 @@ public class ClassMapping { index.floatIndex += c.sizeFloat; index.stringIndex += c.sizeString; } else - c.updateFromData(cpts[i], byteBuffer, floatValues, - stringValues, index); + c.updateFromData(cpts[i], byteBuffer, floatValues, stringValues, index); } } } diff --git a/common/net/minecraft/src/buildcraft/core/DefaultAreaProvider.java b/common/net/minecraft/src/buildcraft/core/DefaultAreaProvider.java index ca8e31d0..7947a2c5 100644 --- a/common/net/minecraft/src/buildcraft/core/DefaultAreaProvider.java +++ b/common/net/minecraft/src/buildcraft/core/DefaultAreaProvider.java @@ -15,8 +15,7 @@ public class DefaultAreaProvider implements IAreaProvider { int xMin, yMin, zMin, xMax, yMax, zMax; - public DefaultAreaProvider(int xMin, int yMin, int zMin, int xMax, - int yMax, int zMax) { + public DefaultAreaProvider(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax) { this.xMin = xMin; this.xMax = xMax; diff --git a/common/net/minecraft/src/buildcraft/core/DefaultTriggerProvider.java b/common/net/minecraft/src/buildcraft/core/DefaultTriggerProvider.java index 535e1517..7a0ff446 100644 --- a/common/net/minecraft/src/buildcraft/core/DefaultTriggerProvider.java +++ b/common/net/minecraft/src/buildcraft/core/DefaultTriggerProvider.java @@ -21,16 +21,14 @@ public class DefaultTriggerProvider implements ITriggerProvider { LinkedList res = new LinkedList(); - if (tile instanceof IInventory - && ((IInventory) tile).getSizeInventory() > 0) { + if (tile instanceof IInventory && ((IInventory) tile).getSizeInventory() > 0) { res.add(BuildCraftCore.triggerEmptyInventory); res.add(BuildCraftCore.triggerContainsInventory); res.add(BuildCraftCore.triggerSpaceInventory); res.add(BuildCraftCore.triggerFullInventory); } - if (tile instanceof ILiquidContainer - && ((ILiquidContainer) tile).getLiquidSlots().length > 0) { + if (tile instanceof ILiquidContainer && ((ILiquidContainer) tile).getLiquidSlots().length > 0) { res.add(BuildCraftCore.triggerEmptyLiquid); res.add(BuildCraftCore.triggerContainsLiquid); res.add(BuildCraftCore.triggerSpaceLiquid); diff --git a/common/net/minecraft/src/buildcraft/core/EntityBlock.java b/common/net/minecraft/src/buildcraft/core/EntityBlock.java index ab68efd3..d1b7efd3 100644 --- a/common/net/minecraft/src/buildcraft/core/EntityBlock.java +++ b/common/net/minecraft/src/buildcraft/core/EntityBlock.java @@ -36,8 +36,7 @@ public class EntityBlock extends Entity { setPosition(xPos, yPos, zPos); } - public EntityBlock(World world, double i, double j, double k, double iSize, - double jSize, double kSize) { + public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize) { this(world); motionX = 0.0D; @@ -53,8 +52,7 @@ public class EntityBlock extends Entity { setPosition(i, j, k); } - public EntityBlock(World world, double i, double j, double k, double iSize, - double jSize, double kSize, int textureID) { + public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, int textureID) { this(world, i, j, k, iSize, jSize, kSize); texture = textureID; diff --git a/common/net/minecraft/src/buildcraft/core/EntityLaser.java b/common/net/minecraft/src/buildcraft/core/EntityLaser.java index 6e4f7924..88afae81 100644 --- a/common/net/minecraft/src/buildcraft/core/EntityLaser.java +++ b/common/net/minecraft/src/buildcraft/core/EntityLaser.java @@ -32,8 +32,7 @@ public class EntityLaser extends Entity { setSize(10, 10); } - public void setPositions(double x1, double y1, double z1, double x2, - double y2, double z2) { + public void setPositions(double x1, double y1, double z1, double x2, double y2, double z2) { this.x1 = x1; this.y1 = y1; this.z1 = z1; @@ -95,16 +94,13 @@ public class EntityLaser extends Entity { } @Override - protected void entityInit() { - } + protected void entityInit() {} @Override - protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { - } + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {} @Override - protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { - } + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {} public String getTexture() { return texture; diff --git a/common/net/minecraft/src/buildcraft/core/EntityRobot.java b/common/net/minecraft/src/buildcraft/core/EntityRobot.java index 280b4265..55bad2a6 100644 --- a/common/net/minecraft/src/buildcraft/core/EntityRobot.java +++ b/common/net/minecraft/src/buildcraft/core/EntityRobot.java @@ -109,16 +109,13 @@ public class EntityRobot extends Entity implements ISpawnHandler { } @Override - protected void entityInit() { - } + protected void entityInit() {} @Override - protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { - } + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {} @Override - protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { - } + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {} @Override public void onUpdate() { @@ -160,8 +157,7 @@ public class EntityRobot extends Entity implements ISpawnHandler { List potentialDestinations = new ArrayList(); for (BlockIndex blockIndex : moveArea.getBlocksInArea()) { - if (BuildCraftAPI.softBlock(blockIndex.getBlockId(worldObj)) - && movementBoundary.contains(blockIndex)) { + if (BuildCraftAPI.softBlock(blockIndex.getBlockId(worldObj)) && movementBoundary.contains(blockIndex)) { potentialDestinations.add(blockIndex); } } @@ -211,16 +207,12 @@ public class EntityRobot extends Entity implements ISpawnHandler { if (target.mode == Mode.ClearIfInvalid) { if (!target.isValid(a.context)) - worldObj.setBlockAndMetadataWithNotify(target.x, - target.y, target.z, 0, 0); + worldObj.setBlockAndMetadataWithNotify(target.x, target.y, target.z, 0, 0); } else if (target.stackToUse != null) { - worldObj.setBlockWithNotify(target.x, target.y, - target.z, 0); - target.stackToUse.getItem().onItemUse( - target.stackToUse, - BuildCraftAPI.getBuildCraftPlayer(worldObj), + worldObj.setBlockWithNotify(target.x, target.y, target.z, 0); + target.stackToUse.getItem().onItemUse(target.stackToUse, BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, target.x, target.y - 1, target.z, 1); } else { @@ -229,8 +221,7 @@ public class EntityRobot extends Entity implements ISpawnHandler { } catch (Throwable t) { // Defensive code against errors in implementers t.printStackTrace(); - ModLoader.getLogger().throwing("EntityRobot", - "update", t); + ModLoader.getLogger().throwing("EntityRobot", "update", t); } } @@ -264,8 +255,7 @@ public class EntityRobot extends Entity implements ISpawnHandler { } if (target != null) - laser.setPositions(posX, posY, posZ, target.x + 0.5, - target.y + 0.5, target.z + 0.5); + laser.setPositions(posX, posY, posZ, target.x + 0.5, target.y + 0.5, target.z + 0.5); else laser.hidden = true; @@ -295,8 +285,7 @@ public class EntityRobot extends Entity implements ISpawnHandler { public void setBox(Box box) { this.box = box; - setDestination((int) box.centerX(), (int) box.centerY(), - (int) box.centerZ()); + setDestination((int) box.centerX(), (int) box.centerY(), (int) box.centerZ()); } @Override diff --git a/common/net/minecraft/src/buildcraft/core/GuiIds.java b/common/net/minecraft/src/buildcraft/core/GuiIds.java index 912ec988..85a2e2dc 100644 --- a/common/net/minecraft/src/buildcraft/core/GuiIds.java +++ b/common/net/minecraft/src/buildcraft/core/GuiIds.java @@ -1,6 +1,7 @@ package net.minecraft.src.buildcraft.core; public class GuiIds { + public static final int ARCHITECT_TABLE = 10; public static final int BUILDER = 11; public static final int FILLER = 12; diff --git a/common/net/minecraft/src/buildcraft/core/IBptContributor.java b/common/net/minecraft/src/buildcraft/core/IBptContributor.java index 89642eb5..00b22b60 100644 --- a/common/net/minecraft/src/buildcraft/core/IBptContributor.java +++ b/common/net/minecraft/src/buildcraft/core/IBptContributor.java @@ -5,10 +5,8 @@ import net.minecraft.src.buildcraft.api.BptSlotInfo; public interface IBptContributor { - public void saveToBluePrint(TileEntity builder, BptBase bluePrint, - BptSlotInfo slot); + public void saveToBluePrint(TileEntity builder, BptBase bluePrint, BptSlotInfo slot); - public void loadFromBluePrint(TileEntity builder, BptBase bluePrint, - BptSlotInfo slot); + public void loadFromBluePrint(TileEntity builder, BptBase bluePrint, BptSlotInfo slot); } diff --git a/common/net/minecraft/src/buildcraft/core/ItemRedstoneChipset.java b/common/net/minecraft/src/buildcraft/core/ItemRedstoneChipset.java index 04a63a6e..6072dbe0 100644 --- a/common/net/minecraft/src/buildcraft/core/ItemRedstoneChipset.java +++ b/common/net/minecraft/src/buildcraft/core/ItemRedstoneChipset.java @@ -32,8 +32,7 @@ public class ItemRedstoneChipset extends ItemBuildCraft { @Override public String getItemNameIS(ItemStack itemstack) { - return (new StringBuilder()).append(super.getItemName()).append(".") - .append(itemstack.getItemDamage()).toString(); + return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString(); } @Override diff --git a/common/net/minecraft/src/buildcraft/core/ItemWrench.java b/common/net/minecraft/src/buildcraft/core/ItemWrench.java index 161f7cf9..2dcc477a 100644 --- a/common/net/minecraft/src/buildcraft/core/ItemWrench.java +++ b/common/net/minecraft/src/buildcraft/core/ItemWrench.java @@ -15,6 +15,5 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench { } @Override - public void wrenchUsed(EntityPlayer player, int x, int y, int z) { - } + public void wrenchUsed(EntityPlayer player, int x, int y, int z) {} } diff --git a/common/net/minecraft/src/buildcraft/core/PersistentWorld.java b/common/net/minecraft/src/buildcraft/core/PersistentWorld.java index 70f3d2d9..c72f6a78 100644 --- a/common/net/minecraft/src/buildcraft/core/PersistentWorld.java +++ b/common/net/minecraft/src/buildcraft/core/PersistentWorld.java @@ -22,8 +22,7 @@ public class PersistentWorld { private TreeMap tiles = new TreeMap(); - public PersistentTile createTile(PersistentTile defaultTile, - BlockIndex index) { + public PersistentTile createTile(PersistentTile defaultTile, BlockIndex index) { PersistentTile result = null; if (!tiles.containsKey(index)) { diff --git a/common/net/minecraft/src/buildcraft/core/RedstonePowerProvider.java b/common/net/minecraft/src/buildcraft/core/RedstonePowerProvider.java index 15b04b5d..9aae69a4 100644 --- a/common/net/minecraft/src/buildcraft/core/RedstonePowerProvider.java +++ b/common/net/minecraft/src/buildcraft/core/RedstonePowerProvider.java @@ -28,8 +28,7 @@ public class RedstonePowerProvider extends PowerProvider { public boolean preConditions(IPowerReceptor receptor) { TileEntity tile = (TileEntity) receptor; - boolean currentPower = tile.worldObj.isBlockIndirectlyGettingPowered( - tile.xCoord, tile.yCoord, tile.zCoord); + boolean currentPower = tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord); if (BuildCraftCore.continuousCurrentModel) { if (currentPower) @@ -62,10 +61,8 @@ public class RedstonePowerProvider extends PowerProvider { } @Override - public void configure(int latency, int minEnergyReceived, - int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { - super.configure(latency, minEnergyReceived, maxEnergyReceived, - minActivationEnergy, maxStoredEnergy); + public void configure(int latency, int minEnergyReceived, int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { + super.configure(latency, minEnergyReceived, maxEnergyReceived, minActivationEnergy, maxStoredEnergy); this.minActivationEnergy = 0; this.energyStored = 1; diff --git a/common/net/minecraft/src/buildcraft/core/StackUtil.java b/common/net/minecraft/src/buildcraft/core/StackUtil.java index 205ece90..ea8005a4 100644 --- a/common/net/minecraft/src/buildcraft/core/StackUtil.java +++ b/common/net/minecraft/src/buildcraft/core/StackUtil.java @@ -44,39 +44,32 @@ public class StackUtil { if (from.reverse().ordinal() == j) continue; - Position pos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, - Orientations.values()[j]); + Position pos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, Orientations.values()[j]); pos.moveForwards(1.0); - TileEntity tileInventory = w.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tileInventory = w.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); if (tileInventory instanceof ISpecialInventory) - if (((ISpecialInventory) tileInventory).addItem(items, false, - from)) + if (((ISpecialInventory) tileInventory).addItem(items, false, from)) possibleInventories.add(pos.orientation); if (tileInventory instanceof IInventory) if (Utils.checkPipesConnections(tile, tileInventory) - && checkAvailableSlot((IInventory) tileInventory, - false, pos.orientation.reverse())) + && checkAvailableSlot((IInventory) tileInventory, false, pos.orientation.reverse())) possibleInventories.add(pos.orientation); } if (possibleInventories.size() > 0) { int choice = w.rand.nextInt(possibleInventories.size()); - Position pos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, - possibleInventories.get(choice)); + Position pos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, possibleInventories.get(choice)); pos.moveForwards(1.0); - TileEntity tileInventory = w.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tileInventory = w.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); - checkAvailableSlot((IInventory) tileInventory, true, - pos.orientation.reverse()); + checkAvailableSlot((IInventory) tileInventory, true, pos.orientation.reverse()); if (items.stackSize > 0) return addToRandomInventory(tileInventory, from); @@ -91,8 +84,7 @@ public class StackUtil { * they will be effectively added. Orientations is the direction to look to * find the item, e.g. if the item is coming from the top, it will be YPos. */ - public boolean checkAvailableSlot(IInventory inventory, boolean add, - Orientations from) { + public boolean checkAvailableSlot(IInventory inventory, boolean add, Orientations from) { // First, look for a similar pile if (inventory instanceof ISpecialInventory) @@ -105,8 +97,7 @@ public class StackUtil { ISidedInventory sidedInv = (ISidedInventory) inv; int first = sidedInv.getStartInventorySide(from.ordinal()); - int last = first + sidedInv.getSizeInventorySide(from.ordinal()) - - 1; + int last = first + sidedInv.getSizeInventorySide(from.ordinal()) - 1; for (int j = first; j <= last; ++j) if (tryAdding(inv, j, add, false)) { @@ -160,8 +151,7 @@ public class StackUtil { ISidedInventory sidedInv = (ISidedInventory) inv; int first = sidedInv.getStartInventorySide(from.ordinal()); - int last = first + sidedInv.getSizeInventorySide(from.ordinal()) - - 1; + int last = first + sidedInv.getSizeInventorySide(from.ordinal()) - 1; for (int j = first; j <= last; ++j) if (tryAdding(inv, j, add, true)) { @@ -220,17 +210,14 @@ public class StackUtil { * * This will add one item at a time, and decrease the items member. */ - public boolean tryAdding(IInventory inventory, int stackIndex, - boolean doAdd, boolean addInEmpty) { + public boolean tryAdding(IInventory inventory, int stackIndex, boolean doAdd, boolean addInEmpty) { ItemStack stack = inventory.getStackInSlot(stackIndex); if (!addInEmpty) { if (stack != null) - if (stack.getItem() == items.getItem() - && stack.getItemDamage() == items.getItemDamage() + if (stack.getItem() == items.getItem() && stack.getItemDamage() == items.getItemDamage() && stack.stackSize + 1 <= stack.getMaxStackSize() - && stack.stackSize + 1 <= inventory - .getInventoryStackLimit()) { + && stack.stackSize + 1 <= inventory.getInventoryStackLimit()) { if (doAdd) { stack.stackSize++; diff --git a/common/net/minecraft/src/buildcraft/core/SurroundingInventory.java b/common/net/minecraft/src/buildcraft/core/SurroundingInventory.java index 1ff81d9e..7dc1c568 100644 --- a/common/net/minecraft/src/buildcraft/core/SurroundingInventory.java +++ b/common/net/minecraft/src/buildcraft/core/SurroundingInventory.java @@ -140,8 +140,7 @@ public class SurroundingInventory implements IInventory, IBuilderInventory { } @Override - public void onInventoryChanged() { - } + public void onInventoryChanged() {} @Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { @@ -149,12 +148,10 @@ public class SurroundingInventory implements IInventory, IBuilderInventory { } @Override - public void openChest() { - } + public void openChest() {} @Override - public void closeChest() { - } + public void closeChest() {} @Override public boolean isBuildingMaterial(int i) { @@ -165,8 +162,7 @@ public class SurroundingInventory implements IInventory, IBuilderInventory { if (size > i) if (inv instanceof IBuilderInventory) - return ((IBuilderInventory) inv).isBuildingMaterial(i - - lastSize); + return ((IBuilderInventory) inv).isBuildingMaterial(i - lastSize); else return true; diff --git a/common/net/minecraft/src/buildcraft/core/TileBuildCraft.java b/common/net/minecraft/src/buildcraft/core/TileBuildCraft.java index 5725b4f8..c642efcc 100644 --- a/common/net/minecraft/src/buildcraft/core/TileBuildCraft.java +++ b/common/net/minecraft/src/buildcraft/core/TileBuildCraft.java @@ -22,8 +22,7 @@ import net.minecraft.src.buildcraft.core.network.PacketTileUpdate; import net.minecraft.src.buildcraft.core.network.PacketUpdate; import net.minecraft.src.buildcraft.core.network.TilePacketWrapper; -public abstract class TileBuildCraft extends TileEntity implements - ISynchronizedTile { +public abstract class TileBuildCraft extends TileEntity implements ISynchronizedTile { @SuppressWarnings("rawtypes") private static Map updateWrappers = new HashMap(); @@ -37,12 +36,10 @@ public abstract class TileBuildCraft extends TileEntity implements public TileBuildCraft() { if (!updateWrappers.containsKey(this.getClass())) - updateWrappers.put(this.getClass(), - new TilePacketWrapper(this.getClass())); + updateWrappers.put(this.getClass(), new TilePacketWrapper(this.getClass())); if (!descriptionWrappers.containsKey(this.getClass())) - descriptionWrappers.put(this.getClass(), - new TilePacketWrapper(this.getClass())); + descriptionWrappers.put(this.getClass(), new TilePacketWrapper(this.getClass())); updatePacket = updateWrappers.get(this.getClass()); descriptionPacket = descriptionWrappers.get(this.getClass()); @@ -73,10 +70,8 @@ public abstract class TileBuildCraft extends TileEntity implements public void sendNetworkUpdate() { if (this instanceof ISynchronizedTile) - CoreProxy.sendToPlayers( - ((ISynchronizedTile) this).getUpdatePacket(), worldObj, - xCoord, yCoord, zCoord, DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftCore.instance); + CoreProxy.sendToPlayers(((ISynchronizedTile) this).getUpdatePacket(), worldObj, xCoord, yCoord, zCoord, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftCore.instance); } @Override diff --git a/common/net/minecraft/src/buildcraft/core/TriggerInventory.java b/common/net/minecraft/src/buildcraft/core/TriggerInventory.java index ad8e00ff..efb70ce5 100644 --- a/common/net/minecraft/src/buildcraft/core/TriggerInventory.java +++ b/common/net/minecraft/src/buildcraft/core/TriggerInventory.java @@ -17,6 +17,7 @@ import net.minecraft.src.buildcraft.api.Trigger; import net.minecraft.src.buildcraft.api.TriggerParameter; public class TriggerInventory extends Trigger { + public enum State { Empty, Contains, Space, Full }; @@ -72,8 +73,7 @@ public class TriggerInventory extends Trigger { if (parameter != null) searchedStack = parameter.getItem(); - if (tile instanceof IInventory - && ((IInventory) tile).getSizeInventory() > 0) { + if (tile instanceof IInventory && ((IInventory) tile).getSizeInventory() > 0) { IInventory inv = Utils.getInventory(((IInventory) tile)); boolean foundItems = false; @@ -83,21 +83,17 @@ public class TriggerInventory extends Trigger { ItemStack stack = inv.getStackInSlot(i); if (parameter == null || parameter.stack == null) - foundItems = foundItems || stack != null - && stack.stackSize > 0; + foundItems = foundItems || stack != null && stack.stackSize > 0; else if (stack != null && stack.stackSize > 0) foundItems = foundItems - || (stack.itemID == parameter.stack.itemID && stack - .getItemDamage() == parameter.stack + || (stack.itemID == parameter.stack.itemID && stack.getItemDamage() == parameter.stack .getItemDamage()); if (stack == null || stack.stackSize == 0) foundSpace = true; else if (searchedStack != null) - if (stack.stackSize < stack.getMaxStackSize() - && stack.itemID == searchedStack.itemID - && stack.getItemDamage() == searchedStack - .getItemDamage()) + if (stack.stackSize < stack.getMaxStackSize() && stack.itemID == searchedStack.itemID + && stack.getItemDamage() == searchedStack.getItemDamage()) foundSpace = true; } diff --git a/common/net/minecraft/src/buildcraft/core/TriggerLiquidContainer.java b/common/net/minecraft/src/buildcraft/core/TriggerLiquidContainer.java index 2ed6d478..807b45fe 100644 --- a/common/net/minecraft/src/buildcraft/core/TriggerLiquidContainer.java +++ b/common/net/minecraft/src/buildcraft/core/TriggerLiquidContainer.java @@ -18,6 +18,7 @@ import net.minecraft.src.buildcraft.api.Trigger; import net.minecraft.src.buildcraft.api.TriggerParameter; public class TriggerLiquidContainer extends Trigger { + public enum State { Empty, Contains, Space, Full }; @@ -73,8 +74,7 @@ public class TriggerLiquidContainer extends Trigger { int seachedLiquidId = 0; if (parameter != null && parameter.getItem() != null) - seachedLiquidId = BuildCraftAPI - .getLiquidForFilledItem(parameter.getItem()); + seachedLiquidId = BuildCraftAPI.getLiquidForFilledItem(parameter.getItem()); LiquidSlot[] liquids = container.getLiquidSlots(); @@ -95,8 +95,7 @@ public class TriggerLiquidContainer extends Trigger { case Contains: for (LiquidSlot c : liquids) if (c.getLiquidQty() != 0) - if (seachedLiquidId == 0 - || seachedLiquidId == c.getLiquidId()) + if (seachedLiquidId == 0 || seachedLiquidId == c.getLiquidId()) return true; return false; @@ -106,8 +105,7 @@ public class TriggerLiquidContainer extends Trigger { if (c.getLiquidQty() == 0) return true; else if (c.getLiquidQty() < c.getCapacity()) - if (seachedLiquidId == 0 - || seachedLiquidId == c.getLiquidId()) + if (seachedLiquidId == 0 || seachedLiquidId == c.getLiquidId()) return true; return false; diff --git a/common/net/minecraft/src/buildcraft/core/Utils.java b/common/net/minecraft/src/buildcraft/core/Utils.java index d7e637af..b7c0e811 100644 --- a/common/net/minecraft/src/buildcraft/core/Utils.java +++ b/common/net/minecraft/src/buildcraft/core/Utils.java @@ -86,8 +86,7 @@ public class Utils { * isn't used again so that entities doesn't go backwards. Returns true if * successful, false otherwise. */ - public static boolean addToRandomPipeEntry(TileEntity tile, - Orientations from, ItemStack items) { + public static boolean addToRandomPipeEntry(TileEntity tile, Orientations from, ItemStack items) { World w = tile.worldObj; LinkedList possiblePipes = new LinkedList(); @@ -96,26 +95,21 @@ public class Utils { if (from.reverse().ordinal() == j) continue; - Position pos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, - Orientations.values()[j]); + Position pos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, Orientations.values()[j]); pos.moveForwards(1.0); - TileEntity pipeEntry = w.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity pipeEntry = w.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); - if (pipeEntry instanceof IPipeEntry - && ((IPipeEntry) pipeEntry).acceptItems()) + if (pipeEntry instanceof IPipeEntry && ((IPipeEntry) pipeEntry).acceptItems()) possiblePipes.add(Orientations.values()[j]); } if (possiblePipes.size() > 0) { int choice = w.rand.nextInt(possiblePipes.size()); - Position entityPos = new Position(tile.xCoord, tile.yCoord, - tile.zCoord, possiblePipes.get(choice)); - Position pipePos = new Position(tile.xCoord, tile.yCoord, - tile.zCoord, possiblePipes.get(choice)); + Position entityPos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, possiblePipes.get(choice)); + Position pipePos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, possiblePipes.get(choice)); entityPos.x += 0.5; entityPos.y += getPipeFloorOf(items); @@ -125,11 +119,9 @@ public class Utils { pipePos.moveForwards(1.0); - IPipeEntry pipeEntry = (IPipeEntry) w.getBlockTileEntity( - (int) pipePos.x, (int) pipePos.y, (int) pipePos.z); + IPipeEntry pipeEntry = (IPipeEntry) w.getBlockTileEntity((int) pipePos.x, (int) pipePos.y, (int) pipePos.z); - EntityPassiveItem entity = new EntityPassiveItem(w, entityPos.x, - entityPos.y, entityPos.z, items); + EntityPassiveItem entity = new EntityPassiveItem(w, entityPos.x, entityPos.y, entityPos.z, items); pipeEntry.entityEntering(entity, entityPos.orientation); items.stackSize = 0; @@ -138,21 +130,18 @@ public class Utils { return false; } - public static void dropItems(World world, ItemStack stack, int i, int j, - int k) { + public static void dropItems(World world, ItemStack stack, int i, int j, int k) { float f1 = 0.7F; double d = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D; double d1 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D; double d2 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D; - EntityItem entityitem = new EntityItem(world, i + d, j + d1, k + d2, - stack); + EntityItem entityitem = new EntityItem(world, i + d, j + d1, k + d2, stack); entityitem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityitem); } - public static void dropItems(World world, IInventory inventory, int i, - int j, int k) { + public static void dropItems(World world, IInventory inventory, int i, int j, int k) { for (int l = 0; l < inventory.getSizeInventory(); ++l) { ItemStack items = inventory.getStackInSlot(l); @@ -161,8 +150,7 @@ public class Utils { } } - public static TileEntity getTile(World world, Position pos, - Orientations step) { + public static TileEntity getTile(World world, Position pos, Orientations step) { Position tmp = new Position(pos); tmp.orientation = step; tmp.moveForwards(1.0); @@ -173,8 +161,7 @@ public class Utils { public static IInventory getInventory(IInventory inv) { if (inv instanceof TileEntityChest) { TileEntityChest chest = (TileEntityChest) inv; - Position pos = new Position(chest.xCoord, chest.yCoord, - chest.zCoord); + Position pos = new Position(chest.xCoord, chest.yCoord, chest.zCoord); TileEntity tile; IInventory chest2 = null; tile = Utils.getTile(chest.worldObj, pos, Orientations.XNeg); @@ -195,8 +182,7 @@ public class Utils { return inv; } - public static IAreaProvider getNearbyAreaProvider(World world, int i, - int j, int k) { + public static IAreaProvider getNearbyAreaProvider(World world, int i, int j, int k) { TileEntity a1 = world.getBlockTileEntity(i + 1, j, k); TileEntity a2 = world.getBlockTileEntity(i - 1, j, k); TileEntity a3 = world.getBlockTileEntity(i, j, k + 1); @@ -225,8 +211,7 @@ public class Utils { return null; } - public static EntityBlock createLaser(World world, Position p1, - Position p2, LaserKind kind) { + public static EntityBlock createLaser(World world, Position p1, Position p2, LaserKind kind) { if (p1.equals(p2)) return null; @@ -277,17 +262,15 @@ public class Utils { break; } - EntityBlock block = new EntityBlock(world, i, j, k, iSize, jSize, - kSize, texture); + EntityBlock block = new EntityBlock(world, i, j, k, iSize, jSize, kSize, texture); world.spawnEntityInWorld(block); return block; } - public static EntityBlock[] createLaserBox(World world, double xMin, - double yMin, double zMin, double xMax, double yMax, double zMax, - LaserKind kind) { + public static EntityBlock[] createLaserBox(World world, double xMin, double yMin, double zMin, double xMax, double yMax, + double zMax, LaserKind kind) { EntityBlock lasers[] = new EntityBlock[12]; Position[] p = new Position[8]; @@ -322,8 +305,7 @@ public class Utils { if (BuildCraftCore.bufferedDescriptions.containsKey(index)) { - PacketUpdate payload = BuildCraftCore.bufferedDescriptions - .get(index); + PacketUpdate payload = BuildCraftCore.bufferedDescriptions.get(index); BuildCraftCore.bufferedDescriptions.remove(index); tileSynch.handleDescriptionPacket(payload); @@ -332,11 +314,9 @@ public class Utils { } public static int liquidId(int blockId) { - if (blockId == Block.waterStill.blockID - || blockId == Block.waterMoving.blockID) + if (blockId == Block.waterStill.blockID || blockId == Block.waterMoving.blockID) return Block.waterStill.blockID; - else if (blockId == Block.lavaStill.blockID - || blockId == Block.lavaMoving.blockID) + else if (blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID) return Block.lavaStill.blockID; else if (Block.blocksList[blockId] instanceof ILiquid) return ((ILiquid) Block.blocksList[blockId]).stillLiquidId(); @@ -394,21 +374,18 @@ public class Utils { TileEntity tile = world.getBlockTileEntity(i, j, k); if (tile instanceof IInventory && !APIProxy.isClient(world)) - if (!(tile instanceof IDropControlInventory) - || ((IDropControlInventory) tile).doDrop()) + if (!(tile instanceof IDropControlInventory) || ((IDropControlInventory) tile).doDrop()) dropItems(world, (IInventory) tile, i, j, k); if (tile instanceof TileBuildCraft) ((TileBuildCraft) tile).destroy(); } - public static boolean checkPipesConnections(TileEntity tile1, - TileEntity tile2) { + public static boolean checkPipesConnections(TileEntity tile1, TileEntity tile2) { if (tile1 == null || tile2 == null) return false; - if (!(tile1 instanceof IPipeConnection) - && !(tile2 instanceof IPipeConnection)) + if (!(tile1 instanceof IPipeConnection) && !(tile2 instanceof IPipeConnection)) return false; Orientations o = Orientations.Unknown; @@ -426,64 +403,54 @@ public class Utils { else if (tile1.zCoord + 1 == tile2.zCoord) o = Orientations.ZPos; - if (tile1 instanceof IPipeConnection - && !((IPipeConnection) tile1).isPipeConnected(o)) + if (tile1 instanceof IPipeConnection && !((IPipeConnection) tile1).isPipeConnected(o)) return false; - if (tile2 instanceof IPipeConnection - && !((IPipeConnection) tile2).isPipeConnected(o.reverse())) + if (tile2 instanceof IPipeConnection && !((IPipeConnection) tile2).isPipeConnected(o.reverse())) return false; return true; } - public static boolean checkPipesConnections(IBlockAccess blockAccess, - TileEntity tile1, int x2, int y2, int z2) { + public static boolean checkPipesConnections(IBlockAccess blockAccess, TileEntity tile1, int x2, int y2, int z2) { TileEntity tile2 = blockAccess.getBlockTileEntity(x2, y2, z2); return checkPipesConnections(tile1, tile2); } - public static boolean checkLegacyPipesConnections(IBlockAccess blockAccess, - int x1, int y1, int z1, int x2, int y2, int z2) { + public static boolean checkLegacyPipesConnections(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2) { Block b1 = Block.blocksList[blockAccess.getBlockId(x1, y1, z1)]; Block b2 = Block.blocksList[blockAccess.getBlockId(x2, y2, z2)]; - if (!(b1 instanceof ILegacyPipeConnection) - && !(b2 instanceof ILegacyPipeConnection)) + if (!(b1 instanceof ILegacyPipeConnection) && !(b2 instanceof ILegacyPipeConnection)) return false; if (b1 instanceof ILegacyPipeConnection - && !((ILegacyPipeConnection) b1).isPipeConnected(blockAccess, - x1, y1, z1, x2, y2, z2)) + && !((ILegacyPipeConnection) b1).isPipeConnected(blockAccess, x1, y1, z1, x2, y2, z2)) return false; if (b2 instanceof ILegacyPipeConnection - && !((ILegacyPipeConnection) b2).isPipeConnected(blockAccess, - x2, y2, z2, x1, y1, z1)) + && !((ILegacyPipeConnection) b2).isPipeConnected(blockAccess, x2, y2, z2, x1, y1, z1)) return false; return true; } - public static void readStacksFromNBT(NBTTagCompound nbt, String name, - ItemStack[] stacks) { + public static void readStacksFromNBT(NBTTagCompound nbt, String name, ItemStack[] stacks) { NBTTagList nbttaglist = nbt.getTagList(name); for (int i = 0; i < stacks.length; ++i) if (i < nbttaglist.tagCount()) { - NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist - .tagAt(i); + NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist.tagAt(i); stacks[i] = ItemStack.loadItemStackFromNBT(nbttagcompound2); } else stacks[i] = null; } - public static void writeStacksToNBT(NBTTagCompound nbt, String name, - ItemStack[] stacks) { + public static void writeStacksToNBT(NBTTagCompound nbt, String name, ItemStack[] stacks) { NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < stacks.length; ++i) { diff --git a/common/net/minecraft/src/buildcraft/core/network/EntityIds.java b/common/net/minecraft/src/buildcraft/core/network/EntityIds.java index db75446c..5f8426ac 100644 --- a/common/net/minecraft/src/buildcraft/core/network/EntityIds.java +++ b/common/net/minecraft/src/buildcraft/core/network/EntityIds.java @@ -1,6 +1,7 @@ package net.minecraft.src.buildcraft.core.network; public class EntityIds { + public static final int ROBOT = 10; public static final int ENERGY_LASER = 20; public static final int LASER = 30; diff --git a/common/net/minecraft/src/buildcraft/core/network/ISynchronizedTile.java b/common/net/minecraft/src/buildcraft/core/network/ISynchronizedTile.java index 471b4213..c32ad563 100644 --- a/common/net/minecraft/src/buildcraft/core/network/ISynchronizedTile.java +++ b/common/net/minecraft/src/buildcraft/core/network/ISynchronizedTile.java @@ -12,6 +12,7 @@ package net.minecraft.src.buildcraft.core.network; import net.minecraft.src.Packet; public interface ISynchronizedTile { + public void handleDescriptionPacket(PacketUpdate packet); public void handleUpdatePacket(PacketUpdate packet); diff --git a/common/net/minecraft/src/buildcraft/core/network/IndexInPayload.java b/common/net/minecraft/src/buildcraft/core/network/IndexInPayload.java index 212cc1db..bc829e47 100644 --- a/common/net/minecraft/src/buildcraft/core/network/IndexInPayload.java +++ b/common/net/minecraft/src/buildcraft/core/network/IndexInPayload.java @@ -5,6 +5,7 @@ package net.minecraft.src.buildcraft.core.network; * Internal use only. */ public class IndexInPayload { + public IndexInPayload(int intIndex, int floatIndex, int stringIndex) { this.intIndex = intIndex; this.floatIndex = floatIndex; diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketCoordinates.java b/common/net/minecraft/src/buildcraft/core/network/PacketCoordinates.java index 31528155..5ee29988 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketCoordinates.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketCoordinates.java @@ -12,8 +12,7 @@ public class PacketCoordinates extends BuildCraftPacket { public int posY; public int posZ; - public PacketCoordinates() { - } + public PacketCoordinates() {} public PacketCoordinates(int id, int x, int y, int z) { diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketIds.java b/common/net/minecraft/src/buildcraft/core/network/PacketIds.java index 112865f4..e042c4e3 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketIds.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketIds.java @@ -1,6 +1,7 @@ package net.minecraft.src.buildcraft.core.network; public class PacketIds { + public static final int TILE_UPDATE = 0; public static final int PIPE_DESCRIPTION = 1; public static final int PIPE_CONTENTS = 2; diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketPayload.java b/common/net/minecraft/src/buildcraft/core/network/PacketPayload.java index 1b214cb8..40db23ec 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketPayload.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketPayload.java @@ -3,12 +3,12 @@ package net.minecraft.src.buildcraft.core.network; import net.minecraft.src.buildcraft.core.Utils; public class PacketPayload { + public int[] intPayload = new int[0]; public float[] floatPayload = new float[0]; public String[] stringPayload = new String[0]; - public PacketPayload() { - } + public PacketPayload() {} public PacketPayload(int intSize, int floatSize, int stringSize) { intPayload = new int[intSize]; @@ -23,11 +23,9 @@ public class PacketPayload { if (other.intPayload.length > 0) this.intPayload = Utils.concat(this.intPayload, other.intPayload); if (other.floatPayload.length > 0) - this.floatPayload = Utils.concat(this.floatPayload, - other.floatPayload); + this.floatPayload = Utils.concat(this.floatPayload, other.floatPayload); if (other.stringPayload.length > 0) - this.stringPayload = Utils.concat(this.stringPayload, - other.stringPayload); + this.stringPayload = Utils.concat(this.stringPayload, other.stringPayload); } @@ -39,18 +37,14 @@ public class PacketPayload { } public void splitTail(IndexInPayload index) { - PacketPayload payload = new PacketPayload(intPayload.length - - index.intIndex, floatPayload.length - index.floatIndex, + PacketPayload payload = new PacketPayload(intPayload.length - index.intIndex, floatPayload.length - index.floatIndex, stringPayload.length - index.stringIndex); if (intPayload.length > 0) - System.arraycopy(intPayload, index.intIndex, payload.intPayload, 0, - payload.intPayload.length); + System.arraycopy(intPayload, index.intIndex, payload.intPayload, 0, payload.intPayload.length); if (floatPayload.length > 0) - System.arraycopy(floatPayload, index.floatIndex, - payload.floatPayload, 0, payload.floatPayload.length); + System.arraycopy(floatPayload, index.floatIndex, payload.floatPayload, 0, payload.floatPayload.length); if (stringPayload.length > 0) - System.arraycopy(stringPayload, index.stringIndex, - payload.stringPayload, 0, payload.stringPayload.length); + System.arraycopy(stringPayload, index.stringIndex, payload.stringPayload, 0, payload.stringPayload.length); } } diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketPipeDescription.java b/common/net/minecraft/src/buildcraft/core/network/PacketPipeDescription.java index 53606c3b..6175763f 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketPipeDescription.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketPipeDescription.java @@ -4,8 +4,7 @@ import net.minecraft.src.buildcraft.transport.Pipe; public class PacketPipeDescription extends PacketUpdate { - public PacketPipeDescription() { - } + public PacketPipeDescription() {} public PacketPipeDescription(int posX, int posY, int posZ, Pipe pipe) { diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketPipeTransportContent.java b/common/net/minecraft/src/buildcraft/core/network/PacketPipeTransportContent.java index 5b517cef..fc0ca0a8 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketPipeTransportContent.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketPipeTransportContent.java @@ -9,8 +9,7 @@ public class PacketPipeTransportContent extends PacketUpdate { super(PacketIds.PIPE_CONTENTS); } - public PacketPipeTransportContent(int x, int y, int z, - EntityPassiveItem item, Orientations orientation) { + public PacketPipeTransportContent(int x, int y, int z, EntityPassiveItem item, Orientations orientation) { this(); this.posX = x; diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketSlotChange.java b/common/net/minecraft/src/buildcraft/core/network/PacketSlotChange.java index 521850f2..63b98a9f 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketSlotChange.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketSlotChange.java @@ -11,11 +11,9 @@ public class PacketSlotChange extends PacketCoordinates { public int slot; public ItemStack stack; - public PacketSlotChange() { - } + public PacketSlotChange() {} - public PacketSlotChange(int id, int x, int y, int z, int slot, - ItemStack stack) { + public PacketSlotChange(int id, int x, int y, int z, int slot, ItemStack stack) { super(id, x, y, z); this.slot = slot; this.stack = stack; diff --git a/common/net/minecraft/src/buildcraft/core/network/PacketUpdate.java b/common/net/minecraft/src/buildcraft/core/network/PacketUpdate.java index 9b476bf4..8985738d 100644 --- a/common/net/minecraft/src/buildcraft/core/network/PacketUpdate.java +++ b/common/net/minecraft/src/buildcraft/core/network/PacketUpdate.java @@ -14,15 +14,13 @@ public class PacketUpdate extends BuildCraftPacket { public PacketPayload payload; - public PacketUpdate() { - } + public PacketUpdate() {} public PacketUpdate(int packetId, PacketPayload payload) { this(packetId, 0, 0, 0, payload); } - public PacketUpdate(int packetId, int posX, int posY, int posZ, - PacketPayload payload) { + public PacketUpdate(int packetId, int posX, int posY, int posZ, PacketPayload payload) { this(packetId); this.posX = posX; diff --git a/common/net/minecraft/src/buildcraft/core/network/TilePacketWrapper.java b/common/net/minecraft/src/buildcraft/core/network/TilePacketWrapper.java index 82dd026f..5e83e165 100644 --- a/common/net/minecraft/src/buildcraft/core/network/TilePacketWrapper.java +++ b/common/net/minecraft/src/buildcraft/core/network/TilePacketWrapper.java @@ -50,8 +50,7 @@ public class TilePacketWrapper { buf.writeInt(tile.zCoord); try { - rootMappings[0].setData(tile, buf, payload.floatPayload, - payload.stringPayload, new Indexes(0, 0)); + rootMappings[0].setData(tile, buf, payload.floatPayload, payload.stringPayload, new Indexes(0, 0)); payload.intPayload = buf.readIntArray(); @@ -95,8 +94,7 @@ public class TilePacketWrapper { Indexes ind = new Indexes(0, 0); for (int i = 0; i < rootMappings.length; ++i) - rootMappings[i].setData(obj[i], buf, payload.floatPayload, - payload.stringPayload, ind); + rootMappings[i].setData(obj[i], buf, payload.floatPayload, payload.stringPayload, ind); payload.intPayload = buf.readIntArray(); @@ -117,8 +115,7 @@ public class TilePacketWrapper { buf.readInt(); buf.readInt(); - rootMappings[0].updateFromData(tile, buf, packet.floatPayload, - packet.stringPayload, new Indexes(0, 0)); + rootMappings[0].updateFromData(tile, buf, packet.floatPayload, packet.stringPayload, new Indexes(0, 0)); packet.intPayload = buf.readIntArray(); } catch (Exception e) { @@ -141,8 +138,7 @@ public class TilePacketWrapper { Indexes ind = new Indexes(0, 0); for (int i = 0; i < rootMappings.length; ++i) - rootMappings[i].updateFromData(obj[i], buf, - packet.floatPayload, packet.stringPayload, ind); + rootMappings[i].updateFromData(obj[i], buf, packet.floatPayload, packet.stringPayload, ind); packet.intPayload = buf.readIntArray(); } catch (Exception e) { diff --git a/common/net/minecraft/src/buildcraft/core/utils/INBTTagable.java b/common/net/minecraft/src/buildcraft/core/utils/INBTTagable.java index 1f8417e6..f82277b0 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/INBTTagable.java +++ b/common/net/minecraft/src/buildcraft/core/utils/INBTTagable.java @@ -3,6 +3,7 @@ package net.minecraft.src.buildcraft.core.utils; import net.minecraft.src.NBTTagCompound; public interface INBTTagable { + void readFromNBT(NBTTagCompound nbttagcompound); void writeToNBT(NBTTagCompound nbttagcompound); diff --git a/common/net/minecraft/src/buildcraft/core/utils/InventoryUtil.java b/common/net/minecraft/src/buildcraft/core/utils/InventoryUtil.java index 6c3f4b67..da8e85de 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/InventoryUtil.java +++ b/common/net/minecraft/src/buildcraft/core/utils/InventoryUtil.java @@ -4,6 +4,7 @@ import net.minecraft.src.IInventory; import net.minecraft.src.ItemStack; public class InventoryUtil { + private final IInventory _inventory; public InventoryUtil(IInventory inventory) { @@ -21,10 +22,11 @@ public class InventoryUtil { totalRoom += Math.min(_inventory.getInventoryStackLimit(), itemToTest.getMaxStackSize()); continue; } - if (itemToTest.itemID != stack.itemID || (!itemToTest.getItem().isDamageable() && itemToTest.getItemDamage() != stack.getItemDamage())) + if (itemToTest.itemID != stack.itemID + || (!itemToTest.getItem().isDamageable() && itemToTest.getItemDamage() != stack.getItemDamage())) continue; - totalRoom += (Math.min(_inventory.getInventoryStackLimit(), itemToTest.getMaxStackSize()) - stack.stackSize); + totalRoom += (Math.min(_inventory.getInventoryStackLimit(), itemToTest.getMaxStackSize()) - stack.stackSize); } return totalRoom; } @@ -52,7 +54,8 @@ public class InventoryUtil { _inventory.setInventorySlotContents(i, stackToMove); return null; } - if (stackToMove.itemID == stack.itemID && (stackToMove.getItem().isDamageable() || stackToMove.getItemDamage() == stack.getItemDamage())) { + if (stackToMove.itemID == stack.itemID + && (stackToMove.getItem().isDamageable() || stackToMove.getItemDamage() == stack.getItemDamage())) { if (stackToMove.stackSize + stack.stackSize <= stack.getMaxStackSize()) { stack.stackSize += stackToMove.stackSize; return null; diff --git a/common/net/minecraft/src/buildcraft/core/utils/Localization.java b/common/net/minecraft/src/buildcraft/core/utils/Localization.java index 92f0977e..47ff2cc4 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/Localization.java +++ b/common/net/minecraft/src/buildcraft/core/utils/Localization.java @@ -51,12 +51,9 @@ public class Localization { defaultMappings.clear(); mappings.clear(); try { - InputStream langStream = Localization.class - .getResourceAsStream("/lang/buildcraft/" + newLanguage - + ".properties"); - InputStream defaultLangStream = Localization.class - .getResourceAsStream("/lang/buildcraft/" + DEFAULT_LANGUAGE - + ".properties"); + InputStream langStream = Localization.class.getResourceAsStream("/lang/buildcraft/" + newLanguage + ".properties"); + InputStream defaultLangStream = Localization.class.getResourceAsStream("/lang/buildcraft/" + DEFAULT_LANGUAGE + + ".properties"); mappings.load((langStream == null) ? defaultLangStream : langStream); defaultMappings.load(defaultLangStream); diff --git a/common/net/minecraft/src/buildcraft/core/utils/SessionVars.java b/common/net/minecraft/src/buildcraft/core/utils/SessionVars.java index d956c0de..bf2bb873 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/SessionVars.java +++ b/common/net/minecraft/src/buildcraft/core/utils/SessionVars.java @@ -1,6 +1,7 @@ package net.minecraft.src.buildcraft.core.utils; public class SessionVars { + private static Class openedLedger; public static void setOpenedLedger(Class ledgerClass) { diff --git a/common/net/minecraft/src/buildcraft/core/utils/SidedInventoryAdapter.java b/common/net/minecraft/src/buildcraft/core/utils/SidedInventoryAdapter.java index 544a04b0..9d899d7f 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/SidedInventoryAdapter.java +++ b/common/net/minecraft/src/buildcraft/core/utils/SidedInventoryAdapter.java @@ -19,8 +19,7 @@ public class SidedInventoryAdapter implements IInventory { private final Orientations _side; private final int _slotOffset; - public SidedInventoryAdapter(ISidedInventory sidedInventory, - Orientations side) { + public SidedInventoryAdapter(ISidedInventory sidedInventory, Orientations side) { _sidedInventory = sidedInventory; _side = side; _slotOffset = _sidedInventory.getStartInventorySide(side.ordinal()); diff --git a/common/net/minecraft/src/buildcraft/core/utils/SimpleInventory.java b/common/net/minecraft/src/buildcraft/core/utils/SimpleInventory.java index abadecf8..f438d90d 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/SimpleInventory.java +++ b/common/net/minecraft/src/buildcraft/core/utils/SimpleInventory.java @@ -79,20 +79,17 @@ public class SimpleInventory implements IInventory, INBTTagable { } @Override - public void openChest() { - } + public void openChest() {} @Override - public void closeChest() { - } + public void closeChest() {} @Override public void readFromNBT(NBTTagCompound nbttagcompound) { NBTTagList nbttaglist = nbttagcompound.getTagList("items"); for (int j = 0; j < nbttaglist.tagCount(); ++j) { - NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist - .tagAt(j); + NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist.tagAt(j); int index = nbttagcompound2.getInteger("index"); _contents[index] = ItemStack.loadItemStackFromNBT(nbttagcompound2); } diff --git a/common/net/minecraft/src/buildcraft/core/utils/StringUtil.java b/common/net/minecraft/src/buildcraft/core/utils/StringUtil.java index 0885817e..f95893e2 100644 --- a/common/net/minecraft/src/buildcraft/core/utils/StringUtil.java +++ b/common/net/minecraft/src/buildcraft/core/utils/StringUtil.java @@ -1,6 +1,7 @@ package net.minecraft.src.buildcraft.core.utils; public class StringUtil { + public static String localize(String key) { return Localization.instance.get(key); } diff --git a/common/net/minecraft/src/buildcraft/devel/BlockCheat.java b/common/net/minecraft/src/buildcraft/devel/BlockCheat.java index 1c0886dc..99b5a945 100644 --- a/common/net/minecraft/src/buildcraft/devel/BlockCheat.java +++ b/common/net/minecraft/src/buildcraft/devel/BlockCheat.java @@ -32,119 +32,70 @@ public class BlockCheat extends BlockChest { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { IInventory inv = (IInventory) world.getBlockTileEntity(i, j, k); entityplayer.experienceLevel = 50; int ind = 0; - if (world.getBlockId(i + 1, j, k) == blockID - || world.getBlockId(i, j, k + 1) == blockID) { + if (world.getBlockId(i + 1, j, k) == blockID || world.getBlockId(i, j, k + 1) == blockID) { - inv.setInventorySlotContents(ind++, new ItemStack( - Item.pickaxeStone, 1)); - inv.setInventorySlotContents(ind++, new ItemStack(Item.axeDiamond, - 1)); + inv.setInventorySlotContents(ind++, new ItemStack(Item.pickaxeStone, 1)); + inv.setInventorySlotContents(ind++, new ItemStack(Item.axeDiamond, 1)); inv.setInventorySlotContents(ind++, new ItemStack(Item.coal, 64)); inv.setInventorySlotContents(ind++, new ItemStack(Block.planks, 64)); inv.setInventorySlotContents(ind++, new ItemStack(Block.glass, 64)); - inv.setInventorySlotContents(ind++, - new ItemStack(Item.redstone, 64)); - inv.setInventorySlotContents(ind++, new ItemStack(Item.ingotIron, - 64)); + inv.setInventorySlotContents(ind++, new ItemStack(Item.redstone, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(Item.ingotIron, 64)); inv.setInventorySlotContents(ind++, new ItemStack(Item.diamond, 64)); - inv.setInventorySlotContents(ind++, new ItemStack(Block.oreIron, - 64, 0)); + inv.setInventorySlotContents(ind++, new ItemStack(Block.oreIron, 64, 0)); inv.setInventorySlotContents(ind++, new ItemStack(Item.bed, 1)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsStone, 1)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.templateItem, 1)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.blueprintItem, 1)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.redPipeWire, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.bluePipeWire, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsGold, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.yellowPipeWire, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeLiquidsStone, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeLiquidsIron, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftFactory.tankBlock, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeGate, 64, 5)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeGate, 64, 6)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeGate, 64, 2)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeGate, 64, 3)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeGate, 64, 4)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeStructureCobblestone, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.markerBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsStone, 1)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.templateItem, 1)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.blueprintItem, 1)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.redPipeWire, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.bluePipeWire, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsGold, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.yellowPipeWire, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeLiquidsStone, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeLiquidsIron, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftFactory.tankBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeGate, 64, 5)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeGate, 64, 6)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeGate, 64, 2)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeGate, 64, 3)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeGate, 64, 4)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeStructureCobblestone, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.markerBlock, 64)); } else { - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.pathMarkerBlock, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftFactory.autoWorkbenchBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.pathMarkerBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftFactory.autoWorkbenchBlock, 64)); inv.setInventorySlotContents(ind++, new ItemStack(Item.seeds, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.architectBlock, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.builderBlock, 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)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftCore.wrenchItem, 1)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsWood, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsCobblestone, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsDiamond, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsObsidian, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipePowerWood, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.architectBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.builderBlock, 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)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftCore.wrenchItem, 1)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsWood, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsCobblestone, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsDiamond, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsObsidian, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipePowerWood, 64)); inv.setInventorySlotContents(ind++, new ItemStack(Block.chest, 64)); - inv.setInventorySlotContents(ind++, new ItemStack(Block.torchWood, - 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - Block.stairSingle, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsIron, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipePowerGold, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftBuilders.libraryBlock, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - Block.enchantmentTable, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftEnergy.bucketOil, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftFactory.tankBlock, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeLiquidsWood, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeLiquidsCobblestone, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeLiquidsGold, 64)); - inv.setInventorySlotContents(ind++, new ItemStack( - BuildCraftTransport.pipeItemsStipes, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(Block.torchWood, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(Block.stairSingle, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsIron, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipePowerGold, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftBuilders.libraryBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(Block.enchantmentTable, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftEnergy.bucketOil, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftFactory.tankBlock, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeLiquidsWood, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeLiquidsCobblestone, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeLiquidsGold, 64)); + inv.setInventorySlotContents(ind++, new ItemStack(BuildCraftTransport.pipeItemsStipes, 64)); } diff --git a/common/net/minecraft/src/buildcraft/energy/BlockEngine.java b/common/net/minecraft/src/buildcraft/energy/BlockEngine.java index 7c412a03..2de3b5af 100644 --- a/common/net/minecraft/src/buildcraft/energy/BlockEngine.java +++ b/common/net/minecraft/src/buildcraft/energy/BlockEngine.java @@ -67,8 +67,7 @@ public class BlockEngine extends BlockContainer { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { TileEngine tile = (TileEngine) world.getBlockTileEntity(i, j, k); // Drop through if the player is sneaking @@ -76,10 +75,8 @@ public class BlockEngine extends BlockContainer { return false; // Switch orientation if whacked with a wrench. - Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer - .getCurrentEquippedItem().getItem() : null; - if (equipped instanceof IToolWrench - && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { + Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; + if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { tile.switchOrientation(); ((IToolWrench) equipped).wrenchUsed(entityplayer, i, j, k); @@ -94,14 +91,12 @@ public class BlockEngine extends BlockContainer { if (tile.engine instanceof EngineStone) { if (!APIProxy.isClient(tile.worldObj)) - entityplayer.openGui(mod_BuildCraftEnergy.instance, - GuiIds.ENGINE_STONE, world, i, j, k); + entityplayer.openGui(mod_BuildCraftEnergy.instance, GuiIds.ENGINE_STONE, world, i, j, k); return true; } else if (tile.engine instanceof EngineIron) { if (!APIProxy.isClient(tile.worldObj)) - entityplayer.openGui(mod_BuildCraftEnergy.instance, - GuiIds.ENGINE_IRON, world, i, j, k); + entityplayer.openGui(mod_BuildCraftEnergy.instance, GuiIds.ENGINE_IRON, world, i, j, k); return true; } @@ -124,8 +119,7 @@ public class BlockEngine extends BlockContainer { @SuppressWarnings({ "all" }) // @Override (client only) - public void randomDisplayTick(World world, int i, int j, int k, - Random random) { + public void randomDisplayTick(World world, int i, int j, int k, Random random) { TileEngine tile = (TileEngine) world.getBlockTileEntity(i, j, k); if (!tile.isBurning()) { diff --git a/common/net/minecraft/src/buildcraft/energy/BlockOilFlowing.java b/common/net/minecraft/src/buildcraft/energy/BlockOilFlowing.java index 1b69265f..513be508 100644 --- a/common/net/minecraft/src/buildcraft/energy/BlockOilFlowing.java +++ b/common/net/minecraft/src/buildcraft/energy/BlockOilFlowing.java @@ -20,8 +20,7 @@ import net.minecraft.src.World; import net.minecraft.src.buildcraft.api.liquids.ILiquid; import net.minecraft.src.forge.ITextureProvider; -public class BlockOilFlowing extends BlockFluid implements ITextureProvider, - ILiquid { +public class BlockOilFlowing extends BlockFluid implements ITextureProvider, ILiquid { public BlockOilFlowing(int i, Material material) { super(i, material); @@ -121,19 +120,16 @@ public class BlockOilFlowing extends BlockFluid implements ITextureProvider, if (liquidCanDisplaceBlock(world, i, j, k)) { int i1 = world.getBlockId(i, j, k); if (i1 > 0) { - Block.blocksList[i1].dropBlockAsItem(world, i, j, k, - world.getBlockMetadata(i, j, k), 0); + Block.blocksList[i1].dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0); } world.setBlockAndMetadataWithNotify(i, j, k, blockID, l); } } - private int calculateFlowCost(World world, int i, int j, int k, int l, - int i1) { + private int calculateFlowCost(World world, int i, int j, int k, int l, int i1) { int j1 = 1000; for (int k1 = 0; k1 < 4; k1++) { - if (k1 == 0 && i1 == 1 || k1 == 1 && i1 == 0 || k1 == 2 && i1 == 3 - || k1 == 3 && i1 == 2) { + if (k1 == 0 && i1 == 1 || k1 == 1 && i1 == 0 || k1 == 2 && i1 == 3 || k1 == 3 && i1 == 2) { continue; } int l1 = i; @@ -151,8 +147,7 @@ public class BlockOilFlowing extends BlockFluid implements ITextureProvider, if (k1 == 3) { j2++; } - if (blockBlocksFlow(world, l1, i2, j2) - || world.getBlockMaterial(l1, i2, j2) == blockMaterial + if (blockBlocksFlow(world, l1, i2, j2) || world.getBlockMaterial(l1, i2, j2) == blockMaterial && world.getBlockMetadata(l1, i2, j2) == 0) { continue; } @@ -189,8 +184,7 @@ public class BlockOilFlowing extends BlockFluid implements ITextureProvider, if (l == 3) { j2++; } - if (blockBlocksFlow(world, j1, i2, j2) - || world.getBlockMaterial(j1, i2, j2) == blockMaterial + if (blockBlocksFlow(world, j1, i2, j2) || world.getBlockMaterial(j1, i2, j2) == blockMaterial && world.getBlockMetadata(j1, i2, j2) == 0) { continue; } @@ -217,9 +211,8 @@ public class BlockOilFlowing extends BlockFluid implements ITextureProvider, private boolean blockBlocksFlow(World world, int i, int j, int k) { int l = world.getBlockId(i, j, k); - if (l == Block.doorWood.blockID || l == Block.doorSteel.blockID - || l == Block.signPost.blockID || l == Block.ladder.blockID - || l == Block.reed.blockID) { + if (l == Block.doorWood.blockID || l == Block.doorSteel.blockID || l == Block.signPost.blockID + || l == Block.ladder.blockID || l == Block.reed.blockID) { return true; } if (l == 0) { diff --git a/common/net/minecraft/src/buildcraft/energy/BlockOilStill.java b/common/net/minecraft/src/buildcraft/energy/BlockOilStill.java index 17bf2843..4d94d106 100644 --- a/common/net/minecraft/src/buildcraft/energy/BlockOilStill.java +++ b/common/net/minecraft/src/buildcraft/energy/BlockOilStill.java @@ -17,8 +17,7 @@ import net.minecraft.src.World; import net.minecraft.src.buildcraft.api.liquids.ILiquid; import net.minecraft.src.forge.ITextureProvider; -public class BlockOilStill extends BlockStationary implements ITextureProvider, - ILiquid { +public class BlockOilStill extends BlockStationary implements ITextureProvider, ILiquid { public BlockOilStill(int i, Material material) { super(i, material); diff --git a/common/net/minecraft/src/buildcraft/energy/BlockPollution.java b/common/net/minecraft/src/buildcraft/energy/BlockPollution.java index 301d74e2..77960ca9 100644 --- a/common/net/minecraft/src/buildcraft/energy/BlockPollution.java +++ b/common/net/minecraft/src/buildcraft/energy/BlockPollution.java @@ -44,8 +44,7 @@ public class BlockPollution extends BlockContainer implements ITextureProvider { } @SuppressWarnings({ "all" }) - public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, - int l) { + public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { return 5 * 16 + iblockaccess.getBlockMetadata(i, j, k); } } diff --git a/common/net/minecraft/src/buildcraft/energy/BptBlockEngine.java b/common/net/minecraft/src/buildcraft/energy/BptBlockEngine.java index 1d57a148..8f0ca11d 100644 --- a/common/net/minecraft/src/buildcraft/energy/BptBlockEngine.java +++ b/common/net/minecraft/src/buildcraft/energy/BptBlockEngine.java @@ -33,22 +33,17 @@ public class BptBlockEngine extends BptBlock { } @Override - public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, - int x, int y, int z) { - TileEngine engine = (TileEngine) context.world().getBlockTileEntity(x, - y, z); + public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, int x, int y, int z) { + TileEngine engine = (TileEngine) context.world().getBlockTileEntity(x, y, z); - bptSlot.cpt.setInteger("orientation", - engine.engine.orientation.ordinal()); + bptSlot.cpt.setInteger("orientation", engine.engine.orientation.ordinal()); } @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); - TileEngine engine = (TileEngine) context.world().getBlockTileEntity( - slot.x, slot.y, slot.z); + TileEngine engine = (TileEngine) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); engine.orientation = slot.cpt.getInteger("orientation"); } diff --git a/common/net/minecraft/src/buildcraft/energy/ContainerEngineRoot.java b/common/net/minecraft/src/buildcraft/energy/ContainerEngineRoot.java index 9671c3c1..a69dbab1 100644 --- a/common/net/minecraft/src/buildcraft/energy/ContainerEngineRoot.java +++ b/common/net/minecraft/src/buildcraft/energy/ContainerEngineRoot.java @@ -16,8 +16,7 @@ import net.minecraft.src.buildcraft.core.BuildCraftContainer; public class ContainerEngineRoot extends BuildCraftContainer { - public ContainerEngineRoot(InventoryPlayer inventoryplayer, - TileEngine tileEngine) { + public ContainerEngineRoot(InventoryPlayer inventoryplayer, TileEngine tileEngine) { super(tileEngine); engine = tileEngine; @@ -30,8 +29,7 @@ public class ContainerEngineRoot extends BuildCraftContainer { for (int i = 0; i < 3; i++) { for (int k = 0; k < 9; k++) { - addSlot(new Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, - 84 + i * 18)); + addSlot(new Slot(inventoryplayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18)); } } diff --git a/common/net/minecraft/src/buildcraft/energy/Engine.java b/common/net/minecraft/src/buildcraft/energy/Engine.java index ca488839..46ab83fd 100644 --- a/common/net/minecraft/src/buildcraft/energy/Engine.java +++ b/common/net/minecraft/src/buildcraft/energy/Engine.java @@ -87,8 +87,7 @@ public abstract class Engine { energy += addition; if (getEnergyStage() == EnergyStage.Explosion) { - tile.worldObj.createExplosion(null, tile.xCoord, tile.yCoord, - tile.zCoord, explosionRange()); + tile.worldObj.createExplosion(null, tile.xCoord, tile.yCoord, tile.zCoord, explosionRange()); } if (energy > maxEnergy) { @@ -142,8 +141,7 @@ public abstract class Engine { } - public void sendGUINetworkData(ContainerEngine containerEngine, - ICrafting iCrafting) { + public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) { } diff --git a/common/net/minecraft/src/buildcraft/energy/EngineIron.java b/common/net/minecraft/src/buildcraft/energy/EngineIron.java index 3b4b1279..5c272ac9 100644 --- a/common/net/minecraft/src/buildcraft/energy/EngineIron.java +++ b/common/net/minecraft/src/buildcraft/energy/EngineIron.java @@ -99,8 +99,7 @@ public class EngineIron extends Engine { burnTime--; } else { liquidQty--; - burnTime = currentFuel.totalBurningTime - / BuildCraftAPI.BUCKET_VOLUME; + burnTime = currentFuel.totalBurningTime / BuildCraftAPI.BUCKET_VOLUME; } currentOutput = currentFuel.powerPerCycle; @@ -123,17 +122,13 @@ public class EngineIron extends Engine { ItemStack itemInInventory = tile.getStackInSlot(0); if (itemInInventory != null) { - int liquidId = BuildCraftAPI - .getLiquidForFilledItem(itemInInventory); + int liquidId = BuildCraftAPI.getLiquidForFilledItem(itemInInventory); if (liquidId != 0) { - if (fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, - liquidId, false) == BuildCraftAPI.BUCKET_VOLUME) { - fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, - liquidId, true); + if (fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, liquidId, false) == BuildCraftAPI.BUCKET_VOLUME) { + fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, liquidId, true); - tile.setInventorySlotContents(0, - Utils.consumeItem(itemInInventory)); + tile.setInventorySlotContents(0, Utils.consumeItem(itemInInventory)); } } } @@ -214,8 +209,7 @@ public class EngineIron extends Engine { return res; } - private int fillCoolant(Orientations from, int quantity, int id, - boolean doFill) { + private int fillCoolant(Orientations from, int quantity, int id, boolean doFill) { int res = 0; if (coolantQty > 0 && coolantId != id) { @@ -300,11 +294,9 @@ public class EngineIron extends Engine { } @Override - public void sendGUINetworkData(ContainerEngine containerEngine, - ICrafting iCrafting) { + public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) { iCrafting.updateCraftingInventoryInfo(containerEngine, 0, energy); - iCrafting - .updateCraftingInventoryInfo(containerEngine, 1, currentOutput); + iCrafting.updateCraftingInventoryInfo(containerEngine, 1, currentOutput); iCrafting.updateCraftingInventoryInfo(containerEngine, 2, heat); iCrafting.updateCraftingInventoryInfo(containerEngine, 3, liquidQty); iCrafting.updateCraftingInventoryInfo(containerEngine, 4, liquidId); @@ -314,8 +306,7 @@ public class EngineIron extends Engine { @Override public LiquidSlot[] getLiquidSlots() { - return new LiquidSlot[] { - new LiquidSlot(liquidId, liquidQty, MAX_LIQUID), + return new LiquidSlot[] { new LiquidSlot(liquidId, liquidQty, MAX_LIQUID), new LiquidSlot(coolantId, coolantQty, MAX_LIQUID) }; } diff --git a/common/net/minecraft/src/buildcraft/energy/EngineStone.java b/common/net/minecraft/src/buildcraft/energy/EngineStone.java index a306ccaf..21a5a124 100644 --- a/common/net/minecraft/src/buildcraft/energy/EngineStone.java +++ b/common/net/minecraft/src/buildcraft/energy/EngineStone.java @@ -80,8 +80,7 @@ public class EngineStone extends Engine { burnTime = totalBurnTime = getItemBurnTime(tile.getStackInSlot(0)); if (burnTime > 0) { - tile.setInventorySlotContents(0, - Utils.consumeItem(tile.getStackInSlot(0))); + tile.setInventorySlotContents(0, Utils.consumeItem(tile.getStackInSlot(0))); } } } @@ -96,8 +95,7 @@ public class EngineStone extends Engine { return 0; } int i = itemstack.getItem().shiftedIndex; - if (i < Block.blocksList.length && Block.blocksList[i] != null - && Block.blocksList[i].blockMaterial == Material.wood) { + if (i < Block.blocksList.length && Block.blocksList[i] != null && Block.blocksList[i].blockMaterial == Material.wood) { return 300; } if (i == Item.stick.shiftedIndex) { @@ -109,8 +107,7 @@ public class EngineStone extends Engine { if (i == Item.bucketLava.shiftedIndex) { return 20000; } else { - return i == Block.sapling.blockID ? 100 : CoreProxy.addFuel(i, - itemstack.getItemDamage()); + return i == Block.sapling.blockID ? 100 : CoreProxy.addFuel(i, itemstack.getItemDamage()); } } @@ -130,8 +127,7 @@ public class EngineStone extends Engine { public void delete() { ItemStack stack = tile.getStackInSlot(0); if (stack != null) - Utils.dropItems(tile.worldObj, stack, tile.xCoord, tile.yCoord, - tile.zCoord); + Utils.dropItems(tile.worldObj, stack, tile.xCoord, tile.yCoord, tile.zCoord); } @Override @@ -153,14 +149,11 @@ public class EngineStone extends Engine { } @Override - public void sendGUINetworkData(ContainerEngine containerEngine, - ICrafting iCrafting) { + public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) { iCrafting.updateCraftingInventoryInfo(containerEngine, 0, energy); - iCrafting - .updateCraftingInventoryInfo(containerEngine, 1, currentOutput); + iCrafting.updateCraftingInventoryInfo(containerEngine, 1, currentOutput); iCrafting.updateCraftingInventoryInfo(containerEngine, 2, burnTime); - iCrafting - .updateCraftingInventoryInfo(containerEngine, 3, totalBurnTime); + iCrafting.updateCraftingInventoryInfo(containerEngine, 3, totalBurnTime); } @Override diff --git a/common/net/minecraft/src/buildcraft/energy/IEngineProvider.java b/common/net/minecraft/src/buildcraft/energy/IEngineProvider.java index 986a2b62..1d7faf7b 100644 --- a/common/net/minecraft/src/buildcraft/energy/IEngineProvider.java +++ b/common/net/minecraft/src/buildcraft/energy/IEngineProvider.java @@ -10,5 +10,6 @@ package net.minecraft.src.buildcraft.energy; public interface IEngineProvider { + public Engine getEngine(); } diff --git a/common/net/minecraft/src/buildcraft/energy/OilBucketHandler.java b/common/net/minecraft/src/buildcraft/energy/OilBucketHandler.java index bf5f54fa..90e4f40c 100644 --- a/common/net/minecraft/src/buildcraft/energy/OilBucketHandler.java +++ b/common/net/minecraft/src/buildcraft/energy/OilBucketHandler.java @@ -18,8 +18,7 @@ public class OilBucketHandler implements IBucketHandler { @Override public ItemStack fillCustomBucket(World w, int i, int j, int k) { - if ((w.getBlockId(i, j, k) == BuildCraftEnergy.oilStill.blockID || w - .getBlockId(i, j, k) == BuildCraftEnergy.oilMoving.blockID) + if ((w.getBlockId(i, j, k) == BuildCraftEnergy.oilStill.blockID || w.getBlockId(i, j, k) == BuildCraftEnergy.oilMoving.blockID) && w.getBlockMetadata(i, j, k) == 0) { w.setBlockWithNotify(i, j, k, 0); diff --git a/common/net/minecraft/src/buildcraft/energy/OilPopulate.java b/common/net/minecraft/src/buildcraft/energy/OilPopulate.java index b9a61647..fdc6ea64 100644 --- a/common/net/minecraft/src/buildcraft/energy/OilPopulate.java +++ b/common/net/minecraft/src/buildcraft/energy/OilPopulate.java @@ -31,8 +31,7 @@ public class OilPopulate { rand = APIProxy.createNewRandom(world); } - BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt( - x, z); + BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(x, z); // Do not generate oil in the End if (biomegenbase.biomeID == BiomeGenBase.sky.biomeID) @@ -86,8 +85,7 @@ public class OilPopulate { int d2 = bx * bx + by * by + bz * bz; if (d2 <= r2) { - world.setBlockWithNotify(bx + cx, by + cy, bz + cz, - BuildCraftEnergy.oilStill.blockID); + world.setBlockWithNotify(bx + cx, by + cy, bz + cz, BuildCraftEnergy.oilStill.blockID); } } } @@ -96,19 +94,16 @@ public class OilPopulate { boolean started = false; for (int y = 128; y >= cy; --y) { - if (!started && world.getBlockId(cx, y, cz) != 0 - && world.getBlockId(cx, y, cz) != Block.leaves.blockID + if (!started && world.getBlockId(cx, y, cz) != 0 && world.getBlockId(cx, y, cz) != Block.leaves.blockID && world.getBlockId(cx, y, cz) != Block.wood.blockID && world.getBlockId(cx, y, cz) != Block.grass.blockID) { started = true; if (largeDeposit) { - generateSurfaceDeposit(world, cx, y, cz, - 20 + rand.nextInt(20)); + generateSurfaceDeposit(world, cx, y, cz, 20 + rand.nextInt(20)); } else if (mediumDeposit) { - generateSurfaceDeposit(world, cx, y, cz, - 5 + rand.nextInt(5)); + generateSurfaceDeposit(world, cx, y, cz, 5 + rand.nextInt(5)); } int ymax = 0; @@ -120,21 +115,18 @@ public class OilPopulate { } for (int h = y + 1; h <= ymax; ++h) { - world.setBlockWithNotify(cx, h, cz, - BuildCraftEnergy.oilStill.blockID); + world.setBlockWithNotify(cx, h, cz, BuildCraftEnergy.oilStill.blockID); } } else if (started) { - world.setBlockWithNotify(cx, y, cz, - BuildCraftEnergy.oilStill.blockID); + world.setBlockWithNotify(cx, y, cz, BuildCraftEnergy.oilStill.blockID); } } } } - public static void generateSurfaceDeposit(World world, int x, int y, int z, - int radius) { + public static void generateSurfaceDeposit(World world, int x, int y, int z, int radius) { setOilWithProba(world, 1, x, y, z, true); for (int w = 1; w <= radius; ++w) { @@ -152,9 +144,7 @@ public class OilPopulate { for (int dz = z - radius; dz <= z + radius; ++dz) { if (world.getBlockId(dx, y - 1, dz) != BuildCraftEnergy.oilStill.blockID) { - if (isOil(world, dx + 1, y - 1, dz) - && isOil(world, dx - 1, y - 1, dz) - && isOil(world, dx, y - 1, dz + 1) + if (isOil(world, dx + 1, y - 1, dz) && isOil(world, dx - 1, y - 1, dz) && isOil(world, dx, y - 1, dz + 1) && isOil(world, dx, y - 1, dz - 1)) { setOilWithProba(world, 1.0F, dx, y, dz, true); } @@ -164,20 +154,15 @@ public class OilPopulate { } private static boolean isOil(World world, int x, int y, int z) { - return (world.getBlockId(x, y, z) == BuildCraftEnergy.oilStill.blockID || world - .getBlockId(x, y, z) == BuildCraftEnergy.oilMoving.blockID); + return (world.getBlockId(x, y, z) == BuildCraftEnergy.oilStill.blockID || world.getBlockId(x, y, z) == BuildCraftEnergy.oilMoving.blockID); } - public static void setOilWithProba(World world, float proba, int x, int y, - int z, boolean force) { - if ((rand.nextFloat() <= proba && world.getBlockId(x, y - 2, z) != 0) - || force) { + public static void setOilWithProba(World world, float proba, int x, int y, int z, boolean force) { + if ((rand.nextFloat() <= proba && world.getBlockId(x, y - 2, z) != 0) || force) { boolean adjacentOil = false; for (int d = -1; d <= 1; ++d) { - if (isOil(world, x + d, y - 1, z) - || isOil(world, x - d, y - 1, z) - || isOil(world, x, y - 1, z + d) + if (isOil(world, x + d, y - 1, z) || isOil(world, x - d, y - 1, z) || isOil(world, x, y - 1, z + d) || isOil(world, x, y - 1, z - d)) { adjacentOil = true; } @@ -185,17 +170,14 @@ public class OilPopulate { if (adjacentOil || force) { if (world.getBlockId(x, y, z) == Block.waterMoving.blockID - || world.getBlockId(x, y, z) == Block.waterStill.blockID - || isOil(world, x, y, z)) { + || world.getBlockId(x, y, z) == Block.waterStill.blockID || isOil(world, x, y, z)) { - world.setBlockWithNotify(x, y, z, - BuildCraftEnergy.oilStill.blockID); + world.setBlockWithNotify(x, y, z, BuildCraftEnergy.oilStill.blockID); } else { world.setBlockWithNotify(x, y, z, 0); } - world.setBlockWithNotify(x, y - 1, z, - BuildCraftEnergy.oilStill.blockID); + world.setBlockWithNotify(x, y - 1, z, BuildCraftEnergy.oilStill.blockID); } } } diff --git a/common/net/minecraft/src/buildcraft/energy/PneumaticPowerProvider.java b/common/net/minecraft/src/buildcraft/energy/PneumaticPowerProvider.java index 0e8753ae..bab8fead 100644 --- a/common/net/minecraft/src/buildcraft/energy/PneumaticPowerProvider.java +++ b/common/net/minecraft/src/buildcraft/energy/PneumaticPowerProvider.java @@ -14,10 +14,8 @@ import net.minecraft.src.buildcraft.api.PowerProvider; public class PneumaticPowerProvider extends PowerProvider { @Override - public void configure(int latency, int minEnergyReceived, - int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { - super.configure(latency, minEnergyReceived, maxEnergyReceived, - minActivationEnergy, maxStoredEnergy); + public void configure(int latency, int minEnergyReceived, int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { + super.configure(latency, minEnergyReceived, maxEnergyReceived, minActivationEnergy, maxStoredEnergy); this.latency = 0; } diff --git a/common/net/minecraft/src/buildcraft/energy/TileEngine.java b/common/net/minecraft/src/buildcraft/energy/TileEngine.java index fce47a57..b2298376 100644 --- a/common/net/minecraft/src/buildcraft/energy/TileEngine.java +++ b/common/net/minecraft/src/buildcraft/energy/TileEngine.java @@ -37,8 +37,7 @@ import net.minecraft.src.buildcraft.core.network.PacketUpdate; //TODO: All Engines need to take func_48081_b into account -public class TileEngine extends TileBuildCraft implements IPowerReceptor, - IInventory, ILiquidContainer, IEngineProvider, +public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInventory, ILiquidContainer, IEngineProvider, IOverrideDefaultTriggers, IPipeConnection, IBuilderInventory { public @TileNetworkData @@ -70,8 +69,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, } engine.orientation = Orientations.values()[orientation]; - provider.configure(0, 1, engine.maxEnergyReceived(), 1, - engine.maxEnergy); + provider.configure(0, 1, engine.maxEnergyReceived(), 1, engine.maxEnergy); checkRedstonePower(); } } @@ -104,24 +102,18 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, if (engine.progress > 0.5 && progressPart == 1) { progressPart = 2; - Position pos = new Position(xCoord, yCoord, zCoord, - engine.orientation); + Position pos = new Position(xCoord, yCoord, zCoord, engine.orientation); pos.moveForwards(1.0); - TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); if (isPoweredTile(tile)) { IPowerReceptor receptor = (IPowerReceptor) tile; - int extracted = engine - .extractEnergy( - receptor.getPowerProvider().minEnergyReceived, - receptor.getPowerProvider().maxEnergyReceived, - true); + int extracted = engine.extractEnergy(receptor.getPowerProvider().minEnergyReceived, + receptor.getPowerProvider().maxEnergyReceived, true); if (extracted > 0) { - receptor.getPowerProvider().receiveEnergy(extracted, - engine.orientation.reverse()); + receptor.getPowerProvider().receiveEnergy(extracted, engine.orientation.reverse()); } } } else if (engine.progress >= 1) { @@ -129,17 +121,14 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, progressPart = 0; } } else if (isRedstonePowered && engine.isActive()) { - Position pos = new Position(xCoord, yCoord, zCoord, - engine.orientation); + Position pos = new Position(xCoord, yCoord, zCoord, engine.orientation); pos.moveForwards(1.0); - TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); if (isPoweredTile(tile)) { IPowerReceptor receptor = (IPowerReceptor) tile; - if (engine.extractEnergy( - receptor.getPowerProvider().minEnergyReceived, + if (engine.extractEnergy(receptor.getPowerProvider().minEnergyReceived, receptor.getPowerProvider().maxEnergyReceived, false) > 0) { progressPart = 1; @@ -169,8 +158,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, engine = newEngine(kind); engine.orientation = Orientations.values()[orientation]; - worldObj.notifyBlockChange(xCoord, yCoord, zCoord, - BuildCraftEnergy.engineBlock.blockID); + worldObj.notifyBlockChange(xCoord, yCoord, zCoord, BuildCraftEnergy.engineBlock.blockID); } } @@ -182,8 +170,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, pos.moveForwards(1); - TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); if (isPoweredTile(tile)) { if (engine != null) { @@ -232,8 +219,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, } if (nbttagcompound.hasKey("itemInInventory")) { - NBTTagCompound cpt = nbttagcompound - .getCompoundTag("itemInInventory"); + NBTTagCompound cpt = nbttagcompound.getCompoundTag("itemInInventory"); itemInInventory = ItemStack.loadItemStackFromNBT(cpt); } @@ -246,8 +232,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); - nbttagcompound.setInteger("kind", - worldObj.getBlockMetadata(xCoord, yCoord, zCoord)); + nbttagcompound.setInteger("kind", worldObj.getBlockMetadata(xCoord, yCoord, zCoord)); if (engine != null) { nbttagcompound.setInteger("orientation", orientation); @@ -382,8 +367,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, return; } - engine.addEnergy((int) (provider.useEnergy(1, - engine.maxEnergyReceived(), true) * 0.95F)); + engine.addEnergy((int) (provider.useEnergy(1, engine.maxEnergyReceived(), true) * 0.95F)); } public boolean isPoweredTile(TileEntity tile) { @@ -391,8 +375,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IPowerReceptor receptor = (IPowerReceptor) tile; PowerProvider provider = receptor.getPowerProvider(); - return provider != null - && provider.getClass().equals(PneumaticPowerProvider.class); + return provider != null && provider.getClass().equals(PneumaticPowerProvider.class); } return false; @@ -490,7 +473,6 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, } public void checkRedstonePower() { - isRedstonePowered = worldObj.isBlockIndirectlyGettingPowered(xCoord, - yCoord, zCoord); + isRedstonePowered = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); } } diff --git a/common/net/minecraft/src/buildcraft/factory/BlockAutoWorkbench.java b/common/net/minecraft/src/buildcraft/factory/BlockAutoWorkbench.java index 8eda718a..e080a2c3 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockAutoWorkbench.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockAutoWorkbench.java @@ -26,7 +26,7 @@ import net.minecraft.src.buildcraft.core.IItemPipe; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.forge.ITextureProvider; -public class BlockAutoWorkbench extends BlockBuildCraft { +public class BlockAutoWorkbench extends BlockContainer implements ITextureProvider { int topTexture; int sideTexture; @@ -48,8 +48,7 @@ public class BlockAutoWorkbench extends BlockBuildCraft { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { super.blockActivated(world, i, j, k, entityplayer); // Drop through if the player is sneaking @@ -63,8 +62,7 @@ public class BlockAutoWorkbench extends BlockBuildCraft { } if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftFactory.instance, - GuiIds.AUTO_CRAFTING_TABLE, world, i, j, k); + entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.AUTO_CRAFTING_TABLE, world, i, j, k); return true; } diff --git a/common/net/minecraft/src/buildcraft/factory/BlockFrame.java b/common/net/minecraft/src/buildcraft/factory/BlockFrame.java index 3a02ffc8..1a16ff95 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockFrame.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockFrame.java @@ -29,8 +29,7 @@ import net.minecraft.src.buildcraft.api.Position; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.forge.ITextureProvider; -public class BlockFrame extends Block implements ILegacyPipeConnection, - IBlockPipe, ITextureProvider { +public class BlockFrame extends Block implements ILegacyPipeConnection, IBlockPipe, ITextureProvider { public BlockFrame(int i) { super(i, Material.glass); @@ -48,14 +47,11 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, if (world.isRemote) return; - if (!world.checkChunksExist(i - width2, j - width2, k - width2, i - + width2, j + width2, k + width2)) + if (!world.checkChunksExist(i - width2, j - width2, k - width2, i + width2, j + width2, k + width2)) return; - Position[] targets = new Position[] { new Position(i + 1, j, k), - new Position(i - 1, j, k), new Position(i, j + 1, k), - new Position(i, j - 1, k), new Position(i, j, k + 1), - new Position(i, j, k - 1) }; + Position[] targets = new Position[] { new Position(i + 1, j, k), new Position(i - 1, j, k), new Position(i, j + 1, k), + new Position(i, j - 1, k), new Position(i, j, k + 1), new Position(i, j, k - 1) }; for (Position pos : targets) { int x = (int) pos.x; @@ -87,23 +83,19 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, int[] adjacentFrameBlocks = new int[yFactor * yFactor * yFactor]; - if (world.checkChunksExist(i - width2, j - width2, k - width2, i - + width2, j + width2, k + width2)) { + if (world.checkChunksExist(i - width2, j - width2, k - width2, i + width2, j + width2, k + width2)) { for (int z = -width; z <= width; ++z) { for (int y = -width; y <= width; ++y) { for (int x = -width; x <= width; ++x) { int blockID = world.getBlockId(i + z, j + y, k + x); if (blockID == BuildCraftFactory.quarryBlock.blockID) - adjacentFrameBlocks[(z + xFactor) * zFactor - + (y + xFactor) * yFactor + x + xFactor] = 0; + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + x + xFactor] = 0; else if (blockID == BuildCraftFactory.frameBlock.blockID) - adjacentFrameBlocks[(z + xFactor) * zFactor - + (y + xFactor) * yFactor + x + xFactor] = -2; + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + x + xFactor] = -2; else - adjacentFrameBlocks[(z + xFactor) * zFactor - + (y + xFactor) * yFactor + x + xFactor] = -1; + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + x + xFactor] = -1; } } } @@ -112,49 +104,24 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, for (int z = -width; z <= width; ++z) { for (int y = -width; y <= width; ++y) { for (int x = -width; x <= width; ++x) { - if (adjacentFrameBlocks[(z + xFactor) * zFactor - + (y + xFactor) * yFactor + x + xFactor] == type - 1) { - if (adjacentFrameBlocks[(z + xFactor - 1) - * zFactor + (y + xFactor) * yFactor - + x + xFactor] == -2) - adjacentFrameBlocks[(z + xFactor - 1) - * zFactor + (y + xFactor) - * yFactor + x + xFactor] = type; + if (adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + x + xFactor] == type - 1) { + if (adjacentFrameBlocks[(z + xFactor - 1) * zFactor + (y + xFactor) * yFactor + x + xFactor] == -2) + adjacentFrameBlocks[(z + xFactor - 1) * zFactor + (y + xFactor) * yFactor + x + xFactor] = type; - if (adjacentFrameBlocks[(z + xFactor + 1) - * zFactor + (y + xFactor) * yFactor - + x + xFactor] == -2) - adjacentFrameBlocks[(z + xFactor + 1) - * zFactor + (y + xFactor) - * yFactor + x + xFactor] = type; + if (adjacentFrameBlocks[(z + xFactor + 1) * zFactor + (y + xFactor) * yFactor + x + xFactor] == -2) + adjacentFrameBlocks[(z + xFactor + 1) * zFactor + (y + xFactor) * yFactor + x + xFactor] = type; - if (adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor - 1) - * yFactor + x + xFactor] == -2) - adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor - 1) - * yFactor + x + xFactor] = type; + if (adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor - 1) * yFactor + x + xFactor] == -2) + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor - 1) * yFactor + x + xFactor] = type; - if (adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor + 1) - * yFactor + x + xFactor] == -2) - adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor + 1) - * yFactor + x + xFactor] = type; + if (adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor + 1) * yFactor + x + xFactor] == -2) + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor + 1) * yFactor + x + xFactor] = type; - if (adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor) * yFactor - + (x + xFactor - 1)] == -2) - adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor) - * yFactor + (x + xFactor - 1)] = type; + if (adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + (x + xFactor - 1)] == -2) + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + (x + xFactor - 1)] = type; - if (adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor) * yFactor - + x + xFactor + 1] == -2) - adjacentFrameBlocks[(z + xFactor) - * zFactor + (y + xFactor) - * yFactor + x + xFactor + 1] = type; + if (adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + x + xFactor + 1] == -2) + adjacentFrameBlocks[(z + xFactor) * zFactor + (y + xFactor) * yFactor + x + xFactor + 1] = type; } } } @@ -162,8 +129,7 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, } } - int var12 = adjacentFrameBlocks[xFactor * zFactor + xFactor - * yFactor + xFactor]; + int var12 = adjacentFrameBlocks[xFactor * zFactor + xFactor * yFactor + xFactor]; if (var12 >= 0) world.setBlockMetadata(i, j, k, meta & -9); @@ -193,8 +159,7 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, - int j, int k) { + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { float xMin = Utils.pipeMinPos, xMax = Utils.pipeMaxPos, yMin = Utils.pipeMinPos, yMax = Utils.pipeMaxPos, zMin = Utils.pipeMinPos, zMax = Utils.pipeMaxPos; if (Utils.checkLegacyPipesConnections(world, i, j, k, i - 1, j, k)) { @@ -221,75 +186,57 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, zMax = 1.0F; } - return AxisAlignedBB.getBoundingBoxFromPool((double) i + xMin, - (double) j + yMin, (double) k + zMin, (double) i + xMax, + return AxisAlignedBB.getBoundingBoxFromPool((double) i + xMin, (double) j + yMin, (double) k + zMin, (double) i + xMax, (double) j + yMax, (double) k + zMax); } @SuppressWarnings({ "all" }) // @Override (client only) - public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, - int j, int k) { + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) { return getCollisionBoundingBoxFromPool(world, i, j, k); } @SuppressWarnings("rawtypes") @Override - public void getCollidingBoundingBoxes(World world, int i, int j, int k, - AxisAlignedBB axisalignedbb, ArrayList arraylist) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + public void getCollidingBoundingBoxes(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) { + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); if (Utils.checkLegacyPipesConnections(world, i, j, k, i - 1, j, k)) { - setBlockBounds(0.0F, Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(0.0F, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkLegacyPipesConnections(world, i, j, k, i + 1, j, k)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMinPos, 1.0F, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, 1.0F, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j - 1, k)) { - setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j + 1, k)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j, k - 1)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, 0.0F, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, 0.0F, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j, k + 1)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, 1.0F); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, 1.0F); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } @Override - public MovingObjectPosition collisionRayTrace(World world, int i, int j, - int k, Vec3D vec3d, Vec3D vec3d1) { + public MovingObjectPosition collisionRayTrace(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) { float xMin = Utils.pipeMinPos, xMax = Utils.pipeMaxPos, yMin = Utils.pipeMinPos, yMax = Utils.pipeMaxPos, zMin = Utils.pipeMinPos, zMax = Utils.pipeMaxPos; if (Utils.checkLegacyPipesConnections(world, i, j, k, i - 1, j, k)) { @@ -318,8 +265,7 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax); - MovingObjectPosition r = super.collisionRayTrace(world, i, j, k, vec3d, - vec3d1); + MovingObjectPosition r = super.collisionRayTrace(world, i, j, k, vec3d, vec3d1); setBlockBounds(0, 0, 0, 1, 1, 1); @@ -327,8 +273,7 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, } @Override - public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, - int z1, int x2, int y2, int z2) { + public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2) { return blockAccess.getBlockId(x2, y2, z2) == blockID; } @@ -338,8 +283,7 @@ public class BlockFrame extends Block implements ILegacyPipeConnection, } @Override - public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, - int k, Orientations connection) { + public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, int k, Orientations connection) { // TODO Auto-generated method stub } diff --git a/common/net/minecraft/src/buildcraft/factory/BlockHopper.java b/common/net/minecraft/src/buildcraft/factory/BlockHopper.java index f7faefce..56c3efde 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockHopper.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockHopper.java @@ -47,8 +47,7 @@ public class BlockHopper extends BlockBuildCraft { } @Override - public boolean blockActivated(World world, int x, int y, int z, - EntityPlayer entityPlayer) { + public boolean blockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer) { super.blockActivated(world, x, y, z, entityPlayer); // Drop through if the player is sneaking @@ -62,8 +61,7 @@ public class BlockHopper extends BlockBuildCraft { } if (!APIProxy.isClient(world)) - entityPlayer.openGui(mod_BuildCraftFactory.instance, GuiIds.HOPPER, - world, x, y, z); + entityPlayer.openGui(mod_BuildCraftFactory.instance, GuiIds.HOPPER, world, x, y, z); return true; } diff --git a/common/net/minecraft/src/buildcraft/factory/BlockMiningWell.java b/common/net/minecraft/src/buildcraft/factory/BlockMiningWell.java index 826c961a..2ce3f735 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockMiningWell.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockMiningWell.java @@ -22,8 +22,7 @@ import net.minecraft.src.buildcraft.api.Position; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.forge.ITextureProvider; -public class BlockMiningWell extends BlockMachineRoot implements - ITextureProvider { +public class BlockMiningWell extends BlockMachineRoot implements ITextureProvider { int textureFront, textureSides, textureBack, textureTop; @@ -53,8 +52,7 @@ public class BlockMiningWell extends BlockMachineRoot implements return textureBack; } else if (i == j) { return textureFront; - } else if (j >= 0 && j < 6 - && Orientations.values()[j].reverse().ordinal() == i) { + } else if (j >= 0 && j < 6 && Orientations.values()[j].reverse().ordinal() == i) { return textureBack; } else { return textureSides; @@ -62,14 +60,11 @@ public class BlockMiningWell extends BlockMachineRoot implements } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, - EntityLiving entityliving) { - Orientations orientation = Utils.get2dOrientation(new Position( - entityliving.posX, entityliving.posY, entityliving.posZ), + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { + Orientations orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); - world.setBlockMetadataWithNotify(i, j, k, orientation.reverse() - .ordinal()); + world.setBlockMetadataWithNotify(i, j, k, orientation.reverse().ordinal()); } @Override diff --git a/common/net/minecraft/src/buildcraft/factory/BlockPlainPipe.java b/common/net/minecraft/src/buildcraft/factory/BlockPlainPipe.java index 1470d159..583c40e3 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockPlainPipe.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockPlainPipe.java @@ -23,8 +23,7 @@ import net.minecraft.src.buildcraft.api.Orientations; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.forge.ITextureProvider; -public class BlockPlainPipe extends Block implements ILegacyPipeConnection, - IBlockPipe, ITextureProvider { +public class BlockPlainPipe extends Block implements ILegacyPipeConnection, IBlockPipe, ITextureProvider { public BlockPlainPipe(int i) { super(i, Material.glass); @@ -59,8 +58,7 @@ public class BlockPlainPipe extends Block implements ILegacyPipeConnection, } @Override - public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, - int z1, int x2, int y2, int z2) { + public boolean isPipeConnected(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2) { return false; } @@ -75,8 +73,7 @@ public class BlockPlainPipe extends Block implements ILegacyPipeConnection, } @Override - public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, - int k, Orientations connection) { + public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, int k, Orientations connection) { // TODO Auto-generated method stub } diff --git a/common/net/minecraft/src/buildcraft/factory/BlockQuarry.java b/common/net/minecraft/src/buildcraft/factory/BlockQuarry.java index fa77a22d..08a20c5a 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockQuarry.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockQuarry.java @@ -43,16 +43,13 @@ public class BlockQuarry extends BlockMachineRoot implements ITextureProvider { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, - EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { super.onBlockPlacedBy(world, i, j, k, entityliving); - Orientations orientation = Utils.get2dOrientation(new Position( - entityliving.posX, entityliving.posY, entityliving.posZ), + Orientations orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); - world.setBlockMetadataWithNotify(i, j, k, orientation.reverse() - .ordinal()); + world.setBlockMetadataWithNotify(i, j, k, orientation.reverse().ordinal()); } @Override @@ -81,8 +78,7 @@ public class BlockQuarry extends BlockMachineRoot implements ITextureProvider { public void searchFrames(World world, int i, int j, int k) { int width2 = 1; - if (!world.checkChunksExist(i - width2, j - width2, k - width2, i - + width2, j + width2, k + width2)) + if (!world.checkChunksExist(i - width2, j - width2, k - width2, i + width2, j + width2, k + width2)) return; int blockID = world.getBlockId(i, j, k); @@ -124,8 +120,7 @@ public class BlockQuarry extends BlockMachineRoot implements ITextureProvider { byte width = 1; int width2 = width + 1; - if (world.checkChunksExist(i - width2, j - width2, k - width2, i - + width2, j + width2, k + width2)) { + if (world.checkChunksExist(i - width2, j - width2, k - width2, i + width2, j + width2, k + width2)) { boolean frameFound = false; for (int z = -width; z <= width; ++z) { diff --git a/common/net/minecraft/src/buildcraft/factory/BlockRefinery.java b/common/net/minecraft/src/buildcraft/factory/BlockRefinery.java index b640cd2b..b3d4bb8e 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockRefinery.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockRefinery.java @@ -62,29 +62,23 @@ public class BlockRefinery extends BlockContainer { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, - EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { super.onBlockPlacedBy(world, i, j, k, entityliving); - Orientations orientation = Utils.get2dOrientation(new Position( - entityliving.posX, entityliving.posY, entityliving.posZ), + Orientations orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); - world.setBlockMetadataWithNotify(i, j, k, orientation.reverse() - .ordinal()); + world.setBlockMetadataWithNotify(i, j, k, orientation.reverse().ordinal()); } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { // Drop through if the player is sneaking if (entityplayer.isSneaking()) return false; - Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer - .getCurrentEquippedItem().getItem() : null; - if (equipped instanceof IToolWrench - && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { + Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; + if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { int meta = world.getBlockMetadata(i, j, k); @@ -107,19 +101,15 @@ public class BlockRefinery extends BlockContainer { return true; } else { - int liquidId = BuildCraftAPI.getLiquidForFilledItem(entityplayer - .getCurrentEquippedItem()); + int liquidId = BuildCraftAPI.getLiquidForFilledItem(entityplayer.getCurrentEquippedItem()); if (liquidId != 0) { - int qty = ((TileRefinery) world.getBlockTileEntity(i, j, k)) - .fill(Orientations.Unknown, - BuildCraftAPI.BUCKET_VOLUME, liquidId, true); + int qty = ((TileRefinery) world.getBlockTileEntity(i, j, k)).fill(Orientations.Unknown, + BuildCraftAPI.BUCKET_VOLUME, liquidId, true); if (qty != 0 && !BuildCraftCore.debugMode) { - entityplayer.inventory.setInventorySlotContents( - entityplayer.inventory.currentItem, Utils - .consumeItem(entityplayer.inventory - .getCurrentItem())); + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + Utils.consumeItem(entityplayer.inventory.getCurrentItem())); } return true; @@ -127,8 +117,7 @@ public class BlockRefinery extends BlockContainer { } if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftFactory.instance, - GuiIds.REFINERY, world, i, j, k); + entityplayer.openGui(mod_BuildCraftFactory.instance, GuiIds.REFINERY, world, i, j, k); return true; } diff --git a/common/net/minecraft/src/buildcraft/factory/BlockTank.java b/common/net/minecraft/src/buildcraft/factory/BlockTank.java index b660efc2..19a95bbc 100644 --- a/common/net/minecraft/src/buildcraft/factory/BlockTank.java +++ b/common/net/minecraft/src/buildcraft/factory/BlockTank.java @@ -70,8 +70,7 @@ public class BlockTank extends BlockContainer implements ITextureProvider { } @SuppressWarnings({ "all" }) - public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, - int l) { + public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { switch (l) { case 0: case 1: @@ -86,24 +85,19 @@ public class BlockTank extends BlockContainer implements ITextureProvider { } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { if (entityplayer.getCurrentEquippedItem() != null) { - int liquidId = BuildCraftAPI.getLiquidForFilledItem(entityplayer - .getCurrentEquippedItem()); + int liquidId = BuildCraftAPI.getLiquidForFilledItem(entityplayer.getCurrentEquippedItem()); TileTank tank = (TileTank) world.getBlockTileEntity(i, j, k); if (liquidId != 0) { - int qty = tank.fill(Orientations.Unknown, - BuildCraftAPI.BUCKET_VOLUME, liquidId, true); + int qty = tank.fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, liquidId, true); if (qty != 0 && !BuildCraftCore.debugMode) { - entityplayer.inventory.setInventorySlotContents( - entityplayer.inventory.currentItem, Utils - .consumeItem(entityplayer.inventory - .getCurrentItem())); + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + Utils.consumeItem(entityplayer.inventory.getCurrentItem())); } return true; diff --git a/common/net/minecraft/src/buildcraft/factory/BptBlockAutoWorkbench.java b/common/net/minecraft/src/buildcraft/factory/BptBlockAutoWorkbench.java index 1abffb30..687a816d 100644 --- a/common/net/minecraft/src/buildcraft/factory/BptBlockAutoWorkbench.java +++ b/common/net/minecraft/src/buildcraft/factory/BptBlockAutoWorkbench.java @@ -25,18 +25,15 @@ public class BptBlockAutoWorkbench extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { super.addRequirements(slot, context, requirements); BptBlockUtils.requestInventoryContents(slot, context, requirements); } @Override - public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, - int x, int y, int z) { - IInventory inventory = (IInventory) context.world().getBlockTileEntity( - x, y, z); + public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, int x, int y, int z) { + IInventory inventory = (IInventory) context.world().getBlockTileEntity(x, y, z); BptBlockUtils.initializeInventoryContents(bptSlot, context, inventory); } @@ -45,8 +42,7 @@ public class BptBlockAutoWorkbench extends BptBlock { public void buildBlock(BptSlotInfo slot, IBptContext context) { super.buildBlock(slot, context); - IInventory inventory = (IInventory) context.world().getBlockTileEntity( - slot.x, slot.y, slot.z); + IInventory inventory = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); BptBlockUtils.buildInventoryContents(slot, context, inventory); } diff --git a/common/net/minecraft/src/buildcraft/factory/BptBlockFrame.java b/common/net/minecraft/src/buildcraft/factory/BptBlockFrame.java index 5cfc6eeb..b338016b 100644 --- a/common/net/minecraft/src/buildcraft/factory/BptBlockFrame.java +++ b/common/net/minecraft/src/buildcraft/factory/BptBlockFrame.java @@ -23,8 +23,7 @@ public class BptBlockFrame extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { } diff --git a/common/net/minecraft/src/buildcraft/factory/BptBlockRefinery.java b/common/net/minecraft/src/buildcraft/factory/BptBlockRefinery.java index 21fb6ce3..e70e5914 100644 --- a/common/net/minecraft/src/buildcraft/factory/BptBlockRefinery.java +++ b/common/net/minecraft/src/buildcraft/factory/BptBlockRefinery.java @@ -25,10 +25,8 @@ public class BptBlockRefinery extends BptBlock { } @Override - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, - int x, int y, int z) { - TileRefinery refinery = (TileRefinery) context.world() - .getBlockTileEntity(x, y, z); + public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { + TileRefinery refinery = (TileRefinery) context.world().getBlockTileEntity(x, y, z); slot.cpt.setInteger("filter0", refinery.getFilter(0)); slot.cpt.setInteger("filter1", refinery.getFilter(1)); @@ -38,8 +36,7 @@ public class BptBlockRefinery extends BptBlock { public void buildBlock(BptSlotInfo slot, IBptContext context) { super.buildBlock(slot, context); - TileRefinery refinery = (TileRefinery) context.world() - .getBlockTileEntity(slot.x, slot.y, slot.z); + TileRefinery refinery = (TileRefinery) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); refinery.setFilter(0, slot.cpt.getInteger("filter0")); refinery.setFilter(1, slot.cpt.getInteger("filter1")); diff --git a/common/net/minecraft/src/buildcraft/factory/BptBlockTank.java b/common/net/minecraft/src/buildcraft/factory/BptBlockTank.java index ee73f25b..8f41739d 100644 --- a/common/net/minecraft/src/buildcraft/factory/BptBlockTank.java +++ b/common/net/minecraft/src/buildcraft/factory/BptBlockTank.java @@ -11,15 +11,13 @@ public class BptBlockTank extends BptBlock { } @Override - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, - int x, int y, int z) { + public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { } @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); } } diff --git a/common/net/minecraft/src/buildcraft/factory/ContainerAutoWorkbench.java b/common/net/minecraft/src/buildcraft/factory/ContainerAutoWorkbench.java index 2ebca7e8..8def12d2 100644 --- a/common/net/minecraft/src/buildcraft/factory/ContainerAutoWorkbench.java +++ b/common/net/minecraft/src/buildcraft/factory/ContainerAutoWorkbench.java @@ -30,12 +30,11 @@ public class ContainerAutoWorkbench extends BuildCraftContainer { public IInventory craftResult; public class SlotAutoCrafting extends Slot { + private final IInventory craftMatrix; private EntityPlayer thePlayer; - public SlotAutoCrafting(EntityPlayer entityplayer, - IInventory iinventory, IInventory iinventory1, int i, int j, - int k) { + public SlotAutoCrafting(EntityPlayer entityplayer, IInventory iinventory, IInventory iinventory1, int i, int j, int k) { super(iinventory1, i, j, k); thePlayer = entityplayer; craftMatrix = iinventory; @@ -48,8 +47,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer { @Override public void onPickupFromSlot(ItemStack itemstack) { - CoreProxy - .onCraftingPickup(thePlayer.worldObj, thePlayer, itemstack); + CoreProxy.onCraftingPickup(thePlayer.worldObj, thePlayer, itemstack); if (itemstack.itemID == Block.workbench.blockID) { thePlayer.addStat(AchievementList.buildWorkBench, 1); } else if (itemstack.itemID == Item.pickaxeWood.shiftedIndex) { @@ -79,14 +77,12 @@ public class ContainerAutoWorkbench extends BuildCraftContainer { } - public ContainerAutoWorkbench(InventoryPlayer inventoryplayer, - TileAutoWorkbench tile) { + public ContainerAutoWorkbench(InventoryPlayer inventoryplayer, TileAutoWorkbench tile) { super(tile); craftResult = new InventoryCraftResult(); this.tile = tile; - addSlot(new SlotAutoCrafting(inventoryplayer.player, tile, craftResult, - 0, 124, 35)); + addSlot(new SlotAutoCrafting(inventoryplayer.player, tile, craftResult, 0, 124, 35)); for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 3; k1++) { addSlot(new Slot(tile, k1 + l * 3, 30 + k1 * 18, 17 + l * 18)); @@ -96,8 +92,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer { for (int i1 = 0; i1 < 3; i1++) { for (int l1 = 0; l1 < 9; l1++) { - addSlot(new Slot(inventoryplayer, l1 + i1 * 9 + 9, 8 + l1 * 18, - 84 + i1 * 18)); + addSlot(new Slot(inventoryplayer, l1 + i1 * 9 + 9, 8 + l1 * 18, 84 + i1 * 18)); } } @@ -116,8 +111,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer { } @Override - public ItemStack slotClick(int i, int j, boolean flag, - EntityPlayer entityplayer) { + public ItemStack slotClick(int i, int j, boolean flag, EntityPlayer entityplayer) { // This call ensures that the ouptut is correctly computed craftResult.setInventorySlotContents(0, tile.findRecipe()); diff --git a/common/net/minecraft/src/buildcraft/factory/ContainerHopper.java b/common/net/minecraft/src/buildcraft/factory/ContainerHopper.java index a7ce13aa..deda984d 100644 --- a/common/net/minecraft/src/buildcraft/factory/ContainerHopper.java +++ b/common/net/minecraft/src/buildcraft/factory/ContainerHopper.java @@ -25,8 +25,7 @@ public class ContainerHopper extends BuildCraftContainer { // Player inventory for (int i1 = 0; i1 < 3; i1++) for (int l1 = 0; l1 < 9; l1++) { - addSlot(new Slot(inventory, l1 + i1 * 9 + 9, 8 + l1 * 18, - 71 + i1 * 18)); + addSlot(new Slot(inventory, l1 + i1 * 9 + 9, 8 + l1 * 18, 71 + i1 * 18)); } // Player hotbar diff --git a/common/net/minecraft/src/buildcraft/factory/ContainerRefinery.java b/common/net/minecraft/src/buildcraft/factory/ContainerRefinery.java index 5ffe390d..0d59ee15 100644 --- a/common/net/minecraft/src/buildcraft/factory/ContainerRefinery.java +++ b/common/net/minecraft/src/buildcraft/factory/ContainerRefinery.java @@ -29,8 +29,7 @@ public class ContainerRefinery extends BuildCraftContainer { for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 9; k1++) { - addSlot(new Slot(inventory, k1 + l * 9 + 9, 8 + k1 * 18, - 123 + l * 18)); + addSlot(new Slot(inventory, k1 + l * 9 + 9, 8 + k1 * 18, 123 + l * 18)); } } @@ -60,9 +59,8 @@ public class ContainerRefinery extends BuildCraftContainer { payload.intPayload[0] = slot; payload.intPayload[1] = liquidId; payload.intPayload[2] = liquidMeta; - CoreProxy.sendToServer(new PacketUpdate( - PacketIds.REFINERY_FILTER_SET, refinery.xCoord, - refinery.yCoord, refinery.zCoord, payload).getPacket()); + CoreProxy.sendToServer(new PacketUpdate(PacketIds.REFINERY_FILTER_SET, refinery.xCoord, refinery.yCoord, + refinery.zCoord, payload).getPacket()); } } diff --git a/common/net/minecraft/src/buildcraft/factory/EntityMechanicalArm.java b/common/net/minecraft/src/buildcraft/factory/EntityMechanicalArm.java index 5efdcf58..9adf9c58 100644 --- a/common/net/minecraft/src/buildcraft/factory/EntityMechanicalArm.java +++ b/common/net/minecraft/src/buildcraft/factory/EntityMechanicalArm.java @@ -36,8 +36,7 @@ public class EntityMechanicalArm extends Entity { super(world); } - public EntityMechanicalArm(World world, double i, double j, double k, - double width, double height) { + public EntityMechanicalArm(World world, double i, double j, double k, double width, double height) { super(world); setPosition(i, j, k); @@ -82,8 +81,7 @@ public class EntityMechanicalArm extends Entity { } @Override - protected void entityInit() { - } + protected void entityInit() {} @Override protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { @@ -195,8 +193,7 @@ public class EntityMechanicalArm extends Entity { super.onUpdate(); if (inProgressionXZ) { - if (Math.abs(targetX - headPosX) < instantSpeed * 2 - && Math.abs(targetZ - headPosZ) < instantSpeed * 2) { + if (Math.abs(targetX - headPosX) < instantSpeed * 2 && Math.abs(targetZ - headPosZ) < instantSpeed * 2) { headPosX = targetX; headPosZ = targetZ; diff --git a/common/net/minecraft/src/buildcraft/factory/TankBucketHandler.java b/common/net/minecraft/src/buildcraft/factory/TankBucketHandler.java index 3cb83a3e..10ae7ea5 100644 --- a/common/net/minecraft/src/buildcraft/factory/TankBucketHandler.java +++ b/common/net/minecraft/src/buildcraft/factory/TankBucketHandler.java @@ -25,8 +25,7 @@ public class TankBucketHandler implements IBucketHandler { int qty = tank.empty(BuildCraftAPI.BUCKET_VOLUME, false); - ItemStack filledBucket = BuildCraftAPI.getFilledItemForLiquid(tank - .getLiquidId()); + ItemStack filledBucket = BuildCraftAPI.getFilledItemForLiquid(tank.getLiquidId()); if (qty >= BuildCraftAPI.BUCKET_VOLUME && filledBucket != null) { tank.empty(BuildCraftAPI.BUCKET_VOLUME, true); diff --git a/common/net/minecraft/src/buildcraft/factory/TileAssemblyTable.java b/common/net/minecraft/src/buildcraft/factory/TileAssemblyTable.java index 30690bfc..46890949 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileAssemblyTable.java +++ b/common/net/minecraft/src/buildcraft/factory/TileAssemblyTable.java @@ -25,8 +25,7 @@ import net.minecraft.src.buildcraft.core.network.PacketIds; import net.minecraft.src.buildcraft.core.network.PacketUpdate; import net.minecraft.src.buildcraft.core.network.TilePacketWrapper; -public class TileAssemblyTable extends TileEntity implements IInventory, - IPipeConnection { +public class TileAssemblyTable extends TileEntity implements IInventory, IPipeConnection { ItemStack[] items = new ItemStack[12]; @@ -38,6 +37,7 @@ public class TileAssemblyTable extends TileEntity implements IInventory, private float energyStored = 0; public static class SelectionMessage { + /** * If true, select, if false, unselect */ @@ -57,8 +57,7 @@ public class TileAssemblyTable extends TileEntity implements IInventory, public int itemDmg = 0; } - public static TilePacketWrapper selectionMessageWrapper = new TilePacketWrapper( - SelectionMessage.class); + public static TilePacketWrapper selectionMessageWrapper = new TilePacketWrapper(SelectionMessage.class); public LinkedList getPotentialOutputs() { LinkedList result = new LinkedList(); @@ -148,20 +147,16 @@ public class TileAssemblyTable extends TileEntity implements IInventory, } } - StackUtil stackUtils = new StackUtil( - currentRecipe.output.copy()); + StackUtil stackUtils = new StackUtil(currentRecipe.output.copy()); - boolean added = stackUtils.addToRandomInventory(this, - Orientations.Unknown); + boolean added = stackUtils.addToRandomInventory(this, Orientations.Unknown); if (!added || stackUtils.items.stackSize > 0) { - added = Utils.addToRandomPipeEntry(this, - Orientations.Unknown, stackUtils.items); + added = Utils.addToRandomPipeEntry(this, Orientations.Unknown, stackUtils.items); } if (!added) { - EntityItem entityitem = new EntityItem(worldObj, - xCoord + 0.5, yCoord + 0.7, zCoord + 0.5, + EntityItem entityitem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.7, zCoord + 0.5, currentRecipe.output.copy()); worldObj.spawnEntityInWorld(entityitem); @@ -263,20 +258,17 @@ public class TileAssemblyTable extends TileEntity implements IInventory, ItemStack stack = ItemStack.loadItemStackFromNBT(cpt); for (AssemblyRecipe r : BuildCraftCore.assemblyRecipes) { - if (r.output.itemID == stack.itemID - && r.output.getItemDamage() == stack.getItemDamage()) { + if (r.output.itemID == stack.itemID && r.output.getItemDamage() == stack.getItemDamage()) { plannedOutput.add(r); } } } if (nbttagcompound.hasKey("recipe")) { - ItemStack stack = ItemStack.loadItemStackFromNBT(nbttagcompound - .getCompoundTag("recipe")); + ItemStack stack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("recipe")); for (AssemblyRecipe r : plannedOutput) { - if (r.output.itemID == stack.itemID - && r.output.getItemDamage() == stack.getItemDamage()) { + if (r.output.itemID == stack.itemID && r.output.getItemDamage() == stack.getItemDamage()) { currentRecipe = r; break; } @@ -390,8 +382,7 @@ public class TileAssemblyTable extends TileEntity implements IInventory, public void handleSelectionMessage(SelectionMessage message) { for (AssemblyRecipe recipe : BuildCraftCore.assemblyRecipes) { - if (recipe.output.itemID == message.itemID - && recipe.output.getItemDamage() == message.itemDmg) { + if (recipe.output.itemID == message.itemID && recipe.output.getItemDamage() == message.itemDmg) { if (message.select) { planOutput(recipe); } else { @@ -416,17 +407,13 @@ public class TileAssemblyTable extends TileEntity implements IInventory, message.select = false; } - PacketUpdate packet = new PacketUpdate( - PacketIds.SELECTION_ASSEMBLY, - selectionMessageWrapper.toPayload(xCoord, yCoord, zCoord, - message)); + PacketUpdate packet = new PacketUpdate(PacketIds.SELECTION_ASSEMBLY, selectionMessageWrapper.toPayload(xCoord, + yCoord, zCoord, message)); packet.posX = xCoord; packet.posY = yCoord; packet.posZ = zCoord; - CoreProxy.sendToPlayers(packet.getPacket(), worldObj, - (int) player.posX, (int) player.posY, (int) player.posZ, - DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftSilicon.instance); + CoreProxy.sendToPlayers(packet.getPacket(), worldObj, (int) player.posX, (int) player.posY, (int) player.posZ, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftSilicon.instance); } } @@ -443,8 +430,7 @@ public class TileAssemblyTable extends TileEntity implements IInventory, } public void sendGUINetworkData(Container container, ICrafting iCrafting) { - iCrafting.updateCraftingInventoryInfo(container, 0, - (int) currentRequiredEnergy); + iCrafting.updateCraftingInventoryInfo(container, 0, (int) currentRequiredEnergy); iCrafting.updateCraftingInventoryInfo(container, 1, (int) energyStored); } diff --git a/common/net/minecraft/src/buildcraft/factory/TileAutoWorkbench.java b/common/net/minecraft/src/buildcraft/factory/TileAutoWorkbench.java index 94c41a35..ab689b50 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileAutoWorkbench.java +++ b/common/net/minecraft/src/buildcraft/factory/TileAutoWorkbench.java @@ -33,6 +33,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { public LocalInventoryCrafting() { super(new Container() { + @SuppressWarnings("all") public boolean isUsableByPlayer(EntityPlayer entityplayer) { return false; @@ -131,12 +132,8 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { for (int j = 0; j < getSizeInventory(); ++j) { ItemStack stackInInventory = getStackInSlot(j); - if (stackInInventory != null - && stackInInventory.stackSize > 0 - && stackInInventory.itemID == stack.itemID - && stackInInventory.getItemDamage() == stack - .getItemDamage() - && stackInInventory.stackSize < minSimilar) { + if (stackInInventory != null && stackInInventory.stackSize > 0 && stackInInventory.itemID == stack.itemID + && stackInInventory.getItemDamage() == stack.getItemDamage() && stackInInventory.stackSize < minSimilar) { minSimilar = stackInInventory.stackSize; minSlot = j; } @@ -158,6 +155,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { } class StackPointer { + IInventory inventory; int index; ItemStack item; @@ -172,8 +170,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { craftMatrix.setInventorySlotContents(i, stack); } - ItemStack recipe = CraftingManager.getInstance().findMatchingRecipe( - craftMatrix); + ItemStack recipe = CraftingManager.getInstance().findMatchingRecipe(craftMatrix); return recipe; } @@ -190,8 +187,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { if (stack != null) { if (stack.stackSize <= itemsToLeave) { - StackPointer pointer = getNearbyItem(stack.itemID, - stack.getItemDamage()); + StackPointer pointer = getNearbyItem(stack.itemID, stack.getItemDamage()); if (pointer == null) { resetPointers(pointerList); @@ -214,8 +210,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { craftMatrix.setInventorySlotContents(i, stack); } - ItemStack resultStack = CraftingManager.getInstance() - .findMatchingRecipe(craftMatrix); + ItemStack resultStack = CraftingManager.getInstance().findMatchingRecipe(craftMatrix); if (resultStack == null || !doRemove) { resetPointers(pointerList); @@ -224,8 +219,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { // replace with the container where appropriate if (p.item.getItem().getContainerItem() != null) { - ItemStack newStack = new ItemStack(p.item.getItem() - .getContainerItem(), 1); + ItemStack newStack = new ItemStack(p.item.getItem().getContainerItem(), 1); p.inventory.setInventorySlotContents(p.index, newStack); } @@ -255,44 +249,36 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { public StackPointer getNearbyItem(int itemId, int damage) { StackPointer pointer = null; - pointer = getNearbyItemFromOrientation(itemId, damage, - Orientations.XNeg); + pointer = getNearbyItemFromOrientation(itemId, damage, Orientations.XNeg); if (pointer == null) { - pointer = getNearbyItemFromOrientation(itemId, damage, - Orientations.XPos); + pointer = getNearbyItemFromOrientation(itemId, damage, Orientations.XPos); } if (pointer == null) { - pointer = getNearbyItemFromOrientation(itemId, damage, - Orientations.YNeg); + pointer = getNearbyItemFromOrientation(itemId, damage, Orientations.YNeg); } if (pointer == null) { - pointer = getNearbyItemFromOrientation(itemId, damage, - Orientations.YPos); + pointer = getNearbyItemFromOrientation(itemId, damage, Orientations.YPos); } if (pointer == null) { - pointer = getNearbyItemFromOrientation(itemId, damage, - Orientations.ZNeg); + pointer = getNearbyItemFromOrientation(itemId, damage, Orientations.ZNeg); } if (pointer == null) { - pointer = getNearbyItemFromOrientation(itemId, damage, - Orientations.ZPos); + pointer = getNearbyItemFromOrientation(itemId, damage, Orientations.ZPos); } return pointer; } - public StackPointer getNearbyItemFromOrientation(int itemId, int damage, - Orientations orientation) { + public StackPointer getNearbyItemFromOrientation(int itemId, int damage, Orientations orientation) { Position p = new Position(xCoord, yCoord, zCoord, orientation); p.moveForwards(1.0); - TileEntity tile = worldObj.getBlockTileEntity((int) p.x, (int) p.y, - (int) p.z); + TileEntity tile = worldObj.getBlockTileEntity((int) p.x, (int) p.y, (int) p.z); if (tile instanceof ISpecialInventory) { // Don't get stuff out of ISpecialInventory for now / we wouldn't @@ -304,9 +290,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { for (int j = 0; j < inventory.getSizeInventory(); ++j) { ItemStack stack = inventory.getStackInSlot(j); - if (stack != null && stack.stackSize > 0 - && stack.itemID == itemId - && stack.getItemDamage() == damage) { + if (stack != null && stack.stackSize > 0 && stack.itemID == itemId && stack.getItemDamage() == damage) { inventory.decrStackSize(j, 1); StackPointer result = new StackPointer(); diff --git a/common/net/minecraft/src/buildcraft/factory/TileHopper.java b/common/net/minecraft/src/buildcraft/factory/TileHopper.java index 56e7a246..52e9b972 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileHopper.java +++ b/common/net/minecraft/src/buildcraft/factory/TileHopper.java @@ -111,10 +111,8 @@ public class TileHopper extends TileBuildCraft implements IInventory { } @Override - public void openChest() { - } + public void openChest() {} @Override - public void closeChest() { - } + public void closeChest() {} } diff --git a/common/net/minecraft/src/buildcraft/factory/TileMachine.java b/common/net/minecraft/src/buildcraft/factory/TileMachine.java index 7b132684..8ec2c64b 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileMachine.java +++ b/common/net/minecraft/src/buildcraft/factory/TileMachine.java @@ -13,8 +13,7 @@ import net.minecraft.src.buildcraft.api.IPowerReceptor; import net.minecraft.src.buildcraft.core.IMachine; import net.minecraft.src.buildcraft.core.TileBuildCraft; -public abstract class TileMachine extends TileBuildCraft implements IMachine, - IPowerReceptor { +public abstract class TileMachine extends TileBuildCraft implements IMachine, IPowerReceptor { @Override public int powerRequest() { diff --git a/common/net/minecraft/src/buildcraft/factory/TileMiningWell.java b/common/net/minecraft/src/buildcraft/factory/TileMiningWell.java index ed034822..57a57b53 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileMiningWell.java +++ b/common/net/minecraft/src/buildcraft/factory/TileMiningWell.java @@ -26,8 +26,8 @@ import net.minecraft.src.buildcraft.core.IMachine; import net.minecraft.src.buildcraft.core.StackUtil; import net.minecraft.src.buildcraft.core.Utils; -public class TileMiningWell extends TileMachine implements IMachine, - IPowerReceptor, IPipeConnection { +public class TileMiningWell extends TileMachine implements IMachine, IPowerReceptor, IPipeConnection { + boolean isDigging = true; PowerProvider powerProvider; @@ -56,8 +56,8 @@ public class TileMiningWell extends TileMachine implements IMachine, } if (depth < 0 - || (Block.blocksList[world.getBlockId(xCoord, depth, zCoord)] != null && Block.blocksList[world - .getBlockId(xCoord, depth, zCoord)].getHardness() == -1.0f) + || (Block.blocksList[world.getBlockId(xCoord, depth, zCoord)] != null && Block.blocksList[world.getBlockId( + xCoord, depth, zCoord)].getHardness() == -1.0f) || world.getBlockId(xCoord, depth, zCoord) == Block.lavaMoving.blockID || world.getBlockId(xCoord, depth, zCoord) == Block.lavaStill.blockID) { @@ -67,11 +67,9 @@ public class TileMiningWell extends TileMachine implements IMachine, int blockId = world.getBlockId(xCoord, depth, zCoord); - ArrayList stacks = BuildCraftBlockUtil - .getItemStackFromBlock(worldObj, xCoord, depth, zCoord); + ArrayList stacks = BuildCraftBlockUtil.getItemStackFromBlock(worldObj, xCoord, depth, zCoord); - world.setBlockWithNotify(xCoord, depth, zCoord, - BuildCraftFactory.plainPipeBlock.blockID); + world.setBlockWithNotify(xCoord, depth, zCoord, BuildCraftFactory.plainPipeBlock.blockID); if (blockId == 0) { return; @@ -84,14 +82,12 @@ public class TileMiningWell extends TileMachine implements IMachine, for (ItemStack s : stacks) { StackUtil stackUtil = new StackUtil(s); - if (stackUtil.addToRandomInventory(this, Orientations.Unknown) - && stackUtil.items.stackSize == 0) { + if (stackUtil.addToRandomInventory(this, Orientations.Unknown) && stackUtil.items.stackSize == 0) { // The object has been added to a nearby chest. return; } - if (Utils.addToRandomPipeEntry(this, Orientations.Unknown, s) - && stackUtil.items.stackSize == 0) { + if (Utils.addToRandomPipeEntry(this, Orientations.Unknown, s) && stackUtil.items.stackSize == 0) { // The object has been added to a nearby pipe. return; } @@ -103,8 +99,7 @@ public class TileMiningWell extends TileMachine implements IMachine, float f1 = world.rand.nextFloat() * 0.8F + 0.1F; float f2 = world.rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem = new EntityItem(world, xCoord + f, yCoord - + f1 + 0.5F, zCoord + f2, stackUtil.items); + EntityItem entityitem = new EntityItem(world, xCoord + f, yCoord + f1 + 0.5F, zCoord + f2, stackUtil.items); float f3 = 0.05F; entityitem.motionX = (float) world.rand.nextGaussian() * f3; diff --git a/common/net/minecraft/src/buildcraft/factory/TilePump.java b/common/net/minecraft/src/buildcraft/factory/TilePump.java index ae09102e..b3c21ce7 100644 --- a/common/net/minecraft/src/buildcraft/factory/TilePump.java +++ b/common/net/minecraft/src/buildcraft/factory/TilePump.java @@ -81,8 +81,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { BlockIndex index = getNextIndexToPump(false); if (isPumpableLiquid(index)) { - int liquidToPump = Utils.liquidId(worldObj.getBlockId( - index.i, index.j, index.k)); + int liquidToPump = Utils.liquidId(worldObj.getBlockId(index.i, index.j, index.k)); if (internalLiquid == 0 || liquidId == liquidToPump) { liquidId = liquidToPump; @@ -90,10 +89,8 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { if (powerProvider.useEnergy(10, 10, true) == 10) { index = getNextIndexToPump(true); - if (liquidId != Block.waterStill.blockID - || BuildCraftCore.consumeWaterSources) { - worldObj.setBlockWithNotify(index.i, index.j, - index.k, 0); + if (liquidId != Block.waterStill.blockID || BuildCraftCore.consumeWaterSources) { + worldObj.setBlockWithNotify(index.i, index.j, index.k, 0); } internalLiquid = internalLiquid += BuildCraftAPI.BUCKET_VOLUME; @@ -114,8 +111,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { if (isLiquid(new BlockIndex(xCoord, y, zCoord))) { aimY = y; return; - } else if (worldObj.getBlockId(xCoord, y, - zCoord) != 0) { + } else if (worldObj.getBlockId(xCoord, y, zCoord) != 0) { return; } } @@ -127,17 +123,13 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { if (internalLiquid >= 0) { for (int i = 0; i < 6; ++i) { - Position p = new Position(xCoord, yCoord, zCoord, - Orientations.values()[i]); + Position p = new Position(xCoord, yCoord, zCoord, Orientations.values()[i]); p.moveForwards(1); - TileEntity tile = worldObj.getBlockTileEntity((int) p.x, - (int) p.y, (int) p.z); + TileEntity tile = worldObj.getBlockTileEntity((int) p.x, (int) p.y, (int) p.z); if (tile instanceof ILiquidContainer) { - internalLiquid -= ((ILiquidContainer) tile).fill( - p.orientation.reverse(), internalLiquid, liquidId, - true); + internalLiquid -= ((ILiquidContainer) tile).fill(p.orientation.reverse(), internalLiquid, liquidId, true); if (internalLiquid <= 0) { break; @@ -220,27 +212,17 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { return; } - addToPumpIfLiquid(new BlockIndex(x, y, z), markedBlocks, lastFound, - pumpList, liquidId); + addToPumpIfLiquid(new BlockIndex(x, y, z), markedBlocks, lastFound, pumpList, liquidId); while (lastFound.size() > 0) { - TreeSet visitIteration = new TreeSet( - lastFound); + TreeSet visitIteration = new TreeSet(lastFound); lastFound.clear(); for (BlockIndex index : visitIteration) { - addToPumpIfLiquid( - new BlockIndex(index.i + 1, index.j, index.k), - markedBlocks, lastFound, pumpList, liquidId); - addToPumpIfLiquid( - new BlockIndex(index.i - 1, index.j, index.k), - markedBlocks, lastFound, pumpList, liquidId); - addToPumpIfLiquid( - new BlockIndex(index.i, index.j, index.k + 1), - markedBlocks, lastFound, pumpList, liquidId); - addToPumpIfLiquid( - new BlockIndex(index.i, index.j, index.k - 1), - markedBlocks, lastFound, pumpList, liquidId); + addToPumpIfLiquid(new BlockIndex(index.i + 1, index.j, index.k), markedBlocks, lastFound, pumpList, liquidId); + addToPumpIfLiquid(new BlockIndex(index.i - 1, index.j, index.k), markedBlocks, lastFound, pumpList, liquidId); + addToPumpIfLiquid(new BlockIndex(index.i, index.j, index.k + 1), markedBlocks, lastFound, pumpList, liquidId); + addToPumpIfLiquid(new BlockIndex(index.i, index.j, index.k - 1), markedBlocks, lastFound, pumpList, liquidId); if (!blocksToPump.containsKey(index.j + 1)) { blocksToPump.put(index.j + 1, new LinkedList()); @@ -248,15 +230,12 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { pumpList = blocksToPump.get(index.j + 1); - addToPumpIfLiquid( - new BlockIndex(index.i, index.j + 1, index.k), - markedBlocks, lastFound, pumpList, liquidId); + addToPumpIfLiquid(new BlockIndex(index.i, index.j + 1, index.k), markedBlocks, lastFound, pumpList, liquidId); } } } - public void addToPumpIfLiquid(BlockIndex index, - TreeSet markedBlocks, TreeSet lastFound, + public void addToPumpIfLiquid(BlockIndex index, TreeSet markedBlocks, TreeSet lastFound, LinkedList pumpList, int liquidId) { if (liquidId != worldObj.getBlockId(index.i, index.j, index.k)) { @@ -266,8 +245,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { if (!markedBlocks.contains(index)) { markedBlocks.add(index); - if ((index.i - xCoord) * (index.i - xCoord) + (index.k - zCoord) - * (index.k - zCoord) > 64 * 64) { + if ((index.i - xCoord) * (index.i - xCoord) + (index.k - zCoord) * (index.k - zCoord) > 64 * 64) { return; } @@ -282,14 +260,11 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { } private boolean isPumpableLiquid(BlockIndex index) { - return isLiquid(index) - && worldObj.getBlockMetadata(index.i, index.j, index.k) == 0; + return isLiquid(index) && worldObj.getBlockMetadata(index.i, index.j, index.k) == 0; } private boolean isLiquid(BlockIndex index) { - return index != null - && (Utils.liquidId(worldObj.getBlockId(index.i, index.j, - index.k)) != 0); + return index != null && (Utils.liquidId(worldObj.getBlockId(index.i, index.j, index.k)) != 0); } @Override @@ -341,8 +316,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { } @Override - public void doWork() { - } + public void doWork() {} @Override public void handleDescriptionPacket(PacketUpdate packet) { @@ -364,8 +338,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor { tube.kSize = Utils.pipeMaxPos - Utils.pipeMinPos; tube.jSize = yCoord - tube.posY; - tube.setPosition(xCoord + Utils.pipeMinPos, tubeY, zCoord - + Utils.pipeMinPos); + tube.setPosition(xCoord + Utils.pipeMinPos, tubeY, zCoord + Utils.pipeMinPos); } } diff --git a/common/net/minecraft/src/buildcraft/factory/TileQuarry.java b/common/net/minecraft/src/buildcraft/factory/TileQuarry.java index d0056c87..57193180 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileQuarry.java +++ b/common/net/minecraft/src/buildcraft/factory/TileQuarry.java @@ -42,8 +42,7 @@ import net.minecraft.src.buildcraft.core.StackUtil; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.buildcraft.core.network.PacketUpdate; -public class TileQuarry extends TileMachine implements IArmListener, IMachine, - IPowerReceptor, IPipeConnection, IBuilderInventory { +public class TileQuarry extends TileMachine implements IArmListener, IMachine, IPowerReceptor, IPipeConnection, IBuilderInventory { boolean isDigging = false; @@ -116,10 +115,8 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, private boolean loadDefaultBoundaries = false; private void createArm() { - arm = new EntityMechanicalArm(worldObj, box.xMin + Utils.pipeMaxPos, - yCoord + bluePrintBuilder.bluePrint.sizeY - 1 - + Utils.pipeMinPos, box.zMin + Utils.pipeMaxPos, - bluePrintBuilder.bluePrint.sizeX - 2 + Utils.pipeMinPos * 2, + arm = new EntityMechanicalArm(worldObj, box.xMin + Utils.pipeMaxPos, yCoord + bluePrintBuilder.bluePrint.sizeY - 1 + + Utils.pipeMinPos, box.zMin + Utils.pipeMaxPos, bluePrintBuilder.bluePrint.sizeX - 2 + Utils.pipeMinPos * 2, bluePrintBuilder.bluePrint.sizeZ - 2 + Utils.pipeMinPos * 2); arm.listener = this; @@ -136,8 +133,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, arm.speed = 0; float energyToUse = 2 + powerProvider.energyStored / 1000; - float energy = powerProvider.useEnergy(energyToUse, energyToUse, - true); + float energy = powerProvider.useEnergy(energyToUse, energyToUse, true); if (energy > 0) { arm.doMove(0.015 + energy / 200F); @@ -191,9 +187,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, } if (builder.readyToBuild()) { - builder.scheduleContruction( - bluePrintBuilder.getNextBlock(worldObj, this), - bluePrintBuilder.getContext()); + builder.scheduleContruction(bluePrintBuilder.getNextBlock(worldObj, this), bluePrintBuilder.getContext()); } return; @@ -213,8 +207,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, powerProvider.configure(20, 30, 200, 50, MAX_ENERGY); if (!findTarget(true)) { - arm.setTarget(box.xMin + arm.sizeX / 2, yCoord + 2, box.zMin - + arm.sizeX / 2); + arm.setTarget(box.xMin + arm.sizeX / 2, yCoord + 2, box.zMin + arm.sizeX / 2); isDigging = false; } @@ -264,8 +257,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, for (int searchZ = startZ; searchZ != endZ; searchZ += incZ) { if (!blockedColumns[searchX][searchZ]) { - int bx = box.xMin + searchX + 1, by = searchY, bz = box.zMin - + searchZ + 1; + int bx = box.xMin + searchX + 1, by = searchY, bz = box.zMin + searchZ + 1; int blockId = worldObj.getBlockId(bx, by, bz); @@ -310,8 +302,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, int ySize = nbttagcompound.getInteger("ySize"); int zSize = nbttagcompound.getInteger("zSize"); - box.initialize(xMin, yCoord, zMin, xMin + xSize - 1, yCoord + ySize - - 1, zMin + zSize - 1); + box.initialize(xMin, yCoord, zMin, xMin + xSize - 1, yCoord + ySize - 1, zMin + zSize - 1); loadDefaultBoundaries = false; } else { @@ -376,8 +367,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, // Share this with mining well! - ArrayList stacks = BuildCraftBlockUtil - .getItemStackFromBlock(worldObj, i, j, k); + ArrayList stacks = BuildCraftBlockUtil.getItemStackFromBlock(worldObj, i, j, k); if (stacks != null) { for (ItemStack s : stacks) { @@ -391,8 +381,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, } // Collect any lost items laying around - AxisAlignedBB axis = AxisAlignedBB.getBoundingBoxFromPool( - arm.headPosX - 1.5, arm.headPosY, arm.headPosZ - 1.5, + AxisAlignedBB axis = AxisAlignedBB.getBoundingBoxFromPool(arm.headPosX - 1.5, arm.headPosY, arm.headPosZ - 1.5, arm.headPosX + 2.5, arm.headPosY + 2.5, arm.headPosZ + 2.5); List result = worldObj.getEntitiesWithinAABB(EntityItem.class, axis); for (int ii = 0; ii < result.size(); ii++) { @@ -418,8 +407,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, added = stackUtils.addToRandomInventory(this, Orientations.Unknown); if (!added || stackUtils.items.stackSize > 0) { - added = Utils.addToRandomPipeEntry(this, Orientations.Unknown, - stackUtils.items); + added = Utils.addToRandomPipeEntry(this, Orientations.Unknown, stackUtils.items); } // Last, throw the object away @@ -429,13 +417,11 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, float f1 = worldObj.rand.nextFloat() * 0.8F + 0.1F; float f2 = worldObj.rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem = new EntityItem(worldObj, xCoord + f, yCoord - + f1 + 0.5F, zCoord + f2, stackUtils.items); + EntityItem entityitem = new EntityItem(worldObj, xCoord + f, yCoord + f1 + 0.5F, zCoord + f2, stackUtils.items); float f3 = 0.05F; entityitem.motionX = (float) worldObj.rand.nextGaussian() * f3; - entityitem.motionY = (float) worldObj.rand.nextGaussian() * f3 - + 1.0F; + entityitem.motionY = (float) worldObj.rand.nextGaussian() * f3 + 1.0F; entityitem.motionZ = (float) worldObj.rand.nextGaussian() * f3; worldObj.spawnEntityInWorld(entityitem); } @@ -443,12 +429,10 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, private boolean blockDig(int blockID) { - if (Block.blocksList[blockID] != null - && Block.blocksList[blockID].getHardness() == -1.0f) + if (Block.blocksList[blockID] != null && Block.blocksList[blockID].getHardness() == -1.0f) return true; - return blockID == Block.lavaStill.blockID - || blockID == Block.lavaMoving.blockID; + return blockID == Block.lavaStill.blockID || blockID == Block.lavaMoving.blockID; } private boolean canDig(int blockID) { @@ -483,8 +467,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, } if (a == null) { - a = new DefaultAreaProvider(xCoord, yCoord, zCoord, xCoord + 10, - yCoord + 4, zCoord + 10); + a = new DefaultAreaProvider(xCoord, yCoord, zCoord, xCoord + 10, yCoord + 4, zCoord + 10); useDefault = true; } @@ -494,8 +477,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, int zSize = a.zMax() - a.zMin() + 1; if (xSize < 3 || zSize < 3) { - a = new DefaultAreaProvider(xCoord, yCoord, zCoord, xCoord + 10, - yCoord + 4, zCoord + 10); + a = new DefaultAreaProvider(xCoord, yCoord, zCoord, xCoord + 10, yCoord + 4, zCoord + 10); useDefault = true; } @@ -514,8 +496,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, if (useDefault) { int xMin = 0, zMin = 0; - Orientations o = Orientations.values()[worldObj.getBlockMetadata( - xCoord, yCoord, zCoord)].reverse(); + Orientations o = Orientations.values()[worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].reverse(); switch (o) { case XPos: @@ -536,8 +517,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, break; } - box.initialize(xMin, yCoord, zMin, xMin + xSize - 1, yCoord + ySize - - 1, zMin + zSize - 1); + box.initialize(xMin, yCoord, zMin, xMin + xSize - 1, yCoord + ySize - 1, zMin + zSize - 1); } a.removeFromWorld(); @@ -545,8 +525,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, private void initializeBluePrintBuilder() { - BptBlueprint bluePrint = new BptBlueprint(box.sizeX(), box.sizeY(), - box.sizeZ()); + BptBlueprint bluePrint = new BptBlueprint(box.sizeX(), box.sizeY(), box.sizeZ()); for (int i = 0; i < bluePrint.sizeX; ++i) { for (int j = 0; j < bluePrint.sizeY; ++j) { @@ -558,35 +537,25 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, for (int it = 0; it < 2; it++) { for (int i = 0; i < bluePrint.sizeX; ++i) { - bluePrint.setBlockId(i, it * (box.sizeY() - 1), 0, - BuildCraftFactory.frameBlock.blockID); - bluePrint.setBlockId(i, it * (box.sizeY() - 1), - bluePrint.sizeZ - 1, - BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(i, it * (box.sizeY() - 1), 0, BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(i, it * (box.sizeY() - 1), bluePrint.sizeZ - 1, BuildCraftFactory.frameBlock.blockID); } for (int k = 0; k < bluePrint.sizeZ; ++k) { - bluePrint.setBlockId(0, it * (box.sizeY() - 1), k, - BuildCraftFactory.frameBlock.blockID); - bluePrint.setBlockId(bluePrint.sizeX - 1, it - * (box.sizeY() - 1), k, - BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(0, it * (box.sizeY() - 1), k, BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(bluePrint.sizeX - 1, it * (box.sizeY() - 1), k, BuildCraftFactory.frameBlock.blockID); } } for (int h = 1; h < box.sizeY(); ++h) { bluePrint.setBlockId(0, h, 0, BuildCraftFactory.frameBlock.blockID); - bluePrint.setBlockId(0, h, bluePrint.sizeZ - 1, - BuildCraftFactory.frameBlock.blockID); - bluePrint.setBlockId(bluePrint.sizeX - 1, h, 0, - BuildCraftFactory.frameBlock.blockID); - bluePrint.setBlockId(bluePrint.sizeX - 1, h, bluePrint.sizeZ - 1, - BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(0, h, bluePrint.sizeZ - 1, BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(bluePrint.sizeX - 1, h, 0, BuildCraftFactory.frameBlock.blockID); + bluePrint.setBlockId(bluePrint.sizeX - 1, h, bluePrint.sizeZ - 1, BuildCraftFactory.frameBlock.blockID); } - bluePrintBuilder = new BptBuilderBlueprint(bluePrint, worldObj, - box.xMin, yCoord, box.zMin); + bluePrintBuilder = new BptBuilderBlueprint(bluePrint, worldObj, box.xMin, yCoord, box.zMin); } @Override @@ -680,12 +649,10 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, } @Override - public void openChest() { - } + public void openChest() {} @Override - public void closeChest() { - } + public void closeChest() {} @Override public boolean isBuildingMaterial(int i) { diff --git a/common/net/minecraft/src/buildcraft/factory/TileRefinery.java b/common/net/minecraft/src/buildcraft/factory/TileRefinery.java index 63656fad..f1efe534 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileRefinery.java +++ b/common/net/minecraft/src/buildcraft/factory/TileRefinery.java @@ -29,14 +29,14 @@ import net.minecraft.src.buildcraft.api.SafeTimeTracker; import net.minecraft.src.buildcraft.api.TileNetworkData; import net.minecraft.src.buildcraft.core.IMachine; -public class TileRefinery extends TileMachine implements ILiquidContainer, - IPowerReceptor, IInventory, IMachine { +public class TileRefinery extends TileMachine implements ILiquidContainer, IPowerReceptor, IInventory, IMachine { private int[] filters = new int[2]; public static int LIQUID_PER_SLOT = BuildCraftAPI.BUCKET_VOLUME * 4; public static class Slot { + @TileNetworkData public int liquidId = 0; @TileNetworkData @@ -226,9 +226,7 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, public void updateEntity() { if (APIProxy.isClient(worldObj)) { simpleAnimationIterate(); - } else if (APIProxy.isServerSide() - && updateNetworkTime.markTimeIfDelay(worldObj, - 2 * BuildCraftCore.updateFactor)) { + } else if (APIProxy.isServerSide() && updateNetworkTime.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) { sendNetworkUpdate(); } @@ -236,8 +234,7 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, RefineryRecipe currentRecipe = null; - currentRecipe = BuildCraftAPI.findRefineryRecipe(slot1.liquidId, - slot1.quantity, slot2.liquidId, slot2.quantity); + currentRecipe = BuildCraftAPI.findRefineryRecipe(slot1.liquidId, slot1.quantity, slot2.liquidId, slot2.quantity); if (currentRecipe == null) { decreaseAnimation(); @@ -268,19 +265,16 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, } if (!containsInput(currentRecipe.sourceId1, currentRecipe.sourceQty1) - || !containsInput(currentRecipe.sourceId2, - currentRecipe.sourceQty2)) { + || !containsInput(currentRecipe.sourceId2, currentRecipe.sourceQty2)) { decreaseAnimation(); return; } - float energyUsed = powerProvider.useEnergy(currentRecipe.energy, - currentRecipe.energy, true); + float energyUsed = powerProvider.useEnergy(currentRecipe.energy, currentRecipe.energy, true); if (energyUsed != 0) { if (consumeInput(currentRecipe.sourceId1, currentRecipe.sourceQty1) - && consumeInput(currentRecipe.sourceId2, - currentRecipe.sourceQty2)) { + && consumeInput(currentRecipe.sourceId2, currentRecipe.sourceQty2)) { result.liquidId = currentRecipe.resultId; result.quantity += currentRecipe.resultQty; } @@ -288,8 +282,7 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, } private boolean containsInput(int id, int qty) { - return id == 0 || (slot1.liquidId == id && slot1.quantity >= qty) - || (slot2.liquidId == id && slot2.quantity >= qty); + return id == 0 || (slot1.liquidId == id && slot1.quantity >= qty) || (slot2.liquidId == id && slot2.quantity >= qty); } private boolean consumeInput(int id, int qty) { @@ -426,11 +419,9 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, @Override public LiquidSlot[] getLiquidSlots() { - return new LiquidSlot[] { - new LiquidSlot(slot1.liquidId, slot1.quantity, LIQUID_PER_SLOT), + return new LiquidSlot[] { new LiquidSlot(slot1.liquidId, slot1.quantity, LIQUID_PER_SLOT), new LiquidSlot(slot2.liquidId, slot2.quantity, LIQUID_PER_SLOT), - new LiquidSlot(result.liquidId, result.quantity, - LIQUID_PER_SLOT) }; + new LiquidSlot(result.liquidId, result.quantity, LIQUID_PER_SLOT) }; } public void setFilter(int number, int liquidId) { diff --git a/common/net/minecraft/src/buildcraft/factory/TileTank.java b/common/net/minecraft/src/buildcraft/factory/TileTank.java index bd1c9f0f..0d2b73ad 100644 --- a/common/net/minecraft/src/buildcraft/factory/TileTank.java +++ b/common/net/minecraft/src/buildcraft/factory/TileTank.java @@ -39,8 +39,7 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { for (int j = yCoord - 1; j > 1; --j) { if (worldObj.getBlockTileEntity(xCoord, j, zCoord) instanceof TileTank) { - lastTank = (TileTank) worldObj.getBlockTileEntity(xCoord, j, - zCoord); + lastTank = (TileTank) worldObj.getBlockTileEntity(xCoord, j, zCoord); } else { break; } @@ -49,16 +48,14 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { return lastTank.actualFill(from, quantity, id, doFill); } - private int actualFill(Orientations from, int quantity, int id, - boolean doFill) { + private int actualFill(Orientations from, int quantity, int id, boolean doFill) { if (stored != 0 && id != liquidId) { return 0; } liquidId = id; - TileEntity above = worldObj.getBlockTileEntity(xCoord, yCoord + 1, - zCoord); + TileEntity above = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord); int used = 0; @@ -79,9 +76,7 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { } if (used < quantity && above instanceof TileTank) { - used = used - + ((TileTank) above).actualFill(from, quantity - used, id, - doFill); + used = used + ((TileTank) above).actualFill(from, quantity - used, id, doFill); } return used; @@ -122,8 +117,7 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { for (int j = yCoord + 1; j <= DefaultProps.WORLD_HEIGHT; ++j) { if (worldObj.getBlockTileEntity(xCoord, j, zCoord) instanceof TileTank) { - lastTank = (TileTank) worldObj.getBlockTileEntity(xCoord, j, - zCoord); + lastTank = (TileTank) worldObj.getBlockTileEntity(xCoord, j, zCoord); } else { break; } @@ -148,12 +142,10 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { hasUpdate = true; } - TileEntity under = worldObj.getBlockTileEntity(xCoord, yCoord - 1, - zCoord); + TileEntity under = worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord); if (under instanceof TileTank) { - result += ((TileTank) under).actualEmtpy(quantityMax - result, - doEmpty); + result += ((TileTank) under).actualEmtpy(quantityMax - result, doEmpty); } return result; @@ -167,10 +159,7 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { @Override public void updateEntity() { - if (APIProxy.isServerSide() - && hasUpdate - && tracker.markTimeIfDelay(worldObj, - 2 * BuildCraftCore.updateFactor)) { + if (APIProxy.isServerSide() && hasUpdate && tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) { sendNetworkUpdate(); hasUpdate = false; } @@ -194,8 +183,7 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { break; } - TileTank tank = (TileTank) worldObj.getBlockTileEntity(xCoord, - ySearch, zCoord); + TileTank tank = (TileTank) worldObj.getBlockTileEntity(xCoord, ySearch, zCoord); if (tank.stored != 0) { resultLiquidId = tank.liquidId; @@ -210,8 +198,7 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { break; } - TileTank tank = (TileTank) worldObj.getBlockTileEntity(xCoord, - ySearch, zCoord); + TileTank tank = (TileTank) worldObj.getBlockTileEntity(xCoord, ySearch, zCoord); if (tank.stored != 0) { resultLiquidId = tank.liquidId; @@ -221,7 +208,6 @@ public class TileTank extends TileBuildCraft implements ILiquidContainer { resultCapacity += tank.getTankCapacity(); } - return new LiquidSlot[] { new LiquidSlot(resultLiquidId, - resultLiquidQty, resultCapacity) }; + return new LiquidSlot[] { new LiquidSlot(resultLiquidId, resultLiquidQty, resultCapacity) }; } } diff --git a/common/net/minecraft/src/buildcraft/silicon/BlockAssemblyTable.java b/common/net/minecraft/src/buildcraft/silicon/BlockAssemblyTable.java index 2c8b151e..692caed7 100644 --- a/common/net/minecraft/src/buildcraft/silicon/BlockAssemblyTable.java +++ b/common/net/minecraft/src/buildcraft/silicon/BlockAssemblyTable.java @@ -15,8 +15,7 @@ import net.minecraft.src.buildcraft.core.GuiIds; import net.minecraft.src.buildcraft.factory.TileAssemblyTable; import net.minecraft.src.forge.ITextureProvider; -public class BlockAssemblyTable extends BlockContainer implements - ITextureProvider { +public class BlockAssemblyTable extends BlockContainer implements ITextureProvider { public BlockAssemblyTable(int i) { super(i, Material.iron); @@ -42,15 +41,13 @@ public class BlockAssemblyTable extends BlockContainer implements } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { // Drop through if the player is sneaking if (entityplayer.isSneaking()) return false; if (!APIProxy.isClient(world)) - entityplayer.openGui(mod_BuildCraftSilicon.instance, - GuiIds.ASSEMBLY_TABLE, world, i, j, k); + entityplayer.openGui(mod_BuildCraftSilicon.instance, GuiIds.ASSEMBLY_TABLE, world, i, j, k); return true; } diff --git a/common/net/minecraft/src/buildcraft/silicon/ContainerAssemblyTable.java b/common/net/minecraft/src/buildcraft/silicon/ContainerAssemblyTable.java index 63541ddd..abdf8d7f 100644 --- a/common/net/minecraft/src/buildcraft/silicon/ContainerAssemblyTable.java +++ b/common/net/minecraft/src/buildcraft/silicon/ContainerAssemblyTable.java @@ -24,8 +24,7 @@ class ContainerAssemblyTable extends BuildCraftContainer { int x = Integer.MAX_VALUE, y = Integer.MAX_VALUE, z = Integer.MAX_VALUE; boolean networkSynchronized = false; - public ContainerAssemblyTable(IInventory playerInventory, - TileAssemblyTable table) { + public ContainerAssemblyTable(IInventory playerInventory, TileAssemblyTable table) { super(table); this.playerIInventory = playerInventory; @@ -38,8 +37,7 @@ class ContainerAssemblyTable extends BuildCraftContainer { for (int l = 0; l < 3; l++) { for (int k1 = 0; k1 < 9; k1++) { - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 123 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 123 + l * 18)); } } diff --git a/common/net/minecraft/src/buildcraft/silicon/TileLaser.java b/common/net/minecraft/src/buildcraft/silicon/TileLaser.java index e563a1ec..6d9e5071 100644 --- a/common/net/minecraft/src/buildcraft/silicon/TileLaser.java +++ b/common/net/minecraft/src/buildcraft/silicon/TileLaser.java @@ -56,13 +56,11 @@ public class TileLaser extends TileEntity implements IPowerReceptor { nextLaserSearch = 190 + worldObj.rand.nextInt(20); } - if (assemblyTable != null - && (assemblyTable.isInvalid() || assemblyTable.currentRecipe == null)) { + if (assemblyTable != null && (assemblyTable.isInvalid() || assemblyTable.currentRecipe == null)) { deleteLaser(); } - if (laser != null - && laserTickTracker.markTimeIfDelay(worldObj, nextLaserUpdate)) { + if (laser != null && laserTickTracker.markTimeIfDelay(worldObj, nextLaserUpdate)) { setLaserPosition(); nextLaserUpdate = 5 + worldObj.rand.nextInt(10); } @@ -135,8 +133,7 @@ public class TileLaser extends TileEntity implements IPowerReceptor { } BlockIndex b = targets.get(worldObj.rand.nextInt(targets.size())); - assemblyTable = (TileAssemblyTable) worldObj.getBlockTileEntity(b.i, - b.j, b.k); + assemblyTable = (TileAssemblyTable) worldObj.getBlockTileEntity(b.i, b.j, b.k); if (laser == null) { laser = new EntityEnergyLaser(worldObj); @@ -172,11 +169,9 @@ public class TileLaser extends TileEntity implements IPowerReceptor { break; } - laser.setPositions(xCoord + 0.5 + px, yCoord + 0.5 + py, zCoord + 0.5 - + pz, assemblyTable.xCoord + 0.475 - + (worldObj.rand.nextFloat() - 0.5) / 5F, - assemblyTable.yCoord + 9F / 16F, assemblyTable.zCoord + 0.475 - + (worldObj.rand.nextFloat() - 0.5) / 5F); + laser.setPositions(xCoord + 0.5 + px, yCoord + 0.5 + py, zCoord + 0.5 + pz, + assemblyTable.xCoord + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F, assemblyTable.yCoord + 9F / 16F, + assemblyTable.zCoord + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F); } @Override diff --git a/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java b/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java index 5e7770b4..cda7fe66 100644 --- a/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java +++ b/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java @@ -39,8 +39,7 @@ import net.minecraft.src.buildcraft.core.PersistentWorld; import net.minecraft.src.buildcraft.core.Utils; import net.minecraft.src.forge.ITextureProvider; -public class BlockGenericPipe extends BlockContainer implements IBlockPipe, - ITextureProvider { +public class BlockGenericPipe extends BlockContainer implements IBlockPipe, ITextureProvider { /** Defined subprograms **************************************************/ @@ -70,63 +69,47 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, @SuppressWarnings("rawtypes") @Override - public void getCollidingBoundingBoxes(World world, int i, int j, int k, - AxisAlignedBB axisalignedbb, ArrayList arraylist) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + public void getCollidingBoundingBoxes(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) { + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); TileEntity tile1 = world.getBlockTileEntity(i, j, k); if (Utils.checkPipesConnections(world, tile1, i - 1, j, k)) { - setBlockBounds(0.0F, Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(0.0F, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkPipesConnections(world, tile1, i + 1, j, k)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMinPos, 1.0F, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, 1.0F, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkPipesConnections(world, tile1, i, j - 1, k)) { - setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkPipesConnections(world, tile1, i, j + 1, k)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkPipesConnections(world, tile1, i, j, k - 1)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, 0.0F, - Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, 0.0F, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } if (Utils.checkPipesConnections(world, tile1, i, j, k + 1)) { - setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, - Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, 1.0F); - super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, - arraylist); + setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, 1.0F); + super.getCollidingBoundingBoxes(world, i, j, k, axisalignedbb, arraylist); } setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, - int j, int k) { + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { float xMin = Utils.pipeMinPos, xMax = Utils.pipeMaxPos, yMin = Utils.pipeMinPos, yMax = Utils.pipeMaxPos, zMin = Utils.pipeMinPos, zMax = Utils.pipeMaxPos; TileEntity tile1 = world.getBlockTileEntity(i, j, k); @@ -149,21 +132,18 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, if (Utils.checkPipesConnections(world, tile1, i, j, k + 1)) zMax = 1.0F; - return AxisAlignedBB.getBoundingBoxFromPool((double) i + xMin, - (double) j + yMin, (double) k + zMin, (double) i + xMax, + return AxisAlignedBB.getBoundingBoxFromPool((double) i + xMin, (double) j + yMin, (double) k + zMin, (double) i + xMax, (double) j + yMax, (double) k + zMax); } @SuppressWarnings({ "all" }) // @Override (client only) - public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, - int j, int k) { + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) { return getCollisionBoundingBoxFromPool(world, i, j, k); } @Override - public MovingObjectPosition collisionRayTrace(World world, int i, int j, - int k, Vec3D vec3d, Vec3D vec3d1) { + public MovingObjectPosition collisionRayTrace(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) { float xMin = Utils.pipeMinPos, xMax = Utils.pipeMaxPos, yMin = Utils.pipeMinPos, yMax = Utils.pipeMaxPos, zMin = Utils.pipeMinPos, zMax = Utils.pipeMaxPos; TileEntity tile1 = world.getBlockTileEntity(i, j, k); @@ -188,8 +168,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax); - MovingObjectPosition r = super.collisionRayTrace(world, i, j, k, vec3d, - vec3d1); + MovingObjectPosition r = super.collisionRayTrace(world, i, j, k, vec3d, vec3d1); setBlockBounds(0, 0, 0, 1, 1, 1); @@ -242,8 +221,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @Override - public void dropBlockAsItemWithChance(World world, int i, int j, int k, - int l, float f, int dmg) { + public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int dmg) { if (APIProxy.isClient(world)) return; @@ -263,8 +241,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, if (k1 > 0) { pipe.dropContents(); - dropBlockAsItem_do(world, i, j, k, new ItemStack(k1, 1, - damageDropped(l))); + dropBlockAsItem_do(world, i, j, k, new ItemStack(k1, 1, damageDropped(l))); } } } @@ -299,12 +276,10 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @Override - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { super.blockActivated(world, i, j, k, entityplayer); - world.notifyBlocksOfNeighborChange(i, j, k, - BuildCraftTransport.genericPipeBlock.blockID); + world.notifyBlocksOfNeighborChange(i, j, k, BuildCraftTransport.genericPipeBlock.blockID); Pipe pipe = getPipe(world, i, j, k); @@ -313,8 +288,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, // / Right click while sneaking without wrench to strip equipment // from the pipe. if (entityplayer.isSneaking() - && (entityplayer.getCurrentEquippedItem() == null || !(entityplayer - .getCurrentEquippedItem().getItem() instanceof IToolWrench))) { + && (entityplayer.getCurrentEquippedItem() == null || !(entityplayer.getCurrentEquippedItem().getItem() instanceof IToolWrench))) { if (pipe.hasGate() || pipe.isWired()) return stripEquipment(pipe); @@ -365,8 +339,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, || entityplayer.getCurrentEquippedItem().itemID == BuildCraftTransport.pipeGateAutarchic.shiftedIndex) if (!pipe.hasInterface()) { - pipe.gate = new GateVanilla(pipe, - entityplayer.getCurrentEquippedItem()); + pipe.gate = new GateVanilla(pipe, entityplayer.getCurrentEquippedItem()); entityplayer.getCurrentEquippedItem().splitStack(1); world.markBlockNeedsUpdate(i, j, k); @@ -390,19 +363,16 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, for (IPipe.WireColor color : IPipe.WireColor.values()) if (pipe.wireSet[color.reverse().ordinal()]) { if (!APIProxy.isRemote()) - dropWire(color.reverse(), pipe.worldObj, pipe.xCoord, - pipe.yCoord, pipe.zCoord); + dropWire(color.reverse(), pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord); pipe.wireSet[color.reverse().ordinal()] = false; - pipe.worldObj.markBlockNeedsUpdate(pipe.xCoord, pipe.yCoord, - pipe.zCoord); + pipe.worldObj.markBlockNeedsUpdate(pipe.xCoord, pipe.yCoord, pipe.zCoord); return true; } // Try to strip gate next if (pipe.hasGate()) { if (!APIProxy.isRemote()) - pipe.gate.dropGate(pipe.worldObj, pipe.xCoord, pipe.yCoord, - pipe.zCoord); + pipe.gate.dropGate(pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord); pipe.resetGate(); return true; } @@ -415,8 +385,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, * * @param color */ - private void dropWire(IPipe.WireColor color, World world, int i, int j, - int k) { + private void dropWire(IPipe.WireColor color, World world, int i, int j, int k) { Item wireItem; switch (color) { @@ -437,8 +406,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @Override - public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, - int k, Orientations connection) { + public void prepareTextureFor(IBlockAccess blockAccess, int i, int j, int k, Orientations connection) { Pipe pipe = getPipe(blockAccess, i, j, k); if (isValid(pipe)) @@ -446,8 +414,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @SuppressWarnings({ "all" }) - public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, - int l) { + public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) { Pipe pipe = getPipe(iblockaccess, i, j, k); if (!isValid(pipe)) { CoreProxy.BindTexture(BuildCraftCore.customBuildCraftTexture); @@ -463,8 +430,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @Override - public void onEntityCollidedWithBlock(World world, int i, int j, int k, - Entity entity) { + public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) { super.onEntityCollidedWithBlock(world, i, j, k, entity); Pipe pipe = getPipe(world, i, j, k); @@ -474,8 +440,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @Override - public boolean isPoweringTo(IBlockAccess iblockaccess, int x, int y, int z, - int l) { + public boolean isPoweringTo(IBlockAccess iblockaccess, int x, int y, int z, int l) { Pipe pipe = getPipe(iblockaccess, x, y, z); if (isValid(pipe)) @@ -490,8 +455,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, } @Override - public boolean isIndirectlyPoweringTo(World world, int i, int j, int k, - int l) { + public boolean isIndirectlyPoweringTo(World world, int i, int j, int k, int l) { Pipe pipe = getPipe(world, i, j, k); if (isValid(pipe)) @@ -502,8 +466,7 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, @SuppressWarnings({ "all" }) // @Override (client only) - public void randomDisplayTick(World world, int i, int j, int k, - Random random) { + public void randomDisplayTick(World world, int i, int j, int k, Random random) { Pipe pipe = getPipe(world, i, j, k); if (isValid(pipe)) @@ -535,18 +498,15 @@ public class BlockGenericPipe extends BlockContainer implements IBlockPipe, return null; } - public static Pipe createPipe(IBlockAccess blockAccess, int i, int j, - int k, int key) { + public static Pipe createPipe(IBlockAccess blockAccess, int i, int j, int k, int key) { Pipe pipe = createPipe(key); pipe.setPosition(i, j, k); - return (Pipe) PersistentWorld.getWorld(blockAccess).createTile(pipe, - new BlockIndex(i, j, k)); + return (Pipe) PersistentWorld.getWorld(blockAccess).createTile(pipe, new BlockIndex(i, j, k)); } public static Pipe getPipe(IBlockAccess blockAccess, int i, int j, int k) { - PersistentTile tile = PersistentWorld.getWorld(blockAccess).getTile( - new BlockIndex(i, j, k)); + PersistentTile tile = PersistentWorld.getWorld(blockAccess).getTile(new BlockIndex(i, j, k)); if (tile == null || !tile.isValid() || !(tile instanceof Pipe)) return null; diff --git a/common/net/minecraft/src/buildcraft/transport/BptBlockPipe.java b/common/net/minecraft/src/buildcraft/transport/BptBlockPipe.java index 5ef2c988..85244b72 100644 --- a/common/net/minecraft/src/buildcraft/transport/BptBlockPipe.java +++ b/common/net/minecraft/src/buildcraft/transport/BptBlockPipe.java @@ -31,8 +31,7 @@ public class BptBlockPipe extends BptBlock { } @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { int pipeId = slot.cpt.getInteger("pipeId"); requirements.add(new ItemStack(pipeId, 1, 0)); @@ -51,19 +50,16 @@ public class BptBlockPipe extends BptBlock { if (slot.cpt.hasKey("gate")) { int gateId = slot.cpt.getInteger("gate"); - requirements.add(new ItemStack(BuildCraftTransport.pipeGate, 1, - gateId - 1)); + requirements.add(new ItemStack(BuildCraftTransport.pipeGate, 1, gateId - 1)); } if (BuildCraftCore.itemBptProps[pipeId] != null) - BuildCraftCore.itemBptProps[pipeId].addRequirements(slot, - requirements); + BuildCraftCore.itemBptProps[pipeId].addRequirements(slot, requirements); } @Override public boolean isValid(BptSlotInfo slot, IBptContext context) { - Pipe pipe = BlockGenericPipe.getPipe(context.world(), slot.x, slot.y, - slot.z); + Pipe pipe = BlockGenericPipe.getPipe(context.world(), slot.x, slot.y, slot.z); if (BlockGenericPipe.isValid(pipe)) return pipe.itemID == slot.cpt.getInteger("pipeId"); @@ -83,8 +79,7 @@ public class BptBlockPipe extends BptBlock { public void buildBlock(BptSlotInfo slot, IBptContext context) { int pipeId = slot.cpt.getInteger("pipeId"); - Pipe pipe = BlockGenericPipe.createPipe(context.world(), slot.x, - slot.y, slot.z, pipeId); + Pipe pipe = BlockGenericPipe.createPipe(context.world(), slot.x, slot.y, slot.z, pipeId); for (int i = 0; i < pipe.wireSet.length; ++i) if (slot.cpt.hasKey("wire" + i)) @@ -98,13 +93,10 @@ public class BptBlockPipe extends BptBlock { for (int i = 0; i < 8; ++i) { if (slot.cpt.hasKey("trigger" + i)) - pipe.activatedTriggers[i] = BuildCraftAPI.triggers[slot.cpt - .getInteger("trigger" + i)]; + pipe.activatedTriggers[i] = BuildCraftAPI.triggers[slot.cpt.getInteger("trigger" + i)]; if (slot.cpt.hasKey("triggerParameter" + i)) { - ItemStack s = ItemStack - .loadItemStackFromNBT((NBTTagCompound) slot.cpt - .getTag("triggerParameter" + i)); + ItemStack s = ItemStack.loadItemStackFromNBT((NBTTagCompound) slot.cpt.getTag("triggerParameter" + i)); if (s != null) { pipe.triggerParameters[i] = new TriggerParameter(); @@ -113,23 +105,19 @@ public class BptBlockPipe extends BptBlock { } if (slot.cpt.hasKey("action" + i)) - pipe.activatedActions[i] = BuildCraftAPI.actions[slot.cpt - .getInteger("action" + i)]; + pipe.activatedActions[i] = BuildCraftAPI.actions[slot.cpt.getInteger("action" + i)]; } } - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, - slot.blockId, slot.meta); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, - slot.meta); + context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); + context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta); if (BuildCraftCore.itemBptProps[pipeId] != null) BuildCraftCore.itemBptProps[pipeId].buildBlock(slot, context); } @Override - public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, - int x, int y, int z) { + public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, int x, int y, int z) { Pipe pipe = BlockGenericPipe.getPipe(context.world(), x, y, z); if (BlockGenericPipe.isValid(pipe)) { @@ -145,8 +133,7 @@ public class BptBlockPipe extends BptBlock { for (int i = 0; i < 8; ++i) { if (pipe.activatedTriggers[i] != null) - bptSlot.cpt.setInteger("trigger" + i, - pipe.activatedTriggers[i].id); + bptSlot.cpt.setInteger("trigger" + i, pipe.activatedTriggers[i].id); if (pipe.triggerParameters[i] != null) { NBTTagCompound subCpt = new NBTTagCompound(); @@ -156,14 +143,12 @@ public class BptBlockPipe extends BptBlock { } if (pipe.activatedActions[i] != null) - bptSlot.cpt.setInteger("action" + i, - pipe.activatedActions[i].id); + bptSlot.cpt.setInteger("action" + i, pipe.activatedActions[i].id); } } if (BuildCraftCore.itemBptProps[pipe.itemID] != null) - BuildCraftCore.itemBptProps[pipe.itemID].initializeFromWorld( - bptSlot, context, x, y, z); + BuildCraftCore.itemBptProps[pipe.itemID].initializeFromWorld(bptSlot, context, x, y, z); } } diff --git a/common/net/minecraft/src/buildcraft/transport/BptItemPipeDiamond.java b/common/net/minecraft/src/buildcraft/transport/BptItemPipeDiamond.java index b6e25026..0858b183 100644 --- a/common/net/minecraft/src/buildcraft/transport/BptItemPipeDiamond.java +++ b/common/net/minecraft/src/buildcraft/transport/BptItemPipeDiamond.java @@ -21,12 +21,10 @@ import net.minecraft.src.buildcraft.core.BptItem; public class BptItemPipeDiamond extends BptItem { - public BptItemPipeDiamond() { - } + public BptItemPipeDiamond() {} @Override - public void addRequirements(BptSlotInfo slot, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, LinkedList requirements) { } @@ -50,18 +48,15 @@ public class BptItemPipeDiamond extends BptItem { } @Override - public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, - int x, int y, int z) { - IInventory inventory = (IInventory) context.world().getBlockTileEntity( - x, y, z); + public void initializeFromWorld(BptSlotInfo bptSlot, IBptContext context, int x, int y, int z) { + IInventory inventory = (IInventory) context.world().getBlockTileEntity(x, y, z); BptBlockUtils.initializeInventoryContents(bptSlot, context, inventory); } @Override public void buildBlock(BptSlotInfo slot, IBptContext context) { - IInventory inventory = (IInventory) context.world().getBlockTileEntity( - slot.x, slot.y, slot.z); + IInventory inventory = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); BptBlockUtils.buildInventoryContents(slot, context, inventory); } diff --git a/common/net/minecraft/src/buildcraft/transport/BptItemPipeIron.java b/common/net/minecraft/src/buildcraft/transport/BptItemPipeIron.java index 47b1433c..60102f6d 100644 --- a/common/net/minecraft/src/buildcraft/transport/BptItemPipeIron.java +++ b/common/net/minecraft/src/buildcraft/transport/BptItemPipeIron.java @@ -24,8 +24,7 @@ public class BptItemPipeIron extends BptItem { } @Override - public void addRequirements(BptSlotInfo slot, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, LinkedList requirements) { } @@ -39,8 +38,7 @@ public class BptItemPipeIron extends BptItem { int orientation = slot.meta & 7; int others = slot.meta - orientation; - slot.meta = Orientations.values()[orientation].rotateLeft().ordinal() - + others; + slot.meta = Orientations.values()[orientation].rotateLeft().ordinal() + others; } } diff --git a/common/net/minecraft/src/buildcraft/transport/BptItemPipeWodden.java b/common/net/minecraft/src/buildcraft/transport/BptItemPipeWodden.java index 1d2f8e84..af12d894 100644 --- a/common/net/minecraft/src/buildcraft/transport/BptItemPipeWodden.java +++ b/common/net/minecraft/src/buildcraft/transport/BptItemPipeWodden.java @@ -24,8 +24,7 @@ public class BptItemPipeWodden extends BptItem { } @Override - public void addRequirements(BptSlotInfo slot, - LinkedList requirements) { + public void addRequirements(BptSlotInfo slot, LinkedList requirements) { } @@ -39,8 +38,7 @@ public class BptItemPipeWodden extends BptItem { int orientation = slot.meta & 7; int others = slot.meta - orientation; - slot.meta = Orientations.values()[orientation].rotateLeft().ordinal() - + others; + slot.meta = Orientations.values()[orientation].rotateLeft().ordinal() + others; } } diff --git a/common/net/minecraft/src/buildcraft/transport/CraftingDiamondPipe.java b/common/net/minecraft/src/buildcraft/transport/CraftingDiamondPipe.java index 35eab981..e912a9e7 100644 --- a/common/net/minecraft/src/buildcraft/transport/CraftingDiamondPipe.java +++ b/common/net/minecraft/src/buildcraft/transport/CraftingDiamondPipe.java @@ -19,16 +19,14 @@ class CraftingDiamondPipe extends BuildCraftContainer { IInventory playerIInventory; IInventory filterIInventory; - public CraftingDiamondPipe(IInventory playerInventory, - IInventory filterInventory) { + public CraftingDiamondPipe(IInventory playerInventory, IInventory filterInventory) { super(filterInventory); this.playerIInventory = playerInventory; this.filterIInventory = filterInventory; for (int l = 0; l < 3; l++) for (int k1 = 0; k1 < 9; k1++) - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 140 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 140 + l * 18)); for (int i1 = 0; i1 < 9; i1++) addSlot(new Slot(playerInventory, i1, 8 + i1 * 18, 198)); diff --git a/common/net/minecraft/src/buildcraft/transport/CraftingGateInterface.java b/common/net/minecraft/src/buildcraft/transport/CraftingGateInterface.java index c0943875..23a306b5 100644 --- a/common/net/minecraft/src/buildcraft/transport/CraftingGateInterface.java +++ b/common/net/minecraft/src/buildcraft/transport/CraftingGateInterface.java @@ -49,8 +49,7 @@ public class CraftingGateInterface extends BuildCraftContainer { for (int l = 0; l < 3; l++) for (int k1 = 0; k1 < 9; k1++) - addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, - 123 + l * 18)); + addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 123 + l * 18)); for (int i1 = 0; i1 < 9; i1++) addSlot(new Slot(playerInventory, i1, 8 + i1 * 18, 181)); @@ -64,24 +63,19 @@ public class CraftingGateInterface extends BuildCraftContainer { _potentialTriggers.addAll(BuildCraftAPI.getPipeTriggers(pipe)); for (Orientations o : Orientations.dirs()) { - Position pos = new Position(pipe.xCoord, pipe.yCoord, - pipe.zCoord, o); + Position pos = new Position(pipe.xCoord, pipe.yCoord, pipe.zCoord, o); pos.moveForwards(1.0); - TileEntity tile = pipe.worldObj.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); - int blockID = pipe.worldObj.getBlockId((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tile = pipe.worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); + int blockID = pipe.worldObj.getBlockId((int) pos.x, (int) pos.y, (int) pos.z); Block block = Block.blocksList[blockID]; - LinkedList nearbyTriggers = BuildCraftAPI - .getNeighborTriggers(block, tile); + LinkedList nearbyTriggers = BuildCraftAPI.getNeighborTriggers(block, tile); for (Trigger t : nearbyTriggers) if (!_potentialTriggers.contains(t)) _potentialTriggers.add(t); - LinkedList nearbyActions = BuildCraftAPI - .getNeighborActions(block, tile); + LinkedList nearbyActions = BuildCraftAPI.getNeighborActions(block, tile); for (Action a : nearbyActions) if (!_potentialActions.contains(a)) @@ -116,8 +110,7 @@ public class CraftingGateInterface extends BuildCraftContainer { int length = packet.payload.intPayload[0]; for (int i = 0; i < length; i++) - _potentialActions - .add(BuildCraftAPI.actions[packet.payload.intPayload[i + 1]]); + _potentialActions.add(BuildCraftAPI.actions[packet.payload.intPayload[i + 1]]); } @@ -131,8 +124,7 @@ public class CraftingGateInterface extends BuildCraftContainer { int length = packet.payload.intPayload[0]; for (int i = 0; i < length; i++) - _potentialTriggers - .add(BuildCraftAPI.triggers[packet.payload.intPayload[i + 1]]); + _potentialTriggers.add(BuildCraftAPI.triggers[packet.payload.intPayload[i + 1]]); } /** @@ -144,10 +136,8 @@ public class CraftingGateInterface extends BuildCraftContainer { PacketPayload payload = packet.payload; int position = payload.intPayload[0]; - if (payload.intPayload[1] >= 0 - && payload.intPayload[1] < BuildCraftAPI.triggers.length) { - setTrigger(position, BuildCraftAPI.triggers[payload.intPayload[1]], - false); + if (payload.intPayload[1] >= 0 && payload.intPayload[1] < BuildCraftAPI.triggers.length) { + setTrigger(position, BuildCraftAPI.triggers[payload.intPayload[1]], false); // System.out.println("Trigger["+ position + "]: " + // pipe.activatedTriggers[position].getDescription()); } else { @@ -155,10 +145,8 @@ public class CraftingGateInterface extends BuildCraftContainer { // System.out.println("Trigger["+ position + "] clear!"); } - if (payload.intPayload[2] >= 0 - && payload.intPayload[2] < BuildCraftAPI.actions.length) { - setAction(position, BuildCraftAPI.actions[payload.intPayload[2]], - false); + if (payload.intPayload[2] >= 0 && payload.intPayload[2] < BuildCraftAPI.actions.length) { + setAction(position, BuildCraftAPI.actions[payload.intPayload[2]], false); // System.out.println("Action["+ position + "]: " + // pipe.activatedActions[position].getDescription()); } else { @@ -173,8 +161,7 @@ public class CraftingGateInterface extends BuildCraftContainer { } TriggerParameter param = new TriggerParameter(); - param.set(new ItemStack(itemID, payload.intPayload[4], - payload.intPayload[5])); + param.set(new ItemStack(itemID, payload.intPayload[4], payload.intPayload[5])); setTriggerParameter(position, param, false); } @@ -193,17 +180,14 @@ public class CraftingGateInterface extends BuildCraftContainer { else payload.intPayload[2] = -1; - if (pipe.triggerParameters[position] != null - && pipe.triggerParameters[position].stack != null) { + if (pipe.triggerParameters[position] != null && pipe.triggerParameters[position].stack != null) { payload.intPayload[3] = pipe.triggerParameters[position].stack.itemID; payload.intPayload[4] = pipe.triggerParameters[position].stack.stackSize; - payload.intPayload[5] = pipe.triggerParameters[position].stack - .getItemDamage(); + payload.intPayload[5] = pipe.triggerParameters[position].stack.getItemDamage(); } - CoreProxy.sendToServer(new PacketUpdate( - PacketIds.GATE_SELECTION_CHANGE, pipe.xCoord, pipe.yCoord, - pipe.zCoord, payload).getPacket()); + CoreProxy.sendToServer(new PacketUpdate(PacketIds.GATE_SELECTION_CHANGE, pipe.xCoord, pipe.yCoord, pipe.zCoord, payload) + .getPacket()); } /** @@ -214,16 +198,14 @@ public class CraftingGateInterface extends BuildCraftContainer { if (!isNetInitialized && APIProxy.isRemote()) { isNetInitialized = true; - CoreProxy.sendToServer(new PacketCoordinates( - PacketIds.GATE_REQUEST_INIT, pipe.xCoord, pipe.yCoord, - pipe.zCoord).getPacket()); + CoreProxy.sendToServer(new PacketCoordinates(PacketIds.GATE_REQUEST_INIT, pipe.xCoord, pipe.yCoord, pipe.zCoord) + .getPacket()); } if (!isSynchronized && APIProxy.isRemote()) { isSynchronized = true; - CoreProxy.sendToServer(new PacketCoordinates( - PacketIds.GATE_REQUEST_SELECTION, pipe.xCoord, pipe.yCoord, - pipe.zCoord).getPacket()); + CoreProxy.sendToServer(new PacketCoordinates(PacketIds.GATE_REQUEST_SELECTION, pipe.xCoord, pipe.yCoord, pipe.zCoord) + .getPacket()); } } @@ -240,10 +222,8 @@ public class CraftingGateInterface extends BuildCraftContainer { PacketPayload payload = packet.payload; int position = payload.intPayload[0]; - if (payload.intPayload[1] >= 0 - && payload.intPayload[1] < BuildCraftAPI.triggers.length) { - setTrigger(position, BuildCraftAPI.triggers[payload.intPayload[1]], - true); + if (payload.intPayload[1] >= 0 && payload.intPayload[1] < BuildCraftAPI.triggers.length) { + setTrigger(position, BuildCraftAPI.triggers[payload.intPayload[1]], true); // System.out.println("Trigger["+ position + "]: " + // pipe.activatedTriggers[position].getDescription()); } else { @@ -251,10 +231,8 @@ public class CraftingGateInterface extends BuildCraftContainer { // System.out.println("Trigger["+ position + "] clear!"); } - if (payload.intPayload[2] >= 0 - && payload.intPayload[2] < BuildCraftAPI.actions.length) { - setAction(position, BuildCraftAPI.actions[payload.intPayload[2]], - true); + if (payload.intPayload[2] >= 0 && payload.intPayload[2] < BuildCraftAPI.actions.length) { + setAction(position, BuildCraftAPI.actions[payload.intPayload[2]], true); // System.out.println("Action["+ position + "]: " + // pipe.activatedActions[position].getDescription()); } else { @@ -269,8 +247,7 @@ public class CraftingGateInterface extends BuildCraftContainer { } TriggerParameter param = new TriggerParameter(); - param.set(new ItemStack(itemID, payload.intPayload[4], - payload.intPayload[5])); + param.set(new ItemStack(itemID, payload.intPayload[4], payload.intPayload[5])); setTriggerParameter(position, param, true); } @@ -289,8 +266,7 @@ public class CraftingGateInterface extends BuildCraftContainer { for (int i = 0; i < length; i++) payload.intPayload[i + 1] = _potentialActions.get(i).id; - PacketUpdate packet = new PacketUpdate(PacketIds.GATE_ACTIONS, - pipe.xCoord, pipe.yCoord, pipe.zCoord, payload); + PacketUpdate packet = new PacketUpdate(PacketIds.GATE_ACTIONS, pipe.xCoord, pipe.yCoord, pipe.zCoord, payload); // Send to player CoreProxy.sendToPlayer(player, packet); @@ -311,8 +287,7 @@ public class CraftingGateInterface extends BuildCraftContainer { for (int i = 0; i < length; i++) payload.intPayload[i + 1] = _potentialTriggers.get(i).id; - PacketUpdate packet = new PacketUpdate(PacketIds.GATE_TRIGGERS, - pipe.xCoord, pipe.yCoord, pipe.zCoord, payload); + PacketUpdate packet = new PacketUpdate(PacketIds.GATE_TRIGGERS, pipe.xCoord, pipe.yCoord, pipe.zCoord, payload); // Send to player CoreProxy.sendToPlayer(player, packet); @@ -360,17 +335,14 @@ public class CraftingGateInterface extends BuildCraftContainer { else payload.intPayload[2] = -1; - if (pipe.triggerParameters[position] != null - && pipe.triggerParameters[position].stack != null) { + if (pipe.triggerParameters[position] != null && pipe.triggerParameters[position].stack != null) { payload.intPayload[3] = pipe.triggerParameters[position].stack.itemID; payload.intPayload[4] = pipe.triggerParameters[position].stack.stackSize; - payload.intPayload[5] = pipe.triggerParameters[position].stack - .getItemDamage(); + payload.intPayload[5] = pipe.triggerParameters[position].stack.getItemDamage(); } - CoreProxy.sendToPlayer(player, new PacketUpdate( - PacketIds.GATE_SELECTION, pipe.xCoord, pipe.yCoord, - pipe.zCoord, payload)); + CoreProxy.sendToPlayer(player, new PacketUpdate(PacketIds.GATE_SELECTION, pipe.xCoord, pipe.yCoord, pipe.zCoord, + payload)); } // System.out.println("Sending current selection to player"); @@ -382,22 +354,18 @@ public class CraftingGateInterface extends BuildCraftContainer { } public Trigger getFirstTrigger() { - return _potentialTriggers.size() > 0 ? _potentialTriggers.getFirst() - : null; + return _potentialTriggers.size() > 0 ? _potentialTriggers.getFirst() : null; } public Trigger getLastTrigger() { - return _potentialTriggers.size() > 0 ? _potentialTriggers.getLast() - : null; + return _potentialTriggers.size() > 0 ? _potentialTriggers.getLast() : null; } public Iterator getTriggerIterator(boolean descending) { - return descending ? _potentialTriggers.descendingIterator() - : _potentialTriggers.iterator(); + return descending ? _potentialTriggers.descendingIterator() : _potentialTriggers.iterator(); } - public boolean isNearbyTriggerActive(Trigger trigger, - TriggerParameter parameter) { + public boolean isNearbyTriggerActive(Trigger trigger, TriggerParameter parameter) { return pipe.isNearbyTriggerActive(trigger, parameter); } @@ -407,8 +375,7 @@ public class CraftingGateInterface extends BuildCraftContainer { sendSelectionChange(position); } - public void setTriggerParameter(int position, TriggerParameter parameter, - boolean notify) { + public void setTriggerParameter(int position, TriggerParameter parameter, boolean notify) { pipe.setTriggerParameter(position, parameter); if (APIProxy.isRemote() && notify) sendSelectionChange(position); @@ -420,18 +387,15 @@ public class CraftingGateInterface extends BuildCraftContainer { } public Action getFirstAction() { - return _potentialActions.size() > 0 ? _potentialActions.getFirst() - : null; + return _potentialActions.size() > 0 ? _potentialActions.getFirst() : null; } public Action getLastAction() { - return _potentialActions.size() > 0 ? _potentialActions.getLast() - : null; + return _potentialActions.size() > 0 ? _potentialActions.getLast() : null; } public Iterator getActionIterator(boolean descending) { - return descending ? _potentialActions.descendingIterator() - : _potentialActions.iterator(); + return descending ? _potentialActions.descendingIterator() : _potentialActions.iterator(); } public void setAction(int position, Action action, boolean notify) { diff --git a/common/net/minecraft/src/buildcraft/transport/EnergyPulser.java b/common/net/minecraft/src/buildcraft/transport/EnergyPulser.java index a9fd0241..a2265166 100644 --- a/common/net/minecraft/src/buildcraft/transport/EnergyPulser.java +++ b/common/net/minecraft/src/buildcraft/transport/EnergyPulser.java @@ -32,8 +32,7 @@ public class EnergyPulser { if (progress > 0.5 && progressPart == 1) { progressPart = 2; // Give off energy pulse! - powerReceptor.getPowerProvider().receiveEnergy(1, - Orientations.XNeg); + powerReceptor.getPowerProvider().receiveEnergy(1, Orientations.XNeg); // Heat up if (heat < maxHeat) diff --git a/common/net/minecraft/src/buildcraft/transport/EntityData.java b/common/net/minecraft/src/buildcraft/transport/EntityData.java index 8be518bc..c9bf05b3 100644 --- a/common/net/minecraft/src/buildcraft/transport/EntityData.java +++ b/common/net/minecraft/src/buildcraft/transport/EntityData.java @@ -4,6 +4,7 @@ import net.minecraft.src.buildcraft.api.EntityPassiveItem; import net.minecraft.src.buildcraft.api.Orientations; public class EntityData { + // TODO: Move passive data here too, like position, speed and all? boolean toCenter = true; public EntityPassiveItem item; diff --git a/common/net/minecraft/src/buildcraft/transport/GateVanilla.java b/common/net/minecraft/src/buildcraft/transport/GateVanilla.java index c5c3cd0c..ce7c41c7 100644 --- a/common/net/minecraft/src/buildcraft/transport/GateVanilla.java +++ b/common/net/minecraft/src/buildcraft/transport/GateVanilla.java @@ -50,8 +50,7 @@ public class GateVanilla extends Gate { // Load pulser if any if (nbttagcompound.hasKey("Pulser")) { - NBTTagCompound nbttagcompoundP = nbttagcompound - .getCompoundTag("Pulser"); + NBTTagCompound nbttagcompoundP = nbttagcompound.getCompoundTag("Pulser"); pulser = new EnergyPulser((IPowerReceptor) pipe); pulser.readFromNBT(nbttagcompoundP); } @@ -62,8 +61,7 @@ public class GateVanilla extends Gate { @Override public void openGui(EntityPlayer player) { if (!APIProxy.isClient(player.worldObj)) - player.openGui(mod_BuildCraftTransport.instance, GuiIds.GATES, - pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord); + player.openGui(mod_BuildCraftTransport.instance, GuiIds.GATES, pipe.worldObj, pipe.xCoord, pipe.yCoord, pipe.zCoord); } // / UPDATING @@ -103,11 +101,9 @@ public class GateVanilla extends Gate { @Override public GateConditional getConditional() { - if (kind == GateKind.OR_2 || kind == GateKind.OR_3 - || kind == GateKind.OR_4) + if (kind == GateKind.OR_2 || kind == GateKind.OR_3 || kind == GateKind.OR_4) return GateConditional.OR; - else if (kind == GateKind.AND_2 || kind == GateKind.AND_3 - || kind == GateKind.AND_4) + else if (kind == GateKind.AND_2 || kind == GateKind.AND_3 || kind == GateKind.AND_4) return GateConditional.AND; else return GateConditional.None; @@ -179,20 +175,16 @@ public class GateVanilla extends Gate { @Override public void addActions(LinkedList list) { - if (pipe.wireSet[IPipe.WireColor.Red.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_2.ordinal()) + if (pipe.wireSet[IPipe.WireColor.Red.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_2.ordinal()) list.add(BuildCraftTransport.actionRedSignal); - if (pipe.wireSet[IPipe.WireColor.Blue.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_3.ordinal()) + if (pipe.wireSet[IPipe.WireColor.Blue.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_3.ordinal()) list.add(BuildCraftTransport.actionBlueSignal); - if (pipe.wireSet[IPipe.WireColor.Green.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) + if (pipe.wireSet[IPipe.WireColor.Green.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) list.add(BuildCraftTransport.actionGreenSignal); - if (pipe.wireSet[IPipe.WireColor.Yellow.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) + if (pipe.wireSet[IPipe.WireColor.Yellow.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) list.add(BuildCraftTransport.actionYellowSignal); if (hasPulser()) @@ -221,26 +213,22 @@ public class GateVanilla extends Gate { @Override public void addTrigger(LinkedList list) { - if (pipe.wireSet[IPipe.WireColor.Red.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_2.ordinal()) { + if (pipe.wireSet[IPipe.WireColor.Red.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_2.ordinal()) { list.add(BuildCraftTransport.triggerRedSignalActive); list.add(BuildCraftTransport.triggerRedSignalInactive); } - if (pipe.wireSet[IPipe.WireColor.Blue.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_3.ordinal()) { + if (pipe.wireSet[IPipe.WireColor.Blue.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_3.ordinal()) { list.add(BuildCraftTransport.triggerBlueSignalActive); list.add(BuildCraftTransport.triggerBlueSignalInactive); } - if (pipe.wireSet[IPipe.WireColor.Green.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) { + if (pipe.wireSet[IPipe.WireColor.Green.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) { list.add(BuildCraftTransport.triggerGreenSignalActive); list.add(BuildCraftTransport.triggerGreenSignalInactive); } - if (pipe.wireSet[IPipe.WireColor.Yellow.ordinal()] - && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) { + if (pipe.wireSet[IPipe.WireColor.Yellow.ordinal()] && kind.ordinal() >= Gate.GateKind.AND_4.ordinal()) { list.add(BuildCraftTransport.triggerYellowSignalActive); list.add(BuildCraftTransport.triggerYellowSignalInactive); } diff --git a/common/net/minecraft/src/buildcraft/transport/IItemTravelingHook.java b/common/net/minecraft/src/buildcraft/transport/IItemTravelingHook.java index f2acdc5b..bfc9cb94 100644 --- a/common/net/minecraft/src/buildcraft/transport/IItemTravelingHook.java +++ b/common/net/minecraft/src/buildcraft/transport/IItemTravelingHook.java @@ -8,7 +8,6 @@ public interface IItemTravelingHook { public void centerReached(PipeTransportItems pipe, EntityData data); - public void endReached(PipeTransportItems pipe, EntityData data, - TileEntity tile); + public void endReached(PipeTransportItems pipe, EntityData data, TileEntity tile); } diff --git a/common/net/minecraft/src/buildcraft/transport/IPipeTransportItemsHook.java b/common/net/minecraft/src/buildcraft/transport/IPipeTransportItemsHook.java index f5ec1f87..7c905921 100644 --- a/common/net/minecraft/src/buildcraft/transport/IPipeTransportItemsHook.java +++ b/common/net/minecraft/src/buildcraft/transport/IPipeTransportItemsHook.java @@ -16,8 +16,8 @@ import net.minecraft.src.buildcraft.api.Orientations; import net.minecraft.src.buildcraft.api.Position; public interface IPipeTransportItemsHook { - public LinkedList filterPossibleMovements( - LinkedList possibleOrientations, Position pos, + + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityPassiveItem item); public void entityEntered(EntityPassiveItem item, Orientations orientation); diff --git a/common/net/minecraft/src/buildcraft/transport/IPipeTransportLiquidsHook.java b/common/net/minecraft/src/buildcraft/transport/IPipeTransportLiquidsHook.java index c222c372..c7e4e271 100644 --- a/common/net/minecraft/src/buildcraft/transport/IPipeTransportLiquidsHook.java +++ b/common/net/minecraft/src/buildcraft/transport/IPipeTransportLiquidsHook.java @@ -12,5 +12,6 @@ package net.minecraft.src.buildcraft.transport; import net.minecraft.src.buildcraft.api.Orientations; public interface IPipeTransportLiquidsHook { + public int fill(Orientations from, int quantity, int id, boolean doFill); } diff --git a/common/net/minecraft/src/buildcraft/transport/IPipeTransportPowerHook.java b/common/net/minecraft/src/buildcraft/transport/IPipeTransportPowerHook.java index c79e421d..b628463d 100644 --- a/common/net/minecraft/src/buildcraft/transport/IPipeTransportPowerHook.java +++ b/common/net/minecraft/src/buildcraft/transport/IPipeTransportPowerHook.java @@ -12,6 +12,7 @@ package net.minecraft.src.buildcraft.transport; import net.minecraft.src.buildcraft.api.Orientations; public interface IPipeTransportPowerHook { + public void receiveEnergy(Orientations from, double val); public void requestEnergy(Orientations from, int i); diff --git a/common/net/minecraft/src/buildcraft/transport/ItemGate.java b/common/net/minecraft/src/buildcraft/transport/ItemGate.java index a7226e9e..8e6ae177 100644 --- a/common/net/minecraft/src/buildcraft/transport/ItemGate.java +++ b/common/net/minecraft/src/buildcraft/transport/ItemGate.java @@ -47,8 +47,7 @@ public class ItemGate extends ItemBuildCraft { @Override public String getItemNameIS(ItemStack itemstack) { - return (new StringBuilder()).append(super.getItemName()).append(".") - .append(itemstack.getItemDamage()).toString(); + return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString(); } @SuppressWarnings({ "rawtypes", "unchecked" }) diff --git a/common/net/minecraft/src/buildcraft/transport/ItemPipe.java b/common/net/minecraft/src/buildcraft/transport/ItemPipe.java index 0a4cbcfc..e045eaa7 100644 --- a/common/net/minecraft/src/buildcraft/transport/ItemPipe.java +++ b/common/net/minecraft/src/buildcraft/transport/ItemPipe.java @@ -27,8 +27,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe { } @Override - public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, - World world, int i, int j, int k, int l) { + public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) { int blockID = BuildCraftTransport.genericPipeBlock.blockID; if (world.getBlockId(i, j, k) == Block.snow.blockID) @@ -53,8 +52,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe { BlockGenericPipe.createPipe(world, i, j, k, shiftedIndex); if (world.setBlockAndMetadataWithNotify(i, j, k, blockID, 0)) { Block.blocksList[blockID].onBlockPlaced(world, i, j, k, l); - Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, - entityplayer); + 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(), diff --git a/common/net/minecraft/src/buildcraft/transport/LegacyTile.java b/common/net/minecraft/src/buildcraft/transport/LegacyTile.java index 2861146a..78a2eac0 100644 --- a/common/net/minecraft/src/buildcraft/transport/LegacyTile.java +++ b/common/net/minecraft/src/buildcraft/transport/LegacyTile.java @@ -18,12 +18,10 @@ public class LegacyTile extends TileEntity { @Override public void updateEntity() { int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); - int pipeId = ((LegacyBlock) Block.blocksList[worldObj.getBlockId( - xCoord, yCoord, zCoord)]).newPipeId; + int pipeId = ((LegacyBlock) Block.blocksList[worldObj.getBlockId(xCoord, yCoord, zCoord)]).newPipeId; BlockGenericPipe.createPipe(worldObj, xCoord, yCoord, zCoord, pipeId); - worldObj.setBlockAndMetadataWithNotify(xCoord, yCoord, zCoord, - BuildCraftTransport.genericPipeBlock.blockID, meta); + worldObj.setBlockAndMetadataWithNotify(xCoord, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID, meta); } } diff --git a/common/net/minecraft/src/buildcraft/transport/Pipe.java b/common/net/minecraft/src/buildcraft/transport/Pipe.java index dad526bd..6873a614 100644 --- a/common/net/minecraft/src/buildcraft/transport/Pipe.java +++ b/common/net/minecraft/src/buildcraft/transport/Pipe.java @@ -41,8 +41,7 @@ import net.minecraft.src.buildcraft.core.network.PacketUpdate; import net.minecraft.src.buildcraft.core.network.TilePacketWrapper; import net.minecraft.src.buildcraft.transport.Gate.GateConditional; -public class Pipe extends PersistentTile implements IPipe, - IDropControlInventory { +public class Pipe extends PersistentTile implements IPipe, IDropControlInventory { public int[] signalStrength = new int[] { 0, 0, 0, 0 }; @@ -73,8 +72,7 @@ public class Pipe extends PersistentTile implements IPipe, Action[] activatedActions = new Action[8]; @TileNetworkData(intKind = TileNetworkData.UNSIGNED_BYTE) - public boolean broadcastSignal[] = new boolean[] { false, false, false, - false }; + public boolean broadcastSignal[] = new boolean[] { false, false, false, false }; public boolean broadcastRedstone = false; public SafeTimeTracker actionTracker = new SafeTimeTracker(); @@ -86,8 +84,7 @@ public class Pipe extends PersistentTile implements IPipe, if (!networkWrappers.containsKey(this.getClass())) networkWrappers - .put(this.getClass(), new TilePacketWrapper(new Class[] { - TileGenericPipe.class, this.transport.getClass(), + .put(this.getClass(), new TilePacketWrapper(new Class[] { TileGenericPipe.class, this.transport.getClass(), this.logic.getClass() })); this.networkPacket = networkWrappers.get(this.getClass()); @@ -123,8 +120,7 @@ public class Pipe extends PersistentTile implements IPipe, setPosition(tile.xCoord, tile.yCoord, tile.zCoord); } - public boolean blockActivated(World world, int i, int j, int k, - EntityPlayer entityplayer) { + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) { return logic.blockActivated(entityplayer); } @@ -227,10 +223,8 @@ public class Pipe extends PersistentTile implements IPipe, nbttagcompound.setBoolean("wireSet[" + i + "]", wireSet[i]); for (int i = 0; i < 8; ++i) { - nbttagcompound.setInteger("action[" + i + "]", - activatedActions[i] != null ? activatedActions[i].id : 0); - nbttagcompound.setInteger("trigger[" + i + "]", - activatedTriggers[i] != null ? activatedTriggers[i].id : 0); + nbttagcompound.setInteger("action[" + i + "]", activatedActions[i] != null ? activatedActions[i].id : 0); + nbttagcompound.setInteger("trigger[" + i + "]", activatedTriggers[i] != null ? activatedTriggers[i].id : 0); } for (int i = 0; i < 8; ++i) @@ -247,14 +241,12 @@ public class Pipe extends PersistentTile implements IPipe, // Load pulser if any if (nbttagcompound.hasKey("Gate")) { - NBTTagCompound nbttagcompoundP = nbttagcompound - .getCompoundTag("Gate"); + NBTTagCompound nbttagcompoundP = nbttagcompound.getCompoundTag("Gate"); gate = new GateVanilla(this); gate.readFromNBT(nbttagcompoundP); } else if (nbttagcompound.hasKey("gateKind")) { // Legacy implementation - Gate.GateKind kind = Gate.GateKind.values()[nbttagcompound - .getInteger("gateKind")]; + Gate.GateKind kind = Gate.GateKind.values()[nbttagcompound.getInteger("gateKind")]; if (kind != Gate.GateKind.None) { gate = new GateVanilla(this); gate.kind = kind; @@ -265,17 +257,14 @@ public class Pipe extends PersistentTile implements IPipe, wireSet[i] = nbttagcompound.getBoolean("wireSet[" + i + "]"); for (int i = 0; i < 8; ++i) { - activatedActions[i] = BuildCraftAPI.actions[nbttagcompound - .getInteger("action[" + i + "]")]; - activatedTriggers[i] = BuildCraftAPI.triggers[nbttagcompound - .getInteger("trigger[" + i + "]")]; + activatedActions[i] = BuildCraftAPI.actions[nbttagcompound.getInteger("action[" + i + "]")]; + activatedTriggers[i] = BuildCraftAPI.triggers[nbttagcompound.getInteger("trigger[" + i + "]")]; } for (int i = 0; i < 8; ++i) if (nbttagcompound.hasKey("triggerParameters[" + i + "]")) { triggerParameters[i] = new TriggerParameter(); - triggerParameters[i].readFromNBT(nbttagcompound - .getCompoundTag("triggerParameters[" + i + "]")); + triggerParameters[i].readFromNBT(nbttagcompound.getCompoundTag("triggerParameters[" + i + "]")); } } @@ -301,9 +290,7 @@ public class Pipe extends PersistentTile implements IPipe, if (BlockGenericPipe.isFullyDefined(tilePipe.pipe)) if (isWireConnectedTo(tile, color)) - foundBiggerSignal |= receiveSignal( - tilePipe.pipe.signalStrength[color.ordinal()] - 1, - color); + foundBiggerSignal |= receiveSignal(tilePipe.pipe.signalStrength[color.ordinal()] - 1, color); } } @@ -349,11 +336,9 @@ public class Pipe extends PersistentTile implements IPipe, if (tile instanceof TileGenericPipe) { TileGenericPipe tilePipe = (TileGenericPipe) tile; - if (BlockGenericPipe.isFullyDefined(tilePipe.pipe) - && tilePipe.pipe.wireSet[color.ordinal()]) + if (BlockGenericPipe.isFullyDefined(tilePipe.pipe) && tilePipe.pipe.wireSet[color.ordinal()]) if (isWireConnectedTo(tile, color)) - tilePipe.pipe.receiveSignal( - signalStrength[color.ordinal()] - 1, color); + tilePipe.pipe.receiveSignal(signalStrength[color.ordinal()] - 1, color); } } } @@ -389,8 +374,7 @@ public class Pipe extends PersistentTile implements IPipe, } public PacketPayload getNetworkPacket() { - PacketPayload payload = networkPacket.toPayload(xCoord, yCoord, zCoord, - new Object[] { container, transport, logic }); + PacketPayload payload = networkPacket.toPayload(xCoord, yCoord, zCoord, new Object[] { container, transport, logic }); return payload; } @@ -402,8 +386,7 @@ public class Pipe extends PersistentTile implements IPipe, * @param packet */ public void handlePacket(PacketUpdate packet) { - networkPacket.fromPayload(new Object[] { container, transport, logic }, - packet.payload); + networkPacket.fromPayload(new Object[] { container, transport, logic }, packet.payload); } /** @@ -438,8 +421,7 @@ public class Pipe extends PersistentTile implements IPipe, Orientations o = Orientations.values()[l].reverse(); TileEntity tile = container.getTile(o); - if (tile instanceof TileGenericPipe - && Utils.checkPipesConnections(this.container, tile)) + if (tile instanceof TileGenericPipe && Utils.checkPipesConnections(this.container, tile)) return false; return true; @@ -449,8 +431,7 @@ public class Pipe extends PersistentTile implements IPipe, return isPoweringTo(l); } - public void randomDisplayTick(Random random) { - } + public void randomDisplayTick(Random random) {} private DrawingState drawingState = DrawingState.DrawingPipe; @@ -484,20 +465,16 @@ public class Pipe extends PersistentTile implements IPipe, public void onBlockRemoval() { if (wireSet[IPipe.WireColor.Red.ordinal()]) - Utils.dropItems(worldObj, new ItemStack( - BuildCraftTransport.redPipeWire), xCoord, yCoord, zCoord); + Utils.dropItems(worldObj, new ItemStack(BuildCraftTransport.redPipeWire), xCoord, yCoord, zCoord); if (wireSet[IPipe.WireColor.Blue.ordinal()]) - Utils.dropItems(worldObj, new ItemStack( - BuildCraftTransport.bluePipeWire), xCoord, yCoord, zCoord); + Utils.dropItems(worldObj, new ItemStack(BuildCraftTransport.bluePipeWire), xCoord, yCoord, zCoord); if (wireSet[IPipe.WireColor.Green.ordinal()]) - Utils.dropItems(worldObj, new ItemStack( - BuildCraftTransport.greenPipeWire), xCoord, yCoord, zCoord); + Utils.dropItems(worldObj, new ItemStack(BuildCraftTransport.greenPipeWire), xCoord, yCoord, zCoord); if (wireSet[IPipe.WireColor.Yellow.ordinal()]) - Utils.dropItems(worldObj, new ItemStack( - BuildCraftTransport.yellowPipeWire), xCoord, yCoord, zCoord); + Utils.dropItems(worldObj, new ItemStack(BuildCraftTransport.yellowPipeWire), xCoord, yCoord, zCoord); if (hasGate()) gate.dropGate(worldObj, xCoord, yCoord, zCoord); @@ -519,16 +496,14 @@ public class Pipe extends PersistentTile implements IPipe, return triggerParameters[position]; } - public boolean isNearbyTriggerActive(Trigger trigger, - TriggerParameter parameter) { + public boolean isNearbyTriggerActive(Trigger trigger, TriggerParameter parameter) { if (trigger instanceof ITriggerPipe) return ((ITriggerPipe) trigger).isTriggerActive(this, parameter); else if (trigger != null) for (Orientations o : Orientations.dirs()) { TileEntity tile = container.getTile(o); - if (tile != null && !(tile instanceof TileGenericPipe) - && trigger.isTriggerActive(tile, parameter)) + if (tile != null && !(tile instanceof TileGenericPipe) && trigger.isTriggerActive(tile, parameter)) return true; } @@ -585,14 +560,11 @@ public class Pipe extends PersistentTile implements IPipe, if (trigger != null && action != null) if (!actions.containsKey(action.id)) - actions.put(action.id, - isNearbyTriggerActive(trigger, parameter)); + actions.put(action.id, isNearbyTriggerActive(trigger, parameter)); else if (gate.getConditional() == GateConditional.AND) - actions.put(action.id, actions.get(action.id) - && isNearbyTriggerActive(trigger, parameter)); + actions.put(action.id, actions.get(action.id) && isNearbyTriggerActive(trigger, parameter)); else - actions.put(action.id, actions.get(action.id) - || isNearbyTriggerActive(trigger, parameter)); + actions.put(action.id, actions.get(action.id) || isNearbyTriggerActive(trigger, parameter)); } // Activate the actions @@ -606,13 +578,11 @@ public class Pipe extends PersistentTile implements IPipe, if (BuildCraftAPI.actions[i] instanceof ActionRedstoneOutput) broadcastRedstone = true; else if (BuildCraftAPI.actions[i] instanceof ActionSignalOutput) - broadcastSignal[((ActionSignalOutput) BuildCraftAPI.actions[i]).color - .ordinal()] = true; + broadcastSignal[((ActionSignalOutput) BuildCraftAPI.actions[i]).color.ordinal()] = true; else for (int a = 0; a < container.tileBuffer.length; ++a) if (container.tileBuffer[a].getTile() instanceof IActionReceptor) { - IActionReceptor recept = (IActionReceptor) container.tileBuffer[a] - .getTile(); + IActionReceptor recept = (IActionReceptor) container.tileBuffer[a].getTile(); recept.actionActivated(BuildCraftAPI.actions[i]); } } @@ -621,8 +591,7 @@ public class Pipe extends PersistentTile implements IPipe, if (oldBroadcastRedstone != broadcastRedstone) { worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, - BuildCraftTransport.genericPipeBlock.blockID); + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID); } for (int i = 0; i < oldBroadcastSignal.length; ++i) @@ -655,9 +624,8 @@ public class Pipe extends PersistentTile implements IPipe, if (!tilePipe.pipe.wireSet[color.ordinal()]) return false; - return (tilePipe.pipe.transport instanceof PipeTransportStructure - || transport instanceof PipeTransportStructure || Utils - .checkPipesConnections(container, tile)); + return (tilePipe.pipe.transport instanceof PipeTransportStructure || transport instanceof PipeTransportStructure || Utils + .checkPipesConnections(container, tile)); } public void dropContents() { diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicCobblestone.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicCobblestone.java index c618baef..dc77eca5 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeLogicCobblestone.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicCobblestone.java @@ -24,8 +24,7 @@ public class PipeLogicCobblestone extends PipeLogic { if (BuildCraftTransport.alwaysConnectPipes) return super.isPipeConnected(tile); else - return (pipe2 == null || !(pipe2.logic instanceof PipeLogicStone)) - && super.isPipeConnected(tile); + return (pipe2 == null || !(pipe2.logic instanceof PipeLogicStone)) && super.isPipeConnected(tile); } } diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicDiamond.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicDiamond.java index 4c28d4ff..5e6bf915 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeLogicDiamond.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicDiamond.java @@ -33,6 +33,7 @@ public class PipeLogicDiamond extends PipeLogic { ItemStack[] items = new ItemStack[54]; public class PacketStack { + @TileNetworkData(intKind = TileNetworkData.UNSIGNED_BYTE) public int num; @@ -49,8 +50,7 @@ public class PipeLogicDiamond extends PipeLogic { public PipeLogicDiamond() { if (networkPacket == null) - networkPacket = new TilePacketWrapper( - new Class[] { PacketStack.class }); + networkPacket = new TilePacketWrapper(new Class[] { PacketStack.class }); } @Override @@ -61,8 +61,7 @@ public class PipeLogicDiamond extends PipeLogic { return false; if (!APIProxy.isClient(container.worldObj)) - entityplayer.openGui(mod_BuildCraftTransport.instance, - GuiIds.PIPE_DIAMOND, container.worldObj, container.xCoord, + entityplayer.openGui(mod_BuildCraftTransport.instance, GuiIds.PIPE_DIAMOND, container.worldObj, container.xCoord, container.yCoord, container.zCoord); return true; @@ -90,9 +89,8 @@ public class PipeLogicDiamond extends PipeLogic { if (APIProxy.isServerSide()) for (int p = 0; p < 6; ++p) - CoreProxy.sendToPlayers(getContentsPacket(p), worldObj, xCoord, - yCoord, zCoord, DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftTransport.instance); + CoreProxy.sendToPlayers(getContentsPacket(p), worldObj, xCoord, yCoord, zCoord, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftTransport.instance); return stack; } @@ -101,8 +99,7 @@ public class PipeLogicDiamond extends PipeLogic { public void setInventorySlotContents(int i, ItemStack itemstack) { if (items[i] == null && itemstack == null) return; - else if (items[i] != null && itemstack != null - && items[i].isStackEqual(itemstack)) + else if (items[i] != null && itemstack != null && items[i].isStackEqual(itemstack)) return; if (itemstack != null) @@ -112,9 +109,8 @@ public class PipeLogicDiamond extends PipeLogic { if (APIProxy.isServerSide()) for (int p = 0; p < 6; ++p) - CoreProxy.sendToPlayers(getContentsPacket(p), worldObj, xCoord, - yCoord, zCoord, DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftTransport.instance); + CoreProxy.sendToPlayers(getContentsPacket(p), worldObj, xCoord, yCoord, zCoord, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftTransport.instance); } @Override @@ -122,10 +118,8 @@ public class PipeLogicDiamond extends PipeLogic { if (tracker.markTimeIfDelay(worldObj, 20 * BuildCraftCore.updateFactor)) if (APIProxy.isServerSide()) for (int p = 0; p < 6; ++p) - CoreProxy.sendToPlayers(getContentsPacket(p), worldObj, - xCoord, yCoord, zCoord, - DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftTransport.instance); + CoreProxy.sendToPlayers(getContentsPacket(p), worldObj, xCoord, yCoord, zCoord, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftTransport.instance); } @Override @@ -151,8 +145,7 @@ public class PipeLogicDiamond extends PipeLogic { NBTTagList nbttaglist = nbttagcompound.getTagList("items"); for (int j = 0; j < nbttaglist.tagCount(); ++j) { - NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist - .tagAt(j); + NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist.tagAt(j); int index = nbttagcompound2.getInteger("index"); items[index] = ItemStack.loadItemStackFromNBT(nbttagcompound2); } @@ -199,8 +192,8 @@ public class PipeLogicDiamond extends PipeLogic { stacks.dmg[j] = items[j + num * 9].getItemDamage(); } - return new PacketUpdate(PacketIds.DIAMOND_PIPE_CONTENTS, xCoord, - yCoord, zCoord, networkPacket.toPayload(stacks)).getPacket(); + return new PacketUpdate(PacketIds.DIAMOND_PIPE_CONTENTS, xCoord, yCoord, zCoord, networkPacket.toPayload(stacks)) + .getPacket(); } @@ -216,8 +209,7 @@ public class PipeLogicDiamond extends PipeLogic { if (stacks.ids[j] == -1) items[num * 9 + j] = null; else - items[num * 9 + j] = new ItemStack(stacks.ids[j], 1, - stacks.dmg[j]); + items[num * 9 + j] = new ItemStack(stacks.ids[j], 1, stacks.dmg[j]); } @Override diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java index 0fd78de7..abcbf2df 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java @@ -23,8 +23,7 @@ public class PipeLogicIron extends PipeLogic { boolean lastPower = false; public void switchPower() { - boolean currentPower = worldObj.isBlockIndirectlyGettingPowered(xCoord, - yCoord, zCoord); + boolean currentPower = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); if (currentPower != lastPower) { switchPosition(); @@ -44,15 +43,13 @@ public class PipeLogicIron extends PipeLogic { if (nextMetadata > 5) nextMetadata = 0; - TileEntity tile = container - .getTile(Orientations.values()[nextMetadata]); + TileEntity tile = container.getTile(Orientations.values()[nextMetadata]); if (tile instanceof TileGenericPipe) if (((TileGenericPipe) tile).pipe.logic instanceof PipeLogicWood) continue; - if (tile instanceof IPipeEntry || tile instanceof IInventory - || tile instanceof ILiquidContainer + if (tile instanceof IPipeEntry || tile instanceof IInventory || tile instanceof ILiquidContainer || tile instanceof TileGenericPipe) { worldObj.setBlockMetadata(xCoord, yCoord, zCoord, nextMetadata); @@ -65,8 +62,7 @@ public class PipeLogicIron extends PipeLogic { public void initialize() { super.initialize(); - lastPower = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, - zCoord); + lastPower = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); } @Override @@ -81,15 +77,12 @@ public class PipeLogicIron extends PipeLogic { public boolean blockActivated(EntityPlayer entityplayer) { super.blockActivated(entityplayer); - Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer - .getCurrentEquippedItem().getItem() : null; + Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; if (equipped instanceof IToolWrench - && ((IToolWrench) equipped).canWrench(entityplayer, - this.xCoord, this.yCoord, this.zCoord)) { + && ((IToolWrench) equipped).canWrench(entityplayer, this.xCoord, this.yCoord, this.zCoord)) { switchPosition(); worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord); - ((IToolWrench) equipped).wrenchUsed(entityplayer, this.xCoord, - this.yCoord, this.zCoord); + ((IToolWrench) equipped).wrenchUsed(entityplayer, this.xCoord, this.yCoord, this.zCoord); return true; } @@ -106,8 +99,7 @@ public class PipeLogicIron extends PipeLogic { @Override public boolean outputOpen(Orientations to) { - return to.ordinal() == worldObj - .getBlockMetadata(xCoord, yCoord, zCoord); + return to.ordinal() == worldObj.getBlockMetadata(xCoord, yCoord, zCoord); } } diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicStone.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicStone.java index 5065320a..e0abdccc 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeLogicStone.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicStone.java @@ -24,8 +24,7 @@ public class PipeLogicStone extends PipeLogic { if (BuildCraftTransport.alwaysConnectPipes) return super.isPipeConnected(tile); else - return (pipe2 == null || !(pipe2.logic instanceof PipeLogicCobblestone)) - && super.isPipeConnected(tile); + return (pipe2 == null || !(pipe2.logic instanceof PipeLogicCobblestone)) && super.isPipeConnected(tile); } } diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicStripes.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicStripes.java index 9321a041..dc180da5 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeLogicStripes.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicStripes.java @@ -24,8 +24,7 @@ public class PipeLogicStripes extends PipeLogic { if (BuildCraftTransport.alwaysConnectPipes) return super.isPipeConnected(tile); else - return (pipe2 == null || !(pipe2.logic instanceof PipeLogicStripes) - && !(pipe2.logic instanceof PipeLogicObsidian)) + return (pipe2 == null || !(pipe2.logic instanceof PipeLogicStripes) && !(pipe2.logic instanceof PipeLogicObsidian)) && super.isPipeConnected(tile); } diff --git a/common/net/minecraft/src/buildcraft/transport/PipeLogicWood.java b/common/net/minecraft/src/buildcraft/transport/PipeLogicWood.java index 14db9864..a56cd3cf 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeLogicWood.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeLogicWood.java @@ -49,8 +49,7 @@ public class PipeLogicWood extends PipeLogic { } public boolean isInput(TileEntity tile) { - return !(tile instanceof TileGenericPipe) - && (tile instanceof IInventory || tile instanceof ILiquidContainer) + return !(tile instanceof TileGenericPipe) && (tile instanceof IInventory || tile instanceof ILiquidContainer) && Utils.checkPipesConnections(container, tile); } @@ -59,8 +58,7 @@ public class PipeLogicWood extends PipeLogic { return true; for (String excluded : excludedBlocks) - if (excluded.equals(block.getBlockName()) - || excluded.equals(Integer.toString(block.blockID))) + if (excluded.equals(block.getBlockName()) || excluded.equals(Integer.toString(block.blockID))) return true; return false; @@ -68,14 +66,11 @@ public class PipeLogicWood extends PipeLogic { @Override public boolean blockActivated(EntityPlayer entityplayer) { - Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer - .getCurrentEquippedItem().getItem() : null; + Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; if (equipped instanceof IToolWrench - && ((IToolWrench) equipped).canWrench(entityplayer, - this.xCoord, this.yCoord, this.zCoord)) { + && ((IToolWrench) equipped).canWrench(entityplayer, this.xCoord, this.yCoord, this.zCoord)) { switchSource(); - ((IToolWrench) equipped).wrenchUsed(entityplayer, this.xCoord, - this.yCoord, this.zCoord); + ((IToolWrench) equipped).wrenchUsed(entityplayer, this.xCoord, this.yCoord, this.zCoord); return true; } @@ -92,8 +87,7 @@ public class PipeLogicWood extends PipeLogic { if (BuildCraftTransport.alwaysConnectPipes) return super.isPipeConnected(tile); else - return (pipe2 == null || !(pipe2.logic instanceof PipeLogicWood)) - && super.isPipeConnected(tile); + return (pipe2 == null || !(pipe2.logic instanceof PipeLogicWood)) && super.isPipeConnected(tile); } @Override diff --git a/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java b/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java index 5fdabb5f..c92f42a1 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java @@ -74,34 +74,26 @@ public class PipeTransportItems extends PipeTransport { readjustSpeed(item); if (!travelingEntities.containsKey(new Integer(item.entityId))) { - travelingEntities.put(new Integer(item.entityId), new EntityData( - item, orientation)); + travelingEntities.put(new Integer(item.entityId), new EntityData(item, orientation)); if (item.container != null && item.container != this.container) - ((PipeTransportItems) ((TileGenericPipe) item.container).pipe.transport) - .scheduleRemoval(item); + ((PipeTransportItems) ((TileGenericPipe) item.container).pipe.transport).scheduleRemoval(item); item.container = container; } // Reajusting Ypos to make sure the object looks like sitting on the // pipe. - if (orientation != Orientations.YPos - && orientation != Orientations.YNeg) - item.setPosition(item.posX, - yCoord + Utils.getPipeFloorOf(item.item), item.posZ); + if (orientation != Orientations.YPos && orientation != Orientations.YNeg) + item.setPosition(item.posX, yCoord + Utils.getPipeFloorOf(item.item), item.posZ); if (container.pipe instanceof IPipeTransportItemsHook) - ((IPipeTransportItemsHook) container.pipe).entityEntered(item, - orientation); + ((IPipeTransportItemsHook) container.pipe).entityEntered(item, orientation); if (APIProxy.isServerSide()) - if (item.synchroTracker.markTimeIfDelay(worldObj, - 6 * BuildCraftCore.updateFactor)) - CoreProxy.sendToPlayers(createItemPacket(item, orientation), - worldObj, xCoord, yCoord, zCoord, - DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftTransport.instance); + if (item.synchroTracker.markTimeIfDelay(worldObj, 6 * BuildCraftCore.updateFactor)) + CoreProxy.sendToPlayers(createItemPacket(item, orientation), worldObj, xCoord, yCoord, zCoord, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftTransport.instance); if (travelingEntities.size() > BuildCraftTransport.groupItemsTrigger) { groupEntities(); @@ -115,8 +107,7 @@ public class PipeTransportItems extends PipeTransport { * Returns a list of all possible movements, that is to say adjacent * implementers of IPipeEntry or TileEntityChest. */ - public LinkedList getPossibleMovements(Position pos, - EntityPassiveItem item) { + public LinkedList getPossibleMovements(Position pos, EntityPassiveItem item) { LinkedList result = new LinkedList(); for (Orientations o : Orientations.dirs()) @@ -134,8 +125,7 @@ public class PipeTransportItems extends PipeTransport { } if (this.container.pipe instanceof IPipeTransportItemsHook) - result = ((IPipeTransportItemsHook) this.container.pipe) - .filterPossibleMovements(result, pos, item); + result = ((IPipeTransportItemsHook) this.container.pipe).filterPossibleMovements(result, pos, item); return result; } @@ -153,8 +143,7 @@ public class PipeTransportItems extends PipeTransport { return pipe.pipe.transport instanceof PipeTransportItems; } else if (entity instanceof IInventory) - if (new StackUtil(item.item).checkAvailableSlot( - (IInventory) entity, false, o.reverse())) + if (new StackUtil(item.item).checkAvailableSlot((IInventory) entity, false, o.reverse())) return true; return false; @@ -196,17 +185,14 @@ public class PipeTransportItems extends PipeTransport { Position motion = new Position(0, 0, 0, data.orientation); motion.moveForwards(data.item.speed); - data.item.setPosition(data.item.posX + motion.x, data.item.posY - + motion.y, data.item.posZ + motion.z); + data.item.setPosition(data.item.posX + motion.x, data.item.posY + motion.y, data.item.posZ + motion.z); if ((data.toCenter && middleReached(data)) || outOfBounds(data)) { data.toCenter = false; // Reajusting to the middle - data.item.setPosition(xCoord + 0.5, - yCoord + Utils.getPipeFloorOf(data.item.item), zCoord - + +0.5); + data.item.setPosition(xCoord + 0.5, yCoord + Utils.getPipeFloorOf(data.item.item), zCoord + +0.5); Orientations nextOrientation = resolveDestination(data); @@ -231,13 +217,11 @@ public class PipeTransportItems extends PipeTransport { } } else if (!data.toCenter && endReached(data)) { - Position destPos = new Position(xCoord, yCoord, zCoord, - data.orientation); + Position destPos = new Position(xCoord, yCoord, zCoord, data.orientation); destPos.moveForwards(1.0); - TileEntity tile = worldObj.getBlockTileEntity((int) destPos.x, - (int) destPos.y, (int) destPos.z); + TileEntity tile = worldObj.getBlockTileEntity((int) destPos.x, (int) destPos.y, (int) destPos.z); if (travelHook != null) travelHook.endReached(this, data, tile); @@ -257,24 +241,19 @@ public class PipeTransportItems extends PipeTransport { private void handleTileReached(EntityData data, TileEntity tile) { if (tile instanceof IPipeEntry) ((IPipeEntry) tile).entityEntering(data.item, data.orientation); - else if (tile instanceof TileGenericPipe - && ((TileGenericPipe) tile).pipe.transport instanceof PipeTransportItems) { + else if (tile instanceof TileGenericPipe && ((TileGenericPipe) tile).pipe.transport instanceof PipeTransportItems) { TileGenericPipe pipe = (TileGenericPipe) tile; - ((PipeTransportItems) pipe.pipe.transport).entityEntering( - data.item, data.orientation); + ((PipeTransportItems) pipe.pipe.transport).entityEntering(data.item, data.orientation); } else if (tile instanceof IInventory) { StackUtil utils = new StackUtil(data.item.item); if (!APIProxy.isClient(worldObj)) - if (utils.checkAvailableSlot((IInventory) tile, true, - data.orientation.reverse()) - && utils.items.stackSize == 0) + if (utils.checkAvailableSlot((IInventory) tile, true, data.orientation.reverse()) && utils.items.stackSize == 0) data.item.remove(); else { data.item.item = utils.items; - EntityItem dropped = data.item - .toEntityItem(data.orientation); + EntityItem dropped = data.item.toEntityItem(data.orientation); if (dropped != null) // On SMP, the client side doesn't actually drops @@ -297,24 +276,18 @@ public class PipeTransportItems extends PipeTransport { public boolean middleReached(EntityData entity) { float middleLimit = entity.item.speed * 1.01F; return (Math.abs(xCoord + 0.5 - entity.item.posX) < middleLimit - && Math.abs(yCoord + Utils.getPipeFloorOf(entity.item.item) - - entity.item.posY) < middleLimit && Math.abs(zCoord + && Math.abs(yCoord + Utils.getPipeFloorOf(entity.item.item) - entity.item.posY) < middleLimit && Math.abs(zCoord + 0.5 - entity.item.posZ) < middleLimit); } public boolean endReached(EntityData entity) { - return entity.item.posX > xCoord + 1.0 || entity.item.posX < xCoord - || entity.item.posY > yCoord + 1.0 || entity.item.posY < yCoord - || entity.item.posZ > zCoord + 1.0 || entity.item.posZ < zCoord; + return entity.item.posX > xCoord + 1.0 || entity.item.posX < xCoord || entity.item.posY > yCoord + 1.0 + || entity.item.posY < yCoord || entity.item.posZ > zCoord + 1.0 || entity.item.posZ < zCoord; } public boolean outOfBounds(EntityData entity) { - return entity.item.posX > xCoord + 2.0 - || entity.item.posX < xCoord - 1.0 - || entity.item.posY > yCoord + 2.0 - || entity.item.posY < yCoord - 1.0 - || entity.item.posZ > zCoord + 2.0 - || entity.item.posZ < zCoord - 1.0; + return entity.item.posX > xCoord + 2.0 || entity.item.posX < xCoord - 1.0 || entity.item.posY > yCoord + 2.0 + || entity.item.posY < yCoord - 1.0 || entity.item.posZ > zCoord + 2.0 || entity.item.posZ < zCoord - 1.0; } public Position getPosition() { @@ -329,8 +302,7 @@ public class PipeTransportItems extends PipeTransport { for (int j = 0; j < nbttaglist.tagCount(); ++j) try { - NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist - .tagAt(j); + NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist.tagAt(j); EntityPassiveItem entity = new EntityPassiveItem(null); entity.readFromNBT(nbttagcompound2); @@ -342,9 +314,7 @@ public class PipeTransportItems extends PipeTransport { entity.container = container; - EntityData data = new EntityData(entity, - Orientations.values()[nbttagcompound2 - .getInteger("orientation")]); + EntityData data = new EntityData(entity, Orientations.values()[nbttagcompound2.getInteger("orientation")]); data.toCenter = nbttagcompound2.getBoolean("toCenter"); entitiesToLoad.add(data); @@ -366,17 +336,15 @@ public class PipeTransportItems extends PipeTransport { nbttaglist.appendTag(nbttagcompound2); data.item.writeToNBT(nbttagcompound2); nbttagcompound2.setBoolean("toCenter", data.toCenter); - nbttagcompound2.setInteger("orientation", - data.orientation.ordinal()); + nbttagcompound2.setInteger("orientation", data.orientation.ordinal()); } nbttagcompound.setTag("travelingEntities", nbttaglist); } public Orientations resolveDestination(EntityData data) { - LinkedList listOfPossibleMovements = getPossibleMovements( - new Position(xCoord, yCoord, zCoord, data.orientation), - data.item); + LinkedList listOfPossibleMovements = getPossibleMovements(new Position(xCoord, yCoord, zCoord, + data.orientation), data.item); if (listOfPossibleMovements.size() == 0) return Orientations.Unknown; @@ -384,8 +352,7 @@ public class PipeTransportItems extends PipeTransport { int i; if (APIProxy.isClient(worldObj) || APIProxy.isServerSide()) - i = Math.abs(data.item.entityId + xCoord + yCoord + zCoord - + data.item.deterministicRandomization) + i = Math.abs(data.item.entityId + xCoord + yCoord + zCoord + data.item.deterministicRandomization) % listOfPossibleMovements.size(); else i = worldObj.rand.nextInt(listOfPossibleMovements.size()); @@ -394,8 +361,7 @@ public class PipeTransportItems extends PipeTransport { } } - protected void doWork() { - } + protected void doWork() {} /** * Handles a packet describing a stack of items inside a pipe. @@ -407,30 +373,24 @@ public class PipeTransportItems extends PipeTransport { if (packet.getID() != PacketIds.PIPE_CONTENTS) return; - EntityPassiveItem item = EntityPassiveItem.getOrCreate(worldObj, - packet.getEntityId()); + EntityPassiveItem item = EntityPassiveItem.getOrCreate(worldObj, packet.getEntityId()); - item.item = new ItemStack(packet.getItemId(), packet.getStackSize(), - packet.getItemDamage()); + item.item = new ItemStack(packet.getItemId(), packet.getStackSize(), packet.getItemDamage()); item.setPosition(packet.getPosX(), packet.getPosY(), packet.getPosZ()); item.speed = packet.getSpeed(); item.deterministicRandomization = packet.getRandomization(); - if (item.container != this.container - || !travelingEntities.containsKey(item.entityId)) { + if (item.container != this.container || !travelingEntities.containsKey(item.entityId)) { if (item.container != null) - ((PipeTransportItems) ((TileGenericPipe) item.container).pipe.transport) - .scheduleRemoval(item); + ((PipeTransportItems) ((TileGenericPipe) item.container).pipe.transport).scheduleRemoval(item); - travelingEntities.put(new Integer(item.entityId), new EntityData( - item, packet.getOrientation())); + travelingEntities.put(new Integer(item.entityId), new EntityData(item, packet.getOrientation())); item.container = container; } else - travelingEntities.get(new Integer(item.entityId)).orientation = packet - .getOrientation(); + travelingEntities.get(new Integer(item.entityId)).orientation = packet.getOrientation(); } @@ -441,13 +401,11 @@ public class PipeTransportItems extends PipeTransport { * @param orientation * @return */ - public Packet createItemPacket(EntityPassiveItem item, - Orientations orientation) { + public Packet createItemPacket(EntityPassiveItem item, Orientations orientation) { item.deterministicRandomization += worldObj.rand.nextInt(6); - PacketPipeTransportContent packet = new PacketPipeTransportContent( - container.xCoord, container.yCoord, container.zCoord, item, - orientation); + PacketPipeTransportContent packet = new PacketPipeTransportContent(container.xCoord, container.yCoord, container.zCoord, + item, orientation); return packet.getPacket(); } @@ -466,11 +424,8 @@ public class PipeTransportItems extends PipeTransport { @Override public boolean isPipeConnected(TileEntity tile) { - return tile instanceof TileGenericPipe - || tile instanceof IPipeEntry - || tile instanceof IInventory - || (tile instanceof IMachine && ((IMachine) tile) - .manageSolids()); + return tile instanceof TileGenericPipe || tile instanceof IPipeEntry || tile instanceof IInventory + || (tile instanceof IMachine && ((IMachine) tile).manageSolids()); } @Override @@ -487,8 +442,7 @@ public class PipeTransportItems extends PipeTransport { * contribution controlling them */ public void groupEntities() { - EntityData[] entities = travelingEntities.values().toArray( - new EntityData[travelingEntities.size()]); + EntityData[] entities = travelingEntities.values().toArray(new EntityData[travelingEntities.size()]); TreeSet toRemove = new TreeSet(); @@ -499,15 +453,10 @@ public class PipeTransportItems extends PipeTransport { EntityData data2 = entities[j]; if (data1.item.item.itemID == data2.item.item.itemID - && data1.item.item.getItemDamage() == data2.item.item - .getItemDamage() - && !toRemove.contains(data1.item.entityId) - && !toRemove.contains(data2.item.entityId) - && !data1.item.hasContributions() - && !data2.item.hasContributions() - && data1.item.item.stackSize - + data2.item.item.stackSize < data1.item.item - .getMaxStackSize()) { + && data1.item.item.getItemDamage() == data2.item.item.getItemDamage() + && !toRemove.contains(data1.item.entityId) && !toRemove.contains(data2.item.entityId) + && !data1.item.hasContributions() && !data2.item.hasContributions() + && data1.item.item.stackSize + data2.item.item.stackSize < data1.item.item.getMaxStackSize()) { data1.item.item.stackSize += data2.item.item.stackSize; toRemove.add(data2.item.entityId); diff --git a/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java b/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java index 3031a11b..91130a88 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeTransportLiquids.java @@ -26,8 +26,7 @@ import net.minecraft.src.buildcraft.api.Trigger; import net.minecraft.src.buildcraft.core.IMachine; import net.minecraft.src.buildcraft.core.Utils; -public class PipeTransportLiquids extends PipeTransport implements - ILiquidContainer { +public class PipeTransportLiquids extends PipeTransport implements ILiquidContainer { /** * The amount of liquid contained by a pipe section. For simplicity, all @@ -39,6 +38,7 @@ public class PipeTransportLiquids extends PipeTransport implements public int flowRate = 20; public class LiquidBuffer { + short[] in = new short[travelDelay]; short ready; short[] out = new short[travelDelay]; @@ -138,14 +138,11 @@ public class PipeTransportLiquids extends PipeTransport implements if (isInput[orientation]) extracted = center.fill(out[date], true, liquidId); if (isOutput[orientation]) { - Position p = new Position(xCoord, yCoord, zCoord, - Orientations.values()[orientation]); + Position p = new Position(xCoord, yCoord, zCoord, Orientations.values()[orientation]); p.moveForwards(1); - ILiquidContainer nextPipe = (ILiquidContainer) container - .getTile(Orientations.values()[orientation]); - extracted = nextPipe.fill(p.orientation.reverse(), - out[date], liquidId, true); + ILiquidContainer nextPipe = (ILiquidContainer) container.getTile(Orientations.values()[orientation]); + extracted = nextPipe.fill(p.orientation.reverse(), out[date], liquidId, true); if (extracted == 0) { totalBounced++; @@ -164,8 +161,7 @@ public class PipeTransportLiquids extends PipeTransport implements if (isOutput[i]) outputNumber++; - filled = new boolean[] { false, false, false, false, false, - false }; + filled = new boolean[] { false, false, false, false, false, false }; // try first, to detect filled outputs extracted = splitLiquid(out[date], outputNumber); @@ -179,8 +175,7 @@ public class PipeTransportLiquids extends PipeTransport implements if (isOutput[i] && !filled[i]) outputNumber++; - extracted += splitLiquid(out[date] - extracted, - outputNumber); + extracted += splitLiquid(out[date] - extracted, outputNumber); } } @@ -203,14 +198,12 @@ public class PipeTransportLiquids extends PipeTransport implements private int splitLiquid(int quantity, int outputNumber) { int extracted = 0; - int slotExtract = (int) Math - .ceil(((double) quantity / (double) outputNumber)); + int slotExtract = (int) Math.ceil(((double) quantity / (double) outputNumber)); int[] splitVector = getSplitVector(worldObj); for (int r = 0; r < 6; ++r) { - int toExtract = slotExtract <= quantity ? slotExtract - : quantity; + int toExtract = slotExtract <= quantity ? slotExtract : quantity; int i = splitVector[r]; @@ -258,8 +251,7 @@ public class PipeTransportLiquids extends PipeTransport implements boolean[] isInput = new boolean[6]; // Computed at each update - boolean isOutput[] = new boolean[] { false, false, false, false, false, - false }; + boolean isOutput[] = new boolean[] { false, false, false, false, false, false }; public PipeTransportLiquids() { for (int j = 0; j < 6; ++j) { @@ -301,8 +293,7 @@ public class PipeTransportLiquids extends PipeTransport implements for (int i = 0; i < 6; ++i) { if (nbttagcompound.hasKey("side[" + i + "]")) - side[i].readFromNBT(nbttagcompound.getCompoundTag("side[" + i - + "]")); + side[i].readFromNBT(nbttagcompound.getCompoundTag("side[" + i + "]")); isInput[i] = nbttagcompound.getBoolean("isInput[" + i + "]"); } @@ -332,8 +323,7 @@ public class PipeTransportLiquids extends PipeTransport implements nbttagcompound.setTag("center", sub); } - protected void doWork() { - } + protected void doWork() {} public void onDropped(EntityItem item) { @@ -347,8 +337,7 @@ public class PipeTransportLiquids extends PipeTransport implements isInput[from.ordinal()] = true; if (this.container.pipe instanceof IPipeTransportLiquidsHook) - return ((IPipeTransportLiquidsHook) this.container.pipe).fill(from, - quantity, id, doFill); + return ((IPipeTransportLiquidsHook) this.container.pipe).fill(from, quantity, id, doFill); else return side[from.ordinal()].fill(quantity, doFill, (short) id); } @@ -408,8 +397,7 @@ public class PipeTransportLiquids extends PipeTransport implements int outputNumber = 0; for (Orientations o : Orientations.dirs()) { - isOutput[o.ordinal()] = container.pipe.outputOpen(o) - && canReceiveLiquid(o) && !isInput[o.ordinal()]; + isOutput[o.ordinal()] = container.pipe.outputOpen(o) && canReceiveLiquid(o) && !isInput[o.ordinal()]; if (isOutput[o.ordinal()]) outputNumber++; @@ -452,8 +440,7 @@ public class PipeTransportLiquids extends PipeTransport implements super.onNeighborBlockChange(blockId); for (int i = 0; i < 6; ++i) - if (!Utils.checkPipesConnections( - container.getTile(Orientations.values()[i]), container)) + if (!Utils.checkPipesConnections(container.getTile(Orientations.values()[i]), container)) side[i].reset(); } @@ -471,9 +458,7 @@ public class PipeTransportLiquids extends PipeTransport implements return true; } - return tile instanceof TileGenericPipe - || (tile instanceof IMachine && ((IMachine) tile) - .manageLiquids()); + return tile instanceof TileGenericPipe || (tile instanceof IMachine && ((IMachine) tile).manageLiquids()); } private static long lastSplit = -1; diff --git a/common/net/minecraft/src/buildcraft/transport/PipeTransportPower.java b/common/net/minecraft/src/buildcraft/transport/PipeTransportPower.java index 094e5fd8..0e57fa61 100644 --- a/common/net/minecraft/src/buildcraft/transport/PipeTransportPower.java +++ b/common/net/minecraft/src/buildcraft/transport/PipeTransportPower.java @@ -31,8 +31,7 @@ public class PipeTransportPower extends PipeTransport { public long currentDate; public double[] internalPower = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; - public double[] internalNextPower = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0 }; + public double[] internalNextPower = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; @TileNetworkData(staticSize = 6) public short[] displayPower = new short[] { 0, 0, 0, 0, 0, 0 }; @@ -48,8 +47,7 @@ public class PipeTransportPower extends PipeTransport { @Override public boolean isPipeConnected(TileEntity tile) { - return tile instanceof TileGenericPipe || tile instanceof IMachine - || tile instanceof IPowerReceptor; + return tile instanceof TileGenericPipe || tile instanceof IMachine || tile instanceof IPowerReceptor; } @Override @@ -64,8 +62,7 @@ public class PipeTransportPower extends PipeTransport { // Extract the nearby connected tiles for (int i = 0; i < 6; ++i) - if (Utils.checkPipesConnections( - container.getTile(Orientations.values()[i]), container)) + if (Utils.checkPipesConnections(container.getTile(Orientations.values()[i]), container)) tiles[i] = container.getTile(Orientations.values()[i]); // Send the power to nearby pipes who requested it @@ -78,8 +75,7 @@ public class PipeTransportPower extends PipeTransport { for (int j = 0; j < 6; ++j) if (j != i && powerQuery[j] > 0) - if (tiles[j] instanceof TileGenericPipe - || tiles[j] instanceof IPowerReceptor) + if (tiles[j] instanceof TileGenericPipe || tiles[j] instanceof IPowerReceptor) div += powerQuery[j]; double totalWatt = internalPower[i]; @@ -93,8 +89,7 @@ public class PipeTransportPower extends PipeTransport { PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyTile.pipe.transport; - nearbyTransport.receiveEnergy( - Orientations.values()[j].reverse(), watts); + nearbyTransport.receiveEnergy(Orientations.values()[j].reverse(), watts); displayPower[j] += watts / 2F; displayPower[i] += watts / 2F; @@ -103,8 +98,7 @@ public class PipeTransportPower extends PipeTransport { } else if (tiles[j] instanceof IPowerReceptor) { IPowerReceptor pow = (IPowerReceptor) tiles[j]; - pow.getPowerProvider().receiveEnergy((float) watts, - Orientations.values()[j].reverse()); + pow.getPowerProvider().receiveEnergy((float) watts, Orientations.values()[j].reverse()); displayPower[j] += watts / 2F; displayPower[i] += watts / 2F; @@ -117,8 +111,7 @@ public class PipeTransportPower extends PipeTransport { // Compute the tiles requesting energy that are not pipes for (int i = 0; i < 6; ++i) - if (tiles[i] instanceof IPowerReceptor - && !(tiles[i] instanceof TileGenericPipe)) { + if (tiles[i] instanceof IPowerReceptor && !(tiles[i] instanceof TileGenericPipe)) { IPowerReceptor receptor = (IPowerReceptor) tiles[i]; int request = receptor.powerRequest(); @@ -150,19 +143,14 @@ public class PipeTransportPower extends PipeTransport { PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyTile.pipe.transport; - nearbyTransport.requestEnergy( - Orientations.values()[i].reverse(), - transferQuery[i]); + nearbyTransport.requestEnergy(Orientations.values()[i].reverse(), transferQuery[i]); } } if (APIProxy.isServerSide()) - if (tracker.markTimeIfDelay(worldObj, - 2 * BuildCraftCore.updateFactor)) - CoreProxy.sendToPlayers(this.container.getUpdatePacket(), - worldObj, xCoord, yCoord, zCoord, - DefaultProps.NETWORK_UPDATE_RANGE, - mod_BuildCraftCore.instance); + if (tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) + CoreProxy.sendToPlayers(this.container.getUpdatePacket(), worldObj, xCoord, yCoord, zCoord, + DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftCore.instance); } @@ -181,8 +169,7 @@ public class PipeTransportPower extends PipeTransport { public void receiveEnergy(Orientations from, double val) { step(); if (this.container.pipe instanceof IPipeTransportPowerHook) - ((IPipeTransportPowerHook) this.container.pipe).receiveEnergy(from, - val); + ((IPipeTransportPowerHook) this.container.pipe).receiveEnergy(from, val); else { internalNextPower[from.ordinal()] += val * (1 - powerResitance); @@ -194,8 +181,7 @@ public class PipeTransportPower extends PipeTransport { public void requestEnergy(Orientations from, int i) { step(); if (this.container.pipe instanceof IPipeTransportPowerHook) - ((IPipeTransportPowerHook) this.container.pipe).requestEnergy(from, - i); + ((IPipeTransportPowerHook) this.container.pipe).requestEnergy(from, i); else { step(); nextPowerQuery[from.ordinal()] += i; @@ -213,12 +199,9 @@ public class PipeTransportPower extends PipeTransport { for (int i = 0; i < 6; ++i) { powerQuery[i] = nbttagcompound.getInteger("powerQuery[" + i + "]"); - nextPowerQuery[i] = nbttagcompound.getInteger("nextPowerQuery[" + i - + "]"); - internalPower[i] = nbttagcompound.getDouble("internalPower[" + i - + "]"); - internalNextPower[i] = nbttagcompound - .getDouble("internalNextPower[" + i + "]"); + nextPowerQuery[i] = nbttagcompound.getInteger("nextPowerQuery[" + i + "]"); + internalPower[i] = nbttagcompound.getDouble("internalPower[" + i + "]"); + internalNextPower[i] = nbttagcompound.getDouble("internalNextPower[" + i + "]"); } } @@ -229,12 +212,9 @@ public class PipeTransportPower extends PipeTransport { for (int i = 0; i < 6; ++i) { nbttagcompound.setInteger("powerQuery[" + i + "]", powerQuery[i]); - nbttagcompound.setInteger("nextPowerQuery[" + i + "]", - nextPowerQuery[i]); - nbttagcompound.setDouble("internalPower[" + i + "]", - internalPower[i]); - nbttagcompound.setDouble("internalNextPower[" + i + "]", - internalNextPower[i]); + nbttagcompound.setInteger("nextPowerQuery[" + i + "]", nextPowerQuery[i]); + nbttagcompound.setDouble("internalPower[" + i + "]", internalPower[i]); + nbttagcompound.setDouble("internalNextPower[" + i + "]", internalNextPower[i]); } } diff --git a/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java b/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java index 110fffe3..7b507dca 100644 --- a/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java +++ b/common/net/minecraft/src/buildcraft/transport/TileGenericPipe.java @@ -49,10 +49,8 @@ import net.minecraft.src.buildcraft.core.network.PacketPipeDescription; import net.minecraft.src.buildcraft.core.network.PacketTileUpdate; import net.minecraft.src.buildcraft.core.network.PacketUpdate; -public class TileGenericPipe extends TileEntity implements IPowerReceptor, - ILiquidContainer, ISpecialInventory, IPipeEntry, ISynchronizedTile, - IOverrideDefaultTriggers, ITileBufferHolder, IPipeConnection, - IDropControlInventory { +public class TileGenericPipe extends TileEntity implements IPowerReceptor, ILiquidContainer, ISpecialInventory, IPipeEntry, + ISynchronizedTile, IOverrideDefaultTriggers, ITileBufferHolder, IPipeConnection, IDropControlInventory { public TileBuffer[] tileBuffer; public boolean[] pipeConnectionsBuffer = new boolean[6]; @@ -98,8 +96,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, public void synchronizeIfDelay(int delay) { if (APIProxy.isServerSide()) if (networkSyncTracker.markTimeIfDelay(worldObj, delay)) - CoreProxy.sendToPlayers(getUpdatePacket(), worldObj, xCoord, - yCoord, zCoord, DefaultProps.NETWORK_UPDATE_RANGE, + CoreProxy.sendToPlayers(getUpdatePacket(), worldObj, xCoord, yCoord, zCoord, DefaultProps.NETWORK_UPDATE_RANGE, mod_BuildCraftCore.instance); } @@ -111,8 +108,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, BlockGenericPipe.removePipe(pipe); // Clean the persistent world in case the tile is still here. - PersistentWorld.getWorld(worldObj).removeTile( - new BlockIndex(xCoord, yCoord, zCoord)); + PersistentWorld.getWorld(worldObj).removeTile(new BlockIndex(xCoord, yCoord, zCoord)); } @Override @@ -156,16 +152,14 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, pos.moveForwards(1.0); tileBuffer[o.ordinal()] = new TileBuffer(); - tileBuffer[o.ordinal()].initialize(worldObj, (int) pos.x, - (int) pos.y, (int) pos.z); + tileBuffer[o.ordinal()].initialize(worldObj, (int) pos.x, (int) pos.y, (int) pos.z); } for (Orientations o : Orientations.dirs()) { TileEntity tile = getTile(o); if (tile instanceof ITileBufferHolder) - ((ITileBufferHolder) tile).blockCreated(o, - BuildCraftTransport.genericPipeBlock.blockID, this); + ((ITileBufferHolder) tile).blockCreated(o, BuildCraftTransport.genericPipeBlock.blockID, this); } bindPipe(); @@ -179,8 +173,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, private void bindPipe() { if (!pipeBound) { if (pipe == null) { - PersistentTile tile = PersistentWorld.getWorld(worldObj) - .getTile(new BlockIndex(xCoord, yCoord, zCoord)); + PersistentTile tile = PersistentWorld.getWorld(worldObj).getTile(new BlockIndex(xCoord, yCoord, zCoord)); if (tile != null && tile instanceof Pipe) pipe = (Pipe) tile; @@ -193,8 +186,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, if (worldObj == null) throw new NullPointerException(); - PersistentWorld.getWorld(worldObj).storeTile(pipe, - new BlockIndex(xCoord, yCoord, zCoord)); + PersistentWorld.getWorld(worldObj).storeTile(pipe, new BlockIndex(xCoord, yCoord, zCoord)); pipeId = pipe.itemID; pipeBound = true; } @@ -225,28 +217,23 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, @Override public int fill(Orientations from, int quantity, int id, boolean doFill) { - if (BlockGenericPipe.isValid(pipe) - && pipe.transport instanceof ILiquidContainer) - return ((ILiquidContainer) pipe.transport).fill(from, quantity, id, - doFill); + if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ILiquidContainer) + return ((ILiquidContainer) pipe.transport).fill(from, quantity, id, doFill); else return 0; } @Override public int empty(int quantityMax, boolean doEmpty) { - if (BlockGenericPipe.isValid(pipe) - && pipe.transport instanceof ILiquidContainer) - return ((ILiquidContainer) pipe.transport).empty(quantityMax, - doEmpty); + if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ILiquidContainer) + return ((ILiquidContainer) pipe.transport).empty(quantityMax, doEmpty); else return 0; } @Override public int getLiquidQuantity() { - if (BlockGenericPipe.isValid(pipe) - && pipe.transport instanceof ILiquidContainer) + if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ILiquidContainer) return ((ILiquidContainer) pipe.transport).getLiquidQuantity(); else return 0; @@ -254,8 +241,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, @Override public int getLiquidId() { - if (BlockGenericPipe.isValid(pipe) - && pipe.transport instanceof ILiquidContainer) + if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ILiquidContainer) return ((ILiquidContainer) pipe.transport).getLiquidId(); else return 0; @@ -383,8 +369,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, pipe.handleWirePayload(packet.payload, new IndexInPayload(1, 0, 0)); // Check for gate information if (packet.payload.intPayload.length > 5) - pipe.handleGatePayload(packet.payload, new IndexInPayload(5, 0, - 0)); + pipe.handleGatePayload(packet.payload, new IndexInPayload(5, 0, 0)); } } @@ -395,8 +380,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, } @Override - public void postPacketHandling(PacketUpdate packet) { - } + public void postPacketHandling(PacketUpdate packet) {} @Override public Packet getUpdatePacket() { @@ -491,9 +475,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, if (!BlockGenericPipe.isValid(pipe1)) return false; - if (BlockGenericPipe.isValid(pipe2) - && !pipe1.transport.getClass().isAssignableFrom( - pipe2.transport.getClass()) + if (BlockGenericPipe.isValid(pipe2) && !pipe1.transport.getClass().isAssignableFrom(pipe2.transport.getClass()) && !pipe1.transport.allowsConnect(pipe2.transport)) return false; @@ -514,19 +496,16 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, if (t.getTile() instanceof TileGenericPipe) { TileGenericPipe pipe = (TileGenericPipe) t.getTile(); - pipe.pipeConnectionsBuffer[Orientations.values()[i] - .reverse().ordinal()] = pipeConnectionsBuffer[i]; + pipe.pipeConnectionsBuffer[Orientations.values()[i].reverse().ordinal()] = pipeConnectionsBuffer[i]; } } } for (int i = 0; i < tileBuffer.length; ++i) if (oldConnections[i] != pipeConnectionsBuffer[i]) { - Position pos = new Position(xCoord, yCoord, zCoord, - Orientations.values()[i]); + Position pos = new Position(xCoord, yCoord, zCoord, Orientations.values()[i]); pos.moveForwards(1.0); - worldObj.markBlockAsNeedsUpdate((int) pos.x, (int) pos.y, - (int) pos.z); + worldObj.markBlockAsNeedsUpdate((int) pos.x, (int) pos.y, (int) pos.z); } } } diff --git a/common/net/minecraft/src/buildcraft/transport/TriggerPipeContents.java b/common/net/minecraft/src/buildcraft/transport/TriggerPipeContents.java index c179f077..cd26c24a 100644 --- a/common/net/minecraft/src/buildcraft/transport/TriggerPipeContents.java +++ b/common/net/minecraft/src/buildcraft/transport/TriggerPipeContents.java @@ -80,11 +80,9 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe { return transportItems.travelingEntities.isEmpty(); else if (kind == Kind.ContainsItems) if (parameter != null && parameter.getItem() != null) { - for (EntityData data : transportItems.travelingEntities - .values()) + for (EntityData data : transportItems.travelingEntities.values()) if (data.item.item.itemID == parameter.getItem().itemID - && data.item.item.getItemDamage() == parameter - .getItem().getItemDamage()) + && data.item.item.getItemDamage() == parameter.getItem().getItemDamage()) return true; } else return !transportItems.travelingEntities.isEmpty(); @@ -94,8 +92,7 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe { int seachedLiquidId = 0; if (parameter != null && parameter.getItem() != null) - seachedLiquidId = BuildCraftAPI - .getLiquidForFilledItem(parameter.getItem()); + seachedLiquidId = BuildCraftAPI.getLiquidForFilledItem(parameter.getItem()); if (kind == Kind.Empty) { for (LiquidBuffer b : transportLiquids.side) @@ -106,8 +103,7 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe { } else { for (LiquidBuffer b : transportLiquids.side) if (b.average != 0) - if (seachedLiquidId == 0 - || b.liquidId == seachedLiquidId) + if (seachedLiquidId == 0 || b.liquidId == seachedLiquidId) return true; return false; diff --git a/common/net/minecraft/src/buildcraft/transport/TriggerRedstoneInput.java b/common/net/minecraft/src/buildcraft/transport/TriggerRedstoneInput.java index f05d8fbe..cc9edda0 100644 --- a/common/net/minecraft/src/buildcraft/transport/TriggerRedstoneInput.java +++ b/common/net/minecraft/src/buildcraft/transport/TriggerRedstoneInput.java @@ -42,11 +42,9 @@ public class TriggerRedstoneInput extends Trigger implements ITriggerPipe { @Override public boolean isTriggerActive(Pipe pipe, TriggerParameter parameter) { if (active) - return pipe.worldObj.isBlockIndirectlyGettingPowered(pipe.xCoord, - pipe.yCoord, pipe.zCoord); + return pipe.worldObj.isBlockIndirectlyGettingPowered(pipe.xCoord, pipe.yCoord, pipe.zCoord); else - return !pipe.worldObj.isBlockIndirectlyGettingPowered(pipe.xCoord, - pipe.yCoord, pipe.zCoord); + return !pipe.worldObj.isBlockIndirectlyGettingPowered(pipe.xCoord, pipe.yCoord, pipe.zCoord); } @Override diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsDiamond.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsDiamond.java index 2452fbc2..eae0e346 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsDiamond.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsDiamond.java @@ -39,13 +39,11 @@ public class PipeItemsDiamond extends Pipe implements IPipeTransportItemsHook { if (connection == Orientations.Unknown) nextTexture = 1 * 16 + 5; else - nextTexture = BuildCraftTransport.diamondTextures[connection - .ordinal()]; + nextTexture = BuildCraftTransport.diamondTextures[connection.ordinal()]; } @Override - public LinkedList filterPossibleMovements( - LinkedList possibleOrientations, Position pos, + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityPassiveItem item) { LinkedList filteredOrientations = new LinkedList(); LinkedList defaultOrientations = new LinkedList(); @@ -58,8 +56,7 @@ public class PipeItemsDiamond extends Pipe implements IPipeTransportItemsHook { // to use that filter is higher, this is why there are // no breaks here. for (int slot = 0; slot < 9; ++slot) { - ItemStack stack = logic - .getStackInSlot(dir.ordinal() * 9 + slot); + ItemStack stack = logic.getStackInSlot(dir.ordinal() * 9 + slot); if (stack != null) foundFilter = true; diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsGold.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsGold.java index a199b677..058be7e4 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsGold.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsGold.java @@ -30,9 +30,7 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook { @Override public int getMainBlockTexture() { - if (worldObj != null - && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, - zCoord)) + if (worldObj != null && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) return 1 * 16 + 14; else return 1 * 16 + 4; @@ -51,13 +49,11 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook { if (BuildCraftTransport.alwaysConnectPipes) return super.isPipeConnected(tile); else - return (pipe2 == null || !(pipe2.logic instanceof PipeLogicGold)) - && super.isPipeConnected(tile); + return (pipe2 == null || !(pipe2.logic instanceof PipeLogicGold)) && super.isPipeConnected(tile); } @Override - public LinkedList filterPossibleMovements( - LinkedList possibleOrientations, Position pos, + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityPassiveItem item) { return possibleOrientations; } diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsObsidian.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsObsidian.java index 153dadc1..e545d2ec 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsObsidian.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsObsidian.java @@ -127,8 +127,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { Position min = p1.min(p2); Position max = p1.max(p2); - return AxisAlignedBB.getBoundingBoxFromPool(min.x, min.y, min.z, max.x, - max.y, max.z); + return AxisAlignedBB.getBoundingBoxFromPool(min.x, min.y, min.z, max.x, max.y, max.z); } @Override @@ -147,8 +146,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { return false; @SuppressWarnings("rawtypes") - List list = worldObj.getEntitiesWithinAABB( - net.minecraft.src.Entity.class, box); + List list = worldObj.getEntitiesWithinAABB(net.minecraft.src.Entity.class, box); for (int g = 0; g < list.size(); g++) if (list.get(g) instanceof Entity) { @@ -162,13 +160,9 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { if (distance == 1 && list.get(g) instanceof EntityMinecart) { EntityMinecart cart = (EntityMinecart) list.get(g); if (!cart.isDead && cart.minecartType == 1) { - ItemStack stack = checkExtractGeneric(cart, true, - getOpenOrientation()); - if (stack != null - && powerProvider.useEnergy(1, 1, true) == 1) { - EntityItem entityitem = new EntityItem(worldObj, - cart.posX, cart.posY + 0.3F, cart.posZ, - stack); + ItemStack stack = checkExtractGeneric(cart, true, getOpenOrientation()); + if (stack != null && powerProvider.useEnergy(1, 1, true) == 1) { + EntityItem entityitem = new EntityItem(worldObj, cart.posX, cart.posY + 0.3F, cart.posZ, stack); entityitem.delayBeforeCanPickup = 10; worldObj.spawnEntityInWorld(entityitem); pullItemIntoPipe(entityitem, 1); @@ -181,11 +175,9 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { return false; } - public ItemStack checkExtractGeneric(IInventory inventory, - boolean doRemove, Orientations from) { + public ItemStack checkExtractGeneric(IInventory inventory, boolean doRemove, Orientations from) { for (int k = 0; k < inventory.getSizeInventory(); ++k) - if (inventory.getStackInSlot(k) != null - && inventory.getStackInSlot(k).stackSize > 0) { + if (inventory.getStackInSlot(k) != null && inventory.getStackInSlot(k).stackSize > 0) { ItemStack slot = inventory.getStackInSlot(k); @@ -206,10 +198,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { Orientations orientation = getOpenOrientation().reverse(); if (orientation != Orientations.Unknown) { - worldObj.playSoundAtEntity( - entity, - "random.pop", - 0.2F, + worldObj.playSoundAtEntity(entity, "random.pop", 0.2F, ((worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); ItemStack stack = null; @@ -218,21 +207,17 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { if (entity instanceof EntityItem) { EntityItem item = (EntityItem) entity; - TransportProxy.obsidianPipePickup(worldObj, item, - this.container); + TransportProxy.obsidianPipePickup(worldObj, item, this.container); - float energyUsed = powerProvider.useEnergy(distance, - item.item.stackSize * distance, true); + float energyUsed = powerProvider.useEnergy(distance, item.item.stackSize * distance, true); - if (distance == 0 - || energyUsed / distance == item.item.stackSize) { + if (distance == 0 || energyUsed / distance == item.item.stackSize) { stack = item.item; APIProxy.removeEntity(entity); } else stack = item.item.splitStack((int) (energyUsed / distance)); - speed = Math.sqrt(item.motionX * item.motionX + item.motionY - * item.motionY + item.motionZ * item.motionZ); + speed = Math.sqrt(item.motionX * item.motionX + item.motionY * item.motionY + item.motionZ * item.motionZ); speed = speed / 2F - 0.05; if (speed < 0.01) @@ -243,14 +228,12 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor { APIProxy.removeEntity(entity); } - EntityPassiveItem passive = new EntityPassiveItem(worldObj, - xCoord + 0.5, yCoord + Utils.getPipeFloorOf(stack), + EntityPassiveItem passive = new EntityPassiveItem(worldObj, xCoord + 0.5, yCoord + Utils.getPipeFloorOf(stack), zCoord + 0.5, stack); passive.speed = (float) speed; - ((PipeTransportItems) transport).entityEntering(passive, - orientation); + ((PipeTransportItems) transport).entityEntering(passive, orientation); } } diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStone.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStone.java index aad0a9e6..f1caf0c1 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStone.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStone.java @@ -41,8 +41,7 @@ public class PipeItemsStone extends Pipe implements IPipeTransportItemsHook { } @Override - public LinkedList filterPossibleMovements( - LinkedList possibleOrientations, Position pos, + public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, EntityPassiveItem item) { return possibleOrientations; } diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStripes.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStripes.java index d0f5f8ab..9e32b2f7 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStripes.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsStripes.java @@ -31,8 +31,7 @@ import net.minecraft.src.buildcraft.transport.Pipe; import net.minecraft.src.buildcraft.transport.PipeLogicStripes; import net.minecraft.src.buildcraft.transport.PipeTransportItems; -public class PipeItemsStripes extends Pipe implements IItemTravelingHook, - IPowerReceptor { +public class PipeItemsStripes extends Pipe implements IItemTravelingHook, IPowerReceptor { private PowerProvider powerProvider; @@ -61,16 +60,13 @@ public class PipeItemsStripes extends Pipe implements IItemTravelingHook, p.moveForwards(1.0); ArrayList stacks = BuildCraftBlockUtil - .getItemStackFromBlock(worldObj, (int) p.x, (int) p.y, - (int) p.z); + .getItemStackFromBlock(worldObj, (int) p.x, (int) p.y, (int) p.z); if (stacks != null) for (ItemStack s : stacks) if (s != null) { - EntityPassiveItem newItem = new EntityPassiveItem( - worldObj, xCoord + 0.5, yCoord - + Utils.getPipeFloorOf(s), - zCoord + 0.5, s); + EntityPassiveItem newItem = new EntityPassiveItem(worldObj, xCoord + 0.5, yCoord + + Utils.getPipeFloorOf(s), zCoord + 0.5, s); this.container.entityEntering(newItem, o.reverse()); } @@ -87,18 +83,14 @@ public class PipeItemsStripes extends Pipe implements IItemTravelingHook, p.moveForwards(1.0); if (convertPipe(pipe, data)) - BuildCraftTransport.pipeItemsStipes.onItemUse(new ItemStack( - BuildCraftTransport.pipeItemsStipes), BuildCraftAPI - .getBuildCraftPlayer(worldObj), worldObj, (int) p.x, - (int) p.y - 1, (int) p.z, 1); + BuildCraftTransport.pipeItemsStipes.onItemUse(new ItemStack(BuildCraftTransport.pipeItemsStipes), + BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, (int) p.x, (int) p.y - 1, (int) p.z, 1); else if (worldObj.getBlockId((int) p.x, (int) p.y, (int) p.z) == 0) - data.item.item.getItem().onItemUse(data.item.item, - BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, - (int) p.x, (int) p.y - 1, (int) p.z, 1); + data.item.item.getItem().onItemUse(data.item.item, BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, (int) p.x, + (int) p.y - 1, (int) p.z, 1); else - data.item.item.getItem().onItemUse(data.item.item, - BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, - (int) p.x, (int) p.y, (int) p.z, 1); + data.item.item.getItem().onItemUse(data.item.item, BuildCraftAPI.getBuildCraftPlayer(worldObj), worldObj, (int) p.x, + (int) p.y, (int) p.z, 1); } @Override @@ -110,8 +102,7 @@ public class PipeItemsStripes extends Pipe implements IItemTravelingHook, public boolean convertPipe(PipeTransportItems pipe, EntityData data) { if (data.item.item.getItem() instanceof ItemPipe) if (!(data.item.item.itemID == BuildCraftTransport.pipeItemsStipes.shiftedIndex)) { - Pipe newPipe = BlockGenericPipe.createPipe(worldObj, xCoord, - yCoord, zCoord, data.item.item.itemID); + Pipe newPipe = BlockGenericPipe.createPipe(worldObj, xCoord, yCoord, zCoord, data.item.item.itemID); newPipe.setTile(this.container); newPipe.setWorld(worldObj); this.container.pipe = newPipe; @@ -121,8 +112,7 @@ public class PipeItemsStripes extends Pipe implements IItemTravelingHook, data.item.item.stackSize--; if (data.item.item.stackSize <= 0) - ((PipeTransportItems) newPipe.transport).travelingEntities - .remove(data.item.entityId); + ((PipeTransportItems) newPipe.transport).travelingEntities.remove(data.item.entityId); pipe.scheduleRemoval(data.item); @@ -148,8 +138,7 @@ public class PipeItemsStripes extends Pipe implements IItemTravelingHook, } @Override - public void endReached(PipeTransportItems pipe, EntityData data, - TileEntity tile) { + public void endReached(PipeTransportItems pipe, EntityData data, TileEntity tile) { } } diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java index 0be9bfdd..fe9928ca 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeItemsWood.java @@ -89,41 +89,33 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { if (meta > 5) return; - Position pos = new Position(xCoord, yCoord, zCoord, - Orientations.values()[meta]); + Position pos = new Position(xCoord, yCoord, zCoord, Orientations.values()[meta]); pos.moveForwards(1); int blockId = w.getBlockId((int) pos.x, (int) pos.y, (int) pos.z); - TileEntity tile = w.getBlockTileEntity((int) pos.x, (int) pos.y, - (int) pos.z); + TileEntity tile = w.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); - if (tile == null - || !(tile instanceof IInventory || tile instanceof ILiquidContainer) - || PipeLogicWood - .isExcludedFromExtraction(Block.blocksList[blockId])) + if (tile == null || !(tile instanceof IInventory || tile instanceof ILiquidContainer) + || PipeLogicWood.isExcludedFromExtraction(Block.blocksList[blockId])) return; if (tile instanceof IInventory) { IInventory inventory = (IInventory) tile; - ItemStack stack = checkExtract(inventory, true, - pos.orientation.reverse()); + ItemStack stack = checkExtract(inventory, true, pos.orientation.reverse()); if (stack == null || stack.stackSize == 0) { powerProvider.useEnergy(1, 1, false); return; } - Position entityPos = new Position(pos.x + 0.5, pos.y - + Utils.getPipeFloorOf(stack), pos.z + 0.5, + Position entityPos = new Position(pos.x + 0.5, pos.y + Utils.getPipeFloorOf(stack), pos.z + 0.5, pos.orientation.reverse()); entityPos.moveForwards(0.5); - EntityPassiveItem entity = new EntityPassiveItem(w, entityPos.x, - entityPos.y, entityPos.z, stack); + EntityPassiveItem entity = new EntityPassiveItem(w, entityPos.x, entityPos.y, entityPos.z, stack); - ((PipeTransportItems) transport).entityEntering(entity, - entityPos.orientation); + ((PipeTransportItems) transport).entityEntering(entity, entityPos.orientation); } } @@ -132,8 +124,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { * inventory, null if none. On certain cases, the extractable slot depends * on the position of the pipe. */ - public ItemStack checkExtract(IInventory inventory, boolean doRemove, - Orientations from) { + public ItemStack checkExtract(IInventory inventory, boolean doRemove, Orientations from) { if (inventory instanceof ISpecialInventory) // TAKE INTO ACCOUNT SPECIAL INVENTORIES!!! return ((ISpecialInventory) inventory).extractItem(doRemove, from); @@ -142,13 +133,11 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { ISidedInventory sidedInv = (ISidedInventory) inventory; int first = sidedInv.getStartInventorySide(from.ordinal()); - int last = first + sidedInv.getSizeInventorySide(from.ordinal()) - - 1; + int last = first + sidedInv.getSizeInventorySide(from.ordinal()) - 1; IInventory inv = Utils.getInventory(inventory); - ItemStack result = checkExtractGeneric(inv, doRemove, from, first, - last); + ItemStack result = checkExtractGeneric(inv, doRemove, from, first, last); if (result != null) return result; @@ -166,9 +155,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { if (slot != null && slot.stackSize > 0) if (doRemove) - return inventory.decrStackSize(slotIndex, - (int) powerProvider.useEnergy(1, slot.stackSize, - true)); + return inventory.decrStackSize(slotIndex, (int) powerProvider.useEnergy(1, slot.stackSize, true)); else return slot; } else if (inventory.getSizeInventory() == 3) { @@ -187,17 +174,14 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { if (slot != null && slot.stackSize > 0) if (doRemove) - return inventory.decrStackSize(slotIndex, - (int) powerProvider.useEnergy(1, slot.stackSize, - true)); + return inventory.decrStackSize(slotIndex, (int) powerProvider.useEnergy(1, slot.stackSize, true)); else return slot; } else { // This is a generic inventory IInventory inv = Utils.getInventory(inventory); - ItemStack result = checkExtractGeneric(inv, doRemove, from, 0, - inv.getSizeInventory() - 1); + ItemStack result = checkExtractGeneric(inv, doRemove, from, 0, inv.getSizeInventory() - 1); if (result != null) return result; @@ -206,18 +190,15 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor { return null; } - public ItemStack checkExtractGeneric(IInventory inventory, - boolean doRemove, Orientations from, int start, int stop) { + public ItemStack checkExtractGeneric(IInventory inventory, boolean doRemove, Orientations from, int start, int stop) { for (int k = start; k <= stop; ++k) - if (inventory.getStackInSlot(k) != null - && inventory.getStackInSlot(k).stackSize > 0) { + if (inventory.getStackInSlot(k) != null && inventory.getStackInSlot(k).stackSize > 0) { ItemStack slot = inventory.getStackInSlot(k); if (slot != null && slot.stackSize > 0) if (doRemove) - return inventory.decrStackSize(k, (int) powerProvider - .useEnergy(1, slot.stackSize, true)); + return inventory.decrStackSize(k, (int) powerProvider.useEnergy(1, slot.stackSize, true)); else return slot; } diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java index 80cdb440..7a72b266 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipeLiquidsWood.java @@ -59,23 +59,18 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor { if (meta > 5) return; - Position pos = new Position(xCoord, yCoord, zCoord, - Orientations.values()[meta]); + Position pos = new Position(xCoord, yCoord, zCoord, Orientations.values()[meta]); pos.moveForwards(1); int blockId = w.getBlockId((int) pos.x, (int) pos.y, (int) pos.z); - TileEntity tile = w.getBlockTileEntity((int) pos.x, (int) pos.y, - (int) pos.z); + TileEntity tile = w.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); - if (tile == null - || !(tile instanceof ILiquidContainer) - || PipeLogicWood - .isExcludedFromExtraction(Block.blocksList[blockId])) + if (tile == null || !(tile instanceof ILiquidContainer) + || PipeLogicWood.isExcludedFromExtraction(Block.blocksList[blockId])) return; if (tile instanceof ILiquidContainer) if (liquidToExtract <= BuildCraftAPI.BUCKET_VOLUME) - liquidToExtract += powerProvider.useEnergy(1, 1, true) - * BuildCraftAPI.BUCKET_VOLUME; + liquidToExtract += powerProvider.useEnergy(1, 1, true) * BuildCraftAPI.BUCKET_VOLUME; } @Override @@ -95,25 +90,19 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor { int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if (liquidToExtract > 0 && meta < 6) { - Position pos = new Position(xCoord, yCoord, zCoord, - Orientations.values()[meta]); + Position pos = new Position(xCoord, yCoord, zCoord, Orientations.values()[meta]); pos.moveForwards(1); - TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, - (int) pos.y, (int) pos.z); + TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z); if (tile instanceof ILiquidContainer) { ILiquidContainer container = (ILiquidContainer) tile; int flowRate = ((PipeTransportLiquids) transport).flowRate; - int extracted = container - .empty(liquidToExtract > flowRate ? flowRate - : liquidToExtract, false); + int extracted = container.empty(liquidToExtract > flowRate ? flowRate : liquidToExtract, false); - extracted = ((PipeTransportLiquids) transport).fill( - pos.orientation, extracted, container.getLiquidId(), - true); + extracted = ((PipeTransportLiquids) transport).fill(pos.orientation, extracted, container.getLiquidId(), true); container.empty(extracted, true); diff --git a/common/net/minecraft/src/buildcraft/transport/pipes/PipePowerWood.java b/common/net/minecraft/src/buildcraft/transport/pipes/PipePowerWood.java index 5a841409..3dfe059a 100644 --- a/common/net/minecraft/src/buildcraft/transport/pipes/PipePowerWood.java +++ b/common/net/minecraft/src/buildcraft/transport/pipes/PipePowerWood.java @@ -66,8 +66,7 @@ public class PipePowerWood extends Pipe implements IPowerReceptor { if (tile instanceof TileGenericPipe) { if (((TileGenericPipe) tile).pipe == null) { - System.out - .println("PipePowerWood.pipe was null, this used to cause a NPE crash)"); + System.out.println("PipePowerWood.pipe was null, this used to cause a NPE crash)"); continue; // Null pointer protection } @@ -82,8 +81,7 @@ public class PipePowerWood extends Pipe implements IPowerReceptor { else energyToRemove = 1; - float energyUsed = powerProvider.useEnergy(1, - energyToRemove, true); + float energyUsed = powerProvider.useEnergy(1, energyToRemove, true); pow.receiveEnergy(o.reverse(), energyUsed);