diff --git a/src/functionalTest/java/appeng/test/AppengTestMod.java b/src/functionalTest/java/appeng/test/AppengTestMod.java index f66e9536864..a7efad12a49 100644 --- a/src/functionalTest/java/appeng/test/AppengTestMod.java +++ b/src/functionalTest/java/appeng/test/AppengTestMod.java @@ -1,15 +1,13 @@ package appeng.test; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLServerStartedEvent; import java.io.File; import java.io.PrintWriter; import java.nio.file.FileSystems; import java.nio.file.Path; + import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; + import org.apache.commons.io.output.CloseShieldOutputStream; import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; @@ -22,6 +20,11 @@ import org.junit.platform.launcher.listeners.TestExecutionSummary; import org.junit.platform.reporting.legacy.xml.LegacyXmlReportGeneratingListener; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.event.FMLServerStartedEvent; + // Most of these don't matter as this mod never gets published @Mod( modid = "appeng-tests", @@ -29,6 +32,7 @@ version = "1.0", dependencies = "required-after:appliedenergistics2") public class AppengTestMod { + @EventHandler public void onServerStarted(FMLServerStartedEvent startedEv) { MinecraftServer.getServer().addChatMessage(new ChatComponentText("Running AE2 unit tests...")); @@ -39,8 +43,7 @@ public void onServerStarted(FMLServerStartedEvent startedEv) { public void runTests() { // https://junit.org/junit5/docs/current/user-guide/#launcher-api System.setProperty("junit.platform.reporting.open.xml.enabled", "false"); - final Path testsXmlOutDir = - FileSystems.getDefault().getPath("./junit-out/").toAbsolutePath(); + final Path testsXmlOutDir = FileSystems.getDefault().getPath("./junit-out/").toAbsolutePath(); final File testsXmlOutDirFile = testsXmlOutDir.toFile(); testsXmlOutDirFile.mkdirs(); { @@ -54,13 +57,13 @@ public void runTests() { } } final LauncherDiscoveryRequest discovery = LauncherDiscoveryRequestBuilder.request() - .selectors(DiscoverySelectors.selectPackage("appeng.test")) - .build(); + .selectors(DiscoverySelectors.selectPackage("appeng.test")).build(); final SummaryGeneratingListener summaryGenerator = new SummaryGeneratingListener(); final TestExecutionSummary summary; try (PrintWriter stderrWriter = new PrintWriter(new CloseShieldOutputStream(System.err), true)) { - final LegacyXmlReportGeneratingListener xmlGenerator = - new LegacyXmlReportGeneratingListener(testsXmlOutDir, stderrWriter); + final LegacyXmlReportGeneratingListener xmlGenerator = new LegacyXmlReportGeneratingListener( + testsXmlOutDir, + stderrWriter); try (LauncherSession session = LauncherFactory.openSession()) { final Launcher launcher = session.getLauncher(); final TestPlan plan = launcher.discover(discovery); @@ -74,8 +77,7 @@ public void runTests() { stderrWriter.flush(); } // Throw an exception if running via `runServer` - if (summary.getTotalFailureCount() > 0 - && FMLCommonHandler.instance().getSide().isServer()) { + if (summary.getTotalFailureCount() > 0 && FMLCommonHandler.instance().getSide().isServer()) { throw new RuntimeException("Some of the unit tests failed to execute, check the log for details"); } } diff --git a/src/functionalTest/java/appeng/test/CraftingV2Tests.java b/src/functionalTest/java/appeng/test/CraftingV2Tests.java index 528becc376e..7b3da7b50b0 100644 --- a/src/functionalTest/java/appeng/test/CraftingV2Tests.java +++ b/src/functionalTest/java/appeng/test/CraftingV2Tests.java @@ -2,12 +2,8 @@ import static org.junit.jupiter.api.Assertions.*; -import appeng.api.storage.data.IAEItemStack; -import appeng.crafting.v2.CraftingJobV2; -import appeng.test.mockme.MockAESystem; -import appeng.util.item.AEItemStack; -import appeng.util.item.ItemList; import java.io.File; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -15,11 +11,19 @@ import net.minecraft.world.*; import net.minecraft.world.WorldSettings.GameType; import net.minecraftforge.common.DimensionManager; + import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import appeng.api.storage.data.IAEItemStack; +import appeng.crafting.v2.CraftingJobV2; +import appeng.test.mockme.MockAESystem; +import appeng.util.item.AEItemStack; +import appeng.util.item.ItemList; + public class CraftingV2Tests { + static World dummyWorld = null; final int SIMPLE_SIMULATION_TIMEOUT_MS = 100; @@ -29,19 +33,19 @@ public CraftingV2Tests() { DimensionManager.registerDimension(256, 256); } if (dummyWorld == null) { - dummyWorld = - new WorldServer( - MinecraftServer.getServer(), - new DummySaveHandler(), - "DummyTestWorld", - 256, - new WorldSettings(256, GameType.SURVIVAL, false, false, WorldType.DEFAULT), - MinecraftServer.getServer().theProfiler) { - @Override - public File getChunkSaveLocation() { - return new File("dummy-ignoreme"); - } - }; + dummyWorld = new WorldServer( + MinecraftServer.getServer(), + new DummySaveHandler(), + "DummyTestWorld", + 256, + new WorldSettings(256, GameType.SURVIVAL, false, false, WorldType.DEFAULT), + MinecraftServer.getServer().theProfiler) { + + @Override + public File getChunkSaveLocation() { + return new File("dummy-ignoreme"); + } + }; } } @@ -61,7 +65,9 @@ private void assertJobPlanEquals(CraftingJobV2 job, IAEItemStack... stacks) { assertNotNull(matching, stack::toString); assertEquals(stack.getStackSize(), matching.getStackSize(), () -> "Stack size of " + stack); assertEquals( - stack.getCountRequestable(), matching.getCountRequestable(), () -> "Requestable count of " + stack); + stack.getCountRequestable(), + matching.getCountRequestable(), + () -> "Requestable count of " + stack); matching.setStackSize(0); matching.setCountRequestable(0); } @@ -72,10 +78,8 @@ private void assertJobPlanEquals(CraftingJobV2 job, IAEItemStack... stacks) { } private void addDummyGappleRecipe(MockAESystem aeSystem) { - aeSystem.newProcessingPattern() - .addInput(new ItemStack(Items.gold_ingot, 1)) - .addOutput(new ItemStack(Items.golden_apple, 1)) - .buildAndAdd(); + aeSystem.newProcessingPattern().addInput(new ItemStack(Items.gold_ingot, 1)) + .addOutput(new ItemStack(Items.golden_apple, 1)).buildAndAdd(); } @Test @@ -92,10 +96,8 @@ void noPatternSimulation() { void simplePatternSimulation() { MockAESystem aeSystem = new MockAESystem(dummyWorld); // Very expensive sticks - aeSystem.newProcessingPattern() - .addInput(new ItemStack(Items.diamond, 1)) - .addOutput(new ItemStack(Items.stick, 1)) - .buildAndAdd(); + aeSystem.newProcessingPattern().addInput(new ItemStack(Items.diamond, 1)) + .addOutput(new ItemStack(Items.stick, 1)).buildAndAdd(); // Another pattern that shouldn't match addDummyGappleRecipe(aeSystem); final CraftingJobV2 job = aeSystem.makeCraftingJob(new ItemStack(Items.stick, 13)); @@ -127,10 +129,8 @@ void simplePatternWithItemsSimulation() { aeSystem.addStoredItem(new ItemStack(Items.diamond, 64)); aeSystem.addStoredItem(new ItemStack(Items.gold_ingot, 64)); // Very expensive sticks - aeSystem.newProcessingPattern() - .addInput(new ItemStack(Items.diamond, 1)) - .addOutput(new ItemStack(Items.stick, 1)) - .buildAndAdd(); + aeSystem.newProcessingPattern().addInput(new ItemStack(Items.diamond, 1)) + .addOutput(new ItemStack(Items.stick, 1)).buildAndAdd(); // Another pattern that shouldn't match addDummyGappleRecipe(aeSystem); final CraftingJobV2 job = aeSystem.makeCraftingJob(new ItemStack(Items.stick, 13)); @@ -146,36 +146,27 @@ void simplePatternWithItemsSimulation() { private void addPlankPatterns(MockAESystem aeSystem) { // Add all types of wood for (int meta = 0; meta < 4; meta++) { - aeSystem.newCraftingPattern() - .allowBeingASubstitute() - .addInput(new ItemStack(Blocks.log, 1, meta)) - .addOutput(new ItemStack(Blocks.planks, 4, meta)) - .buildAndAdd(); + aeSystem.newCraftingPattern().allowBeingASubstitute().addInput(new ItemStack(Blocks.log, 1, meta)) + .addOutput(new ItemStack(Blocks.planks, 4, meta)).buildAndAdd(); } } private void addFuzzyChestPattern(MockAESystem aeSystem) { - aeSystem.newCraftingPattern() - .allowUsingSubstitutes() + aeSystem.newCraftingPattern().allowUsingSubstitutes() // row 1 - .addInput(new ItemStack(Blocks.planks, 1)) - .addInput(new ItemStack(Blocks.planks, 1)) + .addInput(new ItemStack(Blocks.planks, 1)).addInput(new ItemStack(Blocks.planks, 1)) .addInput(new ItemStack(Blocks.planks, 1)) // row 2 - .addInput(new ItemStack(Blocks.planks, 1)) - .addInput(null) - .addInput(new ItemStack(Blocks.planks, 1)) + .addInput(new ItemStack(Blocks.planks, 1)).addInput(null).addInput(new ItemStack(Blocks.planks, 1)) // row 3 - .addInput(new ItemStack(Blocks.planks, 1)) - .addInput(new ItemStack(Blocks.planks, 1)) + .addInput(new ItemStack(Blocks.planks, 1)).addInput(new ItemStack(Blocks.planks, 1)) .addInput(new ItemStack(Blocks.planks, 1)) // end - .addOutput(new ItemStack(Blocks.chest, 1)) - .buildAndAdd(); + .addOutput(new ItemStack(Blocks.chest, 1)).buildAndAdd(); } @ParameterizedTest - @ValueSource(ints = {0, 1}) + @ValueSource(ints = { 0, 1 }) void craftChestFromLogs(int woodMetadata) { MockAESystem aeSystem = new MockAESystem(dummyWorld); aeSystem.addStoredItem(new ItemStack(Blocks.log, 64, woodMetadata)); @@ -191,8 +182,7 @@ void craftChestFromLogs(int woodMetadata) { assertJobPlanEquals( job, AEItemStack.create(new ItemStack(Blocks.log, 2, woodMetadata)), - AEItemStack.create(new ItemStack(Blocks.planks, 0, woodMetadata)) - .setCountRequestable(8), + AEItemStack.create(new ItemStack(Blocks.planks, 0, woodMetadata)).setCountRequestable(8), AEItemStack.create(new ItemStack(Blocks.chest, 0)).setCountRequestable(1)); } @@ -223,14 +213,10 @@ void craftChestFromMixedLogs() { void canHandleCyclicalPatterns() { MockAESystem aeSystem = new MockAESystem(dummyWorld); aeSystem.addStoredItem(new ItemStack(Blocks.log, 4, 0)); - aeSystem.newProcessingPattern() - .addInput(new ItemStack(Blocks.log, 1)) - .addOutput(new ItemStack(Blocks.planks, 4)) - .buildAndAdd(); - aeSystem.newProcessingPattern() - .addInput(new ItemStack(Blocks.planks, 4)) - .addOutput(new ItemStack(Blocks.log, 1)) - .buildAndAdd(); + aeSystem.newProcessingPattern().addInput(new ItemStack(Blocks.log, 1)) + .addOutput(new ItemStack(Blocks.planks, 4)).buildAndAdd(); + aeSystem.newProcessingPattern().addInput(new ItemStack(Blocks.planks, 4)) + .addOutput(new ItemStack(Blocks.log, 1)).buildAndAdd(); for (int plankAmount = 1; plankAmount < 64; plankAmount++) { final CraftingJobV2 job = aeSystem.makeCraftingJob(new ItemStack(Blocks.planks, plankAmount)); simulateJobAndCheck(job, SIMPLE_SIMULATION_TIMEOUT_MS); @@ -242,11 +228,8 @@ void canHandleCyclicalPatterns() { void strictNamedItems() { MockAESystem aeSystem = new MockAESystem(dummyWorld); aeSystem.addStoredItem(new ItemStack(Blocks.log, 4, 0).setStackDisplayName("Named Log")); - aeSystem.newProcessingPattern() - .addInput(new ItemStack(Blocks.log, 1)) - .addOutput(new ItemStack(Blocks.planks, 4)) - .allowBeingASubstitute() - .buildAndAdd(); + aeSystem.newProcessingPattern().addInput(new ItemStack(Blocks.log, 1)) + .addOutput(new ItemStack(Blocks.planks, 4)).allowBeingASubstitute().buildAndAdd(); final CraftingJobV2 job = aeSystem.makeCraftingJob(new ItemStack(Blocks.planks, 1)); simulateJobAndCheck(job, SIMPLE_SIMULATION_TIMEOUT_MS); diff --git a/src/functionalTest/java/appeng/test/DummySaveHandler.java b/src/functionalTest/java/appeng/test/DummySaveHandler.java index 8b9d9f87b08..66404764b39 100644 --- a/src/functionalTest/java/appeng/test/DummySaveHandler.java +++ b/src/functionalTest/java/appeng/test/DummySaveHandler.java @@ -1,6 +1,7 @@ package appeng.test; import java.io.File; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.MinecraftException; import net.minecraft.world.WorldProvider; @@ -10,6 +11,7 @@ import net.minecraft.world.storage.WorldInfo; public class DummySaveHandler implements ISaveHandler { + @Override public WorldInfo loadWorldInfo() { return null; diff --git a/src/functionalTest/java/appeng/test/mockme/MockAESystem.java b/src/functionalTest/java/appeng/test/mockme/MockAESystem.java index 757bf6161ec..096422546b8 100644 --- a/src/functionalTest/java/appeng/test/mockme/MockAESystem.java +++ b/src/functionalTest/java/appeng/test/mockme/MockAESystem.java @@ -1,5 +1,14 @@ package appeng.test.mockme; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.networking.crafting.ICraftingGrid; @@ -17,15 +26,9 @@ import appeng.me.storage.MEPassThrough; import appeng.util.Platform; import appeng.util.item.AEItemStack; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.world.World; public class MockAESystem implements ICellProvider { + public final World world; public final MockGrid grid = new MockGrid(); public final BaseActionSource dummyActionSource = new BaseActionSource(); @@ -44,7 +47,9 @@ public MockAESystem addStoredItem(ItemStack stack) { final IAEItemStack aeStack = AEItemStack.create(stack); this.itemStorage.injectItems(aeStack, Actionable.MODULATE, dummyActionSource); this.sgCache.postAlterationOfStoredItems( - StorageChannel.ITEMS, Collections.singletonList(aeStack), dummyActionSource); + StorageChannel.ITEMS, + Collections.singletonList(aeStack), + dummyActionSource); return this; } @@ -67,6 +72,7 @@ public PatternBuilder newCraftingPattern() { } public class PatternBuilder { + public final boolean isCrafting; public final List inputs = new ArrayList<>(9); public final List outputs = new ArrayList<>(9); @@ -108,11 +114,7 @@ public PatternBuilder addOutput(ItemStack stack) { } public void buildAndAdd() { - final ItemStack encodedPattern = AEApi.instance() - .definitions() - .items() - .encodedPattern() - .maybeStack(1) + final ItemStack encodedPattern = AEApi.instance().definitions().items().encodedPattern().maybeStack(1) .get(); final NBTTagCompound patternTags = new NBTTagCompound(); patternTags.setBoolean("crafting", isCrafting); @@ -145,8 +147,9 @@ public void buildAndAdd() { // Simulated inventories private final MECraftingInventory itemStorage = new MECraftingInventory(); - private final IMEInventoryHandler storageHandler = - new MEPassThrough<>(itemStorage, StorageChannel.ITEMS); + private final IMEInventoryHandler storageHandler = new MEPassThrough<>( + itemStorage, + StorageChannel.ITEMS); @Override public List getCellArray(StorageChannel channel) { diff --git a/src/functionalTest/java/appeng/test/mockme/MockCraftingMedium.java b/src/functionalTest/java/appeng/test/mockme/MockCraftingMedium.java index ff448342762..36ae0959068 100644 --- a/src/functionalTest/java/appeng/test/mockme/MockCraftingMedium.java +++ b/src/functionalTest/java/appeng/test/mockme/MockCraftingMedium.java @@ -1,10 +1,12 @@ package appeng.test.mockme; +import net.minecraft.inventory.InventoryCrafting; + import appeng.api.networking.crafting.ICraftingMedium; import appeng.api.networking.crafting.ICraftingPatternDetails; -import net.minecraft.inventory.InventoryCrafting; public class MockCraftingMedium implements ICraftingMedium { + @Override public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) { return true; diff --git a/src/functionalTest/java/appeng/test/mockme/MockGrid.java b/src/functionalTest/java/appeng/test/mockme/MockGrid.java index af5559148e0..d0e31f39bef 100644 --- a/src/functionalTest/java/appeng/test/mockme/MockGrid.java +++ b/src/functionalTest/java/appeng/test/mockme/MockGrid.java @@ -3,6 +3,7 @@ import appeng.me.Grid; public class MockGrid extends Grid { + public final MockGridNode rootNode; public MockGrid() { diff --git a/src/functionalTest/java/appeng/test/mockme/MockGridBlock.java b/src/functionalTest/java/appeng/test/mockme/MockGridBlock.java index d7452c047da..0825ec585b4 100644 --- a/src/functionalTest/java/appeng/test/mockme/MockGridBlock.java +++ b/src/functionalTest/java/appeng/test/mockme/MockGridBlock.java @@ -1,14 +1,17 @@ package appeng.test.mockme; -import appeng.api.networking.*; -import appeng.api.util.AEColor; -import appeng.api.util.DimensionalCoord; import java.util.EnumSet; + import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.*; +import appeng.api.util.AEColor; +import appeng.api.util.DimensionalCoord; + public class MockGridBlock implements IGridBlock { + @Override public double getIdlePowerUsage() { return 0; diff --git a/src/functionalTest/java/appeng/test/mockme/MockGridMachine.java b/src/functionalTest/java/appeng/test/mockme/MockGridMachine.java index b70f2bd162a..2b36c6f6d33 100644 --- a/src/functionalTest/java/appeng/test/mockme/MockGridMachine.java +++ b/src/functionalTest/java/appeng/test/mockme/MockGridMachine.java @@ -1,11 +1,13 @@ package appeng.test.mockme; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; import appeng.api.util.AECableType; -import net.minecraftforge.common.util.ForgeDirection; public class MockGridMachine implements IGridHost { + @Override public IGridNode getGridNode(ForgeDirection dir) { return null; diff --git a/src/functionalTest/java/appeng/test/mockme/MockGridNode.java b/src/functionalTest/java/appeng/test/mockme/MockGridNode.java index 8d84a0cec87..28e4b22770c 100644 --- a/src/functionalTest/java/appeng/test/mockme/MockGridNode.java +++ b/src/functionalTest/java/appeng/test/mockme/MockGridNode.java @@ -3,6 +3,7 @@ import appeng.me.GridNode; public class MockGridNode extends GridNode { + public final MockGridBlock myBlock; public MockGridNode() { diff --git a/src/main/java/appeng/api/AEApi.java b/src/main/java/appeng/api/AEApi.java index a0407609161..31670827db6 100644 --- a/src/main/java/appeng/api/AEApi.java +++ b/src/main/java/appeng/api/AEApi.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api; -import appeng.api.exceptions.CoreInaccessibleException; import java.lang.reflect.Field; +import appeng.api.exceptions.CoreInaccessibleException; + /** * Entry point for api. *

@@ -48,11 +39,17 @@ public enum AEApi { throw new CoreInaccessibleException( "AE2 API tried to access the " + CORE_API_FQN + " class, without it being declared."); } catch (final NoSuchFieldException e) { - throw new CoreInaccessibleException("AE2 API tried to access the " + CORE_API_FIELD + " field in " - + CORE_API_FQN + " without it being declared."); + throw new CoreInaccessibleException( + "AE2 API tried to access the " + CORE_API_FIELD + + " field in " + + CORE_API_FQN + + " without it being declared."); } catch (final IllegalAccessException e) { - throw new CoreInaccessibleException("AE2 API tried to access the " + CORE_API_FIELD + " field in " - + CORE_API_FQN + " without enough access permissions."); + throw new CoreInaccessibleException( + "AE2 API tried to access the " + CORE_API_FIELD + + " field in " + + CORE_API_FQN + + " without enough access permissions."); } } diff --git a/src/main/java/appeng/api/IAppEngApi.java b/src/main/java/appeng/api/IAppEngApi.java index d9808c413de..348c9f1e72e 100644 --- a/src/main/java/appeng/api/IAppEngApi.java +++ b/src/main/java/appeng/api/IAppEngApi.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api; diff --git a/src/main/java/appeng/api/config/AccessRestriction.java b/src/main/java/appeng/api/config/AccessRestriction.java index 8385c82e6a4..b3595236e1e 100644 --- a/src/main/java/appeng/api/config/AccessRestriction.java +++ b/src/main/java/appeng/api/config/AccessRestriction.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; public enum AccessRestriction { + NO_ACCESS(0), READ(1), WRITE(2), diff --git a/src/main/java/appeng/api/config/ActionItems.java b/src/main/java/appeng/api/config/ActionItems.java index 9961e9df7e4..4fcc6730af6 100644 --- a/src/main/java/appeng/api/config/ActionItems.java +++ b/src/main/java/appeng/api/config/ActionItems.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/Actionable.java b/src/main/java/appeng/api/config/Actionable.java index 93835e62ade..c442c1ca64f 100644 --- a/src/main/java/appeng/api/config/Actionable.java +++ b/src/main/java/appeng/api/config/Actionable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/CondenserOutput.java b/src/main/java/appeng/api/config/CondenserOutput.java index 03483eb4d27..6a6b5e850d4 100644 --- a/src/main/java/appeng/api/config/CondenserOutput.java +++ b/src/main/java/appeng/api/config/CondenserOutput.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; public enum CondenserOutput { + TRASH, // 0 MATTER_BALLS, // 256 diff --git a/src/main/java/appeng/api/config/CopyMode.java b/src/main/java/appeng/api/config/CopyMode.java index b55d70df6c7..cb2ed5ae1d4 100644 --- a/src/main/java/appeng/api/config/CopyMode.java +++ b/src/main/java/appeng/api/config/CopyMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/FullnessMode.java b/src/main/java/appeng/api/config/FullnessMode.java index 423c9cd5ff2..2ced413cc5f 100644 --- a/src/main/java/appeng/api/config/FullnessMode.java +++ b/src/main/java/appeng/api/config/FullnessMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/FuzzyMode.java b/src/main/java/appeng/api/config/FuzzyMode.java index 1d403a4fa75..a96d2c9fdf7 100644 --- a/src/main/java/appeng/api/config/FuzzyMode.java +++ b/src/main/java/appeng/api/config/FuzzyMode.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; public enum FuzzyMode { + // Note that percentage damaged, is the inverse of percentage durability. IGNORE_ALL(-1), PERCENT_99(0), diff --git a/src/main/java/appeng/api/config/IncludeExclude.java b/src/main/java/appeng/api/config/IncludeExclude.java index 7aae32b7996..76820e69a00 100644 --- a/src/main/java/appeng/api/config/IncludeExclude.java +++ b/src/main/java/appeng/api/config/IncludeExclude.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/ItemSubstitution.java b/src/main/java/appeng/api/config/ItemSubstitution.java index e32ec6ea6c1..76077e1a912 100644 --- a/src/main/java/appeng/api/config/ItemSubstitution.java +++ b/src/main/java/appeng/api/config/ItemSubstitution.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/LevelEmitterMode.java b/src/main/java/appeng/api/config/LevelEmitterMode.java index 03ac44971f4..7c18328b6da 100644 --- a/src/main/java/appeng/api/config/LevelEmitterMode.java +++ b/src/main/java/appeng/api/config/LevelEmitterMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/LevelType.java b/src/main/java/appeng/api/config/LevelType.java index 8f07398473b..b8759da3d12 100644 --- a/src/main/java/appeng/api/config/LevelType.java +++ b/src/main/java/appeng/api/config/LevelType.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/ModSettings.java b/src/main/java/appeng/api/config/ModSettings.java index 097053603e1..4e268c13153 100644 --- a/src/main/java/appeng/api/config/ModSettings.java +++ b/src/main/java/appeng/api/config/ModSettings.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/NetworkEmitterMode.java b/src/main/java/appeng/api/config/NetworkEmitterMode.java index 73178902e76..acbb33e3e69 100644 --- a/src/main/java/appeng/api/config/NetworkEmitterMode.java +++ b/src/main/java/appeng/api/config/NetworkEmitterMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/OperationMode.java b/src/main/java/appeng/api/config/OperationMode.java index 4a4cccaaac1..a8dc1492bb4 100644 --- a/src/main/java/appeng/api/config/OperationMode.java +++ b/src/main/java/appeng/api/config/OperationMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/OutputMode.java b/src/main/java/appeng/api/config/OutputMode.java index 252dc0a078f..aa4dc3facbb 100644 --- a/src/main/java/appeng/api/config/OutputMode.java +++ b/src/main/java/appeng/api/config/OutputMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/PowerMultiplier.java b/src/main/java/appeng/api/config/PowerMultiplier.java index 3f2bc4721cb..dc072bfe7a1 100644 --- a/src/main/java/appeng/api/config/PowerMultiplier.java +++ b/src/main/java/appeng/api/config/PowerMultiplier.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; public enum PowerMultiplier { + ONE, CONFIG; diff --git a/src/main/java/appeng/api/config/PowerUnits.java b/src/main/java/appeng/api/config/PowerUnits.java index e5125ea5c0a..7103b2fe812 100644 --- a/src/main/java/appeng/api/config/PowerUnits.java +++ b/src/main/java/appeng/api/config/PowerUnits.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; public enum PowerUnits { + AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy EU("gui.appliedenergistics2.units.ic2"), // IndustrialCraft 2 - Energy Units WA("gui.appliedenergistics2.units.rotarycraft"), // RotaryCraft - Watts diff --git a/src/main/java/appeng/api/config/RedstoneMode.java b/src/main/java/appeng/api/config/RedstoneMode.java index bd4b0073e0d..5011aad5828 100644 --- a/src/main/java/appeng/api/config/RedstoneMode.java +++ b/src/main/java/appeng/api/config/RedstoneMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/RelativeDirection.java b/src/main/java/appeng/api/config/RelativeDirection.java index 7c598a0bc25..95678bbda91 100644 --- a/src/main/java/appeng/api/config/RelativeDirection.java +++ b/src/main/java/appeng/api/config/RelativeDirection.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/SchedulingMode.java b/src/main/java/appeng/api/config/SchedulingMode.java index ee3ad2a99c6..aa059899ad8 100644 --- a/src/main/java/appeng/api/config/SchedulingMode.java +++ b/src/main/java/appeng/api/config/SchedulingMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/SearchBoxMode.java b/src/main/java/appeng/api/config/SearchBoxMode.java index 275f873882e..276d2084095 100644 --- a/src/main/java/appeng/api/config/SearchBoxMode.java +++ b/src/main/java/appeng/api/config/SearchBoxMode.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/SecurityPermissions.java b/src/main/java/appeng/api/config/SecurityPermissions.java index 8174d4e3fdb..a454efb9548 100644 --- a/src/main/java/appeng/api/config/SecurityPermissions.java +++ b/src/main/java/appeng/api/config/SecurityPermissions.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; @@ -28,6 +18,7 @@ * gameplay feature. */ public enum SecurityPermissions { + /** * required to insert items into the network via terminal ( also used for machines based on the owner of the * network, which is determined by its Security Block. ) @@ -55,8 +46,7 @@ public enum SecurityPermissions { */ SECURITY; - private final String unlocalizedName = - "gui.appliedenergistics2.security." + this.name().toLowerCase(); + private final String unlocalizedName = "gui.appliedenergistics2.security." + this.name().toLowerCase(); public String getUnlocalizedName() { return this.unlocalizedName + ".name"; diff --git a/src/main/java/appeng/api/config/Settings.java b/src/main/java/appeng/api/config/Settings.java index 5ab1c0cada9..74c4a16624f 100644 --- a/src/main/java/appeng/api/config/Settings.java +++ b/src/main/java/appeng/api/config/Settings.java @@ -1,32 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; import java.util.EnumSet; + import javax.annotation.Nonnull; public enum Settings { + LEVEL_EMITTER_MODE(EnumSet.allOf(LevelEmitterMode.class)), REDSTONE_EMITTER(EnumSet.of(RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL)), diff --git a/src/main/java/appeng/api/config/SortDir.java b/src/main/java/appeng/api/config/SortDir.java index 3227e7a2233..17d7b66bd89 100644 --- a/src/main/java/appeng/api/config/SortDir.java +++ b/src/main/java/appeng/api/config/SortDir.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/SortOrder.java b/src/main/java/appeng/api/config/SortOrder.java index bbf7f9cf74e..e5d1b558850 100644 --- a/src/main/java/appeng/api/config/SortOrder.java +++ b/src/main/java/appeng/api/config/SortOrder.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/StorageFilter.java b/src/main/java/appeng/api/config/StorageFilter.java index 158fb3e7067..e7d96230f56 100644 --- a/src/main/java/appeng/api/config/StorageFilter.java +++ b/src/main/java/appeng/api/config/StorageFilter.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/TerminalStyle.java b/src/main/java/appeng/api/config/TerminalStyle.java index 646ae69c343..61016621264 100644 --- a/src/main/java/appeng/api/config/TerminalStyle.java +++ b/src/main/java/appeng/api/config/TerminalStyle.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/TunnelType.java b/src/main/java/appeng/api/config/TunnelType.java index dfd6df0eb80..a83285677ac 100644 --- a/src/main/java/appeng/api/config/TunnelType.java +++ b/src/main/java/appeng/api/config/TunnelType.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/Upgrades.java b/src/main/java/appeng/api/config/Upgrades.java index 709a5bba3cb..586f3bdf3aa 100644 --- a/src/main/java/appeng/api/config/Upgrades.java +++ b/src/main/java/appeng/api/config/Upgrades.java @@ -1,36 +1,30 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; -import appeng.api.definitions.IItemDefinition; -import appeng.api.util.AEItemDefinition; -import com.google.common.base.Optional; import java.util.HashMap; import java.util.Map; + import net.minecraft.item.ItemStack; +import appeng.api.definitions.IItemDefinition; +import appeng.api.util.AEItemDefinition; + +import com.google.common.base.Optional; + public enum Upgrades { + /** * Gold Tier Upgrades. */ diff --git a/src/main/java/appeng/api/config/ViewItems.java b/src/main/java/appeng/api/config/ViewItems.java index 4658a083c65..52d7507704b 100644 --- a/src/main/java/appeng/api/config/ViewItems.java +++ b/src/main/java/appeng/api/config/ViewItems.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/config/YesNo.java b/src/main/java/appeng/api/config/YesNo.java index 79830d9608c..356140c6f8d 100644 --- a/src/main/java/appeng/api/config/YesNo.java +++ b/src/main/java/appeng/api/config/YesNo.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.config; diff --git a/src/main/java/appeng/api/definitions/Blocks.java b/src/main/java/appeng/api/definitions/Blocks.java index 9b147a127e0..1a5c5fe9810 100644 --- a/src/main/java/appeng/api/definitions/Blocks.java +++ b/src/main/java/appeng/api/definitions/Blocks.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -30,6 +20,7 @@ */ @Deprecated public class Blocks { + public AEItemDefinition blockQuartzOre; public AEItemDefinition blockQuartzOreCharged; diff --git a/src/main/java/appeng/api/definitions/IBlockDefinition.java b/src/main/java/appeng/api/definitions/IBlockDefinition.java index f5ef67705fc..05e205a7d8d 100644 --- a/src/main/java/appeng/api/definitions/IBlockDefinition.java +++ b/src/main/java/appeng/api/definitions/IBlockDefinition.java @@ -1,11 +1,13 @@ package appeng.api.definitions; -import com.google.common.base.Optional; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.world.IBlockAccess; +import com.google.common.base.Optional; + public interface IBlockDefinition extends IItemDefinition { + /** * @return the {@link Block} implementation if applicable */ diff --git a/src/main/java/appeng/api/definitions/IBlocks.java b/src/main/java/appeng/api/definitions/IBlocks.java index 6ba8e662d32..9c38d7ce02a 100644 --- a/src/main/java/appeng/api/definitions/IBlocks.java +++ b/src/main/java/appeng/api/definitions/IBlocks.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -27,6 +17,7 @@ * A list of all blocks in AE */ public interface IBlocks { + /* * world gen */ diff --git a/src/main/java/appeng/api/definitions/IComparableDefinition.java b/src/main/java/appeng/api/definitions/IComparableDefinition.java index f30db6eff87..2329c464f0e 100644 --- a/src/main/java/appeng/api/definitions/IComparableDefinition.java +++ b/src/main/java/appeng/api/definitions/IComparableDefinition.java @@ -11,6 +11,7 @@ * @since rv2 */ public interface IComparableDefinition { + /** * Compare {@link ItemStack} with this * diff --git a/src/main/java/appeng/api/definitions/IDefinitions.java b/src/main/java/appeng/api/definitions/IDefinitions.java index c07968abe97..2f7bdff1ece 100644 --- a/src/main/java/appeng/api/definitions/IDefinitions.java +++ b/src/main/java/appeng/api/definitions/IDefinitions.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -27,6 +17,7 @@ * All definitions in AE */ public interface IDefinitions { + /** * @return an accessible list of all of AE's blocks */ diff --git a/src/main/java/appeng/api/definitions/IItemDefinition.java b/src/main/java/appeng/api/definitions/IItemDefinition.java index 10c6834515b..f787cf2a794 100644 --- a/src/main/java/appeng/api/definitions/IItemDefinition.java +++ b/src/main/java/appeng/api/definitions/IItemDefinition.java @@ -1,33 +1,25 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; -import com.google.common.base.Optional; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import com.google.common.base.Optional; + public interface IItemDefinition extends IComparableDefinition { + /** * @return the {@link Item} Implementation if applicable */ diff --git a/src/main/java/appeng/api/definitions/IItems.java b/src/main/java/appeng/api/definitions/IItems.java index 54354ac025d..105a7e353a1 100644 --- a/src/main/java/appeng/api/definitions/IItems.java +++ b/src/main/java/appeng/api/definitions/IItems.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -29,6 +19,7 @@ * A list of all items in AE */ public interface IItems { + IItemDefinition certusQuartzAxe(); IItemDefinition certusQuartzHoe(); diff --git a/src/main/java/appeng/api/definitions/IMaterials.java b/src/main/java/appeng/api/definitions/IMaterials.java index c8f10051e9b..97e82853e73 100644 --- a/src/main/java/appeng/api/definitions/IMaterials.java +++ b/src/main/java/appeng/api/definitions/IMaterials.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -27,6 +17,7 @@ * A list of all materials in AE */ public interface IMaterials { + IItemDefinition cell2SpatialPart(); IItemDefinition cell16SpatialPart(); diff --git a/src/main/java/appeng/api/definitions/IParts.java b/src/main/java/appeng/api/definitions/IParts.java index a7ca2328c66..5b931091dd5 100644 --- a/src/main/java/appeng/api/definitions/IParts.java +++ b/src/main/java/appeng/api/definitions/IParts.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -29,6 +19,7 @@ * A list of all parts in AE */ public interface IParts { + AEColoredItemDefinition cableSmart(); AEColoredItemDefinition cableCovered(); diff --git a/src/main/java/appeng/api/definitions/ITileDefinition.java b/src/main/java/appeng/api/definitions/ITileDefinition.java index 794c20ce9ca..d977ca81ff4 100644 --- a/src/main/java/appeng/api/definitions/ITileDefinition.java +++ b/src/main/java/appeng/api/definitions/ITileDefinition.java @@ -1,9 +1,11 @@ package appeng.api.definitions; -import com.google.common.base.Optional; import net.minecraft.tileentity.TileEntity; +import com.google.common.base.Optional; + public interface ITileDefinition extends IBlockDefinition { + /** * @return the {@link TileEntity} Class if applicable. */ diff --git a/src/main/java/appeng/api/definitions/Items.java b/src/main/java/appeng/api/definitions/Items.java index d0061338859..67e24b6e6b1 100644 --- a/src/main/java/appeng/api/definitions/Items.java +++ b/src/main/java/appeng/api/definitions/Items.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -31,6 +21,7 @@ */ @Deprecated public class Items { + public AEItemDefinition itemCertusQuartzAxe; public AEItemDefinition itemCertusQuartzHoe; diff --git a/src/main/java/appeng/api/definitions/Materials.java b/src/main/java/appeng/api/definitions/Materials.java index 1aa4f1ea03b..e1dbc51631d 100644 --- a/src/main/java/appeng/api/definitions/Materials.java +++ b/src/main/java/appeng/api/definitions/Materials.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -30,6 +20,7 @@ */ @Deprecated public class Materials { + public AEItemDefinition materialCell2SpatialPart; public AEItemDefinition materialCell16SpatialPart; diff --git a/src/main/java/appeng/api/definitions/Parts.java b/src/main/java/appeng/api/definitions/Parts.java index bd441bea59d..34dcc59da59 100644 --- a/src/main/java/appeng/api/definitions/Parts.java +++ b/src/main/java/appeng/api/definitions/Parts.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.definitions; @@ -31,6 +21,7 @@ */ @Deprecated public class Parts { + public AEColoredItemDefinition partCableSmart; public AEColoredItemDefinition partCableCovered; diff --git a/src/main/java/appeng/api/events/LocatableEventAnnounce.java b/src/main/java/appeng/api/events/LocatableEventAnnounce.java index 8024762a063..6b970777295 100644 --- a/src/main/java/appeng/api/events/LocatableEventAnnounce.java +++ b/src/main/java/appeng/api/events/LocatableEventAnnounce.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.events; diff --git a/src/main/java/appeng/api/exceptions/AppEngException.java b/src/main/java/appeng/api/exceptions/AppEngException.java index 0ab4c99ff3e..3509ba60a41 100644 --- a/src/main/java/appeng/api/exceptions/AppEngException.java +++ b/src/main/java/appeng/api/exceptions/AppEngException.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; diff --git a/src/main/java/appeng/api/exceptions/CoreInaccessibleException.java b/src/main/java/appeng/api/exceptions/CoreInaccessibleException.java index ed8480e4f92..2f2b692ae28 100644 --- a/src/main/java/appeng/api/exceptions/CoreInaccessibleException.java +++ b/src/main/java/appeng/api/exceptions/CoreInaccessibleException.java @@ -1,6 +1,7 @@ package appeng.api.exceptions; public class CoreInaccessibleException extends RuntimeException { + public CoreInaccessibleException(final String message) { super(message); } diff --git a/src/main/java/appeng/api/exceptions/ExistingConnectionException.java b/src/main/java/appeng/api/exceptions/ExistingConnectionException.java index e1dc89e9dbe..409819b28db 100644 --- a/src/main/java/appeng/api/exceptions/ExistingConnectionException.java +++ b/src/main/java/appeng/api/exceptions/ExistingConnectionException.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; @@ -28,8 +18,7 @@ /** * Exception occurred because of an already existing connection between the two {@link IGridNode}s *

- * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. + * Intended to signal an internal exception and not intended to be thrown by any 3rd party module. * * @author yueh * @version rv3 diff --git a/src/main/java/appeng/api/exceptions/FailedConnection.java b/src/main/java/appeng/api/exceptions/FailedConnection.java index 5fe968c6a1d..ae7e3ac5b2e 100644 --- a/src/main/java/appeng/api/exceptions/FailedConnection.java +++ b/src/main/java/appeng/api/exceptions/FailedConnection.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; @@ -28,8 +18,7 @@ /** * Exception indicating a failed connection between two {@link IGridNode}s. *

- * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. + * Intended to signal an internal exception and not intended to be thrown by any 3rd party module. *

* See any subclass for a more specific reason. * diff --git a/src/main/java/appeng/api/exceptions/MissingDefinition.java b/src/main/java/appeng/api/exceptions/MissingDefinition.java index c7bcba3ca39..9d2c26494cf 100644 --- a/src/main/java/appeng/api/exceptions/MissingDefinition.java +++ b/src/main/java/appeng/api/exceptions/MissingDefinition.java @@ -1,6 +1,7 @@ package appeng.api.exceptions; public class MissingDefinition extends RuntimeException { + public MissingDefinition(final String message) { super(message); } diff --git a/src/main/java/appeng/api/exceptions/MissingIngredientError.java b/src/main/java/appeng/api/exceptions/MissingIngredientError.java index 655d6f4bafe..f0f2faa6189 100644 --- a/src/main/java/appeng/api/exceptions/MissingIngredientError.java +++ b/src/main/java/appeng/api/exceptions/MissingIngredientError.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; diff --git a/src/main/java/appeng/api/exceptions/ModNotInstalled.java b/src/main/java/appeng/api/exceptions/ModNotInstalled.java index 59d6432b304..e453fac6b88 100644 --- a/src/main/java/appeng/api/exceptions/ModNotInstalled.java +++ b/src/main/java/appeng/api/exceptions/ModNotInstalled.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; diff --git a/src/main/java/appeng/api/exceptions/NullNodeConnectionException.java b/src/main/java/appeng/api/exceptions/NullNodeConnectionException.java index 11c9c108d0d..a4b0f5c0710 100644 --- a/src/main/java/appeng/api/exceptions/NullNodeConnectionException.java +++ b/src/main/java/appeng/api/exceptions/NullNodeConnectionException.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; @@ -26,8 +16,7 @@ /** * Exception due to trying to connect one or more null values. *

- * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. + * Intended to signal an internal exception and not intended to be thrown by any 3rd party module. * * @author yueh * @version rv3 diff --git a/src/main/java/appeng/api/exceptions/RecipeError.java b/src/main/java/appeng/api/exceptions/RecipeError.java index dc5d2db6f5a..9d60bd8b532 100644 --- a/src/main/java/appeng/api/exceptions/RecipeError.java +++ b/src/main/java/appeng/api/exceptions/RecipeError.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; diff --git a/src/main/java/appeng/api/exceptions/RegistrationError.java b/src/main/java/appeng/api/exceptions/RegistrationError.java index 4d92f77fbcd..f3b7fe90609 100644 --- a/src/main/java/appeng/api/exceptions/RegistrationError.java +++ b/src/main/java/appeng/api/exceptions/RegistrationError.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; diff --git a/src/main/java/appeng/api/exceptions/SecurityConnectionException.java b/src/main/java/appeng/api/exceptions/SecurityConnectionException.java index 2f6f46027d7..3c3be5c84a9 100644 --- a/src/main/java/appeng/api/exceptions/SecurityConnectionException.java +++ b/src/main/java/appeng/api/exceptions/SecurityConnectionException.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.exceptions; @@ -26,14 +16,14 @@ /** * Exception due to trying to connect different security realms. *

- * Intended to signal an internal exception and not intended to be thrown by - * any 3rd party module. + * Intended to signal an internal exception and not intended to be thrown by any 3rd party module. * * @author yueh * @version rv3 * @since rv3 */ public class SecurityConnectionException extends FailedConnection { + private static final long serialVersionUID = 5048714900434215426L; private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms."; diff --git a/src/main/java/appeng/api/features/IGrinderEntry.java b/src/main/java/appeng/api/features/IGrinderEntry.java index 27b12b7b950..a52187a5f37 100644 --- a/src/main/java/appeng/api/features/IGrinderEntry.java +++ b/src/main/java/appeng/api/features/IGrinderEntry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/features/IGrinderRegistry.java b/src/main/java/appeng/api/features/IGrinderRegistry.java index 7336131ea32..b176453104b 100644 --- a/src/main/java/appeng/api/features/IGrinderRegistry.java +++ b/src/main/java/appeng/api/features/IGrinderRegistry.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; import java.util.List; + import net.minecraft.item.ItemStack; /** @@ -69,13 +60,7 @@ public interface IGrinderRegistry { * @param chance2 chance to get the second optional output within 0.0 - 1.0 * @param turns amount of turns to turn the input into the outputs */ - void addRecipe( - ItemStack in, - ItemStack out, - ItemStack optional, - float chance, - ItemStack optional2, - float chance2, + void addRecipe(ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns); /** diff --git a/src/main/java/appeng/api/features/IInscriberRecipe.java b/src/main/java/appeng/api/features/IInscriberRecipe.java index 78f48a9067b..409488ec309 100644 --- a/src/main/java/appeng/api/features/IInscriberRecipe.java +++ b/src/main/java/appeng/api/features/IInscriberRecipe.java @@ -1,15 +1,17 @@ package appeng.api.features; -import com.google.common.base.Optional; import java.util.List; + import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; +import com.google.common.base.Optional; + /** * Registration Records for {@link IInscriberRegistry} *

- * You have to pay attention though, that recipes are not mirrored, - * where the top and bottom slots are switching places. + * You have to pay attention though, that recipes are not mirrored, where the top and bottom slots are switching places. *

* This is applied on runtime. * @@ -18,6 +20,7 @@ * @since rv2 */ public interface IInscriberRecipe { + /** * the current inputs * diff --git a/src/main/java/appeng/api/features/IInscriberRecipeBuilder.java b/src/main/java/appeng/api/features/IInscriberRecipeBuilder.java index 4fe34421b3d..d7e4fc1db21 100644 --- a/src/main/java/appeng/api/features/IInscriberRecipeBuilder.java +++ b/src/main/java/appeng/api/features/IInscriberRecipeBuilder.java @@ -1,7 +1,9 @@ package appeng.api.features; import java.util.Collection; + import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; /** @@ -12,9 +14,9 @@ * @since rv2 */ public interface IInscriberRecipeBuilder { + /** - * Creates an inscriber recipe with inputs. - * Needs to be invoked. + * Creates an inscriber recipe with inputs. Needs to be invoked. * * @param inputs new inputs for the recipe * @return currently used builder @@ -23,8 +25,7 @@ public interface IInscriberRecipeBuilder { IInscriberRecipeBuilder withInputs(@Nonnull Collection inputs); /** - * Creates an inscriber recipe with output. - * Needs to be invoked. + * Creates an inscriber recipe with output. Needs to be invoked. * * @param output new output for the recipe * @return currently used builder @@ -33,8 +34,7 @@ public interface IInscriberRecipeBuilder { IInscriberRecipeBuilder withOutput(@Nonnull ItemStack output); /** - * Creates an inscriber recipe with top. - * Either this or bot needs to be invoked. + * Creates an inscriber recipe with top. Either this or bot needs to be invoked. * * @param topOptional new top for the recipe * @return currently used builder @@ -43,8 +43,7 @@ public interface IInscriberRecipeBuilder { IInscriberRecipeBuilder withTopOptional(@Nonnull ItemStack topOptional); /** - * Creates an inscriber recipe with bot. - * Either this or top needs to be invoked. + * Creates an inscriber recipe with bot. Either this or top needs to be invoked. * * @param bottomOptional new bot for the recipe * @return currently used builder @@ -53,8 +52,7 @@ public interface IInscriberRecipeBuilder { IInscriberRecipeBuilder withBottomOptional(@Nonnull ItemStack bottomOptional); /** - * Creates an inscriber recipe with type. - * Needs to be invoked. + * Creates an inscriber recipe with type. Needs to be invoked. * * @param type new type for the recipe * @return currently used builder @@ -63,8 +61,7 @@ public interface IInscriberRecipeBuilder { IInscriberRecipeBuilder withProcessType(@Nonnull InscriberProcessType type); /** - * Finalizes the process of making the recipe. - * Needs to be invoked to fetch inscriber recipe. + * Finalizes the process of making the recipe. Needs to be invoked to fetch inscriber recipe. * * @return legal inscriber recipe * @throws IllegalStateException when input is not defined diff --git a/src/main/java/appeng/api/features/IInscriberRegistry.java b/src/main/java/appeng/api/features/IInscriberRegistry.java index 4aed5044da2..82248fd8f23 100644 --- a/src/main/java/appeng/api/features/IInscriberRegistry.java +++ b/src/main/java/appeng/api/features/IInscriberRegistry.java @@ -2,7 +2,9 @@ import java.util.Collection; import java.util.Set; + import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; /** @@ -13,6 +15,7 @@ * @since rv2 */ public interface IInscriberRegistry { + /** * An immutable copy of currently registered recipes. *

@@ -50,8 +53,8 @@ public interface IInscriberRegistry { IInscriberRecipeBuilder builder(); /** - * add a new recipe the easy way, duplicates will not be added. - * Added recipes will be automatically added to the optionals and inputs. + * add a new recipe the easy way, duplicates will not be added. Added recipes will be automatically added to the + * optionals and inputs. * * @param recipe new recipe * @throws IllegalArgumentException if null is added diff --git a/src/main/java/appeng/api/features/IItemComparison.java b/src/main/java/appeng/api/features/IItemComparison.java index ce2ef184d4b..1168c7e2a13 100644 --- a/src/main/java/appeng/api/features/IItemComparison.java +++ b/src/main/java/appeng/api/features/IItemComparison.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; public interface IItemComparison { + boolean sameAsPrecise(IItemComparison comp); boolean sameAsFuzzy(IItemComparison comp); diff --git a/src/main/java/appeng/api/features/IItemComparisonProvider.java b/src/main/java/appeng/api/features/IItemComparisonProvider.java index 5d9c4b99d0e..051f30dec71 100644 --- a/src/main/java/appeng/api/features/IItemComparisonProvider.java +++ b/src/main/java/appeng/api/features/IItemComparisonProvider.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; @@ -26,15 +16,13 @@ import net.minecraft.item.ItemStack; /** - * Provider for special comparisons. when an item is encountered AE Will request - * if the comparison function handles the item, by trying to request a - * IItemComparison class. + * Provider for special comparisons. when an item is encountered AE Will request if the comparison function handles the + * item, by trying to request a IItemComparison class. */ public interface IItemComparisonProvider { /** - * should return a new IItemComparison, or return null if it doesn't handle - * the supplied item. + * should return a new IItemComparison, or return null if it doesn't handle the supplied item. * * @param is item * @return IItemComparison, or null diff --git a/src/main/java/appeng/api/features/ILocatable.java b/src/main/java/appeng/api/features/ILocatable.java index b8abd4f3e59..4a1291bde7a 100644 --- a/src/main/java/appeng/api/features/ILocatable.java +++ b/src/main/java/appeng/api/features/ILocatable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/features/ILocatableRegistry.java b/src/main/java/appeng/api/features/ILocatableRegistry.java index 79d943a4a17..74611bbe84a 100644 --- a/src/main/java/appeng/api/features/ILocatableRegistry.java +++ b/src/main/java/appeng/api/features/ILocatableRegistry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; @@ -27,9 +17,9 @@ * A Registry for locatable items, works based on serial numbers. */ public interface ILocatableRegistry { + /** - * Attempts to find the object with the serial specified, if it can it - * returns the object. + * Attempts to find the object with the serial specified, if it can it returns the object. * * @param serial serial * @return requestedObject, or null diff --git a/src/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java b/src/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java index 368c88baef1..c6ffdbf6787 100644 --- a/src/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java +++ b/src/main/java/appeng/api/features/IMatterCannonAmmoRegistry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/features/INetworkEncodable.java b/src/main/java/appeng/api/features/INetworkEncodable.java index 62d675113f6..f72df3a0056 100644 --- a/src/main/java/appeng/api/features/INetworkEncodable.java +++ b/src/main/java/appeng/api/features/INetworkEncodable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/features/IP2PTunnelRegistry.java b/src/main/java/appeng/api/features/IP2PTunnelRegistry.java index d1e6e4f3ab0..ffe75c99174 100644 --- a/src/main/java/appeng/api/features/IP2PTunnelRegistry.java +++ b/src/main/java/appeng/api/features/IP2PTunnelRegistry.java @@ -1,40 +1,31 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; -import appeng.api.config.TunnelType; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; +import appeng.api.config.TunnelType; + /** * A Registry for how p2p Tunnels are attuned */ public interface IP2PTunnelRegistry { /** - * Allows third parties to register items from their mod as potential - * attunements for AE's P2P Tunnels + * Allows third parties to register items from their mod as potential attunements for AE's P2P Tunnels * * @param trigger - the item which triggers attunement. Nullable, but then ignored * @param type - the type of tunnel. Nullable, but then ignored diff --git a/src/main/java/appeng/api/features/IPlayerRegistry.java b/src/main/java/appeng/api/features/IPlayerRegistry.java index c818bb5565a..2bfe1d68a3b 100644 --- a/src/main/java/appeng/api/features/IPlayerRegistry.java +++ b/src/main/java/appeng/api/features/IPlayerRegistry.java @@ -1,32 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; -import com.mojang.authlib.GameProfile; import javax.annotation.Nullable; + import net.minecraft.entity.player.EntityPlayer; +import com.mojang.authlib.GameProfile; + /** * Maintains a save specific list of userids and username combinations this greatly simplifies storage internally and * gives a common place to look up and get IDs for the security framework. diff --git a/src/main/java/appeng/api/features/IRecipeHandlerRegistry.java b/src/main/java/appeng/api/features/IRecipeHandlerRegistry.java index e1b304867c4..209aea4e30f 100644 --- a/src/main/java/appeng/api/features/IRecipeHandlerRegistry.java +++ b/src/main/java/appeng/api/features/IRecipeHandlerRegistry.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; +import javax.annotation.Nullable; + import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.IRecipeHandler; import appeng.api.recipes.ISubItemResolver; -import javax.annotation.Nullable; /** * @author AlgorithmX2 diff --git a/src/main/java/appeng/api/features/IRegistryContainer.java b/src/main/java/appeng/api/features/IRegistryContainer.java index 73929529ea5..c1019b3ee55 100644 --- a/src/main/java/appeng/api/features/IRegistryContainer.java +++ b/src/main/java/appeng/api/features/IRegistryContainer.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/features/ISpecialComparisonRegistry.java b/src/main/java/appeng/api/features/ISpecialComparisonRegistry.java index 5484f36e749..0228a88abb1 100644 --- a/src/main/java/appeng/api/features/ISpecialComparisonRegistry.java +++ b/src/main/java/appeng/api/features/ISpecialComparisonRegistry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/features/IWirelessTermHandler.java b/src/main/java/appeng/api/features/IWirelessTermHandler.java index 09613eef5da..b6807ea6427 100644 --- a/src/main/java/appeng/api/features/IWirelessTermHandler.java +++ b/src/main/java/appeng/api/features/IWirelessTermHandler.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; -import appeng.api.util.IConfigManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import appeng.api.util.IConfigManager; + /** * A handler for a wireless terminal. */ diff --git a/src/main/java/appeng/api/features/IWirelessTermRegistry.java b/src/main/java/appeng/api/features/IWirelessTermRegistry.java index d42864efd86..f9aec79cdb2 100644 --- a/src/main/java/appeng/api/features/IWirelessTermRegistry.java +++ b/src/main/java/appeng/api/features/IWirelessTermRegistry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; @@ -47,14 +37,12 @@ public interface IWirelessTermRegistry { /** * @param is item with handler - * @return a register handler for the item in question, or null if there - * isn't one + * @return a register handler for the item in question, or null if there isn't one */ IWirelessTermHandler getWirelessTerminalHandler(ItemStack is); /** - * opens the wireless terminal gui, the wireless terminal item, must be in - * the active slot on the tool bar. + * opens the wireless terminal gui, the wireless terminal item, must be in the active slot on the tool bar. */ void openWirelessTerminalGui(ItemStack item, World w, EntityPlayer player); } diff --git a/src/main/java/appeng/api/features/IWorldGen.java b/src/main/java/appeng/api/features/IWorldGen.java index 633047e4233..5e042c548e2 100644 --- a/src/main/java/appeng/api/features/IWorldGen.java +++ b/src/main/java/appeng/api/features/IWorldGen.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.features; diff --git a/src/main/java/appeng/api/implementations/ICraftingPatternItem.java b/src/main/java/appeng/api/implementations/ICraftingPatternItem.java index 6fef18e9ebc..4dfb0ea1c75 100644 --- a/src/main/java/appeng/api/implementations/ICraftingPatternItem.java +++ b/src/main/java/appeng/api/implementations/ICraftingPatternItem.java @@ -1,33 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations; -import appeng.api.networking.crafting.ICraftingPatternDetails; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import appeng.api.networking.crafting.ICraftingPatternDetails; + /** * Implemented on {@link Item} */ diff --git a/src/main/java/appeng/api/implementations/IPowerChannelState.java b/src/main/java/appeng/api/implementations/IPowerChannelState.java index 964fc3f27ed..86fec3f8d23 100644 --- a/src/main/java/appeng/api/implementations/IPowerChannelState.java +++ b/src/main/java/appeng/api/implementations/IPowerChannelState.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations; diff --git a/src/main/java/appeng/api/implementations/IUpgradeableHost.java b/src/main/java/appeng/api/implementations/IUpgradeableHost.java index 2da8c4d0fd1..ae0f0c6180f 100644 --- a/src/main/java/appeng/api/implementations/IUpgradeableHost.java +++ b/src/main/java/appeng/api/implementations/IUpgradeableHost.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations; +import net.minecraft.tileentity.TileEntity; + import appeng.api.config.Upgrades; import appeng.api.implementations.tiles.ISegmentedInventory; import appeng.api.util.IConfigurableObject; -import net.minecraft.tileentity.TileEntity; public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInventory { diff --git a/src/main/java/appeng/api/implementations/TransitionResult.java b/src/main/java/appeng/api/implementations/TransitionResult.java index b83357777cc..58a69d07b50 100644 --- a/src/main/java/appeng/api/implementations/TransitionResult.java +++ b/src/main/java/appeng/api/implementations/TransitionResult.java @@ -1,33 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations; /** - * Defines the result of performing a transition from the world into a storage - * cell, if its possible, and what the energy usage is. + * Defines the result of performing a transition from the world into a storage cell, if its possible, and what the + * energy usage is. */ public class TransitionResult { + public final boolean success; public final double energyUsage; diff --git a/src/main/java/appeng/api/implementations/guiobjects/IGuiItem.java b/src/main/java/appeng/api/implementations/guiobjects/IGuiItem.java index fa02992132f..210745fe6f9 100644 --- a/src/main/java/appeng/api/implementations/guiobjects/IGuiItem.java +++ b/src/main/java/appeng/api/implementations/guiobjects/IGuiItem.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.guiobjects; @@ -27,8 +17,7 @@ import net.minecraft.world.World; /** - * Implemented on Item objects, to return objects used to manage, and interact - * with the contents. + * Implemented on Item objects, to return objects used to manage, and interact with the contents. */ public interface IGuiItem { diff --git a/src/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java b/src/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java index 5d08fb530aa..dad05d51283 100644 --- a/src/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java +++ b/src/main/java/appeng/api/implementations/guiobjects/IGuiItemObject.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.guiobjects; diff --git a/src/main/java/appeng/api/implementations/guiobjects/INetworkTool.java b/src/main/java/appeng/api/implementations/guiobjects/INetworkTool.java index 1fc7231f1e0..c3c82b074b7 100644 --- a/src/main/java/appeng/api/implementations/guiobjects/INetworkTool.java +++ b/src/main/java/appeng/api/implementations/guiobjects/INetworkTool.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.guiobjects; -import appeng.api.networking.IGridHost; import net.minecraft.inventory.IInventory; +import appeng.api.networking.IGridHost; + /** * Obtained via {@link IGuiItem} getGuiObject */ diff --git a/src/main/java/appeng/api/implementations/guiobjects/IPortableCell.java b/src/main/java/appeng/api/implementations/guiobjects/IPortableCell.java index a4f85901c59..72c7f6aac43 100644 --- a/src/main/java/appeng/api/implementations/guiobjects/IPortableCell.java +++ b/src/main/java/appeng/api/implementations/guiobjects/IPortableCell.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.guiobjects; @@ -31,4 +21,5 @@ /** * Obtained via {@link IGuiItem} getGuiObject */ -public interface IPortableCell extends ITerminalHost, IMEMonitor, IEnergySource, IGuiItemObject {} +public interface IPortableCell extends ITerminalHost, IMEMonitor, IEnergySource, IGuiItemObject { +} diff --git a/src/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java b/src/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java index 15ca18d9a56..2836fade39c 100644 --- a/src/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java +++ b/src/main/java/appeng/api/implementations/items/IAEItemPowerStorage.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; +import net.minecraft.item.ItemStack; + import appeng.api.config.AccessRestriction; import appeng.api.networking.energy.IAEPowerStorage; -import net.minecraft.item.ItemStack; /** * Basically the same as {@link IAEPowerStorage}, but for items. @@ -33,16 +24,14 @@ public interface IAEItemPowerStorage { /** - * Inject amt, power into the device, it will store what it can, and return - * the amount unable to be stored. + * Inject amt, power into the device, it will store what it can, and return the amount unable to be stored. * * @return amount unable to be stored */ double injectAEPower(ItemStack is, double amt); /** - * Attempt to extract power from the device, it will extract what it can and - * return it. + * Attempt to extract power from the device, it will extract what it can and return it. * * @param amt to be extracted power from device * @return what it could extract @@ -60,8 +49,7 @@ public interface IAEItemPowerStorage { double getAECurrentPower(ItemStack is); /** - * Control the power flow by telling what the network can do, either add? or - * subtract? or both! + * Control the power flow by telling what the network can do, either add? or subtract? or both! * * @return access restriction of network */ diff --git a/src/main/java/appeng/api/implementations/items/IAEWrench.java b/src/main/java/appeng/api/implementations/items/IAEWrench.java index 79c60b97f60..a360d9e654f 100644 --- a/src/main/java/appeng/api/implementations/items/IAEWrench.java +++ b/src/main/java/appeng/api/implementations/items/IAEWrench.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; @@ -27,8 +17,7 @@ import net.minecraft.item.ItemStack; /** - * Implemented on AE's wrench(s) as a substitute for if BC's API is not - * available. + * Implemented on AE's wrench(s) as a substitute for if BC's API is not available. */ public interface IAEWrench { diff --git a/src/main/java/appeng/api/implementations/items/IBiometricCard.java b/src/main/java/appeng/api/implementations/items/IBiometricCard.java index 79e4a782ac7..173379edfc6 100644 --- a/src/main/java/appeng/api/implementations/items/IBiometricCard.java +++ b/src/main/java/appeng/api/implementations/items/IBiometricCard.java @@ -1,39 +1,32 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; +import java.util.EnumSet; + +import net.minecraft.item.ItemStack; + import appeng.api.config.SecurityPermissions; import appeng.api.features.IPlayerRegistry; import appeng.api.networking.security.ISecurityRegistry; + import com.mojang.authlib.GameProfile; -import java.util.EnumSet; -import net.minecraft.item.ItemStack; public interface IBiometricCard { /** - * Set the {@link GameProfile} to null, to clear it. + * Set the {@link GameProfile} to null, to clear it. */ void setProfile(ItemStack itemStack, GameProfile username); diff --git a/src/main/java/appeng/api/implementations/items/IGrowableCrystal.java b/src/main/java/appeng/api/implementations/items/IGrowableCrystal.java index a76c2b0e7b2..55fc221b93a 100644 --- a/src/main/java/appeng/api/implementations/items/IGrowableCrystal.java +++ b/src/main/java/appeng/api/implementations/items/IGrowableCrystal.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; diff --git a/src/main/java/appeng/api/implementations/items/IItemGroup.java b/src/main/java/appeng/api/implementations/items/IItemGroup.java index f061799f803..3b3f4a878ef 100644 --- a/src/main/java/appeng/api/implementations/items/IItemGroup.java +++ b/src/main/java/appeng/api/implementations/items/IItemGroup.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; import java.util.Set; + import net.minecraft.item.ItemStack; /** diff --git a/src/main/java/appeng/api/implementations/items/IMemoryCard.java b/src/main/java/appeng/api/implementations/items/IMemoryCard.java index 0369fb160cb..dd88d2bb05b 100644 --- a/src/main/java/appeng/api/implementations/items/IMemoryCard.java +++ b/src/main/java/appeng/api/implementations/items/IMemoryCard.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; @@ -35,21 +25,18 @@ public interface IMemoryCard { /** - * Configures the data stored on the memory card, the SettingsName, will be - * localized when displayed. + * Configures the data stored on the memory card, the SettingsName, will be localized when displayed. * * @param is item * @param SettingsName unlocalized string that represents the tile entity. - * @param data may contain a String called "tooltip" which is is a - * unlocalized string displayed after the settings name, optional - * but can be used to add details to the card for later. + * @param data may contain a String called "tooltip" which is is a unlocalized string displayed after the + * settings name, optional but can be used to add details to the card for later. */ void setMemoryCardContents(ItemStack is, String SettingsName, NBTTagCompound data); /** - * returns the settings name provided by a previous call to - * setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there was no - * previous call to setMemoryCardContents. + * returns the settings name provided by a previous call to setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if + * there was no previous call to setMemoryCardContents. * * @param is item * @return setting name @@ -58,8 +45,7 @@ public interface IMemoryCard { /** * @param is item - * @return the NBT Data previously saved by setMemoryCardContents, or an - * empty NBTCompound + * @return the NBT Data previously saved by setMemoryCardContents, or an empty NBTCompound */ NBTTagCompound getData(ItemStack is); diff --git a/src/main/java/appeng/api/implementations/items/ISpatialStorageCell.java b/src/main/java/appeng/api/implementations/items/ISpatialStorageCell.java index 7c942e68767..8e72b20f165 100644 --- a/src/main/java/appeng/api/implementations/items/ISpatialStorageCell.java +++ b/src/main/java/appeng/api/implementations/items/ISpatialStorageCell.java @@ -1,34 +1,25 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; -import appeng.api.implementations.TransitionResult; -import appeng.api.util.WorldCoord; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import appeng.api.implementations.TransitionResult; +import appeng.api.util.WorldCoord; + /** * Implemented on a {@link Item} */ diff --git a/src/main/java/appeng/api/implementations/items/IStorageCell.java b/src/main/java/appeng/api/implementations/items/IStorageCell.java index 372b735c47c..eb7838cf50a 100644 --- a/src/main/java/appeng/api/implementations/items/IStorageCell.java +++ b/src/main/java/appeng/api/implementations/items/IStorageCell.java @@ -1,48 +1,37 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; -import appeng.api.storage.ICellWorkbenchItem; -import appeng.api.storage.data.IAEItemStack; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; +import appeng.api.storage.ICellWorkbenchItem; +import appeng.api.storage.data.IAEItemStack; + /** - * Any item which implements this can be treated as an IMEInventory via - * Util.getCell / Util.isCell It automatically handles the internals and NBT - * data, which is both nice, and bad for you! + * Any item which implements this can be treated as an IMEInventory via Util.getCell / Util.isCell It automatically + * handles the internals and NBT data, which is both nice, and bad for you! *

- * Good cause it means you don't have to do anything, bad because you have - * little to no control over it. + * Good cause it means you don't have to do anything, bad because you have little to no control over it. *

* The standard AE implementation only provides 1-63 Types */ public interface IStorageCell extends ICellWorkbenchItem { /** - * It wont work if the return is not a multiple of 8. - * The limit is ({@link Integer#MAX_VALUE} + 1) / 8. + * It wont work if the return is not a multiple of 8. The limit is ({@link Integer#MAX_VALUE} + 1) / 8. * * @param cellItem item * @return number of bytes @@ -68,8 +57,7 @@ public interface IStorageCell extends ICellWorkbenchItem { int getBytesPerType(ItemStack cellItem); /** - * Must be between 1 and 63, indicates how many types you want to store on - * the item. + * Must be between 1 and 63, indicates how many types you want to store on the item. * * @param cellItem item * @return number of types @@ -77,9 +65,8 @@ public interface IStorageCell extends ICellWorkbenchItem { int getTotalTypes(ItemStack cellItem); /** - * Allows you to fine tune which items are allowed on a given cell, if you - * don't care, just return false; As the handler for this type of cell is - * still the default cells, the normal AE black list is also applied. + * Allows you to fine tune which items are allowed on a given cell, if you don't care, just return false; As the + * handler for this type of cell is still the default cells, the normal AE black list is also applied. * * @param cellItem item * @param requestedAddition requested addition @@ -88,19 +75,16 @@ public interface IStorageCell extends ICellWorkbenchItem { boolean isBlackListed(ItemStack cellItem, IAEItemStack requestedAddition); /** - * Allows you to specify if this storage cell can be stored inside other - * storage cells, only set this for special items like the matter cannon - * that are not general purpose storage. + * Allows you to specify if this storage cell can be stored inside other storage cells, only set this for special + * items like the matter cannon that are not general purpose storage. * - * @return true if the storage cell can be stored inside other storage - * cells, this is generally false, except for certain situations - * such as the matter cannon. + * @return true if the storage cell can be stored inside other storage cells, this is generally false, except for + * certain situations such as the matter cannon. */ boolean storableInStorageCell(); /** - * Allows an item to selectively enable or disable its status as a storage - * cell. + * Allows an item to selectively enable or disable its status as a storage cell. * * @param i item * @return if the ItemStack should behavior as a storage cell. @@ -118,6 +102,7 @@ default double getIdleDrain(@Nullable ItemStack i) { /** * The old idle drain API that didn't accept an ItemStack. Unused in base AE2. + * * @return drain in ae/t this storage cell will use. */ double getIdleDrain(); diff --git a/src/main/java/appeng/api/implementations/items/IStorageComponent.java b/src/main/java/appeng/api/implementations/items/IStorageComponent.java index cd0e643ca7c..ecd01709313 100644 --- a/src/main/java/appeng/api/implementations/items/IStorageComponent.java +++ b/src/main/java/appeng/api/implementations/items/IStorageComponent.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; @@ -32,9 +22,8 @@ public interface IStorageComponent { /** - * This isn't necessarily the same as if you make a storage cell out of it, - * but all of AE's default cells do it that way, its currently only used for - * the condenser. + * This isn't necessarily the same as if you make a storage cell out of it, but all of AE's default cells do it that + * way, its currently only used for the condenser. * * @param is item * @return number of bytes diff --git a/src/main/java/appeng/api/implementations/items/IUpgradeModule.java b/src/main/java/appeng/api/implementations/items/IUpgradeModule.java index 482b93c3743..8148d054bd4 100644 --- a/src/main/java/appeng/api/implementations/items/IUpgradeModule.java +++ b/src/main/java/appeng/api/implementations/items/IUpgradeModule.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; -import appeng.api.config.Upgrades; import net.minecraft.item.ItemStack; +import appeng.api.config.Upgrades; + public interface IUpgradeModule { /** diff --git a/src/main/java/appeng/api/implementations/items/MemoryCardMessages.java b/src/main/java/appeng/api/implementations/items/MemoryCardMessages.java index cca2b33e01c..8b9552776b3 100644 --- a/src/main/java/appeng/api/implementations/items/MemoryCardMessages.java +++ b/src/main/java/appeng/api/implementations/items/MemoryCardMessages.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.items; diff --git a/src/main/java/appeng/api/implementations/parts/IPartCable.java b/src/main/java/appeng/api/implementations/parts/IPartCable.java index a1dce229ce1..ea7d8b19e15 100644 --- a/src/main/java/appeng/api/implementations/parts/IPartCable.java +++ b/src/main/java/appeng/api/implementations/parts/IPartCable.java @@ -1,37 +1,29 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.parts; +import java.util.EnumSet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridHost; import appeng.api.parts.BusSupport; import appeng.api.parts.IPart; import appeng.api.parts.IPartHost; import appeng.api.util.AECableType; import appeng.api.util.AEColor; -import java.util.EnumSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; /** * Implemented on the {@link IPart}s cable objects that can be placed at {@link ForgeDirection}.UNKNOWN in diff --git a/src/main/java/appeng/api/implementations/parts/IPartMonitor.java b/src/main/java/appeng/api/implementations/parts/IPartMonitor.java index 6d106624e62..5a94dfd4cb1 100644 --- a/src/main/java/appeng/api/implementations/parts/IPartMonitor.java +++ b/src/main/java/appeng/api/implementations/parts/IPartMonitor.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.parts; @@ -32,8 +22,7 @@ public interface IPartMonitor extends IPart, IGridHost { /** - * @return if the device is online you should check this before providing - * any other information. + * @return if the device is online you should check this before providing any other information. */ boolean isPowered(); } diff --git a/src/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java b/src/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java index ec1c60992dc..5b4c8423644 100644 --- a/src/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java +++ b/src/main/java/appeng/api/implementations/parts/IPartStorageMonitor.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.parts; @@ -35,8 +25,8 @@ public interface IPartStorageMonitor extends IPartMonitor, IPart, IGridHost, INe /** * @return the item being displayed on the storage monitor, in AEStack Form, can be either a IAEItemStack or an - * IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the - * FluidStack/ItemStack acquired from it. + * IAEFluidStack the quantity is important remember to use getStackSize() on the IAEStack, and not on the + * FluidStack/ItemStack acquired from it. */ IAEStack getDisplayed(); diff --git a/src/main/java/appeng/api/implementations/tiles/IChestOrDrive.java b/src/main/java/appeng/api/implementations/tiles/IChestOrDrive.java index 201f15c7e3c..003626f3dfd 100644 --- a/src/main/java/appeng/api/implementations/tiles/IChestOrDrive.java +++ b/src/main/java/appeng/api/implementations/tiles/IChestOrDrive.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; diff --git a/src/main/java/appeng/api/implementations/tiles/IColorableTile.java b/src/main/java/appeng/api/implementations/tiles/IColorableTile.java index a6d1860089b..06f8308a68a 100644 --- a/src/main/java/appeng/api/implementations/tiles/IColorableTile.java +++ b/src/main/java/appeng/api/implementations/tiles/IColorableTile.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; -import appeng.api.util.AEColor; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.AEColor; + public interface IColorableTile { AEColor getColor(); diff --git a/src/main/java/appeng/api/implementations/tiles/ICraftingMachine.java b/src/main/java/appeng/api/implementations/tiles/ICraftingMachine.java index bcd711b5635..7b6abef041c 100644 --- a/src/main/java/appeng/api/implementations/tiles/ICraftingMachine.java +++ b/src/main/java/appeng/api/implementations/tiles/ICraftingMachine.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; -import appeng.api.networking.crafting.ICraftingPatternDetails; import net.minecraft.inventory.InventoryCrafting; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.crafting.ICraftingPatternDetails; + public interface ICraftingMachine { /** @@ -37,8 +28,8 @@ public interface ICraftingMachine { * @param ejectionDirection ejection direction * @return if it was accepted, all or nothing. */ - boolean pushPattern( - ICraftingPatternDetails patternDetails, InventoryCrafting table, ForgeDirection ejectionDirection); + boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table, + ForgeDirection ejectionDirection); /** * check if the crafting machine is accepting pushes via pushPattern, if this is false, all calls to push will fail, diff --git a/src/main/java/appeng/api/implementations/tiles/ICrankable.java b/src/main/java/appeng/api/implementations/tiles/ICrankable.java index 5e5afcabcfd..2a691607f71 100644 --- a/src/main/java/appeng/api/implementations/tiles/ICrankable.java +++ b/src/main/java/appeng/api/implementations/tiles/ICrankable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; @@ -28,8 +18,7 @@ /** * Crank/Crankable API, *

- * Tiles that Implement this can receive power, from the crank, and have the - * crank placed on them. + * Tiles that Implement this can receive power, from the crank, and have the crank placed on them. *

* Tiles that access other tiles that implement this method can act as Cranks. *

diff --git a/src/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java b/src/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java index e29196de02e..8dbff978622 100644 --- a/src/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java +++ b/src/main/java/appeng/api/implementations/tiles/ICrystalGrowthAccelerator.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; diff --git a/src/main/java/appeng/api/implementations/tiles/IMEChest.java b/src/main/java/appeng/api/implementations/tiles/IMEChest.java index a5f74bf742e..26fbc799d35 100644 --- a/src/main/java/appeng/api/implementations/tiles/IMEChest.java +++ b/src/main/java/appeng/api/implementations/tiles/IMEChest.java @@ -1,28 +1,19 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; import appeng.api.networking.energy.IEnergySource; -public interface IMEChest extends IChestOrDrive, ITileStorageMonitorable, IEnergySource {} +public interface IMEChest extends IChestOrDrive, ITileStorageMonitorable, IEnergySource { +} diff --git a/src/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java b/src/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java index 73314ce1203..8d4dfc6e955 100644 --- a/src/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java +++ b/src/main/java/appeng/api/implementations/tiles/ISegmentedInventory.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; diff --git a/src/main/java/appeng/api/implementations/tiles/ITileStorageMonitorable.java b/src/main/java/appeng/api/implementations/tiles/ITileStorageMonitorable.java index cb816c1a184..630c9f475c3 100644 --- a/src/main/java/appeng/api/implementations/tiles/ITileStorageMonitorable.java +++ b/src/main/java/appeng/api/implementations/tiles/ITileStorageMonitorable.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IStorageMonitorable; -import net.minecraftforge.common.util.ForgeDirection; /** * Implemented on inventories that can share their inventories with other networks, best example, ME Interface. diff --git a/src/main/java/appeng/api/implementations/tiles/IViewCellStorage.java b/src/main/java/appeng/api/implementations/tiles/IViewCellStorage.java index 5d74ba354f1..9cff463ae54 100644 --- a/src/main/java/appeng/api/implementations/tiles/IViewCellStorage.java +++ b/src/main/java/appeng/api/implementations/tiles/IViewCellStorage.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; diff --git a/src/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java b/src/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java index 52a8e4eb090..c6be238f597 100644 --- a/src/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java +++ b/src/main/java/appeng/api/implementations/tiles/IWirelessAccessPoint.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.implementations.tiles; diff --git a/src/main/java/appeng/api/integration/IBeeComparison.java b/src/main/java/appeng/api/integration/IBeeComparison.java index a0c74959911..fff2571a11e 100644 --- a/src/main/java/appeng/api/integration/IBeeComparison.java +++ b/src/main/java/appeng/api/integration/IBeeComparison.java @@ -1,34 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.integration; /** - * An interface to get access to the individual settings for AE's Internal Bee - * Comparison handler. + * An interface to get access to the individual settings for AE's Internal Bee Comparison handler. *

- * Assessable via: ( IBeeComparison ) - * IAEItemStack.getTagCompound().getSpecialComparison() + * Assessable via: ( IBeeComparison ) IAEItemStack.getTagCompound().getSpecialComparison() *

* If you don't have the forestry API, just delete this file when using the API. */ diff --git a/src/main/java/appeng/api/movable/IMovableHandler.java b/src/main/java/appeng/api/movable/IMovableHandler.java index aa0fd2a1a3c..c56d8b11711 100644 --- a/src/main/java/appeng/api/movable/IMovableHandler.java +++ b/src/main/java/appeng/api/movable/IMovableHandler.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.movable; @@ -29,8 +19,8 @@ public interface IMovableHandler { /** - * if you return true from this, your saying you can handle the class, not - * that single entity, you cannot opt out of single entities. + * if you return true from this, your saying you can handle the class, not that single entity, you cannot opt out of + * single entities. * * @param myClass tile entity class * @param tile tile entity @@ -39,19 +29,23 @@ public interface IMovableHandler { boolean canHandle(Class myClass, TileEntity tile); /** - * request that the handler move the the tile from its current location to - * the new one. the tile has already been invalidated, and the blocks have - * already been fully moved. + * request that the handler move the the tile from its current location to the new one. the tile has already been + * invalidated, and the blocks have already been fully moved. *

* Potential Example: *

+ * *

-     * {@code
-     * Chunk c = world.getChunkFromBlockCoords( x, z ); c.setChunkBlockTileEntity( x
-     * & 0xF, y + y, z & 0xF, tile );
+     * 
+     * {
+     *     @code
+     *     Chunk c = world.getChunkFromBlockCoords(x, z);
+     *     c.setChunkBlockTileEntity(x & 0xF, y + y, z & 0xF, tile);
      *
-     * if ( c.isChunkLoaded ) { world.addTileEntity( tile ); world.markBlockForUpdate( x,
-     * y, z ); }
+     *     if (c.isChunkLoaded) {
+     *         world.addTileEntity(tile);
+     *         world.markBlockForUpdate(x, y, z);
+     *     }
      * }
      * 
* diff --git a/src/main/java/appeng/api/movable/IMovableRegistry.java b/src/main/java/appeng/api/movable/IMovableRegistry.java index 6b42a1a4fe7..6f5e942ab55 100644 --- a/src/main/java/appeng/api/movable/IMovableRegistry.java +++ b/src/main/java/appeng/api/movable/IMovableRegistry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.movable; diff --git a/src/main/java/appeng/api/movable/IMovableTile.java b/src/main/java/appeng/api/movable/IMovableTile.java index 4aa3a2c0bd0..bad5644f562 100644 --- a/src/main/java/appeng/api/movable/IMovableTile.java +++ b/src/main/java/appeng/api/movable/IMovableTile.java @@ -1,37 +1,26 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.movable; /** - * You can implement this, or use the IMovableRegistry to white list your tile, - * please see the registry for more information. + * You can implement this, or use the IMovableRegistry to white list your tile, please see the registry for more + * information. */ public interface IMovableTile { /** - * notification that your block will be moved, called instead of invalidate, - * return false to prevent movement. + * notification that your block will be moved, called instead of invalidate, return false to prevent movement. * * @return false to prevent movement */ diff --git a/src/main/java/appeng/api/networking/GridFlags.java b/src/main/java/appeng/api/networking/GridFlags.java index d4da9abc19c..8fe0661eafa 100644 --- a/src/main/java/appeng/api/networking/GridFlags.java +++ b/src/main/java/appeng/api/networking/GridFlags.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; @@ -54,8 +44,8 @@ public enum GridFlags { DENSE_CAPACITY, /** - * This block is part of a multiblock, used in conjunction with REQUIRE_CHANNEL, and {@link IGridMultiblock} see this - * interface for details. + * This block is part of a multiblock, used in conjunction with REQUIRE_CHANNEL, and {@link IGridMultiblock} see + * this interface for details. */ MULTIBLOCK, diff --git a/src/main/java/appeng/api/networking/GridNotification.java b/src/main/java/appeng/api/networking/GridNotification.java index 99f0d42cafc..cd7bcbf727a 100644 --- a/src/main/java/appeng/api/networking/GridNotification.java +++ b/src/main/java/appeng/api/networking/GridNotification.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGrid.java b/src/main/java/appeng/api/networking/IGrid.java index 06b25d94815..5b5ffd3771c 100644 --- a/src/main/java/appeng/api/networking/IGrid.java +++ b/src/main/java/appeng/api/networking/IGrid.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGridBlock.java b/src/main/java/appeng/api/networking/IGridBlock.java index 43eb9f46258..73f5ab9b736 100644 --- a/src/main/java/appeng/api/networking/IGridBlock.java +++ b/src/main/java/appeng/api/networking/IGridBlock.java @@ -1,35 +1,27 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; -import appeng.api.parts.IPart; -import appeng.api.util.AEColor; -import appeng.api.util.DimensionalCoord; import java.util.EnumSet; + import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPart; +import appeng.api.util.AEColor; +import appeng.api.util.DimensionalCoord; + /** * An Implementation is required to create your node for IGridHost *

diff --git a/src/main/java/appeng/api/networking/IGridCache.java b/src/main/java/appeng/api/networking/IGridCache.java index fd1fe2d6e9e..7b5f01d74dc 100644 --- a/src/main/java/appeng/api/networking/IGridCache.java +++ b/src/main/java/appeng/api/networking/IGridCache.java @@ -1,49 +1,35 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; /** - * Allows you to create a network wise service, AE2 uses these for providing - * item, spatial, and tunnel services. + * Allows you to create a network wise service, AE2 uses these for providing item, spatial, and tunnel services. *

- * Any Class that implements this, should have a public default constructor that - * takes a single argument of type IGrid. + * Any Class that implements this, should have a public default constructor that takes a single argument of type IGrid. */ public interface IGridCache { /** - * Called each tick for the network, allows you to have active network wide - * behaviors. + * Called each tick for the network, allows you to have active network wide behaviors. */ void onUpdateTick(); /** * inform your cache, that a machine was removed from the grid. *

- * Important: Do not trust the grids state in this method, interact only - * with the node you are passed, if you need to manage other grid - * information, do it on the next updateTick. + * Important: Do not trust the grids state in this method, interact only with the node you are passed, if you need + * to manage other grid information, do it on the next updateTick. * * @param gridNode removed from that grid * @param machine to be removed machine @@ -53,9 +39,8 @@ public interface IGridCache { /** * informs you cache that a machine was added to the grid. *

- * Important: Do not trust the grids state in this method, interact only - * with the node you are passed, if you need to manage other grid - * information, do it on the next updateTick. + * Important: Do not trust the grids state in this method, interact only with the node you are passed, if you need + * to manage other grid information, do it on the next updateTick. * * @param gridNode added to grid node * @param machine to be added machine @@ -63,18 +48,16 @@ public interface IGridCache { void addNode(IGridNode gridNode, IGridHost machine); /** - * Called when a grid splits into two grids, AE will call a split as it - * Iteratively processes changes. The destination should receive half, and - * the current cache should receive half. + * Called when a grid splits into two grids, AE will call a split as it Iteratively processes changes. The + * destination should receive half, and the current cache should receive half. * * @param destinationStorage storage which receives half of old grid */ void onSplit(IGridStorage destinationStorage); /** - * Called when two grids merge into one, AE will call a join as it - * Iteratively processes changes. Use this method to incorporate all the - * data from the source into your cache. + * Called when two grids merge into one, AE will call a join as it Iteratively processes changes. Use this method to + * incorporate all the data from the source into your cache. * * @param sourceStorage old storage */ diff --git a/src/main/java/appeng/api/networking/IGridCacheRegistry.java b/src/main/java/appeng/api/networking/IGridCacheRegistry.java index ef4b4ef5235..2fd6d50124e 100644 --- a/src/main/java/appeng/api/networking/IGridCacheRegistry.java +++ b/src/main/java/appeng/api/networking/IGridCacheRegistry.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGridConnection.java b/src/main/java/appeng/api/networking/IGridConnection.java index ec682a79318..563e3afcc8e 100644 --- a/src/main/java/appeng/api/networking/IGridConnection.java +++ b/src/main/java/appeng/api/networking/IGridConnection.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGridConnectionVisitor.java b/src/main/java/appeng/api/networking/IGridConnectionVisitor.java index 3b6446709c2..9f8bc0999f9 100644 --- a/src/main/java/appeng/api/networking/IGridConnectionVisitor.java +++ b/src/main/java/appeng/api/networking/IGridConnectionVisitor.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGridHost.java b/src/main/java/appeng/api/networking/IGridHost.java index e32b7646ad2..a52da25dcf4 100644 --- a/src/main/java/appeng/api/networking/IGridHost.java +++ b/src/main/java/appeng/api/networking/IGridHost.java @@ -1,54 +1,41 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; -import appeng.api.parts.IPart; -import appeng.api.util.AECableType; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPart; +import appeng.api.util.AECableType; + /** - * Implement to create a networked {@link TileEntity} or {@link IPart} must - * be implemented for a part, or tile entity to become part of a grid. + * Implement to create a networked {@link TileEntity} or {@link IPart} must be implemented for a part, or tile entity to + * become part of a grid. */ public interface IGridHost { /** - * get the grid node for a particular side of a block, you can return null, - * by returning a valid node later and calling updateState, you can join the - * Grid when your block is ready. + * get the grid node for a particular side of a block, you can return null, by returning a valid node later and + * calling updateState, you can join the Grid when your block is ready. * - * @param dir feel free to ignore this, most blocks will use the same node - * for every side. - * @return a new IGridNode, create these with - * AEApi.INSTANCE().createGridNode( MyIGridBlock ) + * @param dir feel free to ignore this, most blocks will use the same node for every side. + * @return a new IGridNode, create these with AEApi.INSTANCE().createGridNode( MyIGridBlock ) */ IGridNode getGridNode(ForgeDirection dir); /** - * Determines how cables render when they connect to this block. Priority is - * Smart > Covered > Glass + * Determines how cables render when they connect to this block. Priority is Smart > Covered > Glass * * @param dir direction */ diff --git a/src/main/java/appeng/api/networking/IGridMultiblock.java b/src/main/java/appeng/api/networking/IGridMultiblock.java index 8545f1b6bf4..7f9bf633b39 100644 --- a/src/main/java/appeng/api/networking/IGridMultiblock.java +++ b/src/main/java/appeng/api/networking/IGridMultiblock.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGridNode.java b/src/main/java/appeng/api/networking/IGridNode.java index 32950ccd59c..5e18f5e62d8 100644 --- a/src/main/java/appeng/api/networking/IGridNode.java +++ b/src/main/java/appeng/api/networking/IGridNode.java @@ -1,35 +1,27 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; -import appeng.api.IAppEngApi; -import appeng.api.util.IReadOnlyCollection; import java.util.EnumSet; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.IAppEngApi; +import appeng.api.util.IReadOnlyCollection; + /** * Gives you a view into your Nodes connections and information. *

@@ -130,7 +122,7 @@ public interface IGridNode { /** * @return if the node's channel requirements are currently met, use this for display purposes, use isActive for - * status. + * status. */ boolean meetsChannelRequirements(); @@ -149,7 +141,8 @@ public interface IGridNode { /** * tell the node who was responsible for placing it, failure to do this may result in in-compatibility with the - * security system. Called instead of loadFromNBT when initially placed, once set never required again, the value is saved with the Node NBT. + * security system. Called instead of loadFromNBT when initially placed, once set never required again, the value is + * saved with the Node NBT. * * @param playerID new player id */ diff --git a/src/main/java/appeng/api/networking/IGridStorage.java b/src/main/java/appeng/api/networking/IGridStorage.java index c54115092e7..762cb59b681 100644 --- a/src/main/java/appeng/api/networking/IGridStorage.java +++ b/src/main/java/appeng/api/networking/IGridStorage.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IGridVisitor.java b/src/main/java/appeng/api/networking/IGridVisitor.java index 9ad70c0128b..bbb35cfdeed 100644 --- a/src/main/java/appeng/api/networking/IGridVisitor.java +++ b/src/main/java/appeng/api/networking/IGridVisitor.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/IMachineSet.java b/src/main/java/appeng/api/networking/IMachineSet.java index c345ec8f8e2..9493c5aeaa5 100644 --- a/src/main/java/appeng/api/networking/IMachineSet.java +++ b/src/main/java/appeng/api/networking/IMachineSet.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking; diff --git a/src/main/java/appeng/api/networking/crafting/CraftingItemList.java b/src/main/java/appeng/api/networking/crafting/CraftingItemList.java index 7632196fc30..766bbc3127e 100644 --- a/src/main/java/appeng/api/networking/crafting/CraftingItemList.java +++ b/src/main/java/appeng/api/networking/crafting/CraftingItemList.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingCPU.java b/src/main/java/appeng/api/networking/crafting/ICraftingCPU.java index c61921610df..530c571fb87 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingCPU.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingCPU.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; +import javax.annotation.Nullable; + import appeng.api.networking.security.BaseActionSource; import appeng.api.networking.storage.IBaseMonitor; import appeng.api.storage.data.IAEItemStack; -import javax.annotation.Nullable; public interface ICraftingCPU extends IBaseMonitor { diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingCallback.java b/src/main/java/appeng/api/networking/crafting/ICraftingCallback.java index fd088fa9c79..594f057fc61 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingCallback.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingCallback.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingGrid.java b/src/main/java/appeng/api/networking/crafting/ICraftingGrid.java index 9f5435e14f5..faf61f95987 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingGrid.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingGrid.java @@ -1,38 +1,31 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; +import java.util.concurrent.Future; + +import net.minecraft.world.World; + import appeng.api.networking.IGrid; import appeng.api.networking.IGridCache; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.data.IAEItemStack; + import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import java.util.concurrent.Future; -import net.minecraft.world.World; public interface ICraftingGrid extends IGridCache { @@ -43,8 +36,8 @@ public interface ICraftingGrid extends IGridCache { * @param details pattern details * @return a collection of crafting patterns for the item in question. */ - ImmutableCollection getCraftingFor( - IAEItemStack whatToCraft, ICraftingPatternDetails details, int slot, World world); + ImmutableCollection getCraftingFor(IAEItemStack whatToCraft, + ICraftingPatternDetails details, int slot, World world); /** * @return a collection of all the crafting patterns in the system @@ -58,13 +51,12 @@ ImmutableCollection getCraftingFor( * @param grid network * @param actionSrc source * @param craftWhat result - * @param callback callback - * -- optional + * @param callback callback -- optional * @return a future which will at an undetermined point in the future get you the {@link ICraftingJob} do not wait - * on this, your be waiting forever. + * on this, your be waiting forever. */ - Future beginCraftingJob( - World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack craftWhat, ICraftingCallback callback); + Future beginCraftingJob(World world, IGrid grid, BaseActionSource actionSrc, IAEItemStack craftWhat, + ICraftingCallback callback); /** * Submit the job to the Crafting system for processing. @@ -72,21 +64,17 @@ Future beginCraftingJob( * @param job - the crafting job from beginCraftingJob * @param requestingMachine - a machine if its being requested via automation, may be null. * @param target - can be null - * @param prioritizePower - if cpu is null, this determine if the system should prioritize power, or if it should find the lower - * end cpus, automatic processes generally should pick lower end cpus. - * @param src - the action source to use when starting the job, this will be used for extracting items, should - * usually be the same as the one provided to beginCraftingJob. + * @param prioritizePower - if cpu is null, this determine if the system should prioritize power, or if it should + * find the lower end cpus, automatic processes generally should pick lower end cpus. + * @param src - the action source to use when starting the job, this will be used for extracting + * items, should usually be the same as the one provided to beginCraftingJob. * @return null ( if failed ) or an {@link ICraftingLink} other wise, if you send requestingMachine you need to - * properly keep track of this and handle the nbt saving and loading of the object as well as the - * {@link ICraftingRequester} methods. if you send null, this object should be discarded after verifying the - * return state. + * properly keep track of this and handle the nbt saving and loading of the object as well as the + * {@link ICraftingRequester} methods. if you send null, this object should be discarded after verifying the + * return state. */ - ICraftingLink submitJob( - ICraftingJob job, - ICraftingRequester requestingMachine, - ICraftingCPU target, - boolean prioritizePower, - BaseActionSource src); + ICraftingLink submitJob(ICraftingJob job, ICraftingRequester requestingMachine, ICraftingCPU target, + boolean prioritizePower, BaseActionSource src); /** * @return list of all the crafting cpus on the grid diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingJob.java b/src/main/java/appeng/api/networking/crafting/ICraftingJob.java index 4f74d58f2f3..e8100269a22 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingJob.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingJob.java @@ -1,39 +1,30 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; +import java.util.concurrent.Future; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.crafting.MECraftingInventory; -import java.util.concurrent.Future; public interface ICraftingJob { /** * @return if this job is a simulation, simulations cannot be submitted and only represent 1 possible future - * crafting job with fake items. + * crafting job with fake items. */ boolean isSimulation(); @@ -75,6 +66,6 @@ default boolean supportsCPUCluster(final ICraftingCPU cluster) { /** * Begins crafting on a CPU cluster */ - default void startCrafting( - final MECraftingInventory storage, final ICraftingCPU craftingCPUCluster, final BaseActionSource src) {} + default void startCrafting(final MECraftingInventory storage, final ICraftingCPU craftingCPUCluster, + final BaseActionSource src) {} } diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingLink.java b/src/main/java/appeng/api/networking/crafting/ICraftingLink.java index 2dc0e99c0d2..be503bc97ad 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingLink.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingLink.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingMedium.java b/src/main/java/appeng/api/networking/crafting/ICraftingMedium.java index 32023e55aca..7ceac651b52 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingMedium.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingMedium.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java b/src/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java index 36640807241..59298679140 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingPatternDetails.java @@ -1,34 +1,25 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; -import appeng.api.implementations.ICraftingPatternItem; -import appeng.api.storage.data.IAEItemStack; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import appeng.api.implementations.ICraftingPatternItem; +import appeng.api.storage.data.IAEItemStack; + /** * do not implement provided by {@link ICraftingPatternItem} *

diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingProvider.java b/src/main/java/appeng/api/networking/crafting/ICraftingProvider.java index a6a8af2c25c..865ec6136f3 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingProvider.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingProvider.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java b/src/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java index ef137bd05a0..850c84980c3 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingProviderHelper.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingRequester.java b/src/main/java/appeng/api/networking/crafting/ICraftingRequester.java index 701f9f50060..f95ce6176b4 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingRequester.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingRequester.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; @@ -26,6 +16,7 @@ import appeng.api.config.Actionable; import appeng.api.networking.security.IActionHost; import appeng.api.storage.data.IAEItemStack; + import com.google.common.collect.ImmutableSet; public interface ICraftingRequester extends IActionHost { diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingWatcher.java b/src/main/java/appeng/api/networking/crafting/ICraftingWatcher.java index fd1fba30297..51f2d946e71 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingWatcher.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingWatcher.java @@ -1,29 +1,21 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; -import appeng.api.storage.data.IAEStack; import java.util.Collection; -public interface ICraftingWatcher extends Collection {} +import appeng.api.storage.data.IAEStack; + +public interface ICraftingWatcher extends Collection { +} diff --git a/src/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java b/src/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java index 4fdc63e8236..9a78e3293c4 100644 --- a/src/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java +++ b/src/main/java/appeng/api/networking/crafting/ICraftingWatcherHost.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.crafting; diff --git a/src/main/java/appeng/api/networking/energy/IAEPowerStorage.java b/src/main/java/appeng/api/networking/energy/IAEPowerStorage.java index 1dac076f7dc..86a775975ed 100644 --- a/src/main/java/appeng/api/networking/energy/IAEPowerStorage.java +++ b/src/main/java/appeng/api/networking/energy/IAEPowerStorage.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.energy; diff --git a/src/main/java/appeng/api/networking/energy/IEnergyGrid.java b/src/main/java/appeng/api/networking/energy/IEnergyGrid.java index 1b629c0f305..73bee762b5f 100644 --- a/src/main/java/appeng/api/networking/energy/IEnergyGrid.java +++ b/src/main/java/appeng/api/networking/energy/IEnergyGrid.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.energy; @@ -39,7 +29,7 @@ public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvi /** * @return the average power drain over the past 10 ticks, includes idle usage during this time, and all use of - * extractPower. + * extractPower. */ double getAvgPowerUsage(); diff --git a/src/main/java/appeng/api/networking/energy/IEnergyGridProvider.java b/src/main/java/appeng/api/networking/energy/IEnergyGridProvider.java index 04c9da11e98..58a2980dc47 100644 --- a/src/main/java/appeng/api/networking/energy/IEnergyGridProvider.java +++ b/src/main/java/appeng/api/networking/energy/IEnergyGridProvider.java @@ -1,35 +1,27 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.energy; -import appeng.api.config.Actionable; import java.util.Set; +import appeng.api.config.Actionable; + /** * internal use only. */ public interface IEnergyGridProvider { + /** * internal use only */ diff --git a/src/main/java/appeng/api/networking/energy/IEnergySource.java b/src/main/java/appeng/api/networking/energy/IEnergySource.java index d734e5ae426..79f1a8e8f2d 100644 --- a/src/main/java/appeng/api/networking/energy/IEnergySource.java +++ b/src/main/java/appeng/api/networking/energy/IEnergySource.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.energy; diff --git a/src/main/java/appeng/api/networking/energy/IEnergyWatcher.java b/src/main/java/appeng/api/networking/energy/IEnergyWatcher.java index 554fbf1c265..ffb9177d95d 100644 --- a/src/main/java/appeng/api/networking/energy/IEnergyWatcher.java +++ b/src/main/java/appeng/api/networking/energy/IEnergyWatcher.java @@ -1,28 +1,19 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.energy; import java.util.Collection; -public interface IEnergyWatcher extends Collection {} +public interface IEnergyWatcher extends Collection { +} diff --git a/src/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java b/src/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java index 501f84f87cc..74035849b87 100644 --- a/src/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java +++ b/src/main/java/appeng/api/networking/energy/IEnergyWatcherHost.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.energy; diff --git a/src/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java b/src/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java index 58f6cac52d1..da45dbe896e 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkBootingStatusChange.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -26,9 +16,10 @@ import appeng.api.networking.IGridNode; /** - * Posted by the network when the booting status of the network goes up - * or down, the change is reflected via {@link IGridNode}.isActive() + * Posted by the network when the booting status of the network goes up or down, the change is reflected via + * {@link IGridNode}.isActive() *

* Note: Most machines just need to check {@link IGridNode}.isActive() */ -public class MENetworkBootingStatusChange extends MENetworkEvent {} +public class MENetworkBootingStatusChange extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java b/src/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java index 8c4372a2015..30cb8fd9b13 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java +++ b/src/main/java/appeng/api/networking/events/MENetworkCellArrayUpdate.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -26,10 +16,9 @@ /** * Posted by storage devices to inform AE to refresh its storage structure. *

- * This is done in cases such as a storage cell being removed or added to a - * drive. + * This is done in cases such as a storage cell being removed or added to a drive. *

- * you do not need to send this event when your node is added / removed from the - * grid. + * you do not need to send this event when your node is added / removed from the grid. */ -public class MENetworkCellArrayUpdate extends MENetworkEvent {} +public class MENetworkCellArrayUpdate extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkChannelChanged.java b/src/main/java/appeng/api/networking/events/MENetworkChannelChanged.java index 92b4f493366..3bd93a9ff6a 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkChannelChanged.java +++ b/src/main/java/appeng/api/networking/events/MENetworkChannelChanged.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; diff --git a/src/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java b/src/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java index 966433ff2b3..a9d76c97bd9 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java +++ b/src/main/java/appeng/api/networking/events/MENetworkChannelsChanged.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -30,4 +20,5 @@ *

* Never posted IGridCaches. */ -public class MENetworkChannelsChanged extends MENetworkEvent {} +public class MENetworkChannelsChanged extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkControllerChange.java b/src/main/java/appeng/api/networking/events/MENetworkControllerChange.java index b2ec9a12b8d..cb7dd4033d5 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkControllerChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkControllerChange.java @@ -1,31 +1,21 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; /** - * Event posted when the networks controller state changes, this can be from no - * controller to 1 controller, or any time the network changes from conflicted - * to not conflicted. + * Event posted when the networks controller state changes, this can be from no controller to 1 controller, or any time + * the network changes from conflicted to not conflicted. */ -public class MENetworkControllerChange extends MENetworkEvent {} +public class MENetworkControllerChange extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java b/src/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java index d0ebcf47085..5fe022847ea 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkCraftingCpuChange.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; diff --git a/src/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java b/src/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java index f8ecd6e7dbc..5a805e6f30b 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkCraftingPatternChange.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; diff --git a/src/main/java/appeng/api/networking/events/MENetworkEvent.java b/src/main/java/appeng/api/networking/events/MENetworkEvent.java index f37224e2428..9c3e8a192da 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkEvent.java +++ b/src/main/java/appeng/api/networking/events/MENetworkEvent.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; diff --git a/src/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java b/src/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java index 6e5d5e45949..f744371ec2d 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java +++ b/src/main/java/appeng/api/networking/events/MENetworkEventSubscribe.java @@ -1,33 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; -import appeng.api.networking.IGridCache; -import appeng.api.networking.IGridHost; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import appeng.api.networking.IGridCache; +import appeng.api.networking.IGridHost; + /** * Usable on any {@link IGridHost}, or {@link IGridCache} */ diff --git a/src/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java b/src/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java index 7f5727ea41f..5b587a4971f 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java +++ b/src/main/java/appeng/api/networking/events/MENetworkPostCacheConstruction.java @@ -1,30 +1,21 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; /** - * Posted after all the caches are available, but before the grid is fully - * constructed, can be used to perform cross cache construction processes. + * Posted after all the caches are available, but before the grid is fully constructed, can be used to perform cross + * cache construction processes. */ -public class MENetworkPostCacheConstruction extends MENetworkEvent {} +public class MENetworkPostCacheConstruction extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java b/src/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java index bfbd8b3202d..c4edc321629 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkPowerIdleChange.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -26,9 +16,8 @@ import appeng.api.networking.IGridNode; /** - * Implementers of a IGridBlock must post this event when your getIdlePowerUsage - * starts returning a new value, if you do not post this event the network will - * not change the idle draw. + * Implementers of a IGridBlock must post this event when your getIdlePowerUsage starts returning a new value, if you do + * not post this event the network will not change the idle draw. *

* you do not need to send this event when your node is added / removed from the grid. */ diff --git a/src/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java b/src/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java index 6d4e1e256cd..40ba437f5e3 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkPowerStatusChange.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -27,10 +17,10 @@ import appeng.api.networking.energy.IEnergyGrid; /** - * Posted by the network when the power status of the network goes up or down, - * the change is reflected via the {@link IEnergyGrid}.isNetworkPowered() or via - * {@link IGridNode}.isActive() + * Posted by the network when the power status of the network goes up or down, the change is reflected via the + * {@link IEnergyGrid}.isNetworkPowered() or via {@link IGridNode}.isActive() *

* Note: Most machines just need to check {@link IGridNode}.isActive() */ -public class MENetworkPowerStatusChange extends MENetworkEvent {} +public class MENetworkPowerStatusChange extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkPowerStorage.java b/src/main/java/appeng/api/networking/events/MENetworkPowerStorage.java index 59b3baeebe8..2e4568569fc 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkPowerStorage.java +++ b/src/main/java/appeng/api/networking/events/MENetworkPowerStorage.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -26,11 +16,11 @@ import appeng.api.networking.energy.IAEPowerStorage; /** - * informs the network, that a {@link IAEPowerStorage} block that had either run, - * out of power, or was full, is no longer in that state. + * informs the network, that a {@link IAEPowerStorage} block that had either run, out of power, or was full, is no + * longer in that state. *

- * failure to post this event when your {@link IAEPowerStorage} changes state will - * result in your block not charging, or not-discharging. + * failure to post this event when your {@link IAEPowerStorage} changes state will result in your block not charging, or + * not-discharging. *

* you do not need to send this event when your node is added / removed from the grid. */ diff --git a/src/main/java/appeng/api/networking/events/MENetworkSecurityChange.java b/src/main/java/appeng/api/networking/events/MENetworkSecurityChange.java index d2e7e0367de..b02de4f9161 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkSecurityChange.java +++ b/src/main/java/appeng/api/networking/events/MENetworkSecurityChange.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -26,4 +16,5 @@ /** * Posted by the security framework when permissions change */ -public class MENetworkSecurityChange extends MENetworkEvent {} +public class MENetworkSecurityChange extends MENetworkEvent { +} diff --git a/src/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java b/src/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java index 0f9ca24fb4c..90cdd18e90d 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java +++ b/src/main/java/appeng/api/networking/events/MENetworkSpatialEvent.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; @@ -29,6 +19,7 @@ * An event that is posted whenever a spatial IO is active, called for IGridCache */ public class MENetworkSpatialEvent extends MENetworkEvent { + public final IGridHost host; public final double spatialEnergyUsage; diff --git a/src/main/java/appeng/api/networking/events/MENetworkStorageEvent.java b/src/main/java/appeng/api/networking/events/MENetworkStorageEvent.java index 8c4142d1d4f..29fd0a99564 100644 --- a/src/main/java/appeng/api/networking/events/MENetworkStorageEvent.java +++ b/src/main/java/appeng/api/networking/events/MENetworkStorageEvent.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.events; diff --git a/src/main/java/appeng/api/networking/pathing/ControllerState.java b/src/main/java/appeng/api/networking/pathing/ControllerState.java index f6f4d510cbf..cd619ee82c5 100644 --- a/src/main/java/appeng/api/networking/pathing/ControllerState.java +++ b/src/main/java/appeng/api/networking/pathing/ControllerState.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.pathing; diff --git a/src/main/java/appeng/api/networking/pathing/IPathingGrid.java b/src/main/java/appeng/api/networking/pathing/IPathingGrid.java index 3720c92c105..6968e3db22c 100644 --- a/src/main/java/appeng/api/networking/pathing/IPathingGrid.java +++ b/src/main/java/appeng/api/networking/pathing/IPathingGrid.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.pathing; @@ -33,8 +23,7 @@ public interface IPathingGrid extends IGridCache { boolean isNetworkBooting(); /** - * @return the controller state of the network, useful if you want to - * require a controller for a feature. + * @return the controller state of the network, useful if you want to require a controller for a feature. */ ControllerState getControllerState(); diff --git a/src/main/java/appeng/api/networking/security/BaseActionSource.java b/src/main/java/appeng/api/networking/security/BaseActionSource.java index cec63cec536..71c43086158 100644 --- a/src/main/java/appeng/api/networking/security/BaseActionSource.java +++ b/src/main/java/appeng/api/networking/security/BaseActionSource.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; diff --git a/src/main/java/appeng/api/networking/security/IActionHost.java b/src/main/java/appeng/api/networking/security/IActionHost.java index 1a853908944..d2ba513d551 100644 --- a/src/main/java/appeng/api/networking/security/IActionHost.java +++ b/src/main/java/appeng/api/networking/security/IActionHost.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; @@ -29,12 +19,10 @@ public interface IActionHost extends IGridHost { /** - * Used to for calculating security rules, you must supply a node from your - * IGridHost for the security test, this should be the primary node for the - * machine, unless the action is preformed by a non primary node. + * Used to for calculating security rules, you must supply a node from your IGridHost for the security test, this + * should be the primary node for the machine, unless the action is preformed by a non primary node. * - * @return the the gridnode that actions from this IGridHost are preformed - * by. + * @return the the gridnode that actions from this IGridHost are preformed by. */ IGridNode getActionableNode(); } diff --git a/src/main/java/appeng/api/networking/security/ISecurityGrid.java b/src/main/java/appeng/api/networking/security/ISecurityGrid.java index 93c49adbe50..acb1a69a840 100644 --- a/src/main/java/appeng/api/networking/security/ISecurityGrid.java +++ b/src/main/java/appeng/api/networking/security/ISecurityGrid.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; +import net.minecraft.entity.player.EntityPlayer; + import appeng.api.config.SecurityPermissions; import appeng.api.networking.IGridCache; -import net.minecraft.entity.player.EntityPlayer; public interface ISecurityGrid extends IGridCache { diff --git a/src/main/java/appeng/api/networking/security/ISecurityProvider.java b/src/main/java/appeng/api/networking/security/ISecurityProvider.java index 16c4a739019..f419e03611e 100644 --- a/src/main/java/appeng/api/networking/security/ISecurityProvider.java +++ b/src/main/java/appeng/api/networking/security/ISecurityProvider.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; -import appeng.api.config.SecurityPermissions; import java.util.EnumSet; import java.util.HashMap; +import appeng.api.config.SecurityPermissions; + /** * Implemented on Security Terminal to interface with security cache. */ diff --git a/src/main/java/appeng/api/networking/security/ISecurityRegistry.java b/src/main/java/appeng/api/networking/security/ISecurityRegistry.java index 6c5e8a21e0b..9b29578aeea 100644 --- a/src/main/java/appeng/api/networking/security/ISecurityRegistry.java +++ b/src/main/java/appeng/api/networking/security/ISecurityRegistry.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; -import appeng.api.config.SecurityPermissions; import java.util.EnumSet; +import appeng.api.config.SecurityPermissions; + /** * Used by vanilla Security Terminal to post biometric data into the security cache. */ diff --git a/src/main/java/appeng/api/networking/security/MachineSource.java b/src/main/java/appeng/api/networking/security/MachineSource.java index 714013c4d08..876352c5ad8 100644 --- a/src/main/java/appeng/api/networking/security/MachineSource.java +++ b/src/main/java/appeng/api/networking/security/MachineSource.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; diff --git a/src/main/java/appeng/api/networking/security/PlayerSource.java b/src/main/java/appeng/api/networking/security/PlayerSource.java index 0201629774a..b31c959ac92 100644 --- a/src/main/java/appeng/api/networking/security/PlayerSource.java +++ b/src/main/java/appeng/api/networking/security/PlayerSource.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.security; diff --git a/src/main/java/appeng/api/networking/spatial/ISpatialCache.java b/src/main/java/appeng/api/networking/spatial/ISpatialCache.java index 543e5946f5b..caf775be8a7 100644 --- a/src/main/java/appeng/api/networking/spatial/ISpatialCache.java +++ b/src/main/java/appeng/api/networking/spatial/ISpatialCache.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.spatial; @@ -29,7 +19,8 @@ public interface ISpatialCache extends IGridCache { /** - * @return true if a region is defined at all, it doesn't have to be valid, but all points must be in the same world. + * @return true if a region is defined at all, it doesn't have to be valid, but all points must be in the same + * world. */ boolean hasRegion(); diff --git a/src/main/java/appeng/api/networking/storage/IBaseMonitor.java b/src/main/java/appeng/api/networking/storage/IBaseMonitor.java index 8c422f60617..b2da7fc547a 100644 --- a/src/main/java/appeng/api/networking/storage/IBaseMonitor.java +++ b/src/main/java/appeng/api/networking/storage/IBaseMonitor.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.storage; diff --git a/src/main/java/appeng/api/networking/storage/IStackWatcher.java b/src/main/java/appeng/api/networking/storage/IStackWatcher.java index 4b0919a7b22..0c937d56fb9 100644 --- a/src/main/java/appeng/api/networking/storage/IStackWatcher.java +++ b/src/main/java/appeng/api/networking/storage/IStackWatcher.java @@ -1,29 +1,21 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.storage; -import appeng.api.storage.data.IAEStack; import java.util.Collection; -public interface IStackWatcher extends Collection {} +import appeng.api.storage.data.IAEStack; + +public interface IStackWatcher extends Collection { +} diff --git a/src/main/java/appeng/api/networking/storage/IStackWatcherHost.java b/src/main/java/appeng/api/networking/storage/IStackWatcherHost.java index 0c48cc80bd9..f6c4a762139 100644 --- a/src/main/java/appeng/api/networking/storage/IStackWatcherHost.java +++ b/src/main/java/appeng/api/networking/storage/IStackWatcherHost.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.storage; diff --git a/src/main/java/appeng/api/networking/storage/IStorageGrid.java b/src/main/java/appeng/api/networking/storage/IStorageGrid.java index dd7a7b47d80..930f72fc139 100644 --- a/src/main/java/appeng/api/networking/storage/IStorageGrid.java +++ b/src/main/java/appeng/api/networking/storage/IStorageGrid.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.storage; diff --git a/src/main/java/appeng/api/networking/ticking/IGridTickable.java b/src/main/java/appeng/api/networking/ticking/IGridTickable.java index 9a8087cf29b..448cca9f518 100644 --- a/src/main/java/appeng/api/networking/ticking/IGridTickable.java +++ b/src/main/java/appeng/api/networking/ticking/IGridTickable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.ticking; @@ -33,40 +23,33 @@ public interface IGridTickable { /** * Important note regarding IGridTickables with more then one one node, * - * If your IGridHost hosts multiple nodes, it may be on multiple grids, or - * its node may be present on the same grid multiple times, this is as - * designed, however if you choose to use the grid to tick these Hosts you - * must be aware that they they should probably pick a single node to tick - * for, and not tick for each node. + * If your IGridHost hosts multiple nodes, it may be on multiple grids, or its node may be present on the same grid + * multiple times, this is as designed, however if you choose to use the grid to tick these Hosts you must be aware + * that they they should probably pick a single node to tick for, and not tick for each node. * */ /** - * You can return null, if you wish to tick using MC's ticking mechanism, or - * you can return a valid TickingRequest to tell AE a guide for which type - * of responsiveness your device wants. + * You can return null, if you wish to tick using MC's ticking mechanism, or you can return a valid TickingRequest + * to tell AE a guide for which type of responsiveness your device wants. *

- * this will be called for your tile any time your tile changes grids, this - * can happen at any time, so if your using the sleep feature you may wish - * to preserve your sleep, in the result of this method. or you can simply - * reset it. + * this will be called for your tile any time your tile changes grids, this can happen at any time, so if your using + * the sleep feature you may wish to preserve your sleep, in the result of this method. or you can simply reset it. * * @return null or a valid new TickingRequest */ TickingRequest getTickingRequest(IGridNode node); /** - * AE lets you adjust your tick rate based on the results of your tick, if - * your block as accomplished work you may wish to increase the ticking - * speed, if your block is idle you may wish to slow it down. + * AE lets you adjust your tick rate based on the results of your tick, if your block as accomplished work you may + * wish to increase the ticking speed, if your block is idle you may wish to slow it down. *

* Its up to you. *

* Note: this is never called if you return null from getTickingRequest. * - * @param TicksSinceLastCall the number of world ticks that were skipped since your last - * tick, you can use this to adjust speed of processing or adjust - * your tick rate. + * @param TicksSinceLastCall the number of world ticks that were skipped since your last tick, you can use this to + * adjust speed of processing or adjust your tick rate. * @return tick rate adjustment. */ TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall); diff --git a/src/main/java/appeng/api/networking/ticking/ITickManager.java b/src/main/java/appeng/api/networking/ticking/ITickManager.java index 4a6a2327cc0..1c42ff80364 100644 --- a/src/main/java/appeng/api/networking/ticking/ITickManager.java +++ b/src/main/java/appeng/api/networking/ticking/ITickManager.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.ticking; diff --git a/src/main/java/appeng/api/networking/ticking/TickRateModulation.java b/src/main/java/appeng/api/networking/ticking/TickRateModulation.java index a83f2fbd1dd..e2360fac201 100644 --- a/src/main/java/appeng/api/networking/ticking/TickRateModulation.java +++ b/src/main/java/appeng/api/networking/ticking/TickRateModulation.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.ticking; diff --git a/src/main/java/appeng/api/networking/ticking/TickingRequest.java b/src/main/java/appeng/api/networking/ticking/TickingRequest.java index 7ebc6c8d995..e64335ec7ec 100644 --- a/src/main/java/appeng/api/networking/ticking/TickingRequest.java +++ b/src/main/java/appeng/api/networking/ticking/TickingRequest.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.networking.ticking; @@ -38,8 +28,7 @@ public class TickingRequest { public final int minTickRate; /** - * the maximum number of ticks that can pass between ticks, if this value is - * exceeded the tile must tick. + * the maximum number of ticks that can pass between ticks, if this value is exceeded the tile must tick. *

* Valid Values are 1+ *

@@ -48,8 +37,7 @@ public class TickingRequest { public final int maxTickRate; /** - * Determines the current expected state of your node, if your node expects - * to be sleeping, then return true. + * Determines the current expected state of your node, if your node expects to be sleeping, then return true. */ public final boolean isSleeping; diff --git a/src/main/java/appeng/api/package-info.java b/src/main/java/appeng/api/package-info.java index 7e5f4a57604..2aa89887a3d 100644 --- a/src/main/java/appeng/api/package-info.java +++ b/src/main/java/appeng/api/package-info.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @API(apiVersion = "rv3", owner = "appliedenergistics2", provides = "appliedenergistics2|API") diff --git a/src/main/java/appeng/api/parts/BusSupport.java b/src/main/java/appeng/api/parts/BusSupport.java index 3255ed9de44..43dc441c8fd 100644 --- a/src/main/java/appeng/api/parts/BusSupport.java +++ b/src/main/java/appeng/api/parts/BusSupport.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/parts/CableRenderMode.java b/src/main/java/appeng/api/parts/CableRenderMode.java index db524c1a103..45a5117afeb 100644 --- a/src/main/java/appeng/api/parts/CableRenderMode.java +++ b/src/main/java/appeng/api/parts/CableRenderMode.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; public enum CableRenderMode { + Standard(false), CableView(true); diff --git a/src/main/java/appeng/api/parts/IAlphaPassItem.java b/src/main/java/appeng/api/parts/IAlphaPassItem.java index 1f4d9ed9d9b..f416ba02ae1 100644 --- a/src/main/java/appeng/api/parts/IAlphaPassItem.java +++ b/src/main/java/appeng/api/parts/IAlphaPassItem.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/parts/IBoxProvider.java b/src/main/java/appeng/api/parts/IBoxProvider.java index 105842f1394..2e09dba8d6e 100644 --- a/src/main/java/appeng/api/parts/IBoxProvider.java +++ b/src/main/java/appeng/api/parts/IBoxProvider.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/parts/IFacadeContainer.java b/src/main/java/appeng/api/parts/IFacadeContainer.java index 1186f49e3b8..b3d7704b4c4 100644 --- a/src/main/java/appeng/api/parts/IFacadeContainer.java +++ b/src/main/java/appeng/api/parts/IFacadeContainer.java @@ -1,33 +1,25 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; -import io.netty.buffer.ByteBuf; import java.io.IOException; + import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import io.netty.buffer.ByteBuf; + /** * Used Internally. *

diff --git a/src/main/java/appeng/api/parts/IFacadePart.java b/src/main/java/appeng/api/parts/IFacadePart.java index e110b636a4e..5a7c69b014c 100644 --- a/src/main/java/appeng/api/parts/IFacadePart.java +++ b/src/main/java/appeng/api/parts/IFacadePart.java @@ -1,30 +1,18 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.item.Item; @@ -32,6 +20,9 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * Used Internally. *

@@ -65,15 +56,8 @@ public interface IFacadePart { * @param renderStilt if to render stilt */ @SideOnly(Side.CLIENT) - void renderStatic( - int x, - int y, - int z, - IPartRenderHelper instance, - RenderBlocks renderer, - IFacadeContainer fc, - AxisAlignedBB busBounds, - boolean renderStilt); + void renderStatic(int x, int y, int z, IPartRenderHelper instance, RenderBlocks renderer, IFacadeContainer fc, + AxisAlignedBB busBounds, boolean renderStilt); /** * render the part in inventory. diff --git a/src/main/java/appeng/api/parts/IPart.java b/src/main/java/appeng/api/parts/IPart.java index 375c30d7ad0..f4db29c90ee 100644 --- a/src/main/java/appeng/api/parts/IPart.java +++ b/src/main/java/appeng/api/parts/IPart.java @@ -1,35 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; -import appeng.api.networking.IGridNode; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import io.netty.buffer.ByteBuf; import java.io.IOException; import java.util.List; import java.util.Random; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -42,6 +29,11 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.IGridNode; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; + public interface IPart extends IBoxProvider { /** @@ -98,7 +90,7 @@ public interface IPart extends IBoxProvider { /** * @return the Block sheet icon used when rendering the breaking particles, return null to use the ItemStack - * texture. + * texture. */ @SideOnly(Side.CLIENT) IIcon getBreakingTexture(); @@ -211,7 +203,7 @@ public interface IPart extends IBoxProvider { * used for tunnels. * * @return a grid node that represents the external facing side, these must be isWorldAccessible with the correct - * faces marked as external + * faces marked as external */ IGridNode getExternalFacingNode(); diff --git a/src/main/java/appeng/api/parts/IPartCollisionHelper.java b/src/main/java/appeng/api/parts/IPartCollisionHelper.java index c7556aabf7b..6b3052a248d 100644 --- a/src/main/java/appeng/api/parts/IPartCollisionHelper.java +++ b/src/main/java/appeng/api/parts/IPartCollisionHelper.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/parts/IPartHelper.java b/src/main/java/appeng/api/parts/IPartHelper.java index 71a83b08a49..f24cb7f4388 100644 --- a/src/main/java/appeng/api/parts/IPartHelper.java +++ b/src/main/java/appeng/api/parts/IPartHelper.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; @@ -30,8 +20,8 @@ public interface IPartHelper { /** - * Register a new layer with the part layer system, this allows you to write - * an in between between tile entities and parts. + * Register a new layer with the part layer system, this allows you to write an in between between tile entities and + * parts. *

* AE By Default includes, *

@@ -49,11 +39,10 @@ public interface IPartHelper { *

* 7. IPipeConnection BC Pipe Connections *

- * As long as a valid layer is registered for a interface you can simply - * implement that interface on a part get implement it. + * As long as a valid layer is registered for a interface you can simply implement that interface on a part get + * implement it. * - * @return true on success, false on failure, usually a error will be logged - * as well. + * @return true on success, false on failure, usually a error will be logged as well. */ boolean registerNewLayer(String string, String layerInterface); diff --git a/src/main/java/appeng/api/parts/IPartHost.java b/src/main/java/appeng/api/parts/IPartHost.java index 551eee66cfb..3cdd23589a7 100644 --- a/src/main/java/appeng/api/parts/IPartHost.java +++ b/src/main/java/appeng/api/parts/IPartHost.java @@ -1,37 +1,29 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; -import appeng.api.util.AEColor; -import appeng.api.util.DimensionalCoord; import java.util.Set; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.AEColor; +import appeng.api.util.DimensionalCoord; + /** * Implemented on AE's TileEntity or AE's FMP Part. *

@@ -61,7 +53,7 @@ public interface IPartHost { * @param side onto side * @param owner with owning player * @return null if the item failed to add, the side it was placed on other wise ( may different for cables, - * {@link ForgeDirection}.UNKNOWN ) + * {@link ForgeDirection}.UNKNOWN ) */ ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner); @@ -101,7 +93,7 @@ public interface IPartHost { /** * @return the color of the host type ( this is determined by the middle cable. ) if no cable is present, it returns - * {@link AEColor} .Transparent other wise it returns the color of the cable in the center. + * {@link AEColor} .Transparent other wise it returns the color of the cable in the center. */ AEColor getColor(); diff --git a/src/main/java/appeng/api/parts/IPartItem.java b/src/main/java/appeng/api/parts/IPartItem.java index 1273c19a41f..684dfebd5a4 100644 --- a/src/main/java/appeng/api/parts/IPartItem.java +++ b/src/main/java/appeng/api/parts/IPartItem.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; // @formatter:off diff --git a/src/main/java/appeng/api/parts/IPartRenderHelper.java b/src/main/java/appeng/api/parts/IPartRenderHelper.java index ca59bf6ff35..b9ba5d28910 100644 --- a/src/main/java/appeng/api/parts/IPartRenderHelper.java +++ b/src/main/java/appeng/api/parts/IPartRenderHelper.java @@ -1,36 +1,28 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public interface IPartRenderHelper { /** @@ -76,8 +68,8 @@ public interface IPartRenderHelper { * @param renderer renderer */ @SideOnly(Side.CLIENT) - void renderFaceCutout( - int x, int y, int z, IIcon ico, ForgeDirection face, float edgeThickness, RenderBlocks renderer); + void renderFaceCutout(int x, int y, int z, IIcon ico, ForgeDirection face, float edgeThickness, + RenderBlocks renderer); /** * static renderer diff --git a/src/main/java/appeng/api/parts/ISimplifiedBundle.java b/src/main/java/appeng/api/parts/ISimplifiedBundle.java index baad8781ef4..dcce0381ff2 100644 --- a/src/main/java/appeng/api/parts/ISimplifiedBundle.java +++ b/src/main/java/appeng/api/parts/ISimplifiedBundle.java @@ -1,26 +1,17 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; -public interface ISimplifiedBundle {} +public interface ISimplifiedBundle { +} diff --git a/src/main/java/appeng/api/parts/LayerBase.java b/src/main/java/appeng/api/parts/LayerBase.java index 01358ada1c4..2096c5ee5b0 100644 --- a/src/main/java/appeng/api/parts/LayerBase.java +++ b/src/main/java/appeng/api/parts/LayerBase.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; import java.util.Set; + import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/appeng/api/parts/LayerFlags.java b/src/main/java/appeng/api/parts/LayerFlags.java index 98b237d3ede..3f84724ee99 100644 --- a/src/main/java/appeng/api/parts/LayerFlags.java +++ b/src/main/java/appeng/api/parts/LayerFlags.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/parts/PartItemStack.java b/src/main/java/appeng/api/parts/PartItemStack.java index 07be0d13197..98308b6dc19 100644 --- a/src/main/java/appeng/api/parts/PartItemStack.java +++ b/src/main/java/appeng/api/parts/PartItemStack.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/parts/SelectedPart.java b/src/main/java/appeng/api/parts/SelectedPart.java index 7c5e588937e..90924af7697 100644 --- a/src/main/java/appeng/api/parts/SelectedPart.java +++ b/src/main/java/appeng/api/parts/SelectedPart.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.parts; diff --git a/src/main/java/appeng/api/recipes/ICraftHandler.java b/src/main/java/appeng/api/recipes/ICraftHandler.java index 839c53bfe6f..46274440ab2 100644 --- a/src/main/java/appeng/api/recipes/ICraftHandler.java +++ b/src/main/java/appeng/api/recipes/ICraftHandler.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; +import java.util.List; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; -import java.util.List; public interface ICraftHandler { diff --git a/src/main/java/appeng/api/recipes/IIngredient.java b/src/main/java/appeng/api/recipes/IIngredient.java index b9fb060f34c..41ab4fbfec6 100644 --- a/src/main/java/appeng/api/recipes/IIngredient.java +++ b/src/main/java/appeng/api/recipes/IIngredient.java @@ -1,37 +1,28 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; -import net.minecraft.item.ItemStack; public interface IIngredient { /** - * Acquire a single input stack for the current recipe, if more then one ItemStack is possible a - * RegistrationError exception will be thrown, ignore these and let the system handle the error. + * Acquire a single input stack for the current recipe, if more then one ItemStack is possible a RegistrationError + * exception will be thrown, ignore these and let the system handle the error. * * @return a single ItemStack for the recipe handler. * @throws RegistrationError @@ -40,8 +31,8 @@ public interface IIngredient { ItemStack getItemStack() throws RegistrationError, MissingIngredientError; /** - * Acquire a list of all the input stacks for the current recipe, this is for handlers that support - * multiple inputs per slot. + * Acquire a list of all the input stacks for the current recipe, this is for handlers that support multiple inputs + * per slot. * * @return an array of ItemStacks for the recipe handler. * @throws RegistrationError diff --git a/src/main/java/appeng/api/recipes/IRecipeHandler.java b/src/main/java/appeng/api/recipes/IRecipeHandler.java index 1cb7fd40a6d..5f57b27503c 100644 --- a/src/main/java/appeng/api/recipes/IRecipeHandler.java +++ b/src/main/java/appeng/api/recipes/IRecipeHandler.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; diff --git a/src/main/java/appeng/api/recipes/IRecipeLoader.java b/src/main/java/appeng/api/recipes/IRecipeLoader.java index bb69f245667..d4c02e39a1a 100644 --- a/src/main/java/appeng/api/recipes/IRecipeLoader.java +++ b/src/main/java/appeng/api/recipes/IRecipeLoader.java @@ -1,32 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 - 2015 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 - 2015 AlgorithmX2 Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; import java.io.BufferedReader; + import javax.annotation.Nonnull; public interface IRecipeLoader { + /** * @param filePath the path to the to be loaded file * @return reader handler of the file diff --git a/src/main/java/appeng/api/recipes/ISubItemResolver.java b/src/main/java/appeng/api/recipes/ISubItemResolver.java index 3c311b0a407..e44df35f4a1 100644 --- a/src/main/java/appeng/api/recipes/ISubItemResolver.java +++ b/src/main/java/appeng/api/recipes/ISubItemResolver.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; public interface ISubItemResolver { + /** * @param namespace namespace of sub item * @param fullName name of sub item diff --git a/src/main/java/appeng/api/recipes/ResolverResult.java b/src/main/java/appeng/api/recipes/ResolverResult.java index eb293a53f78..5ae3f4cfba8 100644 --- a/src/main/java/appeng/api/recipes/ResolverResult.java +++ b/src/main/java/appeng/api/recipes/ResolverResult.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; diff --git a/src/main/java/appeng/api/recipes/ResolverResultSet.java b/src/main/java/appeng/api/recipes/ResolverResultSet.java index ee81f2e16c0..e15cc2203a2 100644 --- a/src/main/java/appeng/api/recipes/ResolverResultSet.java +++ b/src/main/java/appeng/api/recipes/ResolverResultSet.java @@ -1,30 +1,21 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.recipes; import java.util.Arrays; import java.util.List; + import net.minecraft.item.ItemStack; public class ResolverResultSet { diff --git a/src/main/java/appeng/api/storage/ICellContainer.java b/src/main/java/appeng/api/storage/ICellContainer.java index 1916a317281..23ca936dd53 100644 --- a/src/main/java/appeng/api/storage/ICellContainer.java +++ b/src/main/java/appeng/api/storage/ICellContainer.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/ICellHandler.java b/src/main/java/appeng/api/storage/ICellHandler.java index a7762c25e7a..e437a88cb59 100644 --- a/src/main/java/appeng/api/storage/ICellHandler.java +++ b/src/main/java/appeng/api/storage/ICellHandler.java @@ -1,35 +1,26 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; -import appeng.api.implementations.tiles.IChestOrDrive; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import appeng.api.implementations.tiles.IChestOrDrive; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * Registration record for {@link ICellRegistry} */ @@ -57,24 +48,24 @@ public interface ICellHandler { /** * @return the ME Chest texture for light pixels this storage cell type, should be 10x10 with 3px of transparent - * padding on a 16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the - * assets for examples. + * padding on a 16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the + * assets for examples. */ @SideOnly(Side.CLIENT) IIcon getTopTexture_Light(); /** * @return the ME Chest texture for medium pixels this storage cell type, should be 10x10 with 3px of transparent - * padding on a 16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the - * assets for examples. + * padding on a 16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the + * assets for examples. */ @SideOnly(Side.CLIENT) IIcon getTopTexture_Medium(); /** * @return the ME Chest texture for dark pixels this storage cell type, should be 10x10 with 3px of transparent - * padding on a 16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the - * assets for examples. + * padding on a 16x16 texture, null is valid if your cell cannot be used in the ME Chest. refer to the + * assets for examples. */ @SideOnly(Side.CLIENT) IIcon getTopTexture_Dark(); @@ -91,13 +82,8 @@ public interface ICellHandler { * @param is item * @param chan storage channel */ - void openChestGui( - EntityPlayer player, - IChestOrDrive chest, - ICellHandler cellHandler, - IMEInventoryHandler inv, - ItemStack is, - StorageChannel chan); + void openChestGui(EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, + ItemStack is, StorageChannel chan); /** * 0 - cell is missing. diff --git a/src/main/java/appeng/api/storage/ICellInventory.java b/src/main/java/appeng/api/storage/ICellInventory.java index ccf8add9bc8..a7242a22908 100644 --- a/src/main/java/appeng/api/storage/ICellInventory.java +++ b/src/main/java/appeng/api/storage/ICellInventory.java @@ -1,33 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; -import appeng.api.config.FuzzyMode; -import appeng.api.storage.data.IAEItemStack; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import appeng.api.config.FuzzyMode; +import appeng.api.storage.data.IAEItemStack; + public interface ICellInventory extends IMEInventory { /** diff --git a/src/main/java/appeng/api/storage/ICellInventoryHandler.java b/src/main/java/appeng/api/storage/ICellInventoryHandler.java index 016a745eac7..860e444a799 100644 --- a/src/main/java/appeng/api/storage/ICellInventoryHandler.java +++ b/src/main/java/appeng/api/storage/ICellInventoryHandler.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/ICellProvider.java b/src/main/java/appeng/api/storage/ICellProvider.java index 3e7807b7381..861a149c6ab 100644 --- a/src/main/java/appeng/api/storage/ICellProvider.java +++ b/src/main/java/appeng/api/storage/ICellProvider.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/ICellRegistry.java b/src/main/java/appeng/api/storage/ICellRegistry.java index 928c6fb8288..831c14c11c4 100644 --- a/src/main/java/appeng/api/storage/ICellRegistry.java +++ b/src/main/java/appeng/api/storage/ICellRegistry.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; -import appeng.api.IAppEngApi; import net.minecraft.item.ItemStack; +import appeng.api.IAppEngApi; + /** * Storage Cell Registry, used for specially implemented cells, if you just want to make a item act like a cell, or new * cell with different bytes, then you should probably consider IStorageCell instead its considerably simpler. @@ -46,7 +37,7 @@ public interface ICellRegistry { * * @param is to be checked item * @return true if the provided item, can be handled by a handler in AE, ( AE May choose to skip this and just get - * the handler instead. ) + * the handler instead. ) */ boolean isCellHandled(ItemStack is); diff --git a/src/main/java/appeng/api/storage/ICellWorkbenchItem.java b/src/main/java/appeng/api/storage/ICellWorkbenchItem.java index f65b3504f51..95f4758465b 100644 --- a/src/main/java/appeng/api/storage/ICellWorkbenchItem.java +++ b/src/main/java/appeng/api/storage/ICellWorkbenchItem.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; -import appeng.api.config.FuzzyMode; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import appeng.api.config.FuzzyMode; + public interface ICellWorkbenchItem { /** @@ -73,7 +64,7 @@ default String getOreFilter(ItemStack is) { } /** - * @param is cell item + * @param is cell item * @param filter new ore dictionary filter */ default void setOreFilter(ItemStack is, String filter) {} diff --git a/src/main/java/appeng/api/storage/IExternalStorageHandler.java b/src/main/java/appeng/api/storage/IExternalStorageHandler.java index b4d3a408c0b..be1792c2773 100644 --- a/src/main/java/appeng/api/storage/IExternalStorageHandler.java +++ b/src/main/java/appeng/api/storage/IExternalStorageHandler.java @@ -1,32 +1,23 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; -import appeng.api.networking.security.BaseActionSource; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.security.BaseActionSource; + /** * A Registration Record for {@link IExternalStorageRegistry} */ diff --git a/src/main/java/appeng/api/storage/IExternalStorageRegistry.java b/src/main/java/appeng/api/storage/IExternalStorageRegistry.java index 2598feb90e9..a38c2122510 100644 --- a/src/main/java/appeng/api/storage/IExternalStorageRegistry.java +++ b/src/main/java/appeng/api/storage/IExternalStorageRegistry.java @@ -1,33 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; -import appeng.api.IAppEngApi; -import appeng.api.networking.security.BaseActionSource; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.IAppEngApi; +import appeng.api.networking.security.BaseActionSource; + /** * A Registry of External Storage handlers. *

@@ -49,6 +40,6 @@ public interface IExternalStorageRegistry { * @param mySrc source * @return the handler for a given tile / forge direction */ - IExternalStorageHandler getHandler( - TileEntity te, ForgeDirection opposite, StorageChannel channel, BaseActionSource mySrc); + IExternalStorageHandler getHandler(TileEntity te, ForgeDirection opposite, StorageChannel channel, + BaseActionSource mySrc); } diff --git a/src/main/java/appeng/api/storage/IMEInventory.java b/src/main/java/appeng/api/storage/IMEInventory.java index 3641375a470..d77b2fbe95e 100644 --- a/src/main/java/appeng/api/storage/IMEInventory.java +++ b/src/main/java/appeng/api/storage/IMEInventory.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/IMEInventoryHandler.java b/src/main/java/appeng/api/storage/IMEInventoryHandler.java index e6552b035df..b634a0b0485 100644 --- a/src/main/java/appeng/api/storage/IMEInventoryHandler.java +++ b/src/main/java/appeng/api/storage/IMEInventoryHandler.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; @@ -69,8 +59,8 @@ public interface IMEInventoryHandler extends IMEInve * pass back value for blinkCell. * * @return the slot index for the cell that this represents in the storage unit, the method on the - * {@link ICellContainer} will be called with this value, only trust the return value of this method if you - * are the implementer of this. + * {@link ICellContainer} will be called with this value, only trust the return value of this method if you + * are the implementer of this. */ int getSlot(); diff --git a/src/main/java/appeng/api/storage/IMEMonitor.java b/src/main/java/appeng/api/storage/IMEMonitor.java index 29434970c21..2190f3ea146 100644 --- a/src/main/java/appeng/api/storage/IMEMonitor.java +++ b/src/main/java/appeng/api/storage/IMEMonitor.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java b/src/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java index a9475f7dbe3..b9ebf81ac57 100644 --- a/src/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java +++ b/src/main/java/appeng/api/storage/IMEMonitorHandlerReceiver.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/ISaveProvider.java b/src/main/java/appeng/api/storage/ISaveProvider.java index 06fbc9c016e..46e56d1621c 100644 --- a/src/main/java/appeng/api/storage/ISaveProvider.java +++ b/src/main/java/appeng/api/storage/ISaveProvider.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/IStorageHelper.java b/src/main/java/appeng/api/storage/IStorageHelper.java index 10d0982b959..03c6ee5cdcf 100644 --- a/src/main/java/appeng/api/storage/IStorageHelper.java +++ b/src/main/java/appeng/api/storage/IStorageHelper.java @@ -1,28 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; +import java.io.IOException; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import appeng.api.networking.crafting.ICraftingLink; import appeng.api.networking.crafting.ICraftingRequester; import appeng.api.networking.energy.IEnergySource; @@ -31,10 +27,6 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; public interface IStorageHelper { @@ -65,7 +57,7 @@ public interface IStorageHelper { /** * @return a new INSTANCE of {@link IItemList} for items that does not support sorted output, fuzzy lookup - * (findFuzzy would raise UnsupportedOperationException!) nor concurrent access, but does work much faster + * (findFuzzy would raise UnsupportedOperationException!) nor concurrent access, but does work much faster */ IItemList createPrimitiveItemList(); @@ -101,8 +93,8 @@ public interface IStorageHelper { * @param src action source * @return items that successfully extracted. */ - IAEItemStack poweredExtraction( - IEnergySource energy, IMEInventory cell, IAEItemStack request, BaseActionSource src); + IAEItemStack poweredExtraction(IEnergySource energy, IMEInventory cell, IAEItemStack request, + BaseActionSource src); /** * use energy from energy, to inject input items into cell, at the request of src @@ -113,6 +105,6 @@ IAEItemStack poweredExtraction( * @param src action source * @return items that failed to insert. */ - IAEItemStack poweredInsert( - IEnergySource energy, IMEInventory cell, IAEItemStack input, BaseActionSource src); + IAEItemStack poweredInsert(IEnergySource energy, IMEInventory cell, IAEItemStack input, + BaseActionSource src); } diff --git a/src/main/java/appeng/api/storage/IStorageMonitorable.java b/src/main/java/appeng/api/storage/IStorageMonitorable.java index 4a2b45f79b7..d2ed40476a3 100644 --- a/src/main/java/appeng/api/storage/IStorageMonitorable.java +++ b/src/main/java/appeng/api/storage/IStorageMonitorable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; diff --git a/src/main/java/appeng/api/storage/ITerminalHost.java b/src/main/java/appeng/api/storage/ITerminalHost.java index 742ced27f70..e18c7a453ec 100644 --- a/src/main/java/appeng/api/storage/ITerminalHost.java +++ b/src/main/java/appeng/api/storage/ITerminalHost.java @@ -1,28 +1,19 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; import appeng.api.util.IConfigurableObject; -public interface ITerminalHost extends IStorageMonitorable, IConfigurableObject {} +public interface ITerminalHost extends IStorageMonitorable, IConfigurableObject { +} diff --git a/src/main/java/appeng/api/storage/MEMonitorHandler.java b/src/main/java/appeng/api/storage/MEMonitorHandler.java index 0edf192be04..73bed1a8135 100644 --- a/src/main/java/appeng/api/storage/MEMonitorHandler.java +++ b/src/main/java/appeng/api/storage/MEMonitorHandler.java @@ -1,37 +1,29 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map.Entry; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; + import com.google.common.collect.ImmutableList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map.Entry; /** * Common implementation of a simple class that monitors injection/extraction of a inventory to send events to a list of @@ -43,8 +35,7 @@ public class MEMonitorHandler implements IMEMonitor< private final IMEInventoryHandler internalHandler; private final IItemList cachedList; - private final HashMap, Object> listeners = - new HashMap, Object>(); + private final HashMap, Object> listeners = new HashMap, Object>(); protected boolean hasChanged = true; @@ -80,8 +71,8 @@ protected IMEInventoryHandler getHandler() { return this.internalHandler; } - private StackType monitorDifference( - final IAEStack original, final StackType leftOvers, final boolean extraction, final BaseActionSource src) { + private StackType monitorDifference(final IAEStack original, final StackType leftOvers, final boolean extraction, + final BaseActionSource src) { final StackType diff = (StackType) original.copy(); if (extraction) { diff --git a/src/main/java/appeng/api/storage/StorageChannel.java b/src/main/java/appeng/api/storage/StorageChannel.java index 018c2b11754..a920d81417d 100644 --- a/src/main/java/appeng/api/storage/StorageChannel.java +++ b/src/main/java/appeng/api/storage/StorageChannel.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage; @@ -30,6 +20,7 @@ import appeng.api.storage.data.IItemList; public enum StorageChannel { + /** * AE2's Default Storage. */ diff --git a/src/main/java/appeng/api/storage/data/IAEFluidStack.java b/src/main/java/appeng/api/storage/data/IAEFluidStack.java index b62630d620b..6cd227b26ea 100644 --- a/src/main/java/appeng/api/storage/data/IAEFluidStack.java +++ b/src/main/java/appeng/api/storage/data/IAEFluidStack.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage.data; @@ -27,11 +17,10 @@ import net.minecraftforge.fluids.FluidStack; /** - * An alternate version of FluidStack for AE to keep tabs on things easier, and - * to support larger storage. stackSizes of getFluidStack will be capped. + * An alternate version of FluidStack for AE to keep tabs on things easier, and to support larger storage. stackSizes of + * getFluidStack will be capped. *

- * You may hold on to these if you want, just make sure you let go of them when - * your not using them. + * You may hold on to these if you want, just make sure you let go of them when your not using them. *

* Don't Implement. *

diff --git a/src/main/java/appeng/api/storage/data/IAEItemStack.java b/src/main/java/appeng/api/storage/data/IAEItemStack.java index 583b18019b8..504104931a1 100644 --- a/src/main/java/appeng/api/storage/data/IAEItemStack.java +++ b/src/main/java/appeng/api/storage/data/IAEItemStack.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage.data; diff --git a/src/main/java/appeng/api/storage/data/IAEStack.java b/src/main/java/appeng/api/storage/data/IAEStack.java index 075e028a65c..1744f00a065 100644 --- a/src/main/java/appeng/api/storage/data/IAEStack.java +++ b/src/main/java/appeng/api/storage/data/IAEStack.java @@ -1,33 +1,25 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage.data; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.FuzzyMode; import appeng.api.storage.StorageChannel; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; public interface IAEStack { diff --git a/src/main/java/appeng/api/storage/data/IAETagCompound.java b/src/main/java/appeng/api/storage/data/IAETagCompound.java index 6a0a483fec8..171653864e6 100644 --- a/src/main/java/appeng/api/storage/data/IAETagCompound.java +++ b/src/main/java/appeng/api/storage/data/IAETagCompound.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage.data; -import appeng.api.features.IItemComparison; import net.minecraft.nbt.NBTTagCompound; +import appeng.api.features.IItemComparison; + /** * Don't cast this... either compare with it, or copy it. *

diff --git a/src/main/java/appeng/api/storage/data/IItemContainer.java b/src/main/java/appeng/api/storage/data/IItemContainer.java index 603396b875e..8421d251d87 100644 --- a/src/main/java/appeng/api/storage/data/IItemContainer.java +++ b/src/main/java/appeng/api/storage/data/IItemContainer.java @@ -1,31 +1,22 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage.data; -import appeng.api.config.FuzzyMode; import java.util.Collection; +import appeng.api.config.FuzzyMode; + /** * Represents a list of items in AE. *

@@ -45,7 +36,7 @@ public interface IItemContainer { /** * @param i compared item * @return a stack equivalent to the stack passed in, but with the correct stack size information, or null if its - * not present + * not present */ StackType findPrecise(StackType i); diff --git a/src/main/java/appeng/api/storage/data/IItemList.java b/src/main/java/appeng/api/storage/data/IItemList.java index 74dc280e64b..f0292759dd9 100644 --- a/src/main/java/appeng/api/storage/data/IItemList.java +++ b/src/main/java/appeng/api/storage/data/IItemList.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.storage.data; diff --git a/src/main/java/appeng/api/util/AECableType.java b/src/main/java/appeng/api/util/AECableType.java index 2ae6d27d01a..3eee7322540 100644 --- a/src/main/java/appeng/api/util/AECableType.java +++ b/src/main/java/appeng/api/util/AECableType.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; @@ -60,7 +50,8 @@ public enum AECableType { ULTRA_DENSE, /** - * Ultra Dense Cable, represents a tier 3 block that can carry 128 channels and renders as smart (4 channels per line). + * Ultra Dense Cable, represents a tier 3 block that can carry 128 channels and renders as smart (4 channels per + * line). */ ULTRA_DENSE_SMART } diff --git a/src/main/java/appeng/api/util/AEColor.java b/src/main/java/appeng/api/util/AEColor.java index abc10c1fd61..1843563870a 100644 --- a/src/main/java/appeng/api/util/AEColor.java +++ b/src/main/java/appeng/api/util/AEColor.java @@ -1,30 +1,21 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; import java.util.Arrays; import java.util.List; + import net.minecraft.util.StatCollector; /** @@ -33,6 +24,7 @@ * Should be the same order as Dyes, excluding Transparent. */ public enum AEColor { + White("gui.appliedenergistics2.White", 0xBEBEBE, 0xDBDBDB, 0xFAFAFA), Orange("gui.appliedenergistics2.Orange", 0xF99739, 0xFAAE44, 0xF4DEC3), @@ -68,8 +60,22 @@ public enum AEColor { Transparent("gui.appliedenergistics2.Fluix", 0x1B2344, 0x895CA8, 0xD7BBEC); public static final List VALID_COLORS = Arrays.asList( - White, Orange, Magenta, LightBlue, Yellow, Lime, Pink, Gray, LightGray, Cyan, Purple, Blue, Brown, Green, - Red, Black); + White, + Orange, + Magenta, + LightBlue, + Yellow, + Lime, + Pink, + Gray, + LightGray, + Cyan, + Purple, + Blue, + Brown, + Green, + Red, + Black); /** * Unlocalized name for color. diff --git a/src/main/java/appeng/api/util/AEColoredItemDefinition.java b/src/main/java/appeng/api/util/AEColoredItemDefinition.java index 4c516c28102..e26413cba62 100644 --- a/src/main/java/appeng/api/util/AEColoredItemDefinition.java +++ b/src/main/java/appeng/api/util/AEColoredItemDefinition.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/AEItemDefinition.java b/src/main/java/appeng/api/util/AEItemDefinition.java index 047180905d3..4f658279fcd 100644 --- a/src/main/java/appeng/api/util/AEItemDefinition.java +++ b/src/main/java/appeng/api/util/AEItemDefinition.java @@ -1,39 +1,31 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; -import appeng.api.definitions.IBlockDefinition; -import appeng.api.definitions.IComparableDefinition; -import appeng.api.definitions.IItemDefinition; -import appeng.api.definitions.ITileDefinition; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; +import appeng.api.definitions.IBlockDefinition; +import appeng.api.definitions.IComparableDefinition; +import appeng.api.definitions.IItemDefinition; +import appeng.api.definitions.ITileDefinition; + /** * Gives easy access to different part of the various, items/blocks/materials in AE. * @@ -41,6 +33,7 @@ */ @Deprecated public interface AEItemDefinition { + /** * @return the {@link Block} Implementation if applicable * @deprecated use {@link IBlockDefinition#maybeBlock()} diff --git a/src/main/java/appeng/api/util/DimensionalCoord.java b/src/main/java/appeng/api/util/DimensionalCoord.java index f0a20e7b394..f51e0568afd 100644 --- a/src/main/java/appeng/api/util/DimensionalCoord.java +++ b/src/main/java/appeng/api/util/DimensionalCoord.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/ICommonTile.java b/src/main/java/appeng/api/util/ICommonTile.java index 0b156ad0e12..edc224a74c3 100644 --- a/src/main/java/appeng/api/util/ICommonTile.java +++ b/src/main/java/appeng/api/util/ICommonTile.java @@ -1,29 +1,20 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.world.World; diff --git a/src/main/java/appeng/api/util/IConfigManager.java b/src/main/java/appeng/api/util/IConfigManager.java index 0abd7f57acf..8e33d95f31f 100644 --- a/src/main/java/appeng/api/util/IConfigManager.java +++ b/src/main/java/appeng/api/util/IConfigManager.java @@ -1,32 +1,24 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; -import appeng.api.config.Settings; import java.util.Set; + import net.minecraft.nbt.NBTTagCompound; +import appeng.api.config.Settings; + /** * Used to adjust settings on an object, *

diff --git a/src/main/java/appeng/api/util/IConfigurableObject.java b/src/main/java/appeng/api/util/IConfigurableObject.java index 8c7a210f616..e56e7c7d57b 100644 --- a/src/main/java/appeng/api/util/IConfigurableObject.java +++ b/src/main/java/appeng/api/util/IConfigurableObject.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/INetworkToolAgent.java b/src/main/java/appeng/api/util/INetworkToolAgent.java index 70e135253d4..5c488010dee 100644 --- a/src/main/java/appeng/api/util/INetworkToolAgent.java +++ b/src/main/java/appeng/api/util/INetworkToolAgent.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/IOrientable.java b/src/main/java/appeng/api/util/IOrientable.java index 6f10711f41b..246a02e5f7e 100644 --- a/src/main/java/appeng/api/util/IOrientable.java +++ b/src/main/java/appeng/api/util/IOrientable.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/IOrientableBlock.java b/src/main/java/appeng/api/util/IOrientableBlock.java index 3aa9be861da..ec0c4633940 100644 --- a/src/main/java/appeng/api/util/IOrientableBlock.java +++ b/src/main/java/appeng/api/util/IOrientableBlock.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/IReadOnlyCollection.java b/src/main/java/appeng/api/util/IReadOnlyCollection.java index 86b57ab3154..88529a57e82 100644 --- a/src/main/java/appeng/api/util/IReadOnlyCollection.java +++ b/src/main/java/appeng/api/util/IReadOnlyCollection.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; diff --git a/src/main/java/appeng/api/util/WorldCoord.java b/src/main/java/appeng/api/util/WorldCoord.java index e6e8dd44059..3fd6428d4d1 100644 --- a/src/main/java/appeng/api/util/WorldCoord.java +++ b/src/main/java/appeng/api/util/WorldCoord.java @@ -1,24 +1,14 @@ /* - * The MIT License (MIT) - * - * Copyright (c) 2013 AlgorithmX2 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * The MIT License (MIT) Copyright (c) 2013 AlgorithmX2 Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package appeng.api.util; @@ -27,8 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection; /** - * Represents a relative coordinate, either relative to another object, or - * relative to the origin of a dimension. + * Represents a relative coordinate, either relative to another object, or relative to the origin of a dimension. */ public class WorldCoord { diff --git a/src/main/java/appeng/block/AEBaseBlock.java b/src/main/java/appeng/block/AEBaseBlock.java index 98f5de0eb55..99d65329b86 100644 --- a/src/main/java/appeng/block/AEBaseBlock.java +++ b/src/main/java/appeng/block/AEBaseBlock.java @@ -1,42 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; -import appeng.api.util.IOrientable; -import appeng.api.util.IOrientableBlock; -import appeng.client.render.BaseBlockRender; -import appeng.client.render.BlockRenderInfo; -import appeng.client.render.WorldRender; -import appeng.client.texture.FlippableIcon; -import appeng.client.texture.MissingIcon; -import appeng.core.features.*; -import appeng.helpers.AEGlassMaterial; -import appeng.helpers.ICustomCollision; -import appeng.tile.AEBaseTile; -import appeng.util.LookDirection; -import appeng.util.Platform; -import com.google.common.base.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; @@ -52,7 +29,27 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; +import appeng.api.util.IOrientableBlock; +import appeng.client.render.BaseBlockRender; +import appeng.client.render.BlockRenderInfo; +import appeng.client.render.WorldRender; +import appeng.client.texture.FlippableIcon; +import appeng.client.texture.MissingIcon; +import appeng.core.features.*; +import appeng.helpers.AEGlassMaterial; +import appeng.helpers.ICustomCollision; +import appeng.tile.AEBaseTile; +import appeng.util.LookDirection; +import appeng.util.Platform; + +import com.google.common.base.Optional; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public abstract class AEBaseBlock extends Block implements IAEFeature { + private final String featureFullName; protected final Optional featureSubName; protected boolean isOpaque = true; @@ -181,14 +178,8 @@ protected ICustomCollision getCustomCollision(final World w, final int x, final @Override @SuppressWarnings("unchecked") // NOTE: WAS FINAL, changed for Immibis - public void addCollisionBoxesToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollisionBoxesToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { final ICustomCollision collisionHandler = this.getCustomCollision(w, x, y, z); if (collisionHandler != null && bb != null) { @@ -220,16 +211,20 @@ public final AxisAlignedBB getSelectedBoundingBoxFromPool(final World w, final i final EntityPlayer player = Minecraft.getMinecraft().thePlayer; final LookDirection ld = Platform.getPlayerRay(player, Platform.getEyeOffset(player)); - final Iterable bbs = collisionHandler.getSelectedBoundingBoxesFromPool( - w, x, y, z, Minecraft.getMinecraft().thePlayer, true); + final Iterable bbs = collisionHandler + .getSelectedBoundingBoxesFromPool(w, x, y, z, Minecraft.getMinecraft().thePlayer, true); AxisAlignedBB br = null; double lastDist = 0; for (final AxisAlignedBB bb : bbs) { this.setBlockBounds( - (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) - bb.maxZ); + (float) bb.minX, + (float) bb.minY, + (float) bb.minZ, + (float) bb.maxX, + (float) bb.maxY, + (float) bb.maxZ); final MovingObjectPosition r = super.collisionRayTrace(w, x, y, z, ld.getA(), ld.getB()); @@ -282,21 +277,25 @@ public final boolean isOpaqueCube() { } @Override - public MovingObjectPosition collisionRayTrace( - final World w, final int x, final int y, final int z, final Vec3 a, final Vec3 b) { + public MovingObjectPosition collisionRayTrace(final World w, final int x, final int y, final int z, final Vec3 a, + final Vec3 b) { final ICustomCollision collisionHandler = this.getCustomCollision(w, x, y, z); if (collisionHandler != null) { - final Iterable bbs = - collisionHandler.getSelectedBoundingBoxesFromPool(w, x, y, z, null, true); + final Iterable bbs = collisionHandler + .getSelectedBoundingBoxesFromPool(w, x, y, z, null, true); MovingObjectPosition br = null; double lastDist = 0; for (final AxisAlignedBB bb : bbs) { this.setBlockBounds( - (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) - bb.maxZ); + (float) bb.minX, + (float) bb.minY, + (float) bb.minZ, + (float) bb.maxX, + (float) bb.maxY, + (float) bb.maxZ); final MovingObjectPosition r = super.collisionRayTrace(w, x, y, z, a, b); @@ -326,16 +325,8 @@ public MovingObjectPosition collisionRayTrace( return super.collisionRayTrace(w, x, y, z, a, b); } - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { return false; } @@ -418,13 +409,8 @@ protected boolean hasCustomRotation() { protected void customRotateBlock(final IOrientable rotatable, final ForgeDirection axis) {} - public boolean isValidOrientation( - final World w, - final int x, - final int y, - final int z, - final ForgeDirection forward, - final ForgeDirection up) { + public boolean isValidOrientation(final World w, final int x, final int y, final int z, + final ForgeDirection forward, final ForgeDirection up) { return true; } @@ -447,8 +433,7 @@ private FlippableIcon optionalIcon(final IIconRegister ir, final String name, II resLoc.getResourceDomain(), String.format("%s/%s%s", "textures/blocks", resLoc.getResourcePath(), ".png")); - final IResource res = - Minecraft.getMinecraft().getResourceManager().getResource(resLoc); + final IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resLoc); if (res != null) { return new FlippableIcon(ir.registerIcon(name)); } @@ -532,10 +517,7 @@ public String getUnlocalizedName(final ItemStack is) { return this.getUnlocalizedName(); } - void addInformation( - final ItemStack is, - final EntityPlayer player, - final List lines, + void addInformation(final ItemStack is, final EntityPlayer player, final List lines, final boolean advancedItemTooltips) {} public Class getItemBlockClass() { diff --git a/src/main/java/appeng/block/AEBaseItemBlock.java b/src/main/java/appeng/block/AEBaseItemBlock.java index 0bd5ebac6f1..680807ceb83 100644 --- a/src/main/java/appeng/block/AEBaseItemBlock.java +++ b/src/main/java/appeng/block/AEBaseItemBlock.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.util.IOrientable; import appeng.api.util.IOrientableBlock; import appeng.block.misc.BlockLightDetector; @@ -29,15 +32,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.util.ForgeDirection; public class AEBaseItemBlock extends ItemBlock { @@ -64,16 +58,13 @@ public int getMetadata(final int dmg) { @Override @SideOnly(Side.CLIENT) @SuppressWarnings("unchecked") - public final void addInformation( - final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips) { + public final void addInformation(final ItemStack itemStack, final EntityPlayer player, final List toolTip, + final boolean advancedTooltips) { this.addCheckedInformation(itemStack, player, toolTip, advancedTooltips); } @SideOnly(Side.CLIENT) - public void addCheckedInformation( - final ItemStack itemStack, - final EntityPlayer player, - final List toolTip, + public void addCheckedInformation(final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedToolTips) { this.blockType.addInformation(itemStack, player, toolTip, advancedToolTips); } @@ -89,17 +80,8 @@ public String getUnlocalizedName(final ItemStack is) { } @Override - public boolean placeBlockAt( - final ItemStack stack, - final EntityPlayer player, - final World w, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ, + public boolean placeBlockAt(final ItemStack stack, final EntityPlayer player, final World w, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ, final int metadata) { ForgeDirection up = ForgeDirection.UNKNOWN; ForgeDirection forward = ForgeDirection.UNKNOWN; @@ -174,11 +156,8 @@ public boolean placeBlockAt( } if (ori.canBeRotated() && !this.blockType.hasCustomRotation()) { - if (ori.getForward() == null - || ori.getUp() == null - || // null - tile.getForward() == ForgeDirection.UNKNOWN - || ori.getUp() == ForgeDirection.UNKNOWN) { + if (ori.getForward() == null || ori.getUp() == null || // null + tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN) { ori.setOrientation(forward, up); } } diff --git a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java index dbe1f4120cc..2322345e8a2 100644 --- a/src/main/java/appeng/block/AEBaseItemBlockChargeable.java +++ b/src/main/java/appeng/block/AEBaseItemBlockChargeable.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; +import java.text.MessageFormat; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.AccessRestriction; import appeng.api.config.PowerUnits; import appeng.api.definitions.IBlockDefinition; @@ -27,12 +27,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.text.MessageFormat; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEItemPowerStorage { @@ -42,10 +36,7 @@ public AEBaseItemBlockChargeable(final Block id) { @Override @SideOnly(Side.CLIENT) - public void addCheckedInformation( - final ItemStack itemStack, - final EntityPlayer player, - final List toolTip, + public void addCheckedInformation(final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips) { final NBTTagCompound tag = itemStack.getTagCompound(); double internalCurrentPower = 0; @@ -57,9 +48,12 @@ public void addCheckedInformation( final double percent = internalCurrentPower / internalMaxPower; - toolTip.add(GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower) - + Platform.gui_localize(PowerUnits.AE.unlocalizedName) + " - " - + MessageFormat.format(" {0,number,#.##%} ", percent)); + toolTip.add( + GuiText.StoredEnergy.getLocal() + ':' + + MessageFormat.format(" {0,number,#} ", internalCurrentPower) + + Platform.gui_localize(PowerUnits.AE.unlocalizedName) + + " - " + + MessageFormat.format(" {0,number,#.##%} ", percent)); } private double getMaxEnergyCapacity() { diff --git a/src/main/java/appeng/block/AEBaseItemBlockSlab.java b/src/main/java/appeng/block/AEBaseItemBlockSlab.java index 94f94fd04bc..f64838acf53 100644 --- a/src/main/java/appeng/block/AEBaseItemBlockSlab.java +++ b/src/main/java/appeng/block/AEBaseItemBlockSlab.java @@ -5,10 +5,7 @@ public class AEBaseItemBlockSlab extends ItemSlab { - public AEBaseItemBlockSlab( - final Block block, - final AEBaseSlabBlock singleSlab, - final AEBaseSlabBlock doubleSlab, + public AEBaseItemBlockSlab(final Block block, final AEBaseSlabBlock singleSlab, final AEBaseSlabBlock doubleSlab, final Boolean isDoubleSlab) { super(block, singleSlab, doubleSlab, isDoubleSlab); } diff --git a/src/main/java/appeng/block/AEBaseSlabBlock.java b/src/main/java/appeng/block/AEBaseSlabBlock.java index c040098e7af..390a8088f55 100644 --- a/src/main/java/appeng/block/AEBaseSlabBlock.java +++ b/src/main/java/appeng/block/AEBaseSlabBlock.java @@ -1,29 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; -import appeng.core.features.AEFeature; -import appeng.core.features.IAEFeature; -import appeng.core.features.IFeatureHandler; -import appeng.core.features.SlabBlockFeatureHandler; import java.util.EnumSet; import java.util.Random; + import net.minecraft.block.BlockSlab; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; @@ -32,7 +21,13 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import appeng.core.features.AEFeature; +import appeng.core.features.IAEFeature; +import appeng.core.features.IFeatureHandler; +import appeng.core.features.SlabBlockFeatureHandler; + public class AEBaseSlabBlock extends BlockSlab implements IAEFeature { + private final IFeatureHandler features; private final AEBaseBlock block; private final int meta; @@ -40,12 +35,8 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature { private AEBaseSlabBlock doubleSlabs; private final String name; - public AEBaseSlabBlock( - final AEBaseBlock block, - final int meta, - final EnumSet features, - final boolean isDoubleSlab, - final String name) { + public AEBaseSlabBlock(final AEBaseBlock block, final int meta, final EnumSet features, + final boolean isDoubleSlab, final String name) { super(isDoubleSlab, block.getMaterial()); this.block = block; this.meta = meta; @@ -103,8 +94,8 @@ public Item getItemDropped(final int meta, final Random rand, final int fortune) } @Override - public ItemStack getPickBlock( - final MovingObjectPosition target, final World world, final int x, final int y, final int z) { + public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, + final int z) { AEBaseSlabBlock block = (AEBaseSlabBlock) world.getBlock(x, y, z); if (block == null) { diff --git a/src/main/java/appeng/block/AEBaseStairBlock.java b/src/main/java/appeng/block/AEBaseStairBlock.java index 9a184155376..5287b9be5b3 100644 --- a/src/main/java/appeng/block/AEBaseStairBlock.java +++ b/src/main/java/appeng/block/AEBaseStairBlock.java @@ -1,33 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockStairs; + import appeng.core.features.AEFeature; import appeng.core.features.IAEFeature; import appeng.core.features.IFeatureHandler; import appeng.core.features.StairBlockFeatureHandler; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature { + private final IFeatureHandler features; protected AEBaseStairBlock(final Block block, final int meta, final EnumSet features) { diff --git a/src/main/java/appeng/block/AEBaseTileBlock.java b/src/main/java/appeng/block/AEBaseTileBlock.java index 705f255be87..7c2ef9902d2 100644 --- a/src/main/java/appeng/block/AEBaseTileBlock.java +++ b/src/main/java/appeng/block/AEBaseTileBlock.java @@ -1,48 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; -import appeng.api.implementations.items.IMemoryCard; -import appeng.api.implementations.items.MemoryCardMessages; -import appeng.api.implementations.tiles.IColorableTile; -import appeng.api.util.AEColor; -import appeng.api.util.IOrientable; -import appeng.block.networking.BlockCableBus; -import appeng.core.features.AEFeature; -import appeng.core.features.AETileBlockFeatureHandler; -import appeng.core.features.IAEFeature; -import appeng.core.sync.GuiBridge; -import appeng.helpers.ICustomCollision; -import appeng.items.tools.quartz.ToolQuartzCuttingKnife; -import appeng.tile.AEBaseTile; -import appeng.tile.networking.TileCableBus; -import appeng.tile.storage.TileSkyChest; -import appeng.util.Platform; -import appeng.util.SettingsFrom; -import com.google.common.base.Optional; -import com.google.common.collect.Lists; -import cpw.mods.fml.relauncher.ReflectionHelper; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -60,6 +34,28 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.world.BlockEvent; +import appeng.api.implementations.items.IMemoryCard; +import appeng.api.implementations.items.MemoryCardMessages; +import appeng.api.implementations.tiles.IColorableTile; +import appeng.api.util.AEColor; +import appeng.api.util.IOrientable; +import appeng.block.networking.BlockCableBus; +import appeng.core.features.AEFeature; +import appeng.core.features.AETileBlockFeatureHandler; +import appeng.core.features.IAEFeature; +import appeng.core.sync.GuiBridge; +import appeng.helpers.ICustomCollision; +import appeng.items.tools.quartz.ToolQuartzCuttingKnife; +import appeng.tile.AEBaseTile; +import appeng.tile.networking.TileCableBus; +import appeng.tile.storage.TileSkyChest; +import appeng.util.Platform; +import appeng.util.SettingsFrom; + +import com.google.common.base.Optional; +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.ReflectionHelper; + public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature, ITileEntityProvider { @Nonnull @@ -119,7 +115,8 @@ public final TileEntity createNewTileEntity(final World var1, final int var2) { return this.tileEntityType.newInstance(); } catch (final InstantiationException e) { throw new IllegalStateException( - "Failed to create a new instance of an illegal class " + this.tileEntityType, e); + "Failed to create a new instance of an illegal class " + this.tileEntityType, + e); } catch (final IllegalAccessException e) { throw new IllegalStateException( "Failed to create a new instance of " + this.tileEntityType + ", because lack of permissions", @@ -160,8 +157,8 @@ public final ForgeDirection[] getValidRotations(final World w, final int x, fina } @Override - public boolean recolourBlock( - final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour) { + public boolean recolourBlock(final World world, final int x, final int y, final int z, final ForgeDirection side, + final int colour) { final TileEntity te = this.getTileEntity(world, x, y, z); if (te instanceof IColorableTile) { @@ -189,21 +186,16 @@ public int getComparatorInputOverride(final World w, final int x, final int y, f } @Override - public boolean onBlockEventReceived( - final World p_149696_1_, - final int p_149696_2_, - final int p_149696_3_, - final int p_149696_4_, - final int p_149696_5_, - final int p_149696_6_) { + public boolean onBlockEventReceived(final World p_149696_1_, final int p_149696_2_, final int p_149696_3_, + final int p_149696_4_, final int p_149696_5_, final int p_149696_6_) { super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); final TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); return tileentity != null && tileentity.receiveClientEvent(p_149696_5_, p_149696_6_); } @Override - public void onBlockPlacedBy( - final World w, final int x, final int y, final int z, final EntityLivingBase player, final ItemStack is) { + public void onBlockPlacedBy(final World w, final int x, final int y, final int z, final EntityLivingBase player, + final ItemStack is) { if (is.hasDisplayName()) { final TileEntity te = this.getTileEntity(w, x, y, z); if (te instanceof AEBaseTile) { @@ -213,16 +205,8 @@ public void onBlockPlacedBy( } @Override - public boolean onBlockActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onBlockActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { if (player != null) { final ItemStack is = player.inventory.getCurrentItem(); if (is != null) { diff --git a/src/main/java/appeng/block/AEDecorativeBlock.java b/src/main/java/appeng/block/AEDecorativeBlock.java index 1d31a4c29fb..27b0c15f984 100644 --- a/src/main/java/appeng/block/AEDecorativeBlock.java +++ b/src/main/java/appeng/block/AEDecorativeBlock.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block; @@ -23,6 +15,7 @@ import net.minecraft.world.IBlockAccess; public class AEDecorativeBlock extends AEBaseBlock { + public AEDecorativeBlock(final Material mat) { super(mat); } diff --git a/src/main/java/appeng/block/crafting/BlockAdvancedCraftingStorage.java b/src/main/java/appeng/block/crafting/BlockAdvancedCraftingStorage.java index 2710e25edc4..3a02cc0293b 100644 --- a/src/main/java/appeng/block/crafting/BlockAdvancedCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/BlockAdvancedCraftingStorage.java @@ -1,10 +1,11 @@ package appeng.block.crafting; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.crafting.TileCraftingStorageTile; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.crafting.TileCraftingStorageTile; + public class BlockAdvancedCraftingStorage extends BlockCraftingStorage { public BlockAdvancedCraftingStorage() { diff --git a/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java b/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java index 8165449fd0e..76fb2806aaf 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingMonitor.java @@ -1,30 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.crafting; -import appeng.api.AEApi; -import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.crafting.TileCraftingMonitorTile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @@ -32,7 +19,15 @@ import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; +import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.crafting.TileCraftingMonitorTile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockCraftingMonitor extends BlockCraftingUnit { + public BlockCraftingMonitor() { this.setTileEntity(TileCraftingMonitorTile.class); } @@ -46,11 +41,7 @@ protected RenderBlockCraftingCPUMonitor getRenderer() { @Override public IIcon getIcon(final int direction, final int metadata) { if (direction != ForgeDirection.SOUTH.ordinal()) { - for (final Block craftingUnitBlock : AEApi.instance() - .definitions() - .blocks() - .craftingUnit() - .maybeBlock() + for (final Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock() .asSet()) { return craftingUnitBlock.getIcon(direction, metadata); } diff --git a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java index c0ea3edbc4a..6190178f961 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingStorage.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.crafting; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.crafting.TileCraftingStorageTile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.crafting.TileCraftingStorageTile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockCraftingStorage extends BlockCraftingUnit { + public BlockCraftingStorage() { this.setTileEntity(TileCraftingStorageTile.class); } diff --git a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java index c808dce807b..b078bfce7a7 100644 --- a/src/main/java/appeng/block/crafting/BlockCraftingUnit.java +++ b/src/main/java/appeng/block/crafting/BlockCraftingUnit.java @@ -1,34 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.crafting; -import appeng.block.AEBaseTileBlock; -import appeng.client.render.blocks.RenderBlockCraftingCPU; -import appeng.client.texture.ExtraBlockTextures; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.crafting.TileCraftingTile; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -39,7 +23,18 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.client.render.blocks.RenderBlockCraftingCPU; +import appeng.client.texture.ExtraBlockTextures; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.crafting.TileCraftingTile; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockCraftingUnit extends AEBaseTileBlock { + static final int FLAG_FORMED = 8; public BlockCraftingUnit() { @@ -80,16 +75,8 @@ public IIcon getIcon(final int direction, final int metadata) { } @Override - public boolean onBlockActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onBlockActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { final TileCraftingTile tg = this.getTileEntity(w, x, y, z); if (tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive()) { if (Platform.isClient()) { diff --git a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java index 50563b0091f..bcecc8d59ce 100644 --- a/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java +++ b/src/main/java/appeng/block/crafting/BlockMolecularAssembler.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.crafting; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockAssembler; import appeng.core.features.AEFeature; @@ -26,11 +25,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockMolecularAssembler extends AEBaseTileBlock { @@ -63,16 +57,8 @@ public RenderBlockAssembler getRenderer() { } @Override - public boolean onBlockActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onBlockActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { final TileMolecularAssembler tg = this.getTileEntity(w, x, y, z); if (tg != null && !p.isSneaking()) { Platform.openGUI(p, tg, ForgeDirection.getOrientation(side), GuiBridge.GUI_MAC); diff --git a/src/main/java/appeng/block/crafting/ItemCraftingStorage.java b/src/main/java/appeng/block/crafting/ItemCraftingStorage.java index 73e5b70fadd..ef5ac4fe72c 100644 --- a/src/main/java/appeng/block/crafting/ItemCraftingStorage.java +++ b/src/main/java/appeng/block/crafting/ItemCraftingStorage.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.crafting; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.block.AEBaseItemBlock; import appeng.core.AEConfig; import appeng.core.features.AEFeature; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class ItemCraftingStorage extends AEBaseItemBlock { @@ -33,12 +26,7 @@ public ItemCraftingStorage(final Block id) { @Override public ItemStack getContainerItem(final ItemStack itemStack) { - for (final ItemStack stack : AEApi.instance() - .definitions() - .blocks() - .craftingUnit() - .maybeStack(1) - .asSet()) { + for (final ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack(1).asSet()) { return stack; } diff --git a/src/main/java/appeng/block/grindstone/BlockCrank.java b/src/main/java/appeng/block/grindstone/BlockCrank.java index ded1c13ff63..78375f20301 100644 --- a/src/main/java/appeng/block/grindstone/BlockCrank.java +++ b/src/main/java/appeng/block/grindstone/BlockCrank.java @@ -1,33 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.grindstone; -import appeng.api.implementations.tiles.ICrankable; -import appeng.block.AEBaseTileBlock; -import appeng.client.render.blocks.RenderBlockCrank; -import appeng.core.features.AEFeature; -import appeng.core.stats.Stats; -import appeng.tile.AEBaseTile; -import appeng.tile.grindstone.TileCrank; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -38,6 +22,16 @@ import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.implementations.tiles.ICrankable; +import appeng.block.AEBaseTileBlock; +import appeng.client.render.blocks.RenderBlockCrank; +import appeng.core.features.AEFeature; +import appeng.core.stats.Stats; +import appeng.tile.AEBaseTile; +import appeng.tile.grindstone.TileCrank; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockCrank extends AEBaseTileBlock { public BlockCrank() { @@ -57,16 +51,8 @@ public RenderBlockCrank getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { if (player instanceof FakePlayer || player == null) { this.dropCrank(w, x, y, z); return true; @@ -88,12 +74,7 @@ private void dropCrank(final World world, final int x, final int y, final int z) } @Override - public void onBlockPlacedBy( - final World world, - final int x, - final int y, - final int z, - final EntityLivingBase placer, + public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase placer, final ItemStack itemStack) { final AEBaseTile tile = this.getTileEntity(world, x, y, z); if (tile != null) { @@ -109,13 +90,8 @@ public void onBlockPlacedBy( } @Override - public boolean isValidOrientation( - final World world, - final int x, - final int y, - final int z, - final ForgeDirection forward, - final ForgeDirection up) { + public boolean isValidOrientation(final World world, final int x, final int y, final int z, + final ForgeDirection forward, final ForgeDirection up) { final TileEntity te = world.getTileEntity(x, y, z); return !(te instanceof TileCrank) || this.isCrankable(world, x, y, z, up.getOpposite()); } diff --git a/src/main/java/appeng/block/grindstone/BlockGrinder.java b/src/main/java/appeng/block/grindstone/BlockGrinder.java index 55ee8ad7db7..6961828c3aa 100644 --- a/src/main/java/appeng/block/grindstone/BlockGrinder.java +++ b/src/main/java/appeng/block/grindstone/BlockGrinder.java @@ -1,34 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.grindstone; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.grindstone.TileGrinder; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.grindstone.TileGrinder; +import appeng.util.Platform; + public class BlockGrinder extends AEBaseTileBlock { public BlockGrinder() { @@ -40,16 +34,8 @@ public BlockGrinder() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { final TileGrinder tg = this.getTileEntity(w, x, y, z); if (tg != null && !p.isSneaking()) { Platform.openGUI(p, tg, ForgeDirection.getOrientation(side), GuiBridge.GUI_GRINDER); diff --git a/src/main/java/appeng/block/misc/BlockCellWorkbench.java b/src/main/java/appeng/block/misc/BlockCellWorkbench.java index 1997ba6254c..8a89d2edd8f 100644 --- a/src/main/java/appeng/block/misc/BlockCellWorkbench.java +++ b/src/main/java/appeng/block/misc/BlockCellWorkbench.java @@ -1,34 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.misc.TileCellWorkbench; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.misc.TileCellWorkbench; +import appeng.util.Platform; + public class BlockCellWorkbench extends AEBaseTileBlock { public BlockCellWorkbench() { @@ -39,16 +33,8 @@ public BlockCellWorkbench() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/misc/BlockCharger.java b/src/main/java/appeng/block/misc/BlockCharger.java index 6236f5d8c59..b46bc6220ec 100644 --- a/src/main/java/appeng/block/misc/BlockCharger.java +++ b/src/main/java/appeng/block/misc/BlockCharger.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockCharger; @@ -31,17 +36,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockCharger extends AEBaseTileBlock implements ICustomCollision { @@ -61,16 +55,8 @@ protected RenderBlockCharger getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { if (player.isSneaking()) { return false; } @@ -100,10 +86,7 @@ public void randomDisplayTick(final World w, final int x, final int y, final int if (tile instanceof TileCharger) { final TileCharger tc = (TileCharger) tile; - if (AEApi.instance() - .definitions() - .materials() - .certusQuartzCrystalCharged() + if (AEApi.instance().definitions().materials().certusQuartzCrystalCharged() .isSameAs(tc.getStackInSlot(0))) { final double xOff = 0.0; final double yOff = 0.0; @@ -111,8 +94,14 @@ public void randomDisplayTick(final World w, final int x, final int y, final int for (int bolts = 0; bolts < 3; bolts++) { if (CommonHelper.proxy.shouldAddParticles(r)) { - final LightningFX fx = - new LightningFX(w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D); + final LightningFX fx = new LightningFX( + w, + xOff + 0.5 + x, + yOff + 0.5 + y, + zOff + 0.5 + z, + 0.0D, + 0.0D, + 0.0D); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } } @@ -121,15 +110,15 @@ public void randomDisplayTick(final World w, final int x, final int y, final int } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final TileCharger tile = this.getTileEntity(w, x, y, z); if (tile != null) { final double twoPixels = 2.0 / 16.0; final ForgeDirection up = tile.getUp(); final ForgeDirection forward = tile.getForward(); - final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( - twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels); + final AxisAlignedBB bb = AxisAlignedBB + .getBoundingBox(twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels); if (up.offsetX != 0) { bb.minX = 0; @@ -173,14 +162,8 @@ public Iterable getSelectedBoundingBoxesFromPool( } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { out.add(AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); } } diff --git a/src/main/java/appeng/block/misc/BlockCondenser.java b/src/main/java/appeng/block/misc/BlockCondenser.java index a10fc831a66..df0d5b2cbd7 100644 --- a/src/main/java/appeng/block/misc/BlockCondenser.java +++ b/src/main/java/appeng/block/misc/BlockCondenser.java @@ -1,34 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.misc.TileCondenser; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.misc.TileCondenser; +import appeng.util.Platform; + public class BlockCondenser extends AEBaseTileBlock { public BlockCondenser() { @@ -39,16 +33,8 @@ public BlockCondenser() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { if (player.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/misc/BlockInscriber.java b/src/main/java/appeng/block/misc/BlockInscriber.java index c86d7b3381f..b7233f079c1 100644 --- a/src/main/java/appeng/block/misc/BlockInscriber.java +++ b/src/main/java/appeng/block/misc/BlockInscriber.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockInscriber; import appeng.core.features.AEFeature; @@ -26,11 +25,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockInscriber extends AEBaseTileBlock { @@ -50,16 +44,8 @@ protected RenderBlockInscriber getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/misc/BlockInterface.java b/src/main/java/appeng/block/misc/BlockInterface.java index 39576847515..cb486f748a5 100644 --- a/src/main/java/appeng/block/misc/BlockInterface.java +++ b/src/main/java/appeng/block/misc/BlockInterface.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.util.IOrientable; import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockInterface; @@ -27,11 +26,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockInterface extends AEBaseTileBlock { @@ -49,16 +43,8 @@ protected RenderBlockInterface getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/misc/BlockLightDetector.java b/src/main/java/appeng/block/misc/BlockLightDetector.java index 6fe94f5ee2a..b1b2406ddac 100644 --- a/src/main/java/appeng/block/misc/BlockLightDetector.java +++ b/src/main/java/appeng/block/misc/BlockLightDetector.java @@ -1,37 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.api.util.IOrientable; -import appeng.api.util.IOrientableBlock; -import appeng.block.AEBaseTileBlock; -import appeng.client.render.blocks.RenderQuartzTorch; -import appeng.core.features.AEFeature; -import appeng.helpers.ICustomCollision; -import appeng.helpers.MetaRotation; -import appeng.tile.misc.TileLightDetector; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -40,6 +23,17 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; +import appeng.api.util.IOrientableBlock; +import appeng.block.AEBaseTileBlock; +import appeng.client.render.blocks.RenderQuartzTorch; +import appeng.core.features.AEFeature; +import appeng.helpers.ICustomCollision; +import appeng.helpers.MetaRotation; +import appeng.tile.misc.TileLightDetector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision { public BlockLightDetector() { @@ -63,14 +57,8 @@ public int isProvidingWeakPower(final IBlockAccess w, final int x, final int y, } @Override - public void onNeighborChange( - final IBlockAccess world, - final int x, - final int y, - final int z, - final int tileX, - final int tileY, - final int tileZ) { + public void onNeighborChange(final IBlockAccess world, final int x, final int y, final int z, final int tileX, + final int tileY, final int tileZ) { super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ); final TileLightDetector tld = this.getTileEntity(world, x, y, z); @@ -92,13 +80,8 @@ protected RenderQuartzTorch getRenderer() { } @Override - public boolean isValidOrientation( - final World w, - final int x, - final int y, - final int z, - final ForgeDirection forward, - final ForgeDirection up) { + public boolean isValidOrientation(final World w, final int x, final int y, final int z, + final ForgeDirection forward, final ForgeDirection up) { return this.canPlaceAt(w, x, y, z, up.getOpposite()); } @@ -107,8 +90,8 @@ private boolean canPlaceAt(final World w, final int x, final int y, final int z, } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final ForgeDirection up = this.getOrientable(w, x, y, z).getUp(); final double xOff = -0.3 * up.offsetX; final double yOff = -0.3 * up.offsetY; @@ -118,18 +101,13 @@ public Iterable getSelectedBoundingBoxesFromPool( } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { /* * double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * - * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff - * + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) ); + * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, + * zOff + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 + * ) ); */ } diff --git a/src/main/java/appeng/block/misc/BlockPaint.java b/src/main/java/appeng/block/misc/BlockPaint.java index 41dca876b84..e8c6f2cced1 100644 --- a/src/main/java/appeng/block/misc/BlockPaint.java +++ b/src/main/java/appeng/block/misc/BlockPaint.java @@ -1,33 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.block.AEBaseTileBlock; -import appeng.client.render.blocks.RenderBlockPaint; -import appeng.core.features.AEFeature; -import appeng.tile.misc.TilePaint; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MaterialLiquid; @@ -38,6 +24,14 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import appeng.block.AEBaseTileBlock; +import appeng.client.render.blocks.RenderBlockPaint; +import appeng.core.features.AEFeature; +import appeng.tile.misc.TilePaint; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockPaint extends AEBaseTileBlock { public BlockPaint() { @@ -87,14 +81,8 @@ public Item getItemDropped(final int meta, final Random random, final int fortun } @Override - public void dropBlockAsItemWithChance( - final World world, - final int x, - final int y, - final int z, - final int meta, - final float chance, - final int fortune) {} + public void dropBlockAsItemWithChance(final World world, final int x, final int y, final int z, final int meta, + final float chance, final int fortune) {} @Override public void fillWithRain(final World w, final int x, final int y, final int z) { diff --git a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java index 92904c111f5..5673c4ae90a 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/block/misc/BlockQuartzGrowthAccelerator.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; +import java.util.EnumSet; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.util.IOrientableBlock; import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockQuartzAccelerator; @@ -29,13 +30,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOrientableBlock { diff --git a/src/main/java/appeng/block/misc/BlockQuartzTorch.java b/src/main/java/appeng/block/misc/BlockQuartzTorch.java index 9f1d819e146..d2b313e4d67 100644 --- a/src/main/java/appeng/block/misc/BlockQuartzTorch.java +++ b/src/main/java/appeng/block/misc/BlockQuartzTorch.java @@ -1,39 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.api.util.IOrientable; -import appeng.api.util.IOrientableBlock; -import appeng.block.AEBaseBlock; -import appeng.client.render.blocks.RenderQuartzTorch; -import appeng.client.render.effects.LightningFX; -import appeng.core.AEConfig; -import appeng.core.CommonHelper; -import appeng.core.features.AEFeature; -import appeng.helpers.ICustomCollision; -import appeng.helpers.MetaRotation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; @@ -43,7 +24,21 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; +import appeng.api.util.IOrientableBlock; +import appeng.block.AEBaseBlock; +import appeng.client.render.blocks.RenderQuartzTorch; +import appeng.client.render.effects.LightningFX; +import appeng.core.AEConfig; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; +import appeng.helpers.ICustomCollision; +import appeng.helpers.MetaRotation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, ICustomCollision { + public BlockQuartzTorch() { super(Material.circuits); @@ -61,13 +56,8 @@ protected RenderQuartzTorch getRenderer() { } @Override - public boolean isValidOrientation( - final World w, - final int x, - final int y, - final int z, - final ForgeDirection forward, - final ForgeDirection up) { + public boolean isValidOrientation(final World w, final int x, final int y, final int z, + final ForgeDirection forward, final ForgeDirection up) { return this.canPlaceAt(w, x, y, z, up.getOpposite()); } @@ -76,8 +66,8 @@ private boolean canPlaceAt(final World w, final int x, final int y, final int z, } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final ForgeDirection up = this.getOrientable(w, x, y, z).getUp(); final double xOff = -0.3 * up.offsetX; final double yOff = -0.3 * up.offsetY; @@ -87,18 +77,13 @@ public Iterable getSelectedBoundingBoxesFromPool( } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { /* * double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 * - * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff - * + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) ); + * getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, + * zOff + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 + * ) ); */ } @@ -119,8 +104,14 @@ public void randomDisplayTick(final World w, final int x, final int y, final int final double zOff = -0.3 * up.offsetZ; for (int bolts = 0; bolts < 3; bolts++) { if (CommonHelper.proxy.shouldAddParticles(r)) { - final LightningFX fx = - new LightningFX(w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D); + final LightningFX fx = new LightningFX( + w, + xOff + 0.5 + x, + yOff + 0.5 + y, + zOff + 0.5 + z, + 0.0D, + 0.0D, + 0.0D); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } diff --git a/src/main/java/appeng/block/misc/BlockSecurity.java b/src/main/java/appeng/block/misc/BlockSecurity.java index 85fec8dd896..38aac8276e9 100644 --- a/src/main/java/appeng/block/misc/BlockSecurity.java +++ b/src/main/java/appeng/block/misc/BlockSecurity.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RendererSecurity; import appeng.core.features.AEFeature; @@ -26,11 +25,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockSecurity extends AEBaseTileBlock { @@ -48,16 +42,8 @@ protected RendererSecurity getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/misc/BlockSkyCompass.java b/src/main/java/appeng/block/misc/BlockSkyCompass.java index 385754bf2c7..fb15e84cce6 100644 --- a/src/main/java/appeng/block/misc/BlockSkyCompass.java +++ b/src/main/java/appeng/block/misc/BlockSkyCompass.java @@ -1,33 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.block.AEBaseTileBlock; -import appeng.client.render.blocks.RenderBlockSkyCompass; -import appeng.core.features.AEFeature; -import appeng.helpers.ICustomCollision; -import appeng.tile.misc.TileSkyCompass; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collections; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -38,6 +24,14 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.client.render.blocks.RenderBlockSkyCompass; +import appeng.core.features.AEFeature; +import appeng.helpers.ICustomCollision; +import appeng.tile.misc.TileSkyCompass; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision { public BlockSkyCompass() { @@ -66,13 +60,8 @@ public void registerBlockIcons(final IIconRegister iconRegistry) { } @Override - public boolean isValidOrientation( - final World w, - final int x, - final int y, - final int z, - final ForgeDirection forward, - final ForgeDirection up) { + public boolean isValidOrientation(final World w, final int x, final int y, final int z, + final ForgeDirection forward, final ForgeDirection up) { final TileSkyCompass sc = this.getTileEntity(w, x, y, z); if (sc != null) { return false; @@ -110,8 +99,8 @@ public boolean canPlaceBlockAt(final World w, final int x, final int y, final in } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final TileSkyCompass tile = this.getTileEntity(w, x, y, z); if (tile != null) { final ForgeDirection forward = tile.getForward(); @@ -170,12 +159,6 @@ public Iterable getSelectedBoundingBoxesFromPool( } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) {} + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) {} } diff --git a/src/main/java/appeng/block/misc/BlockTinyTNT.java b/src/main/java/appeng/block/misc/BlockTinyTNT.java index 113f2237ae4..bc23349decd 100644 --- a/src/main/java/appeng/block/misc/BlockTinyTNT.java +++ b/src/main/java/appeng/block/misc/BlockTinyTNT.java @@ -1,38 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.block.AEBaseBlock; -import appeng.client.render.blocks.RenderTinyTNT; -import appeng.client.texture.FullIcon; -import appeng.core.AppEng; -import appeng.core.features.AEFeature; -import appeng.entity.EntityIds; -import appeng.entity.EntityTinyTNTPrimed; -import appeng.helpers.ICustomCollision; -import appeng.hooks.DispenserBehaviorTinyTNT; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collections; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; import net.minecraft.block.material.Material; @@ -49,6 +30,19 @@ import net.minecraft.world.Explosion; import net.minecraft.world.World; +import appeng.block.AEBaseBlock; +import appeng.client.render.blocks.RenderTinyTNT; +import appeng.client.texture.FullIcon; +import appeng.core.AppEng; +import appeng.core.features.AEFeature; +import appeng.entity.EntityIds; +import appeng.entity.EntityTinyTNTPrimed; +import appeng.helpers.ICustomCollision; +import appeng.hooks.DispenserBehaviorTinyTNT; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision { public BlockTinyTNT() { @@ -88,8 +82,8 @@ public IIcon getIcon(final int direction, final int metadata) { } @Override - public boolean onBlockActivated( - World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, + float hitZ) { if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) { this.startFuse(w, x, y, z, player); @@ -128,8 +122,12 @@ public void onNeighborBlockChange(final World w, final int x, final int y, final @Override public void onBlockDestroyedByExplosion(final World w, final int x, final int y, final int z, final Explosion exp) { if (!w.isRemote) { - final EntityTinyTNTPrimed primedTinyTNTEntity = - new EntityTinyTNTPrimed(w, x + 0.5F, y + 0.5F, z + 0.5F, exp.getExplosivePlacedBy()); + final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( + w, + x + 0.5F, + y + 0.5F, + z + 0.5F, + exp.getExplosivePlacedBy()); primedTinyTNTEntity.fuse = w.rand.nextInt(primedTinyTNTEntity.fuse / 4) + primedTinyTNTEntity.fuse / 8; w.spawnEntityInWorld(primedTinyTNTEntity); } @@ -160,27 +158,25 @@ public boolean canDropFromExplosion(final Explosion exp) { } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { return Collections.singletonList(AxisAlignedBB.getBoundingBox(0.25, 0, 0.25, 0.75, 0.5, 0.75)); } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { out.add(AxisAlignedBB.getBoundingBox(0.25, 0, 0.25, 0.75, 0.5, 0.75)); } public void startFuse(final World w, final int x, final int y, final int z, final EntityLivingBase igniter) { if (!w.isRemote) { - final EntityTinyTNTPrimed primedTinyTNTEntity = - new EntityTinyTNTPrimed(w, x + 0.5F, y + 0.5F, z + 0.5F, igniter); + final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( + w, + x + 0.5F, + y + 0.5F, + z + 0.5F, + igniter); w.spawnEntityInWorld(primedTinyTNTEntity); w.playSoundAtEntity(primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F); } diff --git a/src/main/java/appeng/block/misc/BlockVibrationChamber.java b/src/main/java/appeng/block/misc/BlockVibrationChamber.java index 18d27d59c28..3804a9dca51 100644 --- a/src/main/java/appeng/block/misc/BlockVibrationChamber.java +++ b/src/main/java/appeng/block/misc/BlockVibrationChamber.java @@ -1,33 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.misc; -import appeng.block.AEBaseTileBlock; -import appeng.client.texture.ExtraBlockTextures; -import appeng.core.AEConfig; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.AEBaseTile; -import appeng.tile.misc.TileVibrationChamber; -import appeng.util.Platform; import java.util.EnumSet; import java.util.Random; + import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.IIcon; @@ -35,6 +20,15 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.client.texture.ExtraBlockTextures; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.AEBaseTile; +import appeng.tile.misc.TileVibrationChamber; +import appeng.util.Platform; + public final class BlockVibrationChamber extends AEBaseTileBlock { public BlockVibrationChamber() { @@ -57,16 +51,8 @@ public IIcon getIcon(final IBlockAccess w, final int x, final int y, final int z } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { if (player.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/networking/BlockCableBus.java b/src/main/java/appeng/block/networking/BlockCableBus.java index 140d1b963c3..d875c8e443f 100644 --- a/src/main/java/appeng/block/networking/BlockCableBus.java +++ b/src/main/java/appeng/block/networking/BlockCableBus.java @@ -1,23 +1,39 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection; +import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType; import appeng.api.parts.IPart; import appeng.api.parts.IPartHost; import appeng.api.parts.PartItemStack; @@ -48,28 +64,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.client.particle.EffectRenderer; -import net.minecraft.client.particle.EntityDiggingFX; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection; -import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType; @Interface( iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", @@ -131,8 +125,7 @@ public int colorMultiplier(final IBlockAccess world, final int x, final int y, f @Override public int isProvidingWeakPower(final IBlockAccess w, final int x, final int y, final int z, final int side) { - return this.cb(w, x, y, z) - .isProvidingWeakPower(ForgeDirection.getOrientation(side).getOpposite()); + return this.cb(w, x, y, z).isProvidingWeakPower(ForgeDirection.getOrientation(side).getOpposite()); } @Override @@ -147,8 +140,7 @@ public void onEntityCollidedWithBlock(final World w, final int x, final int y, f @Override public int isProvidingStrongPower(final IBlockAccess w, final int x, final int y, final int z, final int side) { - return this.cb(w, x, y, z) - .isProvidingStrongPower(ForgeDirection.getOrientation(side).getOpposite()); + return this.cb(w, x, y, z).isProvidingStrongPower(ForgeDirection.getOrientation(side).getOpposite()); } @Override @@ -164,8 +156,8 @@ public int getLightValue(final IBlockAccess world, final int x, final int y, fin } @Override - public boolean isLadder( - final IBlockAccess world, final int x, final int y, final int z, final EntityLivingBase entity) { + public boolean isLadder(final IBlockAccess world, final int x, final int y, final int z, + final EntityLivingBase entity) { return this.cb(world, x, y, z).isLadder(entity); } @@ -181,8 +173,8 @@ public boolean isReplaceable(final IBlockAccess world, final int x, final int y, @SuppressWarnings("deprecation") @Override - public boolean removedByPlayer( - final World world, final EntityPlayer player, final int x, final int y, final int z) { + public boolean removedByPlayer(final World world, final EntityPlayer player, final int x, final int y, + final int z) { if (player.capabilities.isCreativeMode) { final AEBaseTile tile = this.getTileEntity(world, x, y, z); if (tile != null) { @@ -223,13 +215,8 @@ public boolean canRenderInPass(final int pass) { } @Override - public ItemStack getPickBlock( - final MovingObjectPosition target, - final World world, - final int x, - final int y, - final int z, - final EntityPlayer player) { + public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, + final int z, final EntityPlayer player) { final Vec3 v3 = target.hitVec.addVector(-x, -y, -z); final SelectedPart sp = this.cb(world, x, y, z).selectPart(v3); @@ -244,8 +231,8 @@ public ItemStack getPickBlock( @Override @SideOnly(Side.CLIENT) - public boolean addHitEffects( - final World world, final MovingObjectPosition target, final EffectRenderer effectRenderer) { + public boolean addHitEffects(final World world, final MovingObjectPosition target, + final EffectRenderer effectRenderer) { final Object object = this.cb(world, target.blockX, target.blockY, target.blockZ); if (object instanceof IPartHost) { final IPartHost host = (IPartHost) object; @@ -271,16 +258,15 @@ public boolean addHitEffects( final double dd1 = target.hitVec.yCoord; final double dd2 = target.hitVec.zCoord; final EntityDiggingFX fx = (new EntityDiggingFX( - world, - dd0, - dd1, - dd2, - d0 - target.blockX - 0.5D, - d1 - target.blockY - 0.5D, - d2 - target.blockZ - 0.5D, - this, - 0)) - .applyColourMultiplier(target.blockX, target.blockY, target.blockZ); + world, + dd0, + dd1, + dd2, + d0 - target.blockX - 0.5D, + d1 - target.blockY - 0.5D, + d2 - target.blockZ - 0.5D, + this, + 0)).applyColourMultiplier(target.blockX, target.blockY, target.blockZ); fx.setParticleIcon(ico); @@ -296,12 +282,7 @@ public boolean addHitEffects( @Override @SideOnly(Side.CLIENT) - public boolean addDestroyEffects( - final World world, - final int x, - final int y, - final int z, - final int meta, + public boolean addDestroyEffects(final World world, final int x, final int y, final int z, final int meta, final EffectRenderer effectRenderer) { final Object object = this.cb(world, x, y, z); if (object instanceof IPartHost) { @@ -324,8 +305,15 @@ public boolean addDestroyEffects( final double d1 = y + (j1 + 0.5D) / b0; final double d2 = z + (k1 + 0.5D) / b0; final EntityDiggingFX fx = (new EntityDiggingFX( - world, d0, d1, d2, d0 - x - 0.5D, d1 - y - 0.5D, d2 - z - 0.5D, this, meta)) - .applyColourMultiplier(x, y, z); + world, + d0, + d1, + d2, + d0 - x - 0.5D, + d1 - y - 0.5D, + d2 - z - 0.5D, + this, + meta)).applyColourMultiplier(x, y, z); fx.setParticleIcon(ico); @@ -340,14 +328,8 @@ public boolean addDestroyEffects( } @Override - public void onNeighborChange( - final IBlockAccess w, - final int x, - final int y, - final int z, - final int tileX, - final int tileY, - final int tileZ) { + public void onNeighborChange(final IBlockAccess w, final int x, final int y, final int z, final int tileX, + final int tileY, final int tileZ) { if (Platform.isServer()) { this.cb(w, x, y, z).onNeighborChanged(); } @@ -410,16 +392,8 @@ public IIcon getIcon(final int direction, final int metadata) { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { return this.cb(w, x, y, z).activate(player, Vec3.createVectorHelper(hitX, hitY, hitZ)); } @@ -427,23 +401,16 @@ public boolean onActivated( public void registerBlockIcons(final IIconRegister iconRegistry) {} @Override - public boolean recolourBlock( - final World world, final int x, final int y, final int z, final ForgeDirection side, final int colour) { + public boolean recolourBlock(final World world, final int x, final int y, final int z, final ForgeDirection side, + final int colour) { return this.recolourBlock(world, x, y, z, side, colour, null); } - public boolean recolourBlock( - final World world, - final int x, - final int y, - final int z, - final ForgeDirection side, - final int colour, - final EntityPlayer who) { + public boolean recolourBlock(final World world, final int x, final int y, final int z, final ForgeDirection side, + final int colour, final EntityPlayer who) { try { return this.cb(world, x, y, z).recolourBlock(side, AEColor.values()[colour], who); - } catch (final Throwable ignored) { - } + } catch (final Throwable ignored) {} return false; } @@ -487,8 +454,8 @@ public void setupTile() { @Override @Method(iname = IntegrationType.MFR) - public RedNetConnectionType getConnectionType( - final World world, final int x, final int y, final int z, final ForgeDirection side) { + public RedNetConnectionType getConnectionType(final World world, final int x, final int y, final int z, + final ForgeDirection side) { return this.cb(world, x, y, z).canConnectRedstone(EnumSet.allOf(ForgeDirection.class)) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None; diff --git a/src/main/java/appeng/block/networking/BlockController.java b/src/main/java/appeng/block/networking/BlockController.java index de8fcda57d2..a9a8ce604d7 100644 --- a/src/main/java/appeng/block/networking/BlockController.java +++ b/src/main/java/appeng/block/networking/BlockController.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockController; import appeng.core.features.AEFeature; import appeng.tile.networking.TileController; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; public class BlockController extends AEBaseTileBlock { diff --git a/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java b/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java index 284a9bd4c0f..0243e65b15b 100644 --- a/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockCreativeEnergyCell.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.EnumSet; + import appeng.block.AEBaseTileBlock; import appeng.core.features.AEFeature; import appeng.helpers.AEGlassMaterial; import appeng.tile.networking.TileCreativeEnergyCell; -import java.util.EnumSet; public class BlockCreativeEnergyCell extends AEBaseTileBlock { diff --git a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java index a91f08be7bc..6916d3200da 100644 --- a/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockDenseEnergyCell.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.EnumSet; + +import net.minecraft.util.IIcon; + import appeng.api.config.PowerMultiplier; import appeng.client.texture.ExtraBlockTextures; import appeng.core.features.AEFeature; import appeng.tile.networking.TileDenseEnergyCell; -import java.util.EnumSet; -import net.minecraft.util.IIcon; public class BlockDenseEnergyCell extends BlockEnergyCell { diff --git a/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java b/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java index 8d8a7a70139..66e3eae9f78 100644 --- a/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java +++ b/src/main/java/appeng/block/networking/BlockEnergyAcceptor.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; + import appeng.block.AEBaseTileBlock; import appeng.core.features.AEFeature; import appeng.tile.networking.TileEnergyAcceptor; -import java.util.EnumSet; -import net.minecraft.block.material.Material; public class BlockEnergyAcceptor extends AEBaseTileBlock { diff --git a/src/main/java/appeng/block/networking/BlockEnergyCell.java b/src/main/java/appeng/block/networking/BlockEnergyCell.java index 25a16038cf5..29085a53851 100644 --- a/src/main/java/appeng/block/networking/BlockEnergyCell.java +++ b/src/main/java/appeng/block/networking/BlockEnergyCell.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; + import appeng.api.config.PowerMultiplier; import appeng.block.AEBaseItemBlock; import appeng.block.AEBaseItemBlockChargeable; @@ -30,13 +31,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; public class BlockEnergyCell extends AEBaseTileBlock { diff --git a/src/main/java/appeng/block/networking/BlockWireless.java b/src/main/java/appeng/block/networking/BlockWireless.java index 3e43ab44f7c..72980523086 100644 --- a/src/main/java/appeng/block/networking/BlockWireless.java +++ b/src/main/java/appeng/block/networking/BlockWireless.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.networking; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderBlockWireless; import appeng.core.features.AEFeature; @@ -28,14 +30,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockWireless extends AEBaseTileBlock implements ICustomCollision { @@ -55,16 +49,8 @@ protected RenderBlockWireless getRenderer() { } @Override - public boolean onBlockActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onBlockActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { final TileWireless tg = this.getTileEntity(w, x, y, z); if (tg != null && !p.isSneaking()) { @@ -78,8 +64,8 @@ public boolean onBlockActivated( } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final TileWireless tile = this.getTileEntity(w, x, y, z); if (tile != null) { final ForgeDirection forward = tile.getForward(); @@ -138,14 +124,8 @@ public Iterable getSelectedBoundingBoxesFromPool( } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { final TileWireless tile = this.getTileEntity(w, x, y, z); if (tile != null) { final ForgeDirection forward = tile.getForward(); diff --git a/src/main/java/appeng/block/qnb/BlockQuantumBase.java b/src/main/java/appeng/block/qnb/BlockQuantumBase.java index c3b282e02d0..27ba6f12a20 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumBase.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumBase.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.qnb; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderQNB; import appeng.core.features.AEFeature; @@ -25,10 +23,6 @@ import appeng.tile.qnb.TileQuantumBridge; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision { @@ -43,8 +37,8 @@ public BlockQuantumBase(final Material mat) { } @Override - public void onNeighborBlockChange( - final World w, final int x, final int y, final int z, final Block pointlessNumber) { + public void onNeighborBlockChange(final World w, final int x, final int y, final int z, + final Block pointlessNumber) { final TileQuantumBridge bridge = this.getTileEntity(w, x, y, z); if (bridge != null) { bridge.neighborUpdate(); diff --git a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java index e297c366543..23d0021af8a 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumLinkChamber.java @@ -1,40 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.qnb; -import appeng.client.EffectType; -import appeng.core.CommonHelper; -import appeng.core.sync.GuiBridge; -import appeng.helpers.AEGlassMaterial; -import appeng.tile.qnb.TileQuantumBridge; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collections; import java.util.List; import java.util.Random; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.client.EffectType; +import appeng.core.CommonHelper; +import appeng.core.sync.GuiBridge; +import appeng.helpers.AEGlassMaterial; +import appeng.tile.qnb.TileQuantumBridge; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockQuantumLinkChamber extends BlockQuantumBase { public BlockQuantumLinkChamber() { @@ -55,16 +49,8 @@ public void randomDisplayTick(final World w, final int bx, final int by, final i } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } @@ -80,24 +66,20 @@ public boolean onActivated( } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final double onePixel = 2.0 / 16.0; - return Collections.singletonList(AxisAlignedBB.getBoundingBox( - onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); + return Collections.singletonList( + AxisAlignedBB + .getBoundingBox(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { final double onePixel = 2.0 / 16.0; - out.add(AxisAlignedBB.getBoundingBox( - onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); + out.add( + AxisAlignedBB + .getBoundingBox(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); } } diff --git a/src/main/java/appeng/block/qnb/BlockQuantumRing.java b/src/main/java/appeng/block/qnb/BlockQuantumRing.java index b0c7f0ffa6e..7685df66b50 100644 --- a/src/main/java/appeng/block/qnb/BlockQuantumRing.java +++ b/src/main/java/appeng/block/qnb/BlockQuantumRing.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.qnb; -import appeng.tile.qnb.TileQuantumBridge; import java.util.Collections; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; +import appeng.tile.qnb.TileQuantumBridge; + public class BlockQuantumRing extends BlockQuantumBase { public BlockQuantumRing() { @@ -33,8 +27,8 @@ public BlockQuantumRing() { } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { double onePixel = 2.0 / 16.0; final TileQuantumBridge bridge = this.getTileEntity(w, x, y, z); if (bridge != null && bridge.isCorner()) { @@ -42,19 +36,14 @@ public Iterable getSelectedBoundingBoxesFromPool( } else if (bridge != null && bridge.isFormed()) { onePixel = 1.0 / 16.0; } - return Collections.singletonList(AxisAlignedBB.getBoundingBox( - onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); + return Collections.singletonList( + AxisAlignedBB + .getBoundingBox(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { double onePixel = 2.0 / 16.0; final TileQuantumBridge bridge = this.getTileEntity(w, x, y, z); if (bridge != null && bridge.isCorner()) { @@ -62,7 +51,8 @@ public void addCollidingBlockToList( } else if (bridge != null && bridge.isFormed()) { onePixel = 1.0 / 16.0; } - out.add(AxisAlignedBB.getBoundingBox( - onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); + out.add( + AxisAlignedBB + .getBoundingBox(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); } } diff --git a/src/main/java/appeng/block/solids/BlockFluix.java b/src/main/java/appeng/block/solids/BlockFluix.java index a1745855385..40c16409ef7 100644 --- a/src/main/java/appeng/block/solids/BlockFluix.java +++ b/src/main/java/appeng/block/solids/BlockFluix.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; -import appeng.block.AEDecorativeBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.material.Material; +import appeng.block.AEDecorativeBlock; +import appeng.core.features.AEFeature; + public class BlockFluix extends AEDecorativeBlock { + public BlockFluix() { super(Material.rock); this.setFeature(EnumSet.of(AEFeature.DecorativeQuartzBlocks)); diff --git a/src/main/java/appeng/block/solids/BlockQuartz.java b/src/main/java/appeng/block/solids/BlockQuartz.java index 9162e822653..561dce66354 100644 --- a/src/main/java/appeng/block/solids/BlockQuartz.java +++ b/src/main/java/appeng/block/solids/BlockQuartz.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; -import appeng.block.AEDecorativeBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.material.Material; +import appeng.block.AEDecorativeBlock; +import appeng.core.features.AEFeature; + public class BlockQuartz extends AEDecorativeBlock { public BlockQuartz() { diff --git a/src/main/java/appeng/block/solids/BlockQuartzChiseled.java b/src/main/java/appeng/block/solids/BlockQuartzChiseled.java index e0cf0541aff..6dd3a11f523 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzChiseled.java +++ b/src/main/java/appeng/block/solids/BlockQuartzChiseled.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; -import appeng.block.AEDecorativeBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.material.Material; +import appeng.block.AEDecorativeBlock; +import appeng.core.features.AEFeature; + public class BlockQuartzChiseled extends AEDecorativeBlock { public BlockQuartzChiseled() { diff --git a/src/main/java/appeng/block/solids/BlockQuartzGlass.java b/src/main/java/appeng/block/solids/BlockQuartzGlass.java index b059146c2a2..118201d8176 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzGlass.java +++ b/src/main/java/appeng/block/solids/BlockQuartzGlass.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.world.IBlockAccess; + import appeng.block.AEBaseBlock; import appeng.client.render.blocks.RenderQuartzGlass; import appeng.core.features.AEFeature; import appeng.helpers.AEGlassMaterial; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.world.IBlockAccess; public class BlockQuartzGlass extends AEBaseBlock { + public BlockQuartzGlass() { super(Material.glass); this.setLightOpacity(0); diff --git a/src/main/java/appeng/block/solids/BlockQuartzLamp.java b/src/main/java/appeng/block/solids/BlockQuartzLamp.java index feb91cb1b05..a7a1f776941 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzLamp.java +++ b/src/main/java/appeng/block/solids/BlockQuartzLamp.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; +import java.util.EnumSet; +import java.util.Random; + +import net.minecraft.client.Minecraft; +import net.minecraft.world.World; + import appeng.client.render.effects.VibrantFX; import appeng.core.AEConfig; import appeng.core.CommonHelper; import appeng.core.features.AEFeature; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.world.World; public class BlockQuartzLamp extends BlockQuartzGlass { diff --git a/src/main/java/appeng/block/solids/BlockQuartzPillar.java b/src/main/java/appeng/block/solids/BlockQuartzPillar.java index cbf60edd71d..97aa7f8073e 100644 --- a/src/main/java/appeng/block/solids/BlockQuartzPillar.java +++ b/src/main/java/appeng/block/solids/BlockQuartzPillar.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.world.IBlockAccess; + import appeng.api.util.IOrientable; import appeng.api.util.IOrientableBlock; import appeng.block.AEBaseBlock; import appeng.core.features.AEFeature; import appeng.helpers.MetaRotation; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.world.IBlockAccess; public class BlockQuartzPillar extends AEBaseBlock implements IOrientableBlock { diff --git a/src/main/java/appeng/block/solids/BlockSkyStone.java b/src/main/java/appeng/block/solids/BlockSkyStone.java index b43aa9d1c5c..c8872c8da1a 100644 --- a/src/main/java/appeng/block/solids/BlockSkyStone.java +++ b/src/main/java/appeng/block/solids/BlockSkyStone.java @@ -1,36 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; -import appeng.api.util.IOrientable; -import appeng.api.util.IOrientableBlock; -import appeng.block.AEBaseBlock; -import appeng.core.features.AEFeature; -import appeng.core.worlddata.WorldData; -import appeng.helpers.LocationRotation; -import appeng.helpers.NullRotation; -import appeng.util.Platform; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -45,7 +27,20 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent; +import appeng.api.util.IOrientable; +import appeng.api.util.IOrientableBlock; +import appeng.block.AEBaseBlock; +import appeng.core.features.AEFeature; +import appeng.core.worlddata.WorldData; +import appeng.helpers.LocationRotation; +import appeng.helpers.NullRotation; +import appeng.util.Platform; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock { + private static final float BLOCK_RESISTANCE = 150.0f; private static final double BREAK_SPEAK_SCALAR = 0.1; private static final double BREAK_SPEAK_THRESHOLD = 7.0; @@ -92,13 +87,8 @@ public int damageDropped(final int meta) { } @Override - public ItemStack getPickBlock( - final MovingObjectPosition target, - final World world, - final int x, - final int y, - final int z, - final EntityPlayer player) { + public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, + final int z, final EntityPlayer player) { final ItemStack is = super.getPickBlock(target, world, x, y, z, player); is.setItemDamage(world.getBlockMetadata(x, y, z)); diff --git a/src/main/java/appeng/block/solids/OreQuartz.java b/src/main/java/appeng/block/solids/OreQuartz.java index 0025f8cb664..fe745bbfde1 100644 --- a/src/main/java/appeng/block/solids/OreQuartz.java +++ b/src/main/java/appeng/block/solids/OreQuartz.java @@ -1,33 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; -import appeng.api.AEApi; -import appeng.api.exceptions.MissingDefinition; -import appeng.block.AEBaseBlock; -import appeng.client.render.blocks.RenderQuartzOre; -import appeng.core.features.AEFeature; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.Random; + import javax.annotation.Nullable; + import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -35,7 +22,16 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.api.exceptions.MissingDefinition; +import appeng.block.AEBaseBlock; +import appeng.client.render.blocks.RenderQuartzOre; +import appeng.core.features.AEFeature; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class OreQuartz extends AEBaseBlock { + private int boostBrightnessLow; private int boostBrightnessHigh; private boolean enhanceBrightness; @@ -57,8 +53,8 @@ protected RenderQuartzOre getRenderer() { } @Override - public int getMixedBrightnessForBlock( - final IBlockAccess par1iBlockAccess, final int par2, final int par3, final int par4) { + public int getMixedBrightnessForBlock(final IBlockAccess par1iBlockAccess, final int par2, final int par3, + final int par4) { int j1 = super.getMixedBrightnessForBlock(par1iBlockAccess, par2, par3, par4); if (this.enhanceBrightness) { j1 = Math.max(j1 >> 20, j1 >> 4); @@ -85,11 +81,7 @@ public int quantityDropped(final Random rand) { @Nullable @Override public Item getItemDropped(final int id, final Random rand, final int meta) { - for (final Item crystalItem : AEApi.instance() - .definitions() - .materials() - .certusQuartzCrystal() - .maybeItem() + for (final Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem() .asSet()) { return crystalItem; } @@ -98,14 +90,8 @@ public Item getItemDropped(final int id, final Random rand, final int meta) { } @Override - public void dropBlockAsItemWithChance( - final World w, - final int x, - final int y, - final int z, - final int blockID, - final float something, - final int meta) { + public void dropBlockAsItemWithChance(final World w, final int x, final int y, final int z, final int blockID, + final float something, final int meta) { super.dropBlockAsItemWithChance(w, x, y, z, blockID, something, meta); if (this.getItemDropped(blockID, w.rand, meta) != Item.getItemFromBlock(this)) { @@ -117,12 +103,8 @@ public void dropBlockAsItemWithChance( @Override public int damageDropped(final int id) { - for (final ItemStack crystalStack : AEApi.instance() - .definitions() - .materials() - .certusQuartzCrystal() - .maybeStack(1) - .asSet()) { + for (final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal() + .maybeStack(1).asSet()) { return crystalStack.getItemDamage(); } diff --git a/src/main/java/appeng/block/solids/OreQuartzCharged.java b/src/main/java/appeng/block/solids/OreQuartzCharged.java index 8d76b702680..88946b1e967 100644 --- a/src/main/java/appeng/block/solids/OreQuartzCharged.java +++ b/src/main/java/appeng/block/solids/OreQuartzCharged.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.solids; +import java.util.Random; + +import javax.annotation.Nullable; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.exceptions.MissingDefinition; import appeng.client.render.effects.ChargedOreFX; @@ -25,12 +26,6 @@ import appeng.core.CommonHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Random; -import javax.annotation.Nullable; -import net.minecraft.client.Minecraft; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class OreQuartzCharged extends OreQuartz { @@ -42,11 +37,7 @@ public OreQuartzCharged() { @Nullable @Override public Item getItemDropped(final int id, final Random rand, final int meta) { - for (final Item charged : AEApi.instance() - .definitions() - .materials() - .certusQuartzCrystalCharged() - .maybeItem() + for (final Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem() .asSet()) { return charged; } @@ -56,12 +47,8 @@ public Item getItemDropped(final int id, final Random rand, final int meta) { @Override public int damageDropped(final int id) { - for (final ItemStack crystalStack : AEApi.instance() - .definitions() - .materials() - .certusQuartzCrystalCharged() - .maybeStack(1) - .asSet()) { + for (final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged() + .maybeStack(1).asSet()) { return crystalStack.getItemDamage(); } diff --git a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java index 17275bc9b15..1adcb65cfe4 100644 --- a/src/main/java/appeng/block/spatial/BlockMatrixFrame.java +++ b/src/main/java/appeng/block/spatial/BlockMatrixFrame.java @@ -1,32 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.spatial; -import appeng.block.AEBaseBlock; -import appeng.client.render.blocks.RenderNull; -import appeng.core.features.AEFeature; -import appeng.helpers.ICustomCollision; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Arrays; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -38,6 +25,13 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import appeng.block.AEBaseBlock; +import appeng.client.render.blocks.RenderNull; +import appeng.core.features.AEFeature; +import appeng.helpers.ICustomCollision; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision { public BlockMatrixFrame() { @@ -65,21 +59,15 @@ public void getCheckedSubBlocks(final Item item, final CreativeTabs tabs, final } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { return Arrays.asList(new AxisAlignedBB[] {}); // AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) // } ); } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { out.add(AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); } @@ -94,8 +82,8 @@ public void onBlockExploded(final World world, final int x, final int y, final i } @Override - public boolean canEntityDestroy( - final IBlockAccess world, final int x, final int y, final int z, final Entity entity) { + public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z, + final Entity entity) { return false; } } diff --git a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java index 2325ee44db6..e4d059d6a27 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialIOPort.java @@ -1,35 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.spatial; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.spatial.TileSpatialIOPort; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.spatial.TileSpatialIOPort; +import appeng.util.Platform; + public class BlockSpatialIOPort extends AEBaseTileBlock { public BlockSpatialIOPort() { @@ -47,16 +41,8 @@ public final void onNeighborBlockChange(final World w, final int x, final int y, } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java index 5cce92d92a8..756e78289a6 100644 --- a/src/main/java/appeng/block/spatial/BlockSpatialPylon.java +++ b/src/main/java/appeng/block/spatial/BlockSpatialPylon.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.spatial; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderSpatialPylon; import appeng.core.features.AEFeature; @@ -25,10 +23,6 @@ import appeng.tile.spatial.TileSpatialPylon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class BlockSpatialPylon extends AEBaseTileBlock { diff --git a/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java b/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java index cfdab0d4543..e87dc109813 100644 --- a/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java +++ b/src/main/java/appeng/block/stair/ChiseledQuartzStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class ChiseledQuartzStairBlock extends AEBaseStairBlock { + public ChiseledQuartzStairBlock(final Block block) { super(block, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/FluixStairBlock.java b/src/main/java/appeng/block/stair/FluixStairBlock.java index 5f2f7e9a2e6..1416a4e27db 100644 --- a/src/main/java/appeng/block/stair/FluixStairBlock.java +++ b/src/main/java/appeng/block/stair/FluixStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class FluixStairBlock extends AEBaseStairBlock { + public FluixStairBlock(final Block block) { super(block, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java b/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java index 8f84de43d92..28460a77543 100644 --- a/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java +++ b/src/main/java/appeng/block/stair/QuartzPillarStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class QuartzPillarStairBlock extends AEBaseStairBlock { + public QuartzPillarStairBlock(final Block block) { super(block, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/QuartzStairBlock.java b/src/main/java/appeng/block/stair/QuartzStairBlock.java index 69ac289d225..7c0105e306a 100644 --- a/src/main/java/appeng/block/stair/QuartzStairBlock.java +++ b/src/main/java/appeng/block/stair/QuartzStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class QuartzStairBlock extends AEBaseStairBlock { + public QuartzStairBlock(final Block block) { super(block, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java index 05f0ff39dc5..4579657e64c 100644 --- a/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneBlockStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class SkyStoneBlockStairBlock extends AEBaseStairBlock { + public SkyStoneBlockStairBlock(final Block block, final Integer meta) { super(block, meta, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java index 12489a7b8ee..5d5c89476a2 100644 --- a/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneBrickStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class SkyStoneBrickStairBlock extends AEBaseStairBlock { + public SkyStoneBrickStairBlock(final Block block, final Integer meta) { super(block, meta, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java index 6baf40fc698..3c5a8525ac1 100644 --- a/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneSmallBrickStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class SkyStoneSmallBrickStairBlock extends AEBaseStairBlock { + public SkyStoneSmallBrickStairBlock(final Block block, final int meta) { super(block, meta, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/stair/SkyStoneStairBlock.java b/src/main/java/appeng/block/stair/SkyStoneStairBlock.java index 29ac8854b2b..d9fb1cee4e3 100644 --- a/src/main/java/appeng/block/stair/SkyStoneStairBlock.java +++ b/src/main/java/appeng/block/stair/SkyStoneStairBlock.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.stair; -import appeng.block.AEBaseStairBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.Block; +import appeng.block.AEBaseStairBlock; +import appeng.core.features.AEFeature; + public class SkyStoneStairBlock extends AEBaseStairBlock { + public SkyStoneStairBlock(final Block block, final Integer meta) { super(block, meta, EnumSet.of(AEFeature.DecorativeQuartzBlocks)); } diff --git a/src/main/java/appeng/block/storage/BlockChest.java b/src/main/java/appeng/block/storage/BlockChest.java index 94467cf0cb2..981f262ac3b 100644 --- a/src/main/java/appeng/block/storage/BlockChest.java +++ b/src/main/java/appeng/block/storage/BlockChest.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.storage; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.storage.ICellHandler; import appeng.block.AEBaseTileBlock; @@ -29,12 +29,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockChest extends AEBaseTileBlock { @@ -51,16 +45,8 @@ protected RenderMEChest getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { final TileChest tg = this.getTileEntity(w, x, y, z); if (tg != null && !p.isSneaking()) { if (Platform.isClient()) { diff --git a/src/main/java/appeng/block/storage/BlockDrive.java b/src/main/java/appeng/block/storage/BlockDrive.java index 1ea430c9dcc..ead76676e90 100644 --- a/src/main/java/appeng/block/storage/BlockDrive.java +++ b/src/main/java/appeng/block/storage/BlockDrive.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.storage; +import java.util.EnumSet; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.AEBaseTileBlock; import appeng.client.render.blocks.RenderDrive; import appeng.core.features.AEFeature; @@ -26,11 +25,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockDrive extends AEBaseTileBlock { @@ -47,16 +41,8 @@ protected RenderDrive getRenderer() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/storage/BlockIOPort.java b/src/main/java/appeng/block/storage/BlockIOPort.java index 3a3368c1971..5b5581b033b 100644 --- a/src/main/java/appeng/block/storage/BlockIOPort.java +++ b/src/main/java/appeng/block/storage/BlockIOPort.java @@ -1,35 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.storage; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.tile.storage.TileIOPort; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.tile.storage.TileIOPort; +import appeng.util.Platform; + public class BlockIOPort extends AEBaseTileBlock { public BlockIOPort() { @@ -47,16 +41,8 @@ public final void onNeighborBlockChange(final World w, final int x, final int y, } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer p, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer p, + final int side, final float hitX, final float hitY, final float hitZ) { if (p.isSneaking()) { return false; } diff --git a/src/main/java/appeng/block/storage/BlockSkyChest.java b/src/main/java/appeng/block/storage/BlockSkyChest.java index dc1b44c7fb7..46eadfb099a 100644 --- a/src/main/java/appeng/block/storage/BlockSkyChest.java +++ b/src/main/java/appeng/block/storage/BlockSkyChest.java @@ -1,36 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.block.storage; -import appeng.api.AEApi; -import appeng.block.AEBaseTileBlock; -import appeng.client.render.blocks.RenderBlockSkyChest; -import appeng.core.features.AEFeature; -import appeng.core.sync.GuiBridge; -import appeng.helpers.ICustomCollision; -import appeng.tile.storage.TileSkyChest; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collections; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -46,6 +29,17 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; +import appeng.block.AEBaseTileBlock; +import appeng.client.render.blocks.RenderBlockSkyChest; +import appeng.core.features.AEFeature; +import appeng.core.sync.GuiBridge; +import appeng.helpers.ICustomCollision; +import appeng.tile.storage.TileSkyChest; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision { private static final double AABB_OFFSET_BOTTOM = .0625d; @@ -69,13 +63,8 @@ public int damageDropped(final int metadata) { } @Override - public ItemStack getPickBlock( - final MovingObjectPosition target, - final World world, - final int x, - final int y, - final int z, - final EntityPlayer player) { + public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, + final int z, final EntityPlayer player) { final ItemStack is = super.getPickBlock(target, world, x, y, z, player); is.setItemDamage(world.getBlockMetadata(x, y, z)); @@ -91,8 +80,7 @@ protected RenderBlockSkyChest getRenderer() { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(final int direction, final int metadata) { - for (final Block skyStoneBlock : - AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet()) { + for (final Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet()) { return skyStoneBlock.getIcon(direction, metadata); } @@ -100,16 +88,8 @@ public IIcon getIcon(final int direction, final int metadata) { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { if (Platform.isServer()) { Platform.openGUI( player, @@ -142,20 +122,14 @@ public String getUnlocalizedName(final ItemStack is) { } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity thePlayer, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity thePlayer, final boolean isVisual) { return Collections.singletonList(computeAABB(w, x, y, z)); } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { out.add(computeAABB(w, x, y, z)); } diff --git a/src/main/java/appeng/client/ActionKey.java b/src/main/java/appeng/client/ActionKey.java index cfaa5bbfbf0..5a169c55be8 100644 --- a/src/main/java/appeng/client/ActionKey.java +++ b/src/main/java/appeng/client/ActionKey.java @@ -3,6 +3,7 @@ import org.lwjgl.input.Keyboard; public enum ActionKey { + TOGGLE_FOCUS(Keyboard.KEY_NONE); private final int defaultKey; diff --git a/src/main/java/appeng/client/ClientHelper.java b/src/main/java/appeng/client/ClientHelper.java index dbce5981db4..029aa01f004 100644 --- a/src/main/java/appeng/client/ClientHelper.java +++ b/src/main/java/appeng/client/ClientHelper.java @@ -1,23 +1,47 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client; +import java.io.IOException; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderLivingEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.MinecraftForge; + +import org.lwjgl.opengl.GL11; + import appeng.api.parts.CableRenderMode; import appeng.api.util.AEColor; import appeng.block.AEBaseBlock; @@ -48,37 +72,9 @@ import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import java.io.IOException; -import java.util.ArrayList; -import java.util.EnumMap; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.client.event.MouseEvent; -import net.minecraftforge.client.event.RenderLivingEvent; -import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; -import org.lwjgl.opengl.GL11; public class ClientHelper extends ServerHelper { + private static final String KEY_CATEGORY = "key.appliedenergistics2.category"; private final EnumMap bindings = new EnumMap<>(ActionKey.class); @@ -144,13 +140,8 @@ public List getPlayers() { } @Override - public void spawnEffect( - final EffectType effect, - final World worldObj, - final double posX, - final double posY, - final double posZ, - final Object o) { + public void spawnEffect(final EffectType effect, final World worldObj, final double posX, final double posY, + final double posZ, final Object o) { if (AEConfig.instance.enableEffects) { switch (effect) { case Assembler: @@ -176,12 +167,20 @@ public void spawnEffect( } } - private void spawnAssembler( - final World worldObj, final double posX, final double posY, final double posZ, final Object o) { + private void spawnAssembler(final World worldObj, final double posX, final double posY, final double posZ, + final Object o) { final PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o; final AssemblerFX fx = new AssemblerFX( - Minecraft.getMinecraft().theWorld, posX, posY, posZ, 0.0D, 0.0D, 0.0D, paa.rate, paa.is); + Minecraft.getMinecraft().theWorld, + posX, + posY, + posZ, + 0.0D, + 0.0D, + 0.0D, + paa.rate, + paa.is); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } @@ -229,10 +228,19 @@ private void spawnLightning(final World worldObj, final double posX, final doubl Minecraft.getMinecraft().effectRenderer.addEffect(fx); } - private void spawnLightningArc( - final World worldObj, final double posX, final double posY, final double posZ, final Vec3 second) { + private void spawnLightningArc(final World worldObj, final double posX, final double posY, final double posZ, + final Vec3 second) { final LightningFX fx = new LightningArcFX( - worldObj, posX, posY, posZ, second.xCoord, second.yCoord, second.zCoord, 0.0f, 0.0f, 0.0f); + worldObj, + posX, + posY, + posZ, + second.xCoord, + second.yCoord, + second.zCoord, + 0.0f, + 0.0f, + 0.0f); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } @@ -277,16 +285,15 @@ public void doRenderItem(final ItemStack itemstack, final World w) { // GL11.glScalef( 1.0f , -1.0f, 1.0f ); final Block block = Block.getBlockFromItem(itemstack.getItem()); - if ((itemstack.getItemSpriteNumber() == 0 - && block != null + if ((itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))) { GL11.glRotatef(25.0f, 1.0f, 0.0f, 0.0f); GL11.glRotatef(15.0f, 0.0f, 1.0f, 0.0f); GL11.glRotatef(30.0f, 0.0f, 1.0f, 0.0f); } - final IItemRenderer customRenderer = - MinecraftForgeClient.getItemRenderer(itemstack, IItemRenderer.ItemRenderType.ENTITY); + final IItemRenderer customRenderer = MinecraftForgeClient + .getItemRenderer(itemstack, IItemRenderer.ItemRenderType.ENTITY); if (customRenderer != null && !(itemstack.getItem() instanceof ItemBlock)) { if (customRenderer.shouldUseRenderHelper( IItemRenderer.ItemRenderType.ENTITY, @@ -318,7 +325,13 @@ public void doRenderItem(final ItemStack itemstack, final World w) { RenderItem.renderInFrame = false; final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; if (!ForgeHooksClient.renderInventoryItem( - BLOCK_RENDERER, Minecraft.getMinecraft().renderEngine, itemstack, true, 0, 0, 0)) { + BLOCK_RENDERER, + Minecraft.getMinecraft().renderEngine, + itemstack, + true, + 0, + 0, + 0)) { ITEM_RENDERER.renderItemIntoGUI(fr, Minecraft.getMinecraft().renderEngine, itemstack, 0, 0, false); } } @@ -381,8 +394,8 @@ public void wheelEvent(final MouseEvent me) { if (is != null && is.getItem() instanceof IMouseWheelItem && player.isSneaking()) { try { - NetworkHandler.instance.sendToServer( - new PacketValueConfig("Item", me.dwheel > 0 ? "WheelUp" : "WheelDown")); + NetworkHandler.instance + .sendToServer(new PacketValueConfig("Item", me.dwheel > 0 ? "WheelUp" : "WheelDown")); me.setCanceled(true); } catch (final IOException e) { AELog.debug(e); @@ -420,7 +433,7 @@ public boolean isActionKey(ActionKey key, int pressedKeyCode) { } private boolean isActiveAndMatches(KeyBinding keyBinding, int keyCode) { - // return keyCode != 0 && keyCode == keyBinding.getKeyCode() && keyBinding.getKeyConflictContext().isActive() + // return keyCode != 0 && keyCode == keyBinding.getKeyCode() && keyBinding.getKeyConflictContext().isActive() // && keyBinding.getKeyModifier().isActive(keyBinding.getKeyConflictContext()); return keyCode != 0 && keyCode == keyBinding.getKeyCode(); } diff --git a/src/main/java/appeng/client/EffectType.java b/src/main/java/appeng/client/EffectType.java index bcae1a14d3e..c5ec5a08695 100644 --- a/src/main/java/appeng/client/EffectType.java +++ b/src/main/java/appeng/client/EffectType.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client; diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index 55b267579f2..a9fcb746b6a 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -1,23 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui; +import java.io.IOException; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.*; +import java.util.concurrent.TimeUnit; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import appeng.api.storage.data.IAEItemStack; import appeng.client.gui.widgets.GuiScrollbar; import appeng.client.gui.widgets.ITooltip; @@ -41,31 +56,13 @@ import appeng.integration.abstraction.INEI; import appeng.util.Platform; import appeng.util.item.AEItemStack; + import com.google.common.base.Joiner; import com.google.common.base.Stopwatch; import cpw.mods.fml.common.ObfuscationReflectionHelper; -import java.io.IOException; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.*; -import java.util.concurrent.TimeUnit; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; public abstract class AEBaseGui extends GuiContainer { + private static boolean switchingGuis; private final List meSlots = new LinkedList(); // drag y @@ -381,8 +378,8 @@ protected void handleMouseClick(final Slot slot, final int slotIdx, final int ct } else { if (slot instanceof SlotFake) { - final InventoryAction action = - ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; + final InventoryAction action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE + : InventoryAction.PICKUP_OR_SET_DOWN; if (this.drag_click.size() > 1) { return; @@ -453,13 +450,12 @@ protected void handleMouseClick(final Slot slot, final int slotIdx, final int ct switch (mouseButton) { case 0: // pickup / set-down. - { - ItemStack heldStack = player.inventory.getItemStack(); - if (slot.getStack() == null && heldStack != null) - action = InventoryAction.SPLIT_OR_PLACE_SINGLE; - else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= 1)) - action = InventoryAction.PICKUP_OR_SET_DOWN; - } + { + ItemStack heldStack = player.inventory.getItemStack(); + if (slot.getStack() == null && heldStack != null) action = InventoryAction.SPLIT_OR_PLACE_SINGLE; + else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= 1)) + action = InventoryAction.PICKUP_OR_SET_DOWN; + } break; case 1: action = ctrlDown == 1 ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK; @@ -497,8 +493,7 @@ else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN; stack = ((SlotME) slot).getAEStack(); - if (stack != null - && action == InventoryAction.PICKUP_OR_SET_DOWN + if (stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null) { action = InventoryAction.AUTO_CRAFT; @@ -529,8 +524,7 @@ else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= if (action != null) { ((AEBaseContainer) this.inventorySlots).setTargetStack(stack); - final PacketInventoryAction p = new PacketInventoryAction( - action, this.getInventorySlots().size(), 0); + final PacketInventoryAction p = new PacketInventoryAction(action, this.getInventorySlots().size(), 0); NetworkHandler.instance.sendToServer(p); } @@ -540,8 +534,7 @@ else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= if (!this.disableShiftClick && isShiftKeyDown()) { this.disableShiftClick = true; - if (this.dbl_whichItem == null - || this.bl_clicked != slot + if (this.dbl_whichItem == null || this.bl_clicked != slot || this.dbl_clickTimer.elapsed(TimeUnit.MILLISECONDS) > 150) { // some simple double click logic. this.bl_clicked = slot; @@ -556,8 +549,7 @@ else if (slot.getStack() != null && (heldStack == null || heldStack.stackSize <= final List slots = this.getInventorySlots(); for (final Slot inventorySlot : slots) { - if (inventorySlot != null - && inventorySlot.canTakeStack(this.mc.thePlayer) + if (inventorySlot != null && inventorySlot.canTakeStack(this.mc.thePlayer) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.func_94527_a(inventorySlot, this.dbl_whichItem, true)) { @@ -577,8 +569,8 @@ protected boolean checkHotbarKeys(final int keyCode) { final Slot theSlot; try { - theSlot = ObfuscationReflectionHelper.getPrivateValue( - GuiContainer.class, this, "theSlot", "field_147006_u", "f"); + theSlot = ObfuscationReflectionHelper + .getPrivateValue(GuiContainer.class, this, "theSlot", "field_147006_u", "f"); } catch (final Throwable t) { return false; } @@ -603,8 +595,8 @@ protected boolean checkHotbarKeys(final int keyCode) { for (final Slot s : slots) { if (s.getSlotIndex() == j && s.inventory == ((AEBaseContainer) this.inventorySlots).getPlayerInv()) { - NetworkHandler.instance.sendToServer( - new PacketSwapSlots(s.slotNumber, theSlot.slotNumber)); + NetworkHandler.instance + .sendToServer(new PacketSwapSlots(s.slotNumber, theSlot.slotNumber)); return true; } } @@ -651,8 +643,7 @@ public void handleMouseInput() { } else if (this.getScrollBar() != null) { final GuiScrollbar scrollBar = this.getScrollBar(); - if (x > this.guiLeft - && y - this.guiTop > scrollBar.getTop() + if (x > this.guiLeft && y - this.guiTop > scrollBar.getTop() && x <= this.guiLeft + this.xSize && y - this.guiTop <= scrollBar.getTop() + scrollBar.getHeight()) { this.getScrollBar().wheel(wheel); @@ -756,8 +747,7 @@ private void drawSlot(final Slot s) { } else { try { final ItemStack is = s.getStack(); - if (s instanceof AppEngSlot - && (((AppEngSlot) s).renderIconWithItem() || is == null) + if (s instanceof AppEngSlot && (((AppEngSlot) s).renderIconWithItem() || is == null) && (((AppEngSlot) s).shouldDisplay())) { final AppEngSlot aes = (AppEngSlot) s; if (aes.getIcon() >= 0) { @@ -785,27 +775,37 @@ private void drawSlot(final Slot s) { final float f = 0.00390625F; final float par6 = 16; tessellator.addVertexWithUV( - par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * f, (par4 + par6) * f1); + par1 + 0, + par2 + par6, + this.zLevel, + (par3 + 0) * f, + (par4 + par6) * f1); final float par5 = 16; tessellator.addVertexWithUV( - par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * f, (par4 + par6) * f1); + par1 + par5, + par2 + par6, + this.zLevel, + (par3 + par5) * f, + (par4 + par6) * f1); tessellator.addVertexWithUV( - par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * f, (par4 + 0) * f1); - tessellator.addVertexWithUV( - par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * f, (par4 + 0) * f1); + par1 + par5, + par2 + 0, + this.zLevel, + (par3 + par5) * f, + (par4 + 0) * f1); + tessellator + .addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * f, (par4 + 0) * f1); tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f); tessellator.draw(); - } catch (final Exception err) { - } + } catch (final Exception err) {} GL11.glPopAttrib(); } } if (is != null && s instanceof AppEngSlot) { if (((AppEngSlot) s).getIsValid() == hasCalculatedValidness.NotAvailable) { - boolean isValid = s.isItemValid(is) - || s instanceof SlotOutput + boolean isValid = s.isItemValid(is) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible @@ -873,11 +873,8 @@ protected boolean isPowered() { private void safeDrawSlot(final Slot s) { try { - GuiContainer.class - .getDeclaredMethod("func_146977_a_original", Slot.class) - .invoke(this, s); - } catch (final Exception err) { - } + GuiContainer.class.getDeclaredMethod("func_146977_a_original", Slot.class).invoke(this, s); + } catch (final Exception err) {} } public void bindTexture(final String file) { diff --git a/src/main/java/appeng/client/gui/AEBaseMEGui.java b/src/main/java/appeng/client/gui/AEBaseMEGui.java index 87c0883d3e4..da2ceec389e 100644 --- a/src/main/java/appeng/client/gui/AEBaseMEGui.java +++ b/src/main/java/appeng/client/gui/AEBaseMEGui.java @@ -1,44 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui; -import appeng.api.storage.data.IAEItemStack; -import appeng.client.me.SlotME; -import appeng.container.slot.SlotFake; -import appeng.core.AEConfig; -import appeng.core.localization.ButtonToolTips; -import appeng.util.Platform; import java.text.NumberFormat; import java.util.List; import java.util.Locale; + import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import appeng.api.storage.data.IAEItemStack; +import appeng.client.me.SlotME; +import appeng.container.slot.SlotFake; +import appeng.core.AEConfig; +import appeng.core.localization.ButtonToolTips; +import appeng.util.Platform; + public abstract class AEBaseMEGui extends AEBaseGui { public AEBaseMEGui(final Container container) { super(container); } - public List handleItemTooltip( - final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip) { + public List handleItemTooltip(final ItemStack stack, final int mouseX, final int mouseY, + final List currentToolTip) { if (stack != null) { final Slot s = this.getSlot(mouseX, mouseY); final boolean isSlotME = s instanceof SlotME; @@ -49,15 +43,14 @@ public List handleItemTooltip( try { myStack = Platform.getAEStackInSlot(s); - } catch (final Throwable ignore) { - } + } catch (final Throwable ignore) {} if (myStack != null) { if (myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged())) { - final String local = - isSlotME ? ButtonToolTips.ItemsStored.getLocal() : ButtonToolTips.ItemCount.getLocal(); - final String formattedAmount = - NumberFormat.getNumberInstance(Locale.US).format(myStack.getStackSize()); + final String local = isSlotME ? ButtonToolTips.ItemsStored.getLocal() + : ButtonToolTips.ItemCount.getLocal(); + final String formattedAmount = NumberFormat.getNumberInstance(Locale.US) + .format(myStack.getStackSize()); final String format = String.format(local, formattedAmount); currentToolTip.add("\u00a77" + format); @@ -65,16 +58,15 @@ public List handleItemTooltip( if (myStack.getCountRequestable() > 0) { final String local = ButtonToolTips.ItemsRequestable.getLocal(); - final String formattedAmount = - NumberFormat.getNumberInstance(Locale.US).format(myStack.getCountRequestable()); + final String formattedAmount = NumberFormat.getNumberInstance(Locale.US) + .format(myStack.getCountRequestable()); final String format = String.format(local, formattedAmount); currentToolTip.add("\u00a77" + format); } } else if (stack.stackSize > BigNumber || (stack.stackSize > 1 && stack.isItemDamaged())) { final String local = ButtonToolTips.ItemsStored.getLocal(); - final String formattedAmount = - NumberFormat.getNumberInstance(Locale.US).format(stack.stackSize); + final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.stackSize); final String format = String.format(local, formattedAmount); currentToolTip.add("\u00a77" + format); @@ -96,29 +88,29 @@ protected void renderToolTip(final ItemStack stack, final int x, final int y) { try { myStack = Platform.getAEStackInSlot(s); - } catch (final Throwable ignore) { - } + } catch (final Throwable ignore) {} if (myStack != null) { @SuppressWarnings("unchecked") - final List currentToolTip = - stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + final List currentToolTip = stack + .getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); if (myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged())) { - currentToolTip.add("Items Stored: " - + NumberFormat.getNumberInstance(Locale.US).format(myStack.getStackSize())); + currentToolTip.add( + "Items Stored: " + + NumberFormat.getNumberInstance(Locale.US).format(myStack.getStackSize())); } if (myStack.getCountRequestable() > 0) { - currentToolTip.add("Items Requestable: " - + NumberFormat.getNumberInstance(Locale.US).format(myStack.getCountRequestable())); + currentToolTip.add( + "Items Requestable: " + + NumberFormat.getNumberInstance(Locale.US).format(myStack.getCountRequestable())); } this.drawTooltip(x, y, 0, join(currentToolTip, "\n")); } else if (stack.stackSize > BigNumber) { final List var4 = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); - var4.add("Items Stored: " - + NumberFormat.getNumberInstance(Locale.US).format(stack.stackSize)); + var4.add("Items Stored: " + NumberFormat.getNumberInstance(Locale.US).format(stack.stackSize)); this.drawTooltip(x, y, 0, join(var4, "\n")); return; } diff --git a/src/main/java/appeng/client/gui/GuiNull.java b/src/main/java/appeng/client/gui/GuiNull.java index fc3bb1ac2a1..d620e05d818 100644 --- a/src/main/java/appeng/client/gui/GuiNull.java +++ b/src/main/java/appeng/client/gui/GuiNull.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui; diff --git a/src/main/java/appeng/client/gui/config/AEConfigGui.java b/src/main/java/appeng/client/gui/config/AEConfigGui.java index 229a86c069d..a5a13861f7f 100644 --- a/src/main/java/appeng/client/gui/config/AEConfigGui.java +++ b/src/main/java/appeng/client/gui/config/AEConfigGui.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.config; -import appeng.core.AEConfig; -import appeng.core.AppEng; -import cpw.mods.fml.client.config.GuiConfig; -import cpw.mods.fml.client.config.IConfigElement; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.ConfigElement; +import appeng.core.AEConfig; +import appeng.core.AppEng; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; + public class AEConfigGui extends GuiConfig { public AEConfigGui(final GuiScreen parent) { diff --git a/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java b/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java index 57fee0d34a9..acf26053627 100644 --- a/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java +++ b/src/main/java/appeng/client/gui/config/AEConfigGuiFactory.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.config; -import cpw.mods.fml.client.IModGuiFactory; import java.util.Set; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import cpw.mods.fml.client.IModGuiFactory; + public class AEConfigGuiFactory implements IModGuiFactory { @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java index 88e035776c6..710984478f5 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCellWorkbench.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Mouse; + import appeng.api.config.*; import appeng.api.implementations.items.IUpgradeModule; import appeng.client.gui.widgets.GuiImgButton; @@ -28,12 +29,6 @@ import appeng.core.sync.packets.PacketValueConfig; import appeng.tile.misc.TileCellWorkbench; import appeng.util.Platform; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Mouse; public class GuiCellWorkbench extends GuiUpgradeable { @@ -60,10 +55,16 @@ protected void addButtons() { 12 * 16 + 5, GuiText.CopyMode.getLocal(), GuiText.CopyModeDesc.getLocal()); - this.fuzzyMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 68, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL); - this.oreFilter = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 68, Settings.ACTIONS, ActionItems.ORE_FILTER); + this.fuzzyMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 68, + Settings.FUZZY_MODE, + FuzzyMode.IGNORE_ALL); + this.oreFilter = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 68, + Settings.ACTIONS, + ActionItems.ORE_FILTER); this.buttonList.add(this.fuzzyMode); this.buttonList.add(this.partition); @@ -81,9 +82,19 @@ public void drawBG(final int offsetX, final int offsetY, final int mouseX, final if (this.drawUpgrades()) { if (this.workbench.availableUpgrades() <= 8) { this.drawTexturedModalRect( - offsetX + 177, offsetY, 177, 0, 35, 7 + this.workbench.availableUpgrades() * 18); + offsetX + 177, + offsetY, + 177, + 0, + 35, + 7 + this.workbench.availableUpgrades() * 18); this.drawTexturedModalRect( - offsetX + 177, offsetY + (7 + (this.workbench.availableUpgrades()) * 18), 177, 151, 35, 7); + offsetX + 177, + offsetY + (7 + (this.workbench.availableUpgrades()) * 18), + 177, + 151, + 35, + 7); } else if (this.workbench.availableUpgrades() <= 16) { this.drawTexturedModalRect(offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18); this.drawTexturedModalRect(offsetX + 177, offsetY + (7 + (8) * 18), 177, 151, 35, 7); @@ -94,7 +105,12 @@ public void drawBG(final int offsetX, final int offsetY, final int mouseX, final this.drawTexturedModalRect(offsetX + 177 + 27, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7); } else { this.drawTexturedModalRect( - offsetX + 177 + 27 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151, 35 - 8, 7); + offsetX + 177 + 27 + 4, + offsetY + (7 + (dx) * 18), + 186 + 4, + 151, + 35 - 8, + 7); } } else { this.drawTexturedModalRect(offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18); @@ -109,7 +125,12 @@ public void drawBG(final int offsetX, final int offsetY, final int mouseX, final this.drawTexturedModalRect(offsetX + 177 + 27 + 18, offsetY + (7 + (dx) * 18), 186, 151, 35 - 8, 7); } else { this.drawTexturedModalRect( - offsetX + 177 + 27 + 18 + 4, offsetY + (7 + (dx) * 18), 186 + 4, 151, 35 - 8, 7); + offsetX + 177 + 27 + 18 + 4, + offsetY + (7 + (dx) * 18), + 186 + 4, + 151, + 35 - 8, + 7); } } } @@ -174,7 +195,6 @@ protected void actionPerformed(final GuiButton btn) { } else { super.actionPerformed(btn); } - } catch (final IOException ignored) { - } + } catch (final IOException ignored) {} } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiChest.java b/src/main/java/appeng/client/gui/implementations/GuiChest.java index 93abd114563..e3a4b050b19 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiChest.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiTabButton; import appeng.container.implementations.ContainerChest; @@ -27,8 +22,6 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketSwitchGuis; import appeng.tile.storage.TileChest; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; public class GuiChest extends AEBaseGui { @@ -54,15 +47,19 @@ public void initGui() { this.buttonList.add( this.priority = new GuiTabButton( - this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender)); + this.guiLeft + 154, + this.guiTop, + 2 + 4 * 16, + GuiText.Priority.getLocal(), + itemRender)); } @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { - this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.Chest.getLocal()), 8, 6, GuiColors.ChestTitle.getColor()); - this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.ChestInventory.getColor()); + this.fontRendererObj + .drawString(this.getGuiDisplayName(GuiText.Chest.getLocal()), 8, 6, GuiColors.ChestTitle.getColor()); + this.fontRendererObj + .drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.ChestInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java index 2e8b47b296b..747f559daa0 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCondenser.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCondenser.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.Settings; import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiImgButton; @@ -29,9 +26,6 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketConfigButton; import appeng.tile.misc.TileCondenser; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiCondenser extends AEBaseGui { @@ -72,8 +66,11 @@ public void initGui() { Direction.VERTICAL, GuiText.StoredEnergy.getLocal()); - this.mode = - new GuiImgButton(128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.getOutput()); + this.mode = new GuiImgButton( + 128 + this.guiLeft, + 52 + this.guiTop, + Settings.CONDENSER_OUTPUT, + this.cvc.getOutput()); this.buttonList.add(this.pb); this.buttonList.add(this.mode); @@ -82,9 +79,15 @@ public void initGui() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.Condenser.getLocal()), 8, 6, GuiColors.CondenserTitle.getColor()); + this.getGuiDisplayName(GuiText.Condenser.getLocal()), + 8, + 6, + GuiColors.CondenserTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.CondenserInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.CondenserInventory.getColor()); this.mode.set(this.cvc.getOutput()); this.mode.setFillVar(String.valueOf(this.cvc.getOutput().requiredPower)); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java index a828f541bcb..548e58f991f 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IParts; @@ -41,12 +38,9 @@ import appeng.parts.reporting.PartTerminal; import appeng.util.calculators.ArithHelper; import appeng.util.calculators.Calculator; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; public class GuiCraftAmount extends AEBaseGui { + private GuiTextField amountToCraft; private GuiTabButton originalGuiBtn; @@ -97,8 +91,7 @@ public void initGui() { final IParts parts = definitions.parts(); if (target instanceof WirelessTerminalGuiObject) { - for (final ItemStack wirelessTerminalStack : - definitions.items().wirelessTerminal().maybeStack(1).asSet()) { + for (final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack(1).asSet()) { myIcon = wirelessTerminalStack; } @@ -136,11 +129,19 @@ public void initGui() { if (this.originalGui != null && myIcon != null) { this.buttonList.add( this.originalGuiBtn = new GuiTabButton( - this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender)); + this.guiLeft + 154, + this.guiTop, + myIcon, + myIcon.getDisplayName(), + itemRender)); } this.amountToCraft = new GuiTextField( - this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT); + this.fontRendererObj, + this.guiLeft + 62, + this.guiTop + 57, + 59, + this.fontRendererObj.FONT_HEIGHT); this.amountToCraft.setEnableBackgroundDrawing(false); this.amountToCraft.setMaxStringLength(16); this.amountToCraft.setTextColor(GuiColors.CraftAmountToCraft.getColor()); @@ -152,8 +153,8 @@ public void initGui() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { - this.fontRendererObj.drawString( - GuiText.SelectAmount.getLocal(), 8, 6, GuiColors.CraftAmountSelectAmount.getColor()); + this.fontRendererObj + .drawString(GuiText.SelectAmount.getLocal(), 8, 6, GuiColors.CraftAmountSelectAmount.getColor()); } @Override @@ -222,8 +223,9 @@ protected void actionPerformed(final GuiButton btn) { } final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - final boolean isMinus = - btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 + || btn == this.minus100 + || btn == this.minus1000; if (isPlus || isMinus) { this.addQty(this.getQty(btn)); diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java index fc2472dfd84..2017c0c5508 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftConfirm.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.text.NumberFormat; +import java.util.*; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.storage.ITerminalHost; import appeng.api.storage.data.IAEItemStack; @@ -43,14 +45,8 @@ import appeng.parts.reporting.PartTerminal; import appeng.util.Platform; import appeng.util.ReadableNumberConverter; + import com.google.common.base.Joiner; -import java.text.NumberFormat; -import java.util.*; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; public class GuiCraftConfirm extends AEBaseGui implements ICraftingCPUTableHolder { @@ -118,8 +114,13 @@ boolean isAutoStart() { public void initGui() { super.initGui(); - this.start = - new GuiButton(0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal()); + this.start = new GuiButton( + 0, + this.guiLeft + 162, + this.guiTop + this.ySize - 25, + 50, + 20, + GuiText.Start.getLocal()); this.start.enabled = false; this.buttonList.add(this.start); @@ -133,8 +134,13 @@ public void initGui() { this.selectCPU.enabled = false; this.buttonList.add(this.selectCPU); - this.cancel = - new GuiButton(0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal()); + this.cancel = new GuiButton( + 0, + this.guiLeft + 6, + this.guiTop + this.ySize - 25, + 50, + 20, + GuiText.Cancel.getLocal()); this.buttonList.add(this.cancel); } @@ -188,9 +194,7 @@ private void updateCPUButtonText() { if (this.ccc.getSelectedCpu() >= 0) // && status.selectedCpu < status.cpus.size() ) { if (this.ccc.getName().length() > 0) { - final String name = this.ccc - .getName() - .substring(0, Math.min(20, this.ccc.getName().length())); + final String name = this.ccc.getName().substring(0, Math.min(20, this.ccc.getName().length())); btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name; } else { btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.getSelectedCpu(); @@ -214,10 +218,13 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final final long BytesUsed = this.ccc.getUsedBytes(); final String byteUsed = NumberFormat.getInstance().format(BytesUsed); - final String Add = - BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal()) : GuiText.CalculatingWait.getLocal(); + final String Add = BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal()) + : GuiText.CalculatingWait.getLocal(); this.fontRendererObj.drawString( - GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, GuiColors.CraftConfirmCraftingPlan.getColor()); + GuiText.CraftingPlan.getLocal() + " - " + Add, + 8, + 7, + GuiColors.CraftConfirmCraftingPlan.getColor()); String dsp = null; @@ -227,7 +234,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final dsp = this.ccc.getCpuAvailableBytes() > 0 ? (GuiText.Bytes.getLocal() + ": " + NumberFormat.getInstance().format(this.ccc.getCpuAvailableBytes()) - + " : " + GuiText.CoProcessors.getLocal() + ": " + + " : " + + GuiText.CoProcessors.getLocal() + + ": " + NumberFormat.getInstance().format(this.ccc.getCpuCoProcessors())) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A"; } @@ -287,8 +296,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.CraftConfirmFromStorage.getColor()); if (this.tooltip == z - viewStart) { - lineList.add(GuiText.FromStorage.getLocal() + ": " - + NumberFormat.getInstance().format(stored.getStackSize())); + lineList.add( + GuiText.FromStorage.getLocal() + ": " + + NumberFormat.getInstance().format(stored.getStackSize())); } downY += 5; @@ -306,8 +316,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.CraftConfirmMissing.getColor()); if (this.tooltip == z - viewStart) { - lineList.add(GuiText.Missing.getLocal() + ": " - + NumberFormat.getInstance().format(missingStack.getStackSize())); + lineList.add( + GuiText.Missing.getLocal() + ": " + + NumberFormat.getInstance().format(missingStack.getStackSize())); } red = true; @@ -325,8 +336,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.CraftConfirmToCraft.getColor()); if (this.tooltip == z - viewStart) { - lineList.add(GuiText.ToCraft.getLocal() + ": " - + NumberFormat.getInstance().format(pendingStack.getStackSize())); + lineList.add( + GuiText.ToCraft.getLocal() + ": " + + NumberFormat.getInstance().format(pendingStack.getStackSize())); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java index 0ef189d6fba..f688ce51943 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingCPU.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import org.apache.commons.lang3.time.DurationFormatUtils; +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.config.SortDir; import appeng.api.config.SortOrder; @@ -36,21 +43,11 @@ import appeng.core.sync.packets.PacketValueConfig; import appeng.util.Platform; import appeng.util.ReadableNumberConverter; + import com.google.common.base.Joiner; -import java.io.IOException; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.TimeUnit; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import org.apache.commons.lang3.time.DurationFormatUtils; -import org.lwjgl.opengl.GL11; public class GuiCraftingCPU extends AEBaseGui implements ISortSource { + private static final int GUI_HEIGHT = 184; private static final int GUI_WIDTH = 238; @@ -178,15 +175,15 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final String title = this.getGuiDisplayName(GuiText.CraftingStatus.getLocal()); if (this.craftingCpu.getEstimatedTime() > 0 && !this.visual.isEmpty()) { - final long etaInMilliseconds = - TimeUnit.MILLISECONDS.convert(this.craftingCpu.getEstimatedTime(), TimeUnit.NANOSECONDS); - final String etaTimeText = - DurationFormatUtils.formatDuration(etaInMilliseconds, GuiText.ETAFormat.getLocal()); + final long etaInMilliseconds = TimeUnit.MILLISECONDS + .convert(this.craftingCpu.getEstimatedTime(), TimeUnit.NANOSECONDS); + final String etaTimeText = DurationFormatUtils + .formatDuration(etaInMilliseconds, GuiText.ETAFormat.getLocal()); title += " - " + etaTimeText; } - this.fontRendererObj.drawString( - title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, GuiColors.CraftingCPUTitle.getColor()); + this.fontRendererObj + .drawString(title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, GuiColors.CraftingCPUTitle.getColor()); int x = 0; int y = 0; @@ -230,8 +227,8 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final } if (AEConfig.instance.useColoredCraftingStatus && (active || scheduled)) { - final int bgColor = - active ? GuiColors.CraftingCPUActive.getColor() : GuiColors.CraftingCPUInactive.getColor(); + final int bgColor = active ? GuiColors.CraftingCPUActive.getColor() + : GuiColors.CraftingCPUInactive.getColor(); final int startX = (x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET) * 2; final int startY = ((y * offY + ITEMSTACK_TOP_OFFSET) - 3) * 2; drawRect(startX, startY, startX + (SECTION_LENGTH * 2), startY + (offY * 2) - 2, bgColor); @@ -241,8 +238,8 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int downY = 0; if (stored != null && stored.getStackSize() > 0) { - final String str = - GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm(stored.getStackSize()); + final String str = GuiText.Stored.getLocal() + ": " + + converter.toWideReadableForm(stored.getStackSize()); final int w = 4 + this.fontRendererObj.getStringWidth(str); this.fontRendererObj.drawString( str, @@ -252,8 +249,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.CraftingCPUStored.getColor()); if (this.tooltip == z - viewStart) { - lineList.add(GuiText.Stored.getLocal() + ": " - + NumberFormat.getInstance().format(stored.getStackSize())); + lineList.add( + GuiText.Stored.getLocal() + ": " + + NumberFormat.getInstance().format(stored.getStackSize())); } downY += 5; @@ -272,8 +270,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.CraftingCPUAmount.getColor()); if (this.tooltip == z - viewStart) { - lineList.add(GuiText.Crafting.getLocal() + ": " - + NumberFormat.getInstance().format(activeStack.getStackSize())); + lineList.add( + GuiText.Crafting.getLocal() + ": " + + NumberFormat.getInstance().format(activeStack.getStackSize())); } downY += 5; @@ -292,8 +291,9 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.CraftingCPUScheduled.getColor()); if (this.tooltip == z - viewStart) { - lineList.add(GuiText.Scheduled.getLocal() + ": " - + NumberFormat.getInstance().format(pendingStack.getStackSize())); + lineList.add( + GuiText.Scheduled.getLocal() + ": " + + NumberFormat.getInstance().format(pendingStack.getStackSize())); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java index 93537f32b9f..622c2077d3c 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingStatus.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ /** @@ -21,6 +13,12 @@ */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Mouse; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IParts; @@ -38,12 +36,9 @@ import appeng.parts.reporting.PartPatternTerminal; import appeng.parts.reporting.PartPatternTerminalEx; import appeng.parts.reporting.PartTerminal; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Mouse; public class GuiCraftingStatus extends GuiCraftingCPU implements ICraftingCPUTableHolder { + private final ContainerCraftingStatus status; private GuiButton selectCPU; private final GuiCraftingCPUTable cpuTable; @@ -63,8 +58,7 @@ public GuiCraftingStatus(final InventoryPlayer inventoryPlayer, final ITerminalH cpuTable = new GuiCraftingCPUTable(this, this.status.getCPUTable()); if (target instanceof WirelessTerminalGuiObject) { - for (final ItemStack wirelessTerminalStack : - definitions.items().wirelessTerminal().maybeStack(1).asSet()) { + for (final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack(1).asSet()) { this.myIcon = wirelessTerminalStack; } diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java index d012d3ab232..d595cf6c66f 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftingTerm.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; + import appeng.api.config.ActionItems; import appeng.api.config.Settings; import appeng.api.storage.ITerminalHost; @@ -29,10 +26,6 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketInventoryAction; import appeng.helpers.InventoryAction; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; public class GuiCraftingTerm extends GuiMEMonitorable { @@ -68,7 +61,10 @@ public void initGui() { super.initGui(); this.buttonList.add( this.clearBtn = new GuiImgButton( - this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH)); + this.guiLeft + 92, + this.guiTop + this.ySize - 156, + Settings.ACTIONS, + ActionItems.STASH)); this.clearBtn.setHalfSize(true); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiDrive.java b/src/main/java/appeng/client/gui/implementations/GuiDrive.java index 2f038a9724b..6cfda7a38b2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiDrive.java +++ b/src/main/java/appeng/client/gui/implementations/GuiDrive.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiTabButton; import appeng.container.implementations.ContainerDrive; @@ -27,8 +22,6 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketSwitchGuis; import appeng.tile.storage.TileDrive; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; public class GuiDrive extends AEBaseGui { @@ -54,15 +47,19 @@ public void initGui() { this.buttonList.add( this.priority = new GuiTabButton( - this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender)); + this.guiLeft + 154, + this.guiTop, + 2 + 4 * 16, + GuiText.Priority.getLocal(), + itemRender)); } @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { - this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.Drive.getLocal()), 8, 6, GuiColors.DriveTitle.getColor()); - this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.DriveInventory.getColor()); + this.fontRendererObj + .drawString(this.getGuiDisplayName(GuiText.Drive.getLocal()), 8, 6, GuiColors.DriveTitle.getColor()); + this.fontRendererObj + .drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.DriveInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java index efb9cef4c28..499475bdedb 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java +++ b/src/main/java/appeng/client/gui/implementations/GuiFormationPlane.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.FuzzyMode; import appeng.api.config.Settings; import appeng.api.config.YesNo; @@ -31,9 +28,6 @@ import appeng.core.sync.packets.PacketConfigButton; import appeng.core.sync.packets.PacketSwitchGuis; import appeng.parts.automation.PartFormationPlane; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiFormationPlane extends GuiUpgradeable { @@ -48,12 +42,19 @@ public GuiFormationPlane(final InventoryPlayer inventoryPlayer, final PartFormat @Override protected void addButtons() { this.placeMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK, YesNo.YES); - this.fuzzyMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL); + this.fuzzyMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 48, + Settings.FUZZY_MODE, + FuzzyMode.IGNORE_ALL); this.buttonList.add( this.priority = new GuiTabButton( - this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender)); + this.guiLeft + 154, + this.guiTop, + 2 + 4 * 16, + GuiText.Priority.getLocal(), + itemRender)); this.buttonList.add(this.placeMode); this.buttonList.add(this.fuzzyMode); @@ -67,7 +68,10 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final 6, GuiColors.FormationPlaneTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.FormationPlaneInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.FormationPlaneInventory.getColor()); if (this.fuzzyMode != null) { this.fuzzyMode.set(this.cvb.getFuzzyMode()); diff --git a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java index b8aa785c90b..59b96a97f39 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiGrinder.java +++ b/src/main/java/appeng/client/gui/implementations/GuiGrinder.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.client.gui.AEBaseGui; import appeng.container.implementations.ContainerGrinder; import appeng.core.localization.GuiColors; import appeng.core.localization.GuiText; import appeng.tile.grindstone.TileGrinder; -import net.minecraft.entity.player.InventoryPlayer; public class GuiGrinder extends AEBaseGui { @@ -35,9 +28,15 @@ public GuiGrinder(final InventoryPlayer inventoryPlayer, final TileGrinder te) { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.GrindStone.getLocal()), 8, 6, GuiColors.GrindStoneTitle.getColor()); + this.getGuiDisplayName(GuiText.GrindStone.getLocal()), + 8, + 6, + GuiColors.GrindStoneTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.GrindStoneInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.GrindStoneInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java index 09aff142dfa..02701564a02 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiIOPort.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Mouse; + import appeng.api.AEApi; import appeng.api.config.FullnessMode; import appeng.api.config.OperationMode; @@ -31,10 +29,6 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketConfigButton; import appeng.tile.storage.TileIOPort; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Mouse; public class GuiIOPort extends GuiUpgradeable { @@ -50,11 +44,20 @@ public GuiIOPort(final InventoryPlayer inventoryPlayer, final TileIOPort te) { @SuppressWarnings("unchecked") protected void addButtons() { this.redstoneMode = new GuiImgButton( - this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE); - this.fullMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE, FullnessMode.EMPTY); - this.operationMode = - new GuiImgButton(this.guiLeft + 80, this.guiTop + 17, Settings.OPERATION_MODE, OperationMode.EMPTY); + this.guiLeft - 18, + this.guiTop + 28, + Settings.REDSTONE_CONTROLLED, + RedstoneMode.IGNORE); + this.fullMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 8, + Settings.FULLNESS_MODE, + FullnessMode.EMPTY); + this.operationMode = new GuiImgButton( + this.guiLeft + 80, + this.guiTop + 17, + Settings.OPERATION_MODE, + OperationMode.EMPTY); this.buttonList.add(this.operationMode); this.buttonList.add(this.redstoneMode); @@ -63,10 +66,10 @@ protected void addButtons() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { - this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.IOPort.getLocal()), 8, 6, GuiColors.IOPortTitle.getColor()); - this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.IOPortInventory.getColor()); + this.fontRendererObj + .drawString(this.getGuiDisplayName(GuiText.IOPort.getLocal()), 8, 6, GuiColors.IOPortTitle.getColor()); + this.fontRendererObj + .drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.IOPortInventory.getColor()); if (this.redstoneMode != null) { this.redstoneMode.set(this.cvb.getRedStoneMode()); @@ -87,13 +90,11 @@ public void drawBG(final int offsetX, final int offsetY, final int mouseX, final final IDefinitions definitions = AEApi.instance().definitions(); - for (final ItemStack cell1kStack : - definitions.items().cell1k().maybeStack(1).asSet()) { + for (final ItemStack cell1kStack : definitions.items().cell1k().maybeStack(1).asSet()) { this.drawItem(offsetX + 66 - 8, offsetY + 17, cell1kStack); } - for (final ItemStack driveStack : - definitions.blocks().drive().maybeStack(1).asSet()) { + for (final ItemStack driveStack : definitions.blocks().drive().maybeStack(1).asSet()) { this.drawItem(offsetX + 94 + 8, offsetY + 17, driveStack); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java index 76cff8f7987..5aefef43af4 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInscriber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInscriber.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiProgressBar; import appeng.client.gui.widgets.GuiProgressBar.Direction; @@ -26,7 +20,6 @@ import appeng.core.localization.GuiColors; import appeng.core.localization.GuiText; import appeng.tile.misc.TileInscriber; -import net.minecraft.entity.player.InventoryPlayer; public class GuiInscriber extends AEBaseGui { @@ -57,9 +50,15 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final this.pb.setFullMsg(this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%"); this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.Inscriber.getLocal()), 8, 6, GuiColors.InscriberTitle.getColor()); + this.getGuiDisplayName(GuiText.Inscriber.getLocal()), + 8, + 6, + GuiColors.InscriberTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.InscriberInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.InscriberInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterface.java b/src/main/java/appeng/client/gui/implementations/GuiInterface.java index 09de8d7456f..4d92990fd20 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterface.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterface.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.InsertionMode; import appeng.api.config.Settings; import appeng.api.config.YesNo; @@ -32,9 +29,6 @@ import appeng.core.sync.packets.PacketConfigButton; import appeng.core.sync.packets.PacketSwitchGuis; import appeng.helpers.IInterfaceHost; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiInterface extends GuiUpgradeable { @@ -50,8 +44,12 @@ public GuiInterface(final InventoryPlayer inventoryPlayer, final IInterfaceHost @Override protected void addButtons() { - this.priority = - new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender); + this.priority = new GuiTabButton( + this.guiLeft + 154, + this.guiTop, + 2 + 4 * 16, + GuiText.Priority.getLocal(), + itemRender); this.buttonList.add(this.priority); this.BlockMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO); @@ -66,8 +64,11 @@ protected void addButtons() { GuiText.InterfaceTerminalHint.getLocal()); this.buttonList.add(this.interfaceMode); - this.insertionMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 44, Settings.INSERTION_MODE, InsertionMode.DEFAULT); + this.insertionMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 44, + Settings.INSERTION_MODE, + InsertionMode.DEFAULT); this.buttonList.add(this.insertionMode); } @@ -86,7 +87,10 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final } this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.Interface.getLocal()), 8, 6, GuiColors.InterfaceTitle.getColor()); + this.getGuiDisplayName(GuiText.Interface.getLocal()), + 8, + 6, + GuiColors.InterfaceTitle.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java index 4611e8d3b0e..8d594f25469 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterfaceTerminal.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.util.*; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.config.ActionItems; import appeng.api.config.Settings; @@ -45,17 +50,8 @@ import appeng.integration.IntegrationType; import appeng.parts.reporting.PartInterfaceTerminal; import appeng.util.Platform; + import com.google.common.collect.HashMultimap; -import java.util.*; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.world.World; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; public class GuiInterfaceTerminal extends AEBaseGui implements IDropToFillTextField { @@ -96,6 +92,7 @@ public GuiInterfaceTerminal(final InventoryPlayer inventoryPlayer, final PartInt this.ySize = 255; searchFieldInputs = new MEGuiTextField(86, 12, ButtonToolTips.SearchFieldInputs.getLocal()) { + @Override public void onTextChange(final String oldText) { refreshList(); @@ -103,6 +100,7 @@ public void onTextChange(final String oldText) { }; searchFieldOutputs = new MEGuiTextField(86, 12, ButtonToolTips.SearchFieldOutputs.getLocal()) { + @Override public void onTextChange(final String oldText) { refreshList(); @@ -110,6 +108,7 @@ public void onTextChange(final String oldText) { }; searchFieldNames = new MEGuiTextField(71, 12, ButtonToolTips.SearchFieldNames.getLocal()) { + @Override public void onTextChange(final String oldText) { refreshList(); @@ -202,13 +201,12 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final if (lineObj instanceof ClientDCInternalInv) { final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; for (int z = 0; z < inv.getInventory().getSizeInventory(); z++) { - if (this.matchedStacks.contains(inv.getInventory().getStackInSlot(z))) - drawRect( - z * 18 + 22, - 1 + offset, - z * 18 + 22 + 16, - 1 + offset + 16, - GuiColors.InterfaceTerminalMatch.getColor()); + if (this.matchedStacks.contains(inv.getInventory().getStackInSlot(z))) drawRect( + z * 18 + 22, + 1 + offset, + z * 18 + 22 + 16, + 1 + offset + 16, + GuiColors.InterfaceTerminalMatch.getColor()); } } else if (lineObj instanceof String) { String name = (String) lineObj; @@ -247,8 +245,7 @@ public void drawScreen(final int mouseX, final int mouseY, final float btn) { ? ActionItems.TOGGLE_SHOW_FULL_INTERFACES_OFF : ActionItems.TOGGLE_SHOW_FULL_INTERFACES_ON); guiButtonBrokenRecipes.set( - onlyBrokenRecipes - ? ActionItems.TOGGLE_SHOW_ONLY_INVALID_PATTERN_OFF + onlyBrokenRecipes ? ActionItems.TOGGLE_SHOW_ONLY_INVALID_PATTERN_OFF : ActionItems.TOGGLE_SHOW_ONLY_INVALID_PATTERN_ON); terminalStyleBox.set(AEConfig.instance.settings.getSetting(Settings.TERMINAL_STYLE)); @@ -270,7 +267,10 @@ public void drawScreen(final int mouseX, final int mouseY, final float btn) { } GuiButton guiButton = new GuiImgButton( - guiLeft + 4, guiTop + offset + 1, Settings.ACTIONS, ActionItems.HIGHLIGHT_INTERFACE); + guiLeft + 4, + guiTop + offset + 1, + Settings.ACTIONS, + ActionItems.HIGHLIGHT_INTERFACE); guiButtonHashMap.put(guiButton, inv); buttonList.add(guiButton); } @@ -298,22 +298,29 @@ protected void mouseClicked(final int xCoord, final int yCoord, final int btn) { protected void actionPerformed(final GuiButton btn) { if (guiButtonHashMap.containsKey(btn)) { DimensionalCoord blockPos = blockPosHashMap.get(guiButtonHashMap.get(btn)); - WorldCoord blockPos2 = - new WorldCoord((int) mc.thePlayer.posX, (int) mc.thePlayer.posY, (int) mc.thePlayer.posZ); + WorldCoord blockPos2 = new WorldCoord( + (int) mc.thePlayer.posX, + (int) mc.thePlayer.posY, + (int) mc.thePlayer.posZ); if (mc.theWorld.provider.dimensionId != blockPos.getDimension()) { - mc.thePlayer.addChatMessage(new ChatComponentTranslation( - PlayerMessages.InterfaceInOtherDim.getName(), blockPos.getDimension())); + mc.thePlayer.addChatMessage( + new ChatComponentTranslation( + PlayerMessages.InterfaceInOtherDim.getName(), + blockPos.getDimension())); } else { BlockPosHighlighter.highlightBlock( blockPos, System.currentTimeMillis() + 500 * WorldCoord.getTaxicabDistance(blockPos, blockPos2)); - mc.thePlayer.addChatMessage(new ChatComponentTranslation( - PlayerMessages.InterfaceHighlighted.getName(), blockPos.x, blockPos.y, blockPos.z)); + mc.thePlayer.addChatMessage( + new ChatComponentTranslation( + PlayerMessages.InterfaceHighlighted.getName(), + blockPos.x, + blockPos.y, + blockPos.z)); } mc.thePlayer.closeScreen(); } else if (btn == guiButtonHideFull) { - AEConfig.instance.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal = - !AEConfig.instance.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal; + AEConfig.instance.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal = !AEConfig.instance.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal; this.refreshList(); } else if (btn == guiButtonAssemblersOnly) { onlyMolecularAssemblers = !onlyMolecularAssemblers; @@ -326,8 +333,7 @@ protected void actionPerformed(final GuiButton btn) { if (iBtn.getSetting() != Settings.ACTIONS) { final Enum cv = iBtn.getCurrentValue(); final boolean backwards = Mouse.isButtonDown(1); - final Enum next = - Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues()); + final Enum next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues()); if (btn == this.terminalStyleBox) { AEConfig.instance.settings.putSetting(iBtn.getSetting(), next); @@ -384,12 +390,12 @@ protected void keyTyped(final char character, final int key) { if (character == ' ') { if ((searchFieldInputs.getText().isEmpty() && searchFieldInputs.isFocused()) || (searchFieldOutputs.getText().isEmpty() && searchFieldOutputs.isFocused()) - || (searchFieldNames.getText().isEmpty() && searchFieldNames.isFocused())) return; + || (searchFieldNames.getText().isEmpty() && searchFieldNames.isFocused())) + return; } else if (character == '\t') { if (handleTab()) return; } - if (searchFieldInputs.textboxKeyTyped(character, key) - || searchFieldOutputs.textboxKeyTyped(character, key) + if (searchFieldInputs.textboxKeyTyped(character, key) || searchFieldOutputs.textboxKeyTyped(character, key) || searchFieldNames.textboxKeyTyped(character, key)) { refreshList(); } else { @@ -430,8 +436,8 @@ public void postUpdate(final NBTTagCompound in) { try { final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX); final NBTTagCompound invData = in.getCompoundTag(key); - final ClientDCInternalInv current = - this.getById(id, invData.getLong("sortBy"), invData.getString("un")); + final ClientDCInternalInv current = this + .getById(id, invData.getLong("sortBy"), invData.getString("un")); int X = invData.getInteger("x"); int Y = invData.getInteger("y"); int Z = invData.getInteger("z"); @@ -441,13 +447,12 @@ public void postUpdate(final NBTTagCompound in) { for (int x = 0; x < current.getInventory().getSizeInventory(); x++) { final String which = Integer.toString(x); if (invData.hasKey(which)) { - current.getInventory() - .setInventorySlotContents( - x, ItemStack.loadItemStackFromNBT(invData.getCompoundTag(which))); + current.getInventory().setInventorySlotContents( + x, + ItemStack.loadItemStackFromNBT(invData.getCompoundTag(which))); } } - } catch (final NumberFormatException ignored) { - } + } catch (final NumberFormatException ignored) {} } } @@ -473,11 +478,15 @@ private void refreshList() { final String searchFieldOutputs = this.searchFieldOutputs.getText().toLowerCase(); final String searchFieldNames = this.searchFieldNames.getText().toLowerCase(); - final Set cachedSearch = this.getCacheForSearchTerm("IN:" + searchFieldInputs + "OUT:" - + searchFieldOutputs + "NAME:" - + searchFieldNames + AEConfig.instance.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal - + onlyMolecularAssemblers - + onlyBrokenRecipes); + final Set cachedSearch = this.getCacheForSearchTerm( + "IN:" + searchFieldInputs + + "OUT:" + + searchFieldOutputs + + "NAME:" + + searchFieldNames + + AEConfig.instance.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal + + onlyMolecularAssemblers + + onlyBrokenRecipes); final boolean rebuild = cachedSearch.isEmpty(); for (final ClientDCInternalInv entry : this.byId.values()) { @@ -554,17 +563,15 @@ private boolean itemStackMatchesSearchTerm(final ItemStack itemStack, final Stri } final NBTTagList tags = encodedValue.getTagList(pass == 0 ? "in" : "out", 10); - final boolean containsInvalidDisplayName = - GuiText.UnknownItem.getLocal().toLowerCase().contains(searchTerm); + final boolean containsInvalidDisplayName = GuiText.UnknownItem.getLocal().toLowerCase().contains(searchTerm); for (int i = 0; i < tags.tagCount(); i++) { final NBTTagCompound tag = tags.getCompoundTagAt(i); final ItemStack parsedItemStack = ItemStack.loadItemStackFromNBT(tag); if (parsedItemStack != null) { - final String displayName = Platform.getItemDisplayName( - AEApi.instance().storage().createItemStack(parsedItemStack)) - .toLowerCase(); + final String displayName = Platform + .getItemDisplayName(AEApi.instance().storage().createItemStack(parsedItemStack)).toLowerCase(); if (displayName.contains(searchTerm)) { return true; } @@ -642,8 +649,7 @@ private ClientDCInternalInv getById(final long id, final long sortBy, final Stri } public boolean isOverTextField(final int mousex, final int mousey) { - return searchFieldInputs.isMouseIn(mousex, mousey) - || searchFieldOutputs.isMouseIn(mousex, mousey) + return searchFieldInputs.isMouseIn(mousex, mousey) || searchFieldOutputs.isMouseIn(mousex, mousey) || searchFieldNames.isMouseIn(mousex, mousey); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java index 538f09d2e23..46dfe45994b 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java +++ b/src/main/java/appeng/client/gui/implementations/GuiLevelEmitter.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.*; import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiNumberBox; @@ -30,10 +29,6 @@ import appeng.core.sync.packets.PacketConfigButton; import appeng.core.sync.packets.PacketValueConfig; import appeng.parts.automation.PartLevelEmitter; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiLevelEmitter extends GuiUpgradeable { @@ -76,14 +71,26 @@ public void initGui() { @Override protected void addButtons() { - this.levelMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL); + this.levelMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 8, + Settings.LEVEL_TYPE, + LevelType.ITEM_LEVEL); this.redstoneMode = new GuiImgButton( - this.guiLeft - 18, this.guiTop + 28, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL); - this.fuzzyMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL); - this.craftingMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_VIA_REDSTONE, YesNo.NO); + this.guiLeft - 18, + this.guiTop + 28, + Settings.REDSTONE_EMITTER, + RedstoneMode.LOW_SIGNAL); + this.fuzzyMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 48, + Settings.FUZZY_MODE, + FuzzyMode.IGNORE_ALL); + this.craftingMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 48, + Settings.CRAFT_VIA_REDSTONE, + YesNo.NO); final int a = AEConfig.instance.levelByStackAmounts(0); final int b = AEConfig.instance.levelByStackAmounts(1); @@ -171,8 +178,9 @@ protected void actionPerformed(final GuiButton btn) { } final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - final boolean isMinus = - btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 + || btn == this.minus100 + || btn == this.minus1000; if (isPlus || isMinus) { this.addQty(this.getQty(btn)); diff --git a/src/main/java/appeng/client/gui/implementations/GuiMAC.java b/src/main/java/appeng/client/gui/implementations/GuiMAC.java index b90f6718e43..944aed2ce72 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMAC.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMAC.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.api.config.RedstoneMode; import appeng.api.config.Settings; import appeng.client.gui.widgets.GuiImgButton; @@ -26,7 +20,6 @@ import appeng.container.implementations.ContainerMAC; import appeng.core.localization.GuiText; import appeng.tile.crafting.TileMolecularAssembler; -import net.minecraft.entity.player.InventoryPlayer; public class GuiMAC extends GuiUpgradeable { @@ -49,8 +42,11 @@ public void initGui() { @Override protected void addButtons() { - this.redstoneMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE); + this.redstoneMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 8, + Settings.REDSTONE_CONTROLLED, + RedstoneMode.IGNORE); this.buttonList.add(this.redstoneMode); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java index 9f717d559f8..c48b99f8eeb 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEMonitorable.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + import appeng.api.config.*; import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.tiles.IMEChest; @@ -55,15 +59,6 @@ import codechicken.nei.TextField; import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.ReflectionHelper; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.List; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfigManagerHost, IDropToFillTextField { @@ -103,8 +98,8 @@ public GuiMEMonitorable(final InventoryPlayer inventoryPlayer, final ITerminalHo this(inventoryPlayer, te, new ContainerMEMonitorable(inventoryPlayer, te)); } - public GuiMEMonitorable( - final InventoryPlayer inventoryPlayer, final ITerminalHost te, final ContainerMEMonitorable c) { + public GuiMEMonitorable(final InventoryPlayer inventoryPlayer, final ITerminalHost te, + final ContainerMEMonitorable c) { super(c); @@ -135,6 +130,7 @@ public GuiMEMonitorable( } this.searchField = new MEGuiTextField(90, 12, ButtonToolTips.SearchStringTooltip.getLocal()) { + @Override public void onTextChange(final String oldText) { final String text = getText(); @@ -147,8 +143,8 @@ public void onTextChange(final String oldText) { if (Loader.isModLoaded("NotEnoughItems")) { try { - final Class clazz = - ReflectionHelper.getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager"); + final Class clazz = ReflectionHelper + .getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager"); final Field fldSearchField = clazz.getField("searchField"); this.NEISearchField = (TextField) fldSearchField.get(clazz); } catch (NoSuchFieldException | IllegalAccessException e) { @@ -168,9 +164,10 @@ public void postUpdate(final List list) { private void setScrollBar() { this.getScrollBar().setTop(18).setLeft(175).setHeight(this.rows * 18 - 2); - this.getScrollBar() - .setRange( - 0, (this.repo.size() + this.perRow - 1) / this.perRow - this.rows, Math.max(1, this.rows / 6)); + this.getScrollBar().setRange( + 0, + (this.repo.size() + this.perRow - 1) / this.perRow - this.rows, + Math.max(1, this.rows / 6)); } @Override @@ -185,8 +182,7 @@ protected void actionPerformed(final GuiButton btn) { if (iBtn.getSetting() != Settings.ACTIONS) { final Enum cv = iBtn.getCurrentValue(); final boolean backwards = Mouse.isButtonDown(1); - final Enum next = - Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues()); + final Enum next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues()); if (btn == this.terminalStyleBox) { AEConfig.instance.settings.putSetting(iBtn.getSetting(), next); @@ -196,8 +192,8 @@ protected void actionPerformed(final GuiButton btn) { AEConfig.instance.preserveSearchBar = next == YesNo.YES; } else { try { - NetworkHandler.instance.sendToServer( - new PacketValueConfig(iBtn.getSetting().name(), next.name())); + NetworkHandler.instance + .sendToServer(new PacketValueConfig(iBtn.getSetting().name(), next.name())); } catch (final IOException e) { AELog.debug(e); } @@ -221,8 +217,7 @@ private void reinitalize() { public void initGui() { Keyboard.enableRepeatEvents(true); - this.perRow = AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) != TerminalStyle.FULL - ? 9 + this.perRow = AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) != TerminalStyle.FULL ? 9 : 9 + ((this.width - this.standardSize) / 18); this.rows = calculateRowsCount(); @@ -254,7 +249,10 @@ public void initGui() { if (this.customSortOrder) { this.buttonList.add( this.SortByBox = new GuiImgButton( - this.guiLeft - 18, offset, Settings.SORT_BY, this.configSrc.getSetting(Settings.SORT_BY))); + this.guiLeft - 18, + offset, + Settings.SORT_BY, + this.configSrc.getSetting(Settings.SORT_BY))); offset += 20; } @@ -303,9 +301,7 @@ public void initGui() { } if (this.viewCell || this instanceof GuiWirelessTerm) { - if (AEConfig.instance - .getConfigManager() - .getSetting(Settings.CRAFTING_STATUS) + if (AEConfig.instance.getConfigManager().getSetting(Settings.CRAFTING_STATUS) .equals(CraftingStatus.BUTTON)) { this.buttonList.add( this.craftingStatusImgBtn = new GuiImgButton( @@ -367,10 +363,9 @@ public void initGui() { protected int calculateRowsCount() { final boolean hasNEI = IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI); - final int NEIPadding = hasNEI - ? 22 - /** input */ - + 20 + final int NEIPadding = hasNEI ? 22 + /** input */ + + 20 /** top panel */ : 0; final int extraSpace = this.height - MAGIC_HEIGHT_NUMBER - NEIPadding - this.reservedSpace; @@ -381,9 +376,15 @@ protected int calculateRowsCount() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(this.myName.getLocal()), 8, 6, GuiColors.MEMonitorableTitle.getColor()); + this.getGuiDisplayName(this.myName.getLocal()), + 8, + 6, + GuiColors.MEMonitorableTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.MEMonitorableInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.MEMonitorableInventory.getColor()); this.currentMouseX = mouseX; this.currentMouseY = mouseY; @@ -429,11 +430,9 @@ public void drawBG(final int offsetX, final int offsetY, final int mouseX, final boolean update = false; for (int i = 0; i < 5; i++) { - if (this.myCurrentViewCells[i] - != this.monitorableContainer.getCellViewSlot(i).getStack()) { + if (this.myCurrentViewCells[i] != this.monitorableContainer.getCellViewSlot(i).getStack()) { update = true; - this.myCurrentViewCells[i] = - this.monitorableContainer.getCellViewSlot(i).getStack(); + this.myCurrentViewCells[i] = this.monitorableContainer.getCellViewSlot(i).getStack(); } } @@ -468,8 +467,7 @@ protected void repositionSlot(final AppEngSlot s) { protected void keyTyped(final char character, final int key) { if (!this.checkHotbarKeys(key)) { - if (NEISearchField != null - && (NEISearchField.focused() || searchField.isFocused()) + if (NEISearchField != null && (NEISearchField.focused() || searchField.isFocused()) && CommonHelper.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, key)) { final boolean focused = searchField.isFocused(); searchField.setFocused(!focused); @@ -490,8 +488,8 @@ protected void keyTyped(final char character, final int key) { return; } - final boolean mouseInGui = - this.isPointInRegion(0, 0, this.xSize, this.ySize, this.currentMouseX, this.currentMouseY); + final boolean mouseInGui = this + .isPointInRegion(0, 0, this.xSize, this.ySize, this.currentMouseX, this.currentMouseY); if (this.isAutoFocus && !searchField.isFocused() && mouseInGui) { searchField.setFocused(true); @@ -545,8 +543,7 @@ public void updateSetting(final IConfigManager manager, final Enum settingName, protected boolean isPointInRegion(int rectX, int rectY, int rectWidth, int rectHeight, int pointX, int pointY) { pointX -= this.guiLeft; pointY -= this.guiTop; - return pointX >= rectX - 1 - && pointX < rectX + rectWidth + 1 + return pointX >= rectX - 1 && pointX < rectX + rectWidth + 1 && pointY >= rectY - 1 && pointY < rectY + rectHeight + 1; } @@ -619,7 +616,7 @@ public boolean hideItemPanelSlot(int tx, int ty, int tw, int th) { tw += tx; th += ty; - // overflow || intersect + // overflow || intersect return (rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java b/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java index 94743ea5b1f..e18cc043403 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java +++ b/src/main/java/appeng/client/gui/implementations/GuiMEPortableCell.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.api.implementations.guiobjects.IPortableCell; import appeng.container.implementations.ContainerMEPortableCell; -import net.minecraft.entity.player.InventoryPlayer; public class GuiMEPortableCell extends GuiMEMonitorable { diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java index 6322e38d5f8..aaede798a18 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkStatus.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + import appeng.api.config.Settings; import appeng.api.config.SortDir; import appeng.api.config.SortOrder; @@ -35,13 +37,6 @@ import appeng.core.localization.GuiColors; import appeng.core.localization.GuiText; import appeng.util.Platform; -import java.util.List; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; public class GuiNetworkStatus extends AEBaseGui implements ISortSource { @@ -78,7 +73,10 @@ public void initGui() { super.initGui(); this.units = new GuiImgButton( - this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit()); + this.guiLeft - 18, + this.guiTop + 8, + Settings.POWER_UNITS, + AEConfig.instance.selectedPowerUnit()); this.buttonList.add(this.units); } @@ -118,8 +116,8 @@ public void drawScreen(final int mouseX, final int mouseY, final float btn) { public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { final ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots; - this.fontRendererObj.drawString( - GuiText.NetworkDetails.getLocal(), 8, 6, GuiColors.NetworkStatusDetails.getColor()); + this.fontRendererObj + .drawString(GuiText.NetworkDetails.getLocal(), 8, 6, GuiColors.NetworkStatusDetails.getColor()); this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong(ns.getCurrentPower(), false), @@ -183,7 +181,8 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final toolTip += ('\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize())); if (refStack.getCountRequestable() > 0) { - toolTip += ('\n' + GuiText.EnergyDrain.getLocal() + ": " + toolTip += ('\n' + GuiText.EnergyDrain.getLocal() + + ": " + Platform.formatPowerLong(refStack.getCountRequestable(), true)); } @@ -231,8 +230,8 @@ private void setScrollBar() { } // @Override - NEI - public List handleItemTooltip( - final ItemStack stack, final int mouseX, final int mouseY, final List currentToolTip) { + public List handleItemTooltip(final ItemStack stack, final int mouseX, final int mouseY, + final List currentToolTip) { if (stack != null) { final Slot s = this.getSlot(mouseX, mouseY); if (s instanceof SlotME) { @@ -241,8 +240,7 @@ public List handleItemTooltip( try { final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); - } catch (final Throwable ignore) { - } + } catch (final Throwable ignore) {} if (myStack != null) { while (currentToolTip.size() > 1) { @@ -263,20 +261,20 @@ protected void drawItemStackTooltip(final ItemStack stack, final int x, final in try { final SlotME theSlotField = (SlotME) s; myStack = theSlotField.getAEStack(); - } catch (final Throwable ignore) { - } + } catch (final Throwable ignore) {} if (myStack != null) { - final List currentToolTip = - stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + final List currentToolTip = stack + .getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); while (currentToolTip.size() > 1) { currentToolTip.remove(1); } currentToolTip.add(GuiText.Installed.getLocal() + ": " + (myStack.getStackSize())); - currentToolTip.add(GuiText.EnergyDrain.getLocal() + ": " - + Platform.formatPowerLong(myStack.getCountRequestable(), true)); + currentToolTip.add( + GuiText.EnergyDrain.getLocal() + ": " + + Platform.formatPowerLong(myStack.getCountRequestable(), true)); this.drawTooltip(x, y, 0, join(currentToolTip, "\n")); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java index 98d6e65a8a1..67faaa80338 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java +++ b/src/main/java/appeng/client/gui/implementations/GuiNetworkTool.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.api.implementations.guiobjects.INetworkTool; import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiToggleButton; @@ -27,9 +24,6 @@ import appeng.core.localization.GuiText; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; public class GuiNetworkTool extends AEBaseGui { @@ -75,9 +69,15 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final } this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.NetworkTool.getLocal()), 8, 6, GuiColors.NetworkToolTitle.getColor()); + this.getGuiDisplayName(GuiText.NetworkTool.getLocal()), + 8, + 6, + GuiColors.NetworkToolTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.NetworkToolInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.NetworkToolInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiOreFilter.java b/src/main/java/appeng/client/gui/implementations/GuiOreFilter.java index a6d978c6257..7c212211138 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiOreFilter.java +++ b/src/main/java/appeng/client/gui/implementations/GuiOreFilter.java @@ -1,5 +1,11 @@ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.IDropToFillTextField; import appeng.client.gui.widgets.MEGuiTextField; @@ -16,12 +22,9 @@ import appeng.parts.automation.PartSharedItemBus; import appeng.parts.misc.PartStorageBus; import appeng.tile.misc.TileCellWorkbench; -import java.io.IOException; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class GuiOreFilter extends AEBaseGui implements IDropToFillTextField { + private MEGuiTextField textField; public GuiOreFilter(InventoryPlayer ip, IOreFilterable obj) { diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java index 64ba5f6329c..e74db00bdf8 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternTerm.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Keyboard; + import appeng.api.config.ActionItems; import appeng.api.config.ItemSubstitution; import appeng.api.config.PatternBeSubstitution; @@ -31,12 +32,6 @@ import appeng.core.localization.GuiText; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Keyboard; public class GuiPatternTerm extends GuiMEMonitorable { @@ -70,26 +65,32 @@ protected void actionPerformed(final GuiButton btn) { try { if (this.tabCraftButton == btn || this.tabProcessButton == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminal.CraftMode", - this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING)); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminal.CraftMode", + this.tabProcessButton == btn ? CRAFTMODE_CRFTING : CRAFTMODE_PROCESSING)); } else if (this.encodeBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminal.Encode", - isCtrlKeyDown() ? (isShiftKeyDown() ? "6" : "1") : (isShiftKeyDown() ? "2" : "1"))); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminal.Encode", + isCtrlKeyDown() ? (isShiftKeyDown() ? "6" : "1") : (isShiftKeyDown() ? "2" : "1"))); } else if (this.clearBtn == btn) { NetworkHandler.instance.sendToServer(new PacketValueConfig("PatternTerminal.Clear", "1")); } else if (this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminal.Substitute", - this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminal.Substitute", + this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); } else if (this.beSubstitutionsEnabledBtn == btn || this.beSubstitutionsDisabledBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminal.BeSubstitute", - this.beSubstitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminal.BeSubstitute", + this.beSubstitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); } else if (doubleBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminal.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0")); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminal.Double", + Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0")); } } catch (final IOException e) { // TODO Auto-generated catch block @@ -117,36 +118,57 @@ public void initGui() { this.buttonList.add(this.tabProcessButton); this.substitutionsEnabledBtn = new GuiImgButton( - this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED); + this.guiLeft + 84, + this.guiTop + this.ySize - 163, + Settings.ACTIONS, + ItemSubstitution.ENABLED); this.substitutionsEnabledBtn.setHalfSize(true); this.buttonList.add(this.substitutionsEnabledBtn); this.substitutionsDisabledBtn = new GuiImgButton( - this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED); + this.guiLeft + 84, + this.guiTop + this.ySize - 163, + Settings.ACTIONS, + ItemSubstitution.DISABLED); this.substitutionsDisabledBtn.setHalfSize(true); this.buttonList.add(this.substitutionsDisabledBtn); this.beSubstitutionsEnabledBtn = new GuiImgButton( - this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.ENABLED); + this.guiLeft + 84, + this.guiTop + this.ySize - 153, + Settings.ACTIONS, + PatternBeSubstitution.ENABLED); this.beSubstitutionsEnabledBtn.setHalfSize(true); this.buttonList.add(this.beSubstitutionsEnabledBtn); this.beSubstitutionsDisabledBtn = new GuiImgButton( - this.guiLeft + 84, this.guiTop + this.ySize - 153, Settings.ACTIONS, PatternBeSubstitution.DISABLED); + this.guiLeft + 84, + this.guiTop + this.ySize - 153, + Settings.ACTIONS, + PatternBeSubstitution.DISABLED); this.beSubstitutionsDisabledBtn.setHalfSize(true); this.buttonList.add(this.beSubstitutionsDisabledBtn); this.clearBtn = new GuiImgButton( - this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE); + this.guiLeft + 74, + this.guiTop + this.ySize - 163, + Settings.ACTIONS, + ActionItems.CLOSE); this.clearBtn.setHalfSize(true); this.buttonList.add(this.clearBtn); this.encodeBtn = new GuiImgButton( - this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE); + this.guiLeft + 147, + this.guiTop + this.ySize - 142, + Settings.ACTIONS, + ActionItems.ENCODE); this.buttonList.add(this.encodeBtn); this.doubleBtn = new GuiImgButton( - this.guiLeft + 74, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE); + this.guiLeft + 74, + this.guiTop + this.ySize - 153, + Settings.ACTIONS, + ActionItems.DOUBLE); this.doubleBtn.setHalfSize(true); this.buttonList.add(this.doubleBtn); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternTermEx.java b/src/main/java/appeng/client/gui/implementations/GuiPatternTermEx.java index 9c7ea9cce05..da92fef9e64 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternTermEx.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternTermEx.java @@ -1,5 +1,13 @@ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + import appeng.api.config.*; import appeng.api.storage.ITerminalHost; import appeng.client.gui.widgets.GuiImgButton; @@ -11,13 +19,9 @@ import appeng.core.localization.GuiText; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; public class GuiPatternTermEx extends GuiMEMonitorable { + private static final String SUBSITUTION_DISABLE = "0"; private static final String SUBSITUTION_ENABLE = "1"; @@ -48,25 +52,30 @@ protected void actionPerformed(final GuiButton btn) { try { if (this.encodeBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminalEx.Encode", - isCtrlKeyDown() ? (isShiftKeyDown() ? "6" : "1") : (isShiftKeyDown() ? "2" : "1"))); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminalEx.Encode", + isCtrlKeyDown() ? (isShiftKeyDown() ? "6" : "1") : (isShiftKeyDown() ? "2" : "1"))); } else if (this.clearBtn == btn) { NetworkHandler.instance.sendToServer(new PacketValueConfig("PatternTerminalEx.Clear", "1")); } else if (this.invertBtn == btn) { NetworkHandler.instance.sendToServer( new PacketValueConfig("PatternTerminalEx.Invert", container.inverted ? "0" : "1")); } else if (this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminalEx.Substitute", - this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminalEx.Substitute", + this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); } else if (this.beSubstitutionsEnabledBtn == btn || this.beSubstitutionsDisabledBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminalEx.BeSubstitute", - this.beSubstitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminalEx.BeSubstitute", + this.beSubstitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); } else if (doubleBtn == btn) { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminalEx.Double", Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0")); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminalEx.Double", + Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0")); } } catch (final IOException e) { // TODO Auto-generated catch block @@ -79,32 +88,50 @@ public void initGui() { super.initGui(); this.substitutionsEnabledBtn = new GuiImgButton( - this.guiLeft + 97, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED); + this.guiLeft + 97, + this.guiTop + this.ySize - 163, + Settings.ACTIONS, + ItemSubstitution.ENABLED); this.substitutionsEnabledBtn.setHalfSize(true); this.buttonList.add(this.substitutionsEnabledBtn); this.substitutionsDisabledBtn = new GuiImgButton( - this.guiLeft + 97, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED); + this.guiLeft + 97, + this.guiTop + this.ySize - 163, + Settings.ACTIONS, + ItemSubstitution.DISABLED); this.substitutionsDisabledBtn.setHalfSize(true); this.buttonList.add(this.substitutionsDisabledBtn); this.beSubstitutionsEnabledBtn = new GuiImgButton( - this.guiLeft + 97, this.guiTop + this.ySize - 143, Settings.ACTIONS, PatternBeSubstitution.ENABLED); + this.guiLeft + 97, + this.guiTop + this.ySize - 143, + Settings.ACTIONS, + PatternBeSubstitution.ENABLED); this.beSubstitutionsEnabledBtn.setHalfSize(true); this.buttonList.add(this.beSubstitutionsEnabledBtn); this.beSubstitutionsDisabledBtn = new GuiImgButton( - this.guiLeft + 97, this.guiTop + this.ySize - 143, Settings.ACTIONS, PatternBeSubstitution.DISABLED); + this.guiLeft + 97, + this.guiTop + this.ySize - 143, + Settings.ACTIONS, + PatternBeSubstitution.DISABLED); this.beSubstitutionsDisabledBtn.setHalfSize(true); this.buttonList.add(this.beSubstitutionsDisabledBtn); this.clearBtn = new GuiImgButton( - this.guiLeft + 87, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE); + this.guiLeft + 87, + this.guiTop + this.ySize - 163, + Settings.ACTIONS, + ActionItems.CLOSE); this.clearBtn.setHalfSize(true); this.buttonList.add(this.clearBtn); this.encodeBtn = new GuiImgButton( - this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE); + this.guiLeft + 147, + this.guiTop + this.ySize - 142, + Settings.ACTIONS, + ActionItems.ENCODE); this.buttonList.add(this.encodeBtn); invertBtn = new GuiImgButton( @@ -116,7 +143,10 @@ public void initGui() { this.buttonList.add(this.invertBtn); this.doubleBtn = new GuiImgButton( - this.guiLeft + 97, this.guiTop + this.ySize - 153, Settings.ACTIONS, ActionItems.DOUBLE); + this.guiLeft + 97, + this.guiTop + this.ySize - 153, + Settings.ACTIONS, + ActionItems.DOUBLE); this.doubleBtn.setHalfSize(true); this.buttonList.add(this.doubleBtn); @@ -223,8 +253,10 @@ public void handleMouseInput() { private void changeActivePage() { try { - NetworkHandler.instance.sendToServer(new PacketValueConfig( - "PatternTerminalEx.ActivePage", String.valueOf(this.processingScrollBar.getCurrentScroll()))); + NetworkHandler.instance.sendToServer( + new PacketValueConfig( + "PatternTerminalEx.ActivePage", + String.valueOf(this.processingScrollBar.getCurrentScroll()))); } catch (final IOException e) { e.printStackTrace(); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiPatternValueAmount.java b/src/main/java/appeng/client/gui/implementations/GuiPatternValueAmount.java index 76868fc9ce8..e2d0bd74e27 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPatternValueAmount.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPatternValueAmount.java @@ -1,5 +1,13 @@ package appeng.client.gui.implementations; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IParts; @@ -20,13 +28,6 @@ import appeng.parts.reporting.PartPatternTerminalEx; import appeng.util.calculators.ArithHelper; import appeng.util.calculators.Calculator; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class GuiPatternValueAmount extends AEBaseGui { @@ -106,11 +107,19 @@ public void initGui() { if (this.originalGui != null && myIcon != null) { this.buttonList.add( this.originalGuiBtn = new GuiTabButton( - this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender)); + this.guiLeft + 154, + this.guiTop, + myIcon, + myIcon.getDisplayName(), + itemRender)); } this.amountToSet = new GuiTextField( - this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT); + this.fontRendererObj, + this.guiLeft + 62, + this.guiTop + 57, + 59, + this.fontRendererObj.FONT_HEIGHT); this.amountToSet.setEnableBackgroundDrawing(false); this.amountToSet.setMaxStringLength(16); this.amountToSet.setTextColor(GuiColors.CraftAmountToCraft.getColor()); @@ -122,8 +131,8 @@ public void initGui() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { - this.fontRendererObj.drawString( - GuiText.SelectAmount.getLocal(), 8, 6, GuiColors.CraftAmountSelectAmount.getColor()); + this.fontRendererObj + .drawString(GuiText.SelectAmount.getLocal(), 8, 6, GuiColors.CraftAmountSelectAmount.getColor()); } @Override @@ -185,8 +194,8 @@ protected void actionPerformed(final GuiButton btn) { resultI = (int) ArithHelper.round(resultD, 0); } - NetworkHandler.instance.sendToServer( - new PacketPatternValueSet(originalGui.ordinal(), resultI, valueIndex)); + NetworkHandler.instance + .sendToServer(new PacketPatternValueSet(originalGui.ordinal(), resultI, valueIndex)); } } catch (final NumberFormatException e) { // nope.. @@ -194,8 +203,9 @@ protected void actionPerformed(final GuiButton btn) { } final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - final boolean isMinus = - btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 + || btn == this.minus100 + || btn == this.minus1000; if (isPlus || isMinus) { this.addQty(this.getQty(btn)); diff --git a/src/main/java/appeng/client/gui/implementations/GuiPriority.java b/src/main/java/appeng/client/gui/implementations/GuiPriority.java index d4e3d2f4f16..3b21270a6f3 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiPriority.java +++ b/src/main/java/appeng/client/gui/implementations/GuiPriority.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IBlocks; import appeng.api.definitions.IDefinitions; @@ -42,10 +40,6 @@ import appeng.tile.misc.TileInterface; import appeng.tile.storage.TileChest; import appeng.tile.storage.TileDrive; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; public class GuiPriority extends AEBaseGui { @@ -93,16 +87,14 @@ public void initGui() { final IBlocks blocks = definitions.blocks(); if (target instanceof PartStorageBus) { - for (final ItemStack storageBusStack : - parts.storageBus().maybeStack(1).asSet()) { + for (final ItemStack storageBusStack : parts.storageBus().maybeStack(1).asSet()) { myIcon = storageBusStack; } this.OriginalGui = GuiBridge.GUI_STORAGEBUS; } if (target instanceof PartFormationPlane) { - for (final ItemStack formationPlaneStack : - parts.formationPlane().maybeStack(1).asSet()) { + for (final ItemStack formationPlaneStack : parts.formationPlane().maybeStack(1).asSet()) { myIcon = formationPlaneStack; } this.OriginalGui = GuiBridge.GUI_FORMATION_PLANE; @@ -142,7 +134,11 @@ public void initGui() { if (this.OriginalGui != null && myIcon != null) { this.buttonList.add( this.originalGuiBtn = new GuiTabButton( - this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender)); + this.guiLeft + 154, + this.guiTop, + myIcon, + myIcon.getDisplayName(), + itemRender)); } this.priority = new GuiNumberBox( @@ -182,8 +178,9 @@ protected void actionPerformed(final GuiButton btn) { } final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000; - final boolean isMinus = - btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000; + final boolean isMinus = btn == this.minus1 || btn == this.minus10 + || btn == this.minus100 + || btn == this.minus1000; if (isPlus || isMinus) { this.addQty(this.getQty(btn)); @@ -225,13 +222,11 @@ private void addQty(final int i) { @Override protected void keyTyped(final char character, final int key) { if (!this.checkHotbarKeys(key)) { - if ((key == 211 - || key == 205 - || key == 203 - || key == 14 - || character == '-' - || Character.isDigit(character)) - && this.priority.textboxKeyTyped(character, key)) { + if ((key == 211 || key == 205 + || key == 203 + || key == 14 + || character == '-' + || Character.isDigit(character)) && this.priority.textboxKeyTyped(character, key)) { try { String out = this.priority.getText(); diff --git a/src/main/java/appeng/client/gui/implementations/GuiQNB.java b/src/main/java/appeng/client/gui/implementations/GuiQNB.java index 716b9c7aac6..2e9e8feef4c 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQNB.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQNB.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.client.gui.AEBaseGui; import appeng.container.implementations.ContainerQNB; import appeng.core.localization.GuiColors; import appeng.core.localization.GuiText; import appeng.tile.qnb.TileQuantumBridge; -import net.minecraft.entity.player.InventoryPlayer; public class GuiQNB extends AEBaseGui { @@ -40,7 +33,10 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final 6, GuiColors.QuantumLinkChamberTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.QuantumLinkChamberInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.QuantumLinkChamberInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java index eccef79a4e8..21064b43171 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java +++ b/src/main/java/appeng/client/gui/implementations/GuiQuartzKnife.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.IDropToFillTextField; import appeng.client.gui.widgets.MEGuiTextField; @@ -28,9 +25,6 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; import appeng.items.contents.QuartzKnifeObj; -import java.io.IOException; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; public class GuiQuartzKnife extends AEBaseGui implements IDropToFillTextField { @@ -73,7 +67,10 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final 6, GuiColors.QuartzCuttingKnifeTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.QuartzCuttingKnifeInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.QuartzCuttingKnifeInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiRenamer.java b/src/main/java/appeng/client/gui/implementations/GuiRenamer.java index f592aafd1d1..6af86d87d58 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiRenamer.java +++ b/src/main/java/appeng/client/gui/implementations/GuiRenamer.java @@ -1,5 +1,10 @@ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.IDropToFillTextField; import appeng.client.gui.widgets.MEGuiTextField; @@ -10,11 +15,9 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; import appeng.helpers.ICustomNameObject; -import java.io.IOException; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; public class GuiRenamer extends AEBaseGui implements IDropToFillTextField { + private MEGuiTextField textField; public GuiRenamer(InventoryPlayer ip, ICustomNameObject obj) { @@ -68,8 +71,8 @@ protected void mouseClicked(final int xCoord, final int yCoord, final int btn) { protected void keyTyped(final char character, final int key) { if (key == 28) { // Enter try { - NetworkHandler.instance.sendToServer( - new PacketValueConfig("QuartzKnife.ReName", this.textField.getText())); + NetworkHandler.instance + .sendToServer(new PacketValueConfig("QuartzKnife.ReName", this.textField.getText())); } catch (IOException e) { AELog.debug(e); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java index 8398825bde2..6b558fa0018 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSecurity.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSecurity.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.entity.player.InventoryPlayer; + import appeng.api.config.SecurityPermissions; import appeng.api.config.SortOrder; import appeng.api.storage.ITerminalHost; @@ -28,8 +24,6 @@ import appeng.core.localization.GuiText; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; -import java.io.IOException; -import net.minecraft.entity.player.InventoryPlayer; public class GuiSecurity extends GuiMEMonitorable { @@ -73,8 +67,8 @@ protected void actionPerformed(final net.minecraft.client.gui.GuiButton btn) { if (toggleSetting != null) { try { - NetworkHandler.instance.sendToServer( - new PacketValueConfig("TileSecurity.ToggleOption", toggleSetting.name())); + NetworkHandler.instance + .sendToServer(new PacketValueConfig("TileSecurity.ToggleOption", toggleSetting.name())); } catch (final IOException e) { AELog.debug(e); } diff --git a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java index 75e7a006d04..c2d23d88ba6 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSkyChest.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.client.gui.AEBaseGui; import appeng.container.implementations.ContainerSkyChest; import appeng.core.localization.GuiColors; @@ -25,7 +19,6 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.tile.storage.TileSkyChest; -import net.minecraft.entity.player.InventoryPlayer; public class GuiSkyChest extends AEBaseGui { @@ -37,9 +30,15 @@ public GuiSkyChest(final InventoryPlayer inventoryPlayer, final TileSkyChest te) @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.SkyChest.getLocal()), 8, 8, GuiColors.SkyChestTitle.getColor()); + this.getGuiDisplayName(GuiText.SkyChest.getLocal()), + 8, + 8, + GuiColors.SkyChestTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, GuiColors.SkyChestInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 2, + GuiColors.SkyChestInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java index b04ba69b678..4c4203f4d6c 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java +++ b/src/main/java/appeng/client/gui/implementations/GuiSpatialIOPort.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.Settings; import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiImgButton; @@ -27,9 +24,6 @@ import appeng.core.localization.GuiText; import appeng.tile.spatial.TileSpatialIOPort; import appeng.util.Platform; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiSpatialIOPort extends AEBaseGui { @@ -59,7 +53,10 @@ public void initGui() { super.initGui(); this.units = new GuiImgButton( - this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit()); + this.guiLeft - 18, + this.guiTop + 8, + Settings.POWER_UNITS, + AEConfig.instance.selectedPowerUnit()); this.buttonList.add(this.units); } @@ -89,9 +86,12 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final GuiColors.SpatialIOEfficiency.getColor()); this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.SpatialIOPort.getLocal()), 8, 6, GuiColors.SpatialIOTitle.getColor()); - this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96, GuiColors.SpatialIOInventory.getColor()); + this.getGuiDisplayName(GuiText.SpatialIOPort.getLocal()), + 8, + 6, + GuiColors.SpatialIOTitle.getColor()); + this.fontRendererObj + .drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96, GuiColors.SpatialIOInventory.getColor()); } @Override diff --git a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java index 08ade767b3c..468d7ea9a32 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java +++ b/src/main/java/appeng/client/gui/implementations/GuiStorageBus.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.*; import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiTabButton; @@ -31,10 +30,6 @@ import appeng.core.sync.packets.PacketSwitchGuis; import appeng.core.sync.packets.PacketValueConfig; import appeng.parts.misc.PartStorageBus; -import java.io.IOException; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiStorageBus extends GuiUpgradeable { @@ -54,18 +49,34 @@ public GuiStorageBus(final InventoryPlayer inventoryPlayer, final PartStorageBus protected void addButtons() { this.clear = new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE); this.partition = new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH); - this.rwMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE); + this.rwMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 48, + Settings.ACCESS, + AccessRestriction.READ_WRITE); this.storageFilter = new GuiImgButton( - this.guiLeft - 18, this.guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY); - this.fuzzyMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL); - this.oreFilter = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 88, Settings.ACTIONS, ActionItems.ORE_FILTER); + this.guiLeft - 18, + this.guiTop + 68, + Settings.STORAGE_FILTER, + StorageFilter.EXTRACTABLE_ONLY); + this.fuzzyMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 88, + Settings.FUZZY_MODE, + FuzzyMode.IGNORE_ALL); + this.oreFilter = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 88, + Settings.ACTIONS, + ActionItems.ORE_FILTER); this.buttonList.add( this.priority = new GuiTabButton( - this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender)); + this.guiLeft + 154, + this.guiTop, + 2 + 4 * 16, + GuiText.Priority.getLocal(), + itemRender)); this.buttonList.add(this.storageFilter); this.buttonList.add(this.fuzzyMode); @@ -78,9 +89,15 @@ protected void addButtons() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.StorageBus.getLocal()), 8, 6, GuiColors.StorageBusTitle.getColor()); + this.getGuiDisplayName(GuiText.StorageBus.getLocal()), + 8, + 6, + GuiColors.StorageBusTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.StorageBusInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.StorageBusInventory.getColor()); if (this.fuzzyMode != null) { this.fuzzyMode.set(this.cvb.getFuzzyMode()); @@ -116,8 +133,8 @@ protected void actionPerformed(final GuiButton btn) { } else if (btn == this.rwMode) { NetworkHandler.instance.sendToServer(new PacketConfigButton(this.rwMode.getSetting(), backwards)); } else if (btn == this.storageFilter) { - NetworkHandler.instance.sendToServer( - new PacketConfigButton(this.storageFilter.getSetting(), backwards)); + NetworkHandler.instance + .sendToServer(new PacketConfigButton(this.storageFilter.getSetting(), backwards)); } } catch (final IOException e) { AELog.debug(e); diff --git a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java index 439452a6d34..0d06e8f163a 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java +++ b/src/main/java/appeng/client/gui/implementations/GuiUpgradeable.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import java.awt.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +import org.lwjgl.input.Mouse; + import akka.japi.Pair; import appeng.api.config.*; import appeng.api.implementations.IUpgradeableHost; @@ -38,15 +42,6 @@ import codechicken.nei.api.INEIGuiHandler; import codechicken.nei.api.TaggedInventoryArea; import cpw.mods.fml.common.Optional; -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import org.lwjgl.input.Mouse; @Optional.Interface(modid = "NotEnoughItems", iface = "codechicken.nei.api.INEIGuiHandler") public class GuiUpgradeable extends AEBaseGui implements INEIGuiHandler { @@ -85,15 +80,27 @@ public void initGui() { @SuppressWarnings("unchecked") protected void addButtons() { - this.redstoneMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE); - this.fuzzyMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL); + this.redstoneMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 8, + Settings.REDSTONE_CONTROLLED, + RedstoneMode.IGNORE); + this.fuzzyMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 28, + Settings.FUZZY_MODE, + FuzzyMode.IGNORE_ALL); this.craftMode = new GuiImgButton(this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO); - this.schedulingMode = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 68, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT); - this.oreFilter = - new GuiImgButton(this.guiLeft - 18, this.guiTop + 28, Settings.ACTIONS, ActionItems.ORE_FILTER); + this.schedulingMode = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 68, + Settings.SCHEDULING_MODE, + SchedulingMode.DEFAULT); + this.oreFilter = new GuiImgButton( + this.guiLeft - 18, + this.guiTop + 28, + Settings.ACTIONS, + ActionItems.ORE_FILTER); this.buttonList.add(this.craftMode); this.buttonList.add(this.redstoneMode); @@ -105,9 +112,15 @@ protected void addButtons() { @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(this.getName().getLocal()), 8, 6, GuiColors.UpgradableTitle.getColor()); + this.getGuiDisplayName(this.getName().getLocal()), + 8, + 6, + GuiColors.UpgradableTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.UpgradableInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.UpgradableInventory.getColor()); if (this.redstoneMode != null) { this.redstoneMode.set(this.cvb.getRedStoneMode()); @@ -145,8 +158,9 @@ protected void handleButtonVisibility() { this.redstoneMode.setVisibility(this.bc.getInstalledUpgrades(Upgrades.REDSTONE) > 0); } if (this.fuzzyMode != null) { - this.fuzzyMode.setVisibility(this.bc.getInstalledUpgrades(Upgrades.FUZZY) > 0 - && this.bc.getInstalledUpgrades(Upgrades.ORE_FILTER) == 0); + this.fuzzyMode.setVisibility( + this.bc.getInstalledUpgrades(Upgrades.FUZZY) > 0 + && this.bc.getInstalledUpgrades(Upgrades.ORE_FILTER) == 0); } if (this.craftMode != null) { this.craftMode.setVisibility(this.bc.getInstalledUpgrades(Upgrades.CRAFTING) > 0); diff --git a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java index 9f1e982458a..e5c51aacb52 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java +++ b/src/main/java/appeng/client/gui/implementations/GuiVibrationChamber.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.opengl.GL11; + import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiProgressBar; import appeng.client.gui.widgets.GuiProgressBar.Direction; @@ -25,8 +21,6 @@ import appeng.core.localization.GuiColors; import appeng.core.localization.GuiText; import appeng.tile.misc.TileVibrationChamber; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; public class GuiVibrationChamber extends AEBaseGui { @@ -55,7 +49,10 @@ public void drawFG(final int offsetX, final int offsetY, final int mouseX, final 6, GuiColors.VibrationChamberTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.VibrationChamberInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.VibrationChamberInventory.getColor()); this.pb.setFullMsg(this.cvc.getAePerTick() * this.cvc.getCurrentProgress() / 100 + " AE/t"); diff --git a/src/main/java/appeng/client/gui/implementations/GuiWireless.java b/src/main/java/appeng/client/gui/implementations/GuiWireless.java index 6995e495ca2..71040e0dff2 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWireless.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWireless.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.InventoryPlayer; + +import org.lwjgl.input.Mouse; + import appeng.api.config.Settings; import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiImgButton; @@ -27,9 +24,6 @@ import appeng.core.localization.GuiText; import appeng.tile.networking.TileWireless; import appeng.util.Platform; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.input.Mouse; public class GuiWireless extends AEBaseGui { @@ -57,31 +51,40 @@ public void initGui() { super.initGui(); this.units = new GuiImgButton( - this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit()); + this.guiLeft - 18, + this.guiTop + 8, + Settings.POWER_UNITS, + AEConfig.instance.selectedPowerUnit()); this.buttonList.add(this.units); } @Override public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { this.fontRendererObj.drawString( - this.getGuiDisplayName(GuiText.Wireless.getLocal()), 8, 6, GuiColors.WirelessTitle.getColor()); + this.getGuiDisplayName(GuiText.Wireless.getLocal()), + 8, + 6, + GuiColors.WirelessTitle.getColor()); this.fontRendererObj.drawString( - GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, GuiColors.WirelessInventory.getColor()); + GuiText.inventory.getLocal(), + 8, + this.ySize - 96 + 3, + GuiColors.WirelessInventory.getColor()); final ContainerWireless cw = (ContainerWireless) this.inventorySlots; if (cw.getRange() > 0) { final String firstMessage = GuiText.Range.getLocal() + ": " + (cw.getRange() / 10.0) + " m"; - final String secondMessage = - GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong(cw.getDrain(), true); + final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + + Platform.formatPowerLong(cw.getDrain(), true); final int strWidth = Math.max( this.fontRendererObj.getStringWidth(firstMessage), this.fontRendererObj.getStringWidth(secondMessage)); final int cOffset = (this.xSize / 2) - (strWidth / 2); this.fontRendererObj.drawString(firstMessage, cOffset, 20, GuiColors.WirelessRange.getColor()); - this.fontRendererObj.drawString( - secondMessage, cOffset, 20 + 12, GuiColors.WirelessPowerUsageRate.getColor()); + this.fontRendererObj + .drawString(secondMessage, cOffset, 20 + 12, GuiColors.WirelessPowerUsageRate.getColor()); } } diff --git a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java index 5a9c23fec57..70255ab9349 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java +++ b/src/main/java/appeng/client/gui/implementations/GuiWirelessTerm.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.implementations; -import appeng.api.implementations.guiobjects.IPortableCell; import net.minecraft.entity.player.InventoryPlayer; +import appeng.api.implementations.guiobjects.IPortableCell; + public class GuiWirelessTerm extends GuiMEPortableCell { public GuiWirelessTerm(final InventoryPlayer inventoryPlayer, final IPortableCell te) { diff --git a/src/main/java/appeng/client/gui/widgets/GuiCraftingCPUTable.java b/src/main/java/appeng/client/gui/widgets/GuiCraftingCPUTable.java index 771ab1988bb..87f03512552 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiCraftingCPUTable.java +++ b/src/main/java/appeng/client/gui/widgets/GuiCraftingCPUTable.java @@ -1,5 +1,15 @@ package appeng.client.gui.widgets; +import java.io.IOException; +import java.text.NumberFormat; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + import appeng.api.storage.data.IAEItemStack; import appeng.client.gui.AEBaseGui; import appeng.container.implementations.ContainerCPUTable; @@ -10,15 +20,9 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketValueConfig; import appeng.util.ReadableNumberConverter; -import java.io.IOException; -import java.text.NumberFormat; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; public class GuiCraftingCPUTable { + private final AEBaseGui parent; private final ContainerCPUTable container; @@ -100,13 +104,17 @@ public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY, int guiLeft } parent.bindTexture("guis/cpu_selector.png"); parent.drawTexturedModalRect( - x, y, CPU_TABLE_SLOT_XOFF, CPU_TABLE_SLOT_YOFF, CPU_TABLE_SLOT_WIDTH, CPU_TABLE_SLOT_HEIGHT); + x, + y, + CPU_TABLE_SLOT_XOFF, + CPU_TABLE_SLOT_YOFF, + CPU_TABLE_SLOT_WIDTH, + CPU_TABLE_SLOT_HEIGHT); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); String name = cpu.getName(); if (name == null || name.isEmpty()) { - name = GuiText.CPUs.getLocal() + " #" - + NumberFormat.getInstance().format((cpu.getSerial())); + name = GuiText.CPUs.getLocal() + " #" + NumberFormat.getInstance().format((cpu.getSerial())); } if (name.length() > 12) { name = name.substring(0, 11) + ".."; @@ -269,8 +277,7 @@ public boolean handleMouseInput(int guiLeft, int guiTop) { public boolean hideItemPanelSlot(int x, int y, int w, int h) { x += CPU_TABLE_WIDTH; - boolean xInside = (x >= 0 && x < CPU_TABLE_SLOT_WIDTH + 9) - || (x + w >= 0 && x + w < CPU_TABLE_SLOT_WIDTH + 9) + boolean xInside = (x >= 0 && x < CPU_TABLE_SLOT_WIDTH + 9) || (x + w >= 0 && x + w < CPU_TABLE_SLOT_WIDTH + 9) || (x <= 0 && x + w >= CPU_TABLE_SLOT_WIDTH + 9); boolean yInside = (y >= 0 && y < 19 + CPU_TABLE_SLOTS * CPU_TABLE_SLOT_HEIGHT) || (y + h >= 0 && y + h < 19 + CPU_TABLE_SLOTS * CPU_TABLE_SLOT_HEIGHT) diff --git a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java index d150d164cdf..da18273efb0 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java @@ -1,35 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; -import appeng.api.config.*; -import appeng.client.texture.ExtraBlockTextures; -import appeng.core.localization.ButtonToolTips; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; +import appeng.api.config.*; +import appeng.client.texture.ExtraBlockTextures; +import appeng.core.localization.ButtonToolTips; + public class GuiImgButton extends GuiButton implements ITooltip { + private static final Pattern COMPILE = Pattern.compile("%s"); private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL); private static Map appearances; @@ -70,9 +66,17 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) { ButtonToolTips.Singularity); this.registerApp( - 16 * 9 + 1, Settings.ACCESS, AccessRestriction.READ, ButtonToolTips.IOMode, ButtonToolTips.Read); + 16 * 9 + 1, + Settings.ACCESS, + AccessRestriction.READ, + ButtonToolTips.IOMode, + ButtonToolTips.Read); this.registerApp( - 16 * 9, Settings.ACCESS, AccessRestriction.WRITE, ButtonToolTips.IOMode, ButtonToolTips.Write); + 16 * 9, + Settings.ACCESS, + AccessRestriction.WRITE, + ButtonToolTips.IOMode, + ButtonToolTips.Write); this.registerApp( 16 * 9 + 2, Settings.ACCESS, @@ -260,9 +264,17 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) { this.registerApp(64, Settings.SORT_BY, SortOrder.NAME, ButtonToolTips.SortBy, ButtonToolTips.ItemName); this.registerApp( - 65, Settings.SORT_BY, SortOrder.AMOUNT, ButtonToolTips.SortBy, ButtonToolTips.NumberOfItems); - this.registerApp( - 68, Settings.SORT_BY, SortOrder.INVTWEAKS, ButtonToolTips.SortBy, ButtonToolTips.InventoryTweaks); + 65, + Settings.SORT_BY, + SortOrder.AMOUNT, + ButtonToolTips.SortBy, + ButtonToolTips.NumberOfItems); + this.registerApp( + 68, + Settings.SORT_BY, + SortOrder.INVTWEAKS, + ButtonToolTips.SortBy, + ButtonToolTips.InventoryTweaks); this.registerApp(69, Settings.SORT_BY, SortOrder.MOD, ButtonToolTips.SortBy, ButtonToolTips.Mod); this.registerApp( @@ -272,11 +284,19 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) { ButtonToolTips.PartitionStorage, ButtonToolTips.PartitionStorageHint); this.registerApp( - 6, Settings.ACTIONS, ActionItems.CLOSE, ButtonToolTips.Clear, ButtonToolTips.ClearSettings); + 6, + Settings.ACTIONS, + ActionItems.CLOSE, + ButtonToolTips.Clear, + ButtonToolTips.ClearSettings); this.registerApp(6, Settings.ACTIONS, ActionItems.STASH, ButtonToolTips.Stash, ButtonToolTips.StashDesc); this.registerApp( - 8, Settings.ACTIONS, ActionItems.ENCODE, ButtonToolTips.Encode, ButtonToolTips.EncodeDescription); + 8, + Settings.ACTIONS, + ActionItems.ENCODE, + ButtonToolTips.Encode, + ButtonToolTips.EncodeDescription); this.registerApp( 4 + 3 * 16, Settings.ACTIONS, @@ -317,9 +337,17 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) { this.registerApp(16, Settings.VIEW_MODE, ViewItems.STORED, ButtonToolTips.View, ButtonToolTips.StoredItems); this.registerApp( - 18, Settings.VIEW_MODE, ViewItems.ALL, ButtonToolTips.View, ButtonToolTips.StoredCraftable); + 18, + Settings.VIEW_MODE, + ViewItems.ALL, + ButtonToolTips.View, + ButtonToolTips.StoredCraftable); this.registerApp( - 19, Settings.VIEW_MODE, ViewItems.CRAFTABLE, ButtonToolTips.View, ButtonToolTips.Craftable); + 19, + Settings.VIEW_MODE, + ViewItems.CRAFTABLE, + ButtonToolTips.View, + ButtonToolTips.Craftable); this.registerApp( 16 * 6, @@ -372,9 +400,17 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) { ButtonToolTips.MoveWhenFull); this.registerApp( - 16 + 5, Settings.BLOCK, YesNo.YES, ButtonToolTips.InterfaceBlockingMode, ButtonToolTips.Blocking); + 16 + 5, + Settings.BLOCK, + YesNo.YES, + ButtonToolTips.InterfaceBlockingMode, + ButtonToolTips.Blocking); this.registerApp( - 16 + 4, Settings.BLOCK, YesNo.NO, ButtonToolTips.InterfaceBlockingMode, ButtonToolTips.NonBlocking); + 16 + 4, + Settings.BLOCK, + YesNo.NO, + ButtonToolTips.InterfaceBlockingMode, + ButtonToolTips.NonBlocking); this.registerApp(16 + 3, Settings.CRAFT_ONLY, YesNo.YES, ButtonToolTips.Craft, ButtonToolTips.CraftOnly); this.registerApp(16 + 2, Settings.CRAFT_ONLY, YesNo.NO, ButtonToolTips.Craft, ButtonToolTips.CraftEither); @@ -534,11 +570,7 @@ public GuiImgButton(final int x, final int y, final Enum idx, final Enum val) { } } - private void registerApp( - final int iconIndex, - final Settings setting, - final Enum val, - final ButtonToolTips title, + private void registerApp(final int iconIndex, final Settings setting, final Enum val, final ButtonToolTips title, final Object hint) { final ButtonAppearance a = new ButtonAppearance(); a.displayName = title.getUnlocalized(); @@ -572,8 +604,7 @@ public void drawButton(final Minecraft par1Minecraft, final int par2, final int } par1Minecraft.renderEngine.bindTexture(ExtraBlockTextures.GuiTexture("guis/states.png")); - this.field_146123_n = par2 >= this.xPosition - && par3 >= this.yPosition + this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; @@ -593,8 +624,7 @@ public void drawButton(final Minecraft par1Minecraft, final int par2, final int } par1Minecraft.renderEngine.bindTexture(ExtraBlockTextures.GuiTexture("guis/states.png")); - this.field_146123_n = par2 >= this.xPosition - && par3 >= this.yPosition + this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; @@ -634,8 +664,8 @@ public String getMessage() { String displayValue = null; if (this.buttonSetting != null && this.currentValue != null) { - final ButtonAppearance buttonAppearance = - appearances.get(new EnumPair(this.buttonSetting, this.currentValue)); + final ButtonAppearance buttonAppearance = appearances + .get(new EnumPair(this.buttonSetting, this.currentValue)); if (buttonAppearance == null) { return "No Such Message"; } @@ -751,6 +781,7 @@ public boolean equals(final Object obj) { } private static class ButtonAppearance { + public int index; public String displayName; public String displayValue; diff --git a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java index 35e069c5cfe..8177be2322e 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java +++ b/src/main/java/appeng/client/gui/widgets/GuiNumberBox.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; @@ -25,12 +17,7 @@ public class GuiNumberBox extends GuiTextField { private final Class type; - public GuiNumberBox( - final FontRenderer fontRenderer, - final int x, - final int y, - final int width, - final int height, + public GuiNumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type) { super(fontRenderer, x, y, width, height); this.type = type; diff --git a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java index 3d1f491af2d..44fa162cdfd 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiProgressBar.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; -import appeng.container.interfaces.IProgressProvider; -import appeng.core.localization.GuiText; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; +import appeng.container.interfaces.IProgressProvider; +import appeng.core.localization.GuiText; + public class GuiProgressBar extends GuiButton implements ITooltip { private final IProgressProvider source; @@ -34,30 +27,13 @@ public class GuiProgressBar extends GuiButton implements ITooltip { private final String titleName; private String fullMsg; - public GuiProgressBar( - final IProgressProvider source, - final String texture, - final int posX, - final int posY, - final int u, - final int y, - final int width, - final int height, - final Direction dir) { + public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY, + final int u, final int y, final int width, final int height, final Direction dir) { this(source, texture, posX, posY, u, y, width, height, dir, null); } - public GuiProgressBar( - final IProgressProvider source, - final String texture, - final int posX, - final int posY, - final int u, - final int y, - final int width, - final int height, - final Direction dir, - final String title) { + public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY, + final int u, final int y, final int width, final int height, final Direction dir, final String title) { super(posX, posY, width, ""); this.source = source; this.xPosition = posX; @@ -112,8 +88,7 @@ public String getMessage() { return this.fullMsg; } - return (this.titleName != null ? this.titleName : "") - + '\n' + return (this.titleName != null ? this.titleName : "") + '\n' + this.source.getCurrentProgress() + ' ' + GuiText.Of.getLocal() diff --git a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java index 871d12b0ab0..3d85e05841e 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java +++ b/src/main/java/appeng/client/gui/widgets/GuiScrollbar.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; -import appeng.client.gui.AEBaseGui; import org.lwjgl.opengl.GL11; +import appeng.client.gui.AEBaseGui; + public class GuiScrollbar implements IScrollSource { + private String txtBase = "minecraft"; private String txtFile = "gui/container/creative_inventory/tabs.png"; private int txtShiftX = 232; @@ -122,8 +116,7 @@ public void setCurrentScroll(final int currentScroll) { } public boolean contains(final int x, final int y) { - return x >= this.displayX - && y >= this.displayY + return x >= this.displayX && y >= this.displayY && x <= this.displayX + this.width && y <= this.displayY + this.height; } diff --git a/src/main/java/appeng/client/gui/widgets/GuiTabButton.java b/src/main/java/appeng/client/gui/widgets/GuiTabButton.java index 241b2d166dc..7fce88d2947 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiTabButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiTabButton.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; -import appeng.client.texture.ExtraBlockTextures; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import appeng.client.texture.ExtraBlockTextures; + public class GuiTabButton extends GuiButton implements ITooltip { + private final RenderItem itemRenderer; private final String message; private int hideEdge = 0; @@ -72,8 +67,7 @@ public void drawButton(final Minecraft minecraft, final int x, final int y) { if (this.visible) { GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); minecraft.renderEngine.bindTexture(ExtraBlockTextures.GuiTexture("guis/states.png")); - this.field_146123_n = x >= this.xPosition - && y >= this.yPosition + this.field_146123_n = x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height; @@ -88,7 +82,12 @@ public void drawButton(final Minecraft minecraft, final int x, final int y) { uv_x = this.myIcon - uv_y * 16; this.drawTexturedModalRect( - offsetX + this.xPosition + 3, this.yPosition + 3, uv_x * 16, uv_y * 16, 16, 16); + offsetX + this.xPosition + 3, + this.yPosition + 3, + uv_x * 16, + uv_y * 16, + 16, + 16); } this.mouseDragged(minecraft, x, y); diff --git a/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java b/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java index 22ca0e3576b..3f1b6381907 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiToggleButton.java @@ -1,31 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; -import appeng.client.texture.ExtraBlockTextures; import java.util.regex.Pattern; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; +import appeng.client.texture.ExtraBlockTextures; + public class GuiToggleButton extends GuiButton implements ITooltip { + private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL); private final int iconIdxOn; private final int iconIdxOff; @@ -35,8 +31,8 @@ public class GuiToggleButton extends GuiButton implements ITooltip { private boolean isActive; - public GuiToggleButton( - final int x, final int y, final int on, final int off, final String displayName, final String displayHint) { + public GuiToggleButton(final int x, final int y, final int on, final int off, final String displayName, + final String displayHint) { super(0, 0, 16, ""); this.iconIdxOn = on; this.iconIdxOff = off; @@ -59,8 +55,7 @@ public void drawButton(final Minecraft par1Minecraft, final int par2, final int GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); par1Minecraft.renderEngine.bindTexture(ExtraBlockTextures.GuiTexture("guis/states.png")); - this.field_146123_n = par2 >= this.xPosition - && par3 >= this.yPosition + this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; diff --git a/src/main/java/appeng/client/gui/widgets/ICraftingCPUTableHolder.java b/src/main/java/appeng/client/gui/widgets/ICraftingCPUTableHolder.java index c51fa501cec..04c81ffa273 100644 --- a/src/main/java/appeng/client/gui/widgets/ICraftingCPUTableHolder.java +++ b/src/main/java/appeng/client/gui/widgets/ICraftingCPUTableHolder.java @@ -1,5 +1,6 @@ package appeng.client.gui.widgets; public interface ICraftingCPUTableHolder { + GuiCraftingCPUTable getCPUTable(); } diff --git a/src/main/java/appeng/client/gui/widgets/IScrollSource.java b/src/main/java/appeng/client/gui/widgets/IScrollSource.java index 8dc1ddf248c..49e757b56f6 100644 --- a/src/main/java/appeng/client/gui/widgets/IScrollSource.java +++ b/src/main/java/appeng/client/gui/widgets/IScrollSource.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; diff --git a/src/main/java/appeng/client/gui/widgets/ISortSource.java b/src/main/java/appeng/client/gui/widgets/ISortSource.java index 858adafd710..6b8468ba555 100644 --- a/src/main/java/appeng/client/gui/widgets/ISortSource.java +++ b/src/main/java/appeng/client/gui/widgets/ISortSource.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; diff --git a/src/main/java/appeng/client/gui/widgets/ITooltip.java b/src/main/java/appeng/client/gui/widgets/ITooltip.java index 73ef0821c0f..02bb2efd334 100644 --- a/src/main/java/appeng/client/gui/widgets/ITooltip.java +++ b/src/main/java/appeng/client/gui/widgets/ITooltip.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; diff --git a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java index 37bb9deb62b..d560c2bf932 100644 --- a/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java +++ b/src/main/java/appeng/client/gui/widgets/MEGuiTextField.java @@ -1,38 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.gui.widgets; -import appeng.core.localization.GuiColors; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiTextField; + import org.lwjgl.input.Keyboard; +import appeng.core.localization.GuiColors; + /** - * A modified version of the Minecraft text field. - * You can initialize it over the full element span. - * The mouse click area is increased to the full element - * subtracted with the defined padding. + * A modified version of the Minecraft text field. You can initialize it over the full element span. The mouse click + * area is increased to the full element subtracted with the defined padding. *

* The rendering does pay attention to the size of the '_' caret. */ public class MEGuiTextField implements ITooltip { + protected GuiTextField field; private static final int PADDING = 2; @@ -48,12 +41,11 @@ public class MEGuiTextField implements ITooltip { public int h; /** - * Uses the values to instantiate a padded version of a text field. - * Pays attention to the '_' caret. + * Uses the values to instantiate a padded version of a text field. Pays attention to the '_' caret. * - * @param width absolute width - * @param height absolute height - * @param tooltip tooltip message + * @param width absolute width + * @param height absolute height + * @param tooltip tooltip message */ public MEGuiTextField(final int width, final int height, final String tooltip) { final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; @@ -132,10 +124,8 @@ public boolean textboxKeyTyped(final char keyChar, final int keyID) { final String oldText = getText(); boolean handled = field.textboxKeyTyped(keyChar, keyID); - if (!handled - && (keyID == Keyboard.KEY_RETURN - || keyID == Keyboard.KEY_NUMPADENTER - || keyID == Keyboard.KEY_ESCAPE)) { + if (!handled && (keyID == Keyboard.KEY_RETURN || keyID == Keyboard.KEY_NUMPADENTER + || keyID == Keyboard.KEY_ESCAPE)) { setFocused(false); } diff --git a/src/main/java/appeng/client/me/ClientDCInternalInv.java b/src/main/java/appeng/client/me/ClientDCInternalInv.java index 25c74c75875..63cc7bcaf98 100644 --- a/src/main/java/appeng/client/me/ClientDCInternalInv.java +++ b/src/main/java/appeng/client/me/ClientDCInternalInv.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.me; -import appeng.tile.inventory.AppEngInternalInventory; -import appeng.util.ItemSorters; import javax.annotation.Nonnull; + import net.minecraft.util.StatCollector; +import appeng.tile.inventory.AppEngInternalInventory; +import appeng.util.ItemSorters; + public class ClientDCInternalInv implements Comparable { private final String unlocalizedName; diff --git a/src/main/java/appeng/client/me/InternalSlotME.java b/src/main/java/appeng/client/me/InternalSlotME.java index 74921e399e9..d0bd2a5f117 100644 --- a/src/main/java/appeng/client/me/InternalSlotME.java +++ b/src/main/java/appeng/client/me/InternalSlotME.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.me; -import appeng.api.storage.data.IAEItemStack; import net.minecraft.item.ItemStack; +import appeng.api.storage.data.IAEItemStack; + public class InternalSlotME { private final int offset; diff --git a/src/main/java/appeng/client/me/ItemRepo.java b/src/main/java/appeng/client/me/ItemRepo.java index 52f39bd0b6d..3640caad429 100644 --- a/src/main/java/appeng/client/me/ItemRepo.java +++ b/src/main/java/appeng/client/me/ItemRepo.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.me; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + +import javax.annotation.Nonnull; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.storage.data.IAEItemStack; @@ -32,14 +35,6 @@ import appeng.util.item.OreReference; import appeng.util.prioitylist.IPartitionList; import cpw.mods.fml.relauncher.ReflectionHelper; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.regex.Pattern; -import javax.annotation.Nonnull; -import net.minecraft.item.ItemStack; public class ItemRepo { @@ -114,8 +109,8 @@ public void updateView() { } this.innerSearch = this.searchString; - // final boolean terminalSearchToolTips = - // AEConfig.instance.settings.getSetting(Settings.SEARCH_TOOLTIPS) != YesNo.NO; + // final boolean terminalSearchToolTips = + // AEConfig.instance.settings.getSetting(Settings.SEARCH_TOOLTIPS) != YesNo.NO; // boolean terminalSearchMods = Configuration.INSTANCE.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO; final SearchMode searchWhat; if (this.innerSearch.length() == 0) { @@ -235,8 +230,8 @@ public void updateView() { private void updateNEI(final String filter) { try { if (this.NEIWord == null || !this.NEIWord.equals(filter)) { - final Class c = - ReflectionHelper.getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager"); + final Class c = ReflectionHelper + .getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager"); final Field fldSearchField = c.getField("searchField"); final Object searchField = fldSearchField.get(c); diff --git a/src/main/java/appeng/client/me/SlotDisconnected.java b/src/main/java/appeng/client/me/SlotDisconnected.java index 6dff4775f69..80ade924392 100644 --- a/src/main/java/appeng/client/me/SlotDisconnected.java +++ b/src/main/java/appeng/client/me/SlotDisconnected.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.me; -import appeng.container.slot.AppEngSlot; -import appeng.items.misc.ItemEncodedPattern; -import appeng.util.Platform; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import appeng.container.slot.AppEngSlot; +import appeng.items.misc.ItemEncodedPattern; +import appeng.util.Platform; + public class SlotDisconnected extends AppEngSlot { private final ClientDCInternalInv mySlot; diff --git a/src/main/java/appeng/client/me/SlotME.java b/src/main/java/appeng/client/me/SlotME.java index 0f6a3389c86..d498b44ada9 100644 --- a/src/main/java/appeng/client/me/SlotME.java +++ b/src/main/java/appeng/client/me/SlotME.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.me; -import appeng.api.storage.data.IAEItemStack; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import appeng.api.storage.data.IAEItemStack; + public class SlotME extends Slot { private final InternalSlotME mySlot; diff --git a/src/main/java/appeng/client/render/AppEngRenderItem.java b/src/main/java/appeng/client/render/AppEngRenderItem.java index 7b15d1d5a59..de6ee6c7e66 100644 --- a/src/main/java/appeng/client/render/AppEngRenderItem.java +++ b/src/main/java/appeng/client/render/AppEngRenderItem.java @@ -1,37 +1,32 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; -import appeng.api.storage.data.IAEItemStack; -import appeng.core.AEConfig; -import appeng.core.localization.GuiText; -import appeng.util.ISlimReadableNumberConverter; -import appeng.util.IWideReadableNumberConverter; -import appeng.util.ReadableNumberConverter; import javax.annotation.Nonnull; + import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.item.ItemStack; + import org.lwjgl.opengl.GL11; +import appeng.api.storage.data.IAEItemStack; +import appeng.core.AEConfig; +import appeng.core.localization.GuiText; +import appeng.util.ISlimReadableNumberConverter; +import appeng.util.IWideReadableNumberConverter; +import appeng.util.ReadableNumberConverter; + /** * @author AlgorithmX2 * @author thatsIch @@ -39,19 +34,15 @@ * @since rv0 */ public class AppEngRenderItem extends RenderItem { + private static final ISlimReadableNumberConverter SLIM_CONVERTER = ReadableNumberConverter.INSTANCE; private static final IWideReadableNumberConverter WIDE_CONVERTER = ReadableNumberConverter.INSTANCE; private IAEItemStack aeStack = null; @Override - public void renderItemOverlayIntoGUI( - final FontRenderer fontRenderer, - final TextureManager textureManager, - final ItemStack is, - final int par4, - final int par5, - final String par6Str) { + public void renderItemOverlayIntoGUI(final FontRenderer fontRenderer, final TextureManager textureManager, + final ItemStack is, final int par4, final int par5, final String par6Str) { if (is != null) { final float scaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f; final float inverseScaleFactor = 1.0f / scaleFactor; @@ -96,9 +87,9 @@ public void renderItemOverlayIntoGUI( GL11.glPushMatrix(); GL11.glScaled(scaleFactor, scaleFactor, scaleFactor); - final int X = (int) - (((float) par4 + offset + 16.0f - fontRenderer.getStringWidth(craftLabelText) * scaleFactor) - * inverseScaleFactor); + final int X = (int) (((float) par4 + offset + + 16.0f + - fontRenderer.getStringWidth(craftLabelText) * scaleFactor) * inverseScaleFactor); final int Y = (int) (((float) par5 + offset + 16.0f - 7.0f * scaleFactor) * inverseScaleFactor); fontRenderer.drawStringWithShadow(craftLabelText, X, Y, 16777215); @@ -117,9 +108,9 @@ public void renderItemOverlayIntoGUI( GL11.glPushMatrix(); GL11.glScaled(scaleFactor, scaleFactor, scaleFactor); - final int X = - (int) (((float) par4 + offset + 16.0f - fontRenderer.getStringWidth(stackSize) * scaleFactor) - * inverseScaleFactor); + final int X = (int) (((float) par4 + offset + + 16.0f + - fontRenderer.getStringWidth(stackSize) * scaleFactor) * inverseScaleFactor); final int Y = (int) (((float) par5 + offset + 16.0f - 7.0f * scaleFactor) * inverseScaleFactor); fontRenderer.drawStringWithShadow(stackSize, X, Y, 16777215); @@ -132,13 +123,8 @@ public void renderItemOverlayIntoGUI( } } - private void renderQuad( - final Tessellator par1Tessellator, - final int par2, - final int par3, - final int par4, - final int par5, - final int par6) { + private void renderQuad(final Tessellator par1Tessellator, final int par2, final int par3, final int par4, + final int par5, final int par6) { par1Tessellator.startDrawingQuads(); par1Tessellator.setColorOpaque_I(par6); par1Tessellator.addVertex(par2, par3, 0.0D); diff --git a/src/main/java/appeng/client/render/BaseBlockRender.java b/src/main/java/appeng/client/render/BaseBlockRender.java index 0cd82a89871..65ea216fcc1 100644 --- a/src/main/java/appeng/client/render/BaseBlockRender.java +++ b/src/main/java/appeng/client/render/BaseBlockRender.java @@ -1,33 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; -import appeng.api.util.IOrientable; -import appeng.block.AEBaseBlock; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.AEBaseTile; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.nio.FloatBuffer; import java.util.EnumSet; + import javax.annotation.Nullable; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderHelper; @@ -42,11 +29,21 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11; +import appeng.api.util.IOrientable; +import appeng.block.AEBaseBlock; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.AEBaseTile; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class BaseBlockRender { + private static final int ORIENTATION_BITS = 7; private static final int FLIP_H_BIT = 8; private static final int FLIP_V_BIT = 16; @@ -266,12 +263,8 @@ protected int adjustBrightness(final int v, final double d) { return this.renderDistance; } - public void renderInventory( - final B block, - final ItemStack item, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] data) { + public void renderInventory(final B block, final ItemStack item, final RenderBlocks renderer, + final ItemRenderType type, final Object[] data) { final Tessellator tess = Tessellator.instance; final BlockRenderInfo info = block.getRendererInstance(); @@ -302,13 +295,11 @@ public void renderInventory( info.setTemporaryRenderIcon(null); } - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } static int getOrientation(final ForgeDirection in, final ForgeDirection forward, final ForgeDirection up) { - if (in == null - || in == ForgeDirection.UNKNOWN // 1 + if (in == null || in == ForgeDirection.UNKNOWN // 1 || forward == null || forward == ForgeDirection.UNKNOWN // 2 || up == null @@ -323,13 +314,8 @@ static int getOrientation(final ForgeDirection in, final ForgeDirection forward, return ORIENTATION_MAP[a][b][c]; } - public void renderInvBlock( - final EnumSet sides, - final B block, - final ItemStack item, - final Tessellator tess, - final int color, - final RenderBlocks renderer) { + public void renderInvBlock(final EnumSet sides, final B block, final ItemStack item, + final Tessellator tess, final int color, final RenderBlocks renderer) { if (block == null) { return; } @@ -447,12 +433,7 @@ private IIcon firstNotNull(final IIcon... s) { return ExtraBlockTextures.getMissing(); } - public boolean renderInWorld( - final B block, - final IBlockAccess world, - final int x, - final int y, - final int z, + public boolean renderInWorld(final B block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer) { this.preRenderInWorld(block, world, x, y, z, renderer); @@ -463,12 +444,7 @@ public boolean renderInWorld( return o; } - public void preRenderInWorld( - final B block, - final IBlockAccess world, - final int x, - final int y, - final int z, + public void preRenderInWorld(final B block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer) { final BlockRenderInfo info = block.getRendererInstance(); @@ -478,26 +454,25 @@ public void preRenderInWorld( final ForgeDirection forward = te.getForward(); final ForgeDirection up = te.getUp(); - renderer.uvRotateBottom = - info.getTexture(ForgeDirection.DOWN).setFlip(getOrientation(ForgeDirection.DOWN, forward, up)); - renderer.uvRotateTop = - info.getTexture(ForgeDirection.UP).setFlip(getOrientation(ForgeDirection.UP, forward, up)); + renderer.uvRotateBottom = info.getTexture(ForgeDirection.DOWN) + .setFlip(getOrientation(ForgeDirection.DOWN, forward, up)); + renderer.uvRotateTop = info.getTexture(ForgeDirection.UP) + .setFlip(getOrientation(ForgeDirection.UP, forward, up)); - renderer.uvRotateEast = - info.getTexture(ForgeDirection.EAST).setFlip(getOrientation(ForgeDirection.EAST, forward, up)); - renderer.uvRotateWest = - info.getTexture(ForgeDirection.WEST).setFlip(getOrientation(ForgeDirection.WEST, forward, up)); + renderer.uvRotateEast = info.getTexture(ForgeDirection.EAST) + .setFlip(getOrientation(ForgeDirection.EAST, forward, up)); + renderer.uvRotateWest = info.getTexture(ForgeDirection.WEST) + .setFlip(getOrientation(ForgeDirection.WEST, forward, up)); - renderer.uvRotateNorth = - info.getTexture(ForgeDirection.NORTH).setFlip(getOrientation(ForgeDirection.NORTH, forward, up)); - renderer.uvRotateSouth = - info.getTexture(ForgeDirection.SOUTH).setFlip(getOrientation(ForgeDirection.SOUTH, forward, up)); + renderer.uvRotateNorth = info.getTexture(ForgeDirection.NORTH) + .setFlip(getOrientation(ForgeDirection.NORTH, forward, up)); + renderer.uvRotateSouth = info.getTexture(ForgeDirection.SOUTH) + .setFlip(getOrientation(ForgeDirection.SOUTH, forward, up)); } } public void postRenderInWorld(final RenderBlocks renderer) { - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } @Nullable @@ -505,22 +480,13 @@ public IOrientable getOrientable(final B block, final IBlockAccess w, final int return block.getOrientable(w, x, y, z); } - protected void setInvRenderBounds( - final RenderBlocks renderer, final int i, final int j, final int k, final int l, final int m, final int n) { + protected void setInvRenderBounds(final RenderBlocks renderer, final int i, final int j, final int k, final int l, + final int m, final int n) { renderer.setRenderBounds(i / 16.0, j / 16.0, k / 16.0, l / 16.0, m / 16.0, n / 16.0); } - protected void renderBlockBounds( - final RenderBlocks renderer, - double minX, - double minY, - double minZ, - double maxX, - double maxY, - double maxZ, - final ForgeDirection x, - final ForgeDirection y, - final ForgeDirection z) { + protected void renderBlockBounds(final RenderBlocks renderer, double minX, double minY, double minZ, double maxX, + double maxY, double maxZ, final ForgeDirection x, final ForgeDirection y, final ForgeDirection z) { minX /= 16.0; minY /= 16.0; minZ /= 16.0; @@ -560,15 +526,8 @@ protected void renderBlockBounds( } @SideOnly(Side.CLIENT) - protected void renderCutoutFace( - final B block, - final IIcon ico, - final int x, - final int y, - final int z, - final RenderBlocks renderer, - final ForgeDirection orientation, - final float edgeThickness) { + protected void renderCutoutFace(final B block, final IIcon ico, final int x, final int y, final int z, + final RenderBlocks renderer, final ForgeDirection orientation, final float edgeThickness) { final Tessellator tess = Tessellator.instance; double offsetX = 0.0; @@ -709,23 +668,9 @@ protected void renderCutoutFace( } @SideOnly(Side.CLIENT) - private void renderFace( - final Tessellator tess, - final double offsetX, - final double offsetY, - final double offsetZ, - final double ax, - final double ay, - final double az, - final double bx, - final double by, - final double bz, - final double ua, - final double ub, - final double va, - final double vb, - final IIcon ico, - final boolean flip) { + private void renderFace(final Tessellator tess, final double offsetX, final double offsetY, final double offsetZ, + final double ax, final double ay, final double az, final double bx, final double by, final double bz, + final double ua, final double ub, final double va, final double vb, final IIcon ico, final boolean flip) { if (flip) { tess.addVertexWithUV( offsetX + ax * ua + bx * va, @@ -780,14 +725,8 @@ private void renderFace( } @SideOnly(Side.CLIENT) - protected void renderFace( - final int x, - final int y, - final int z, - final B block, - final IIcon ico, - final RenderBlocks renderer, - final ForgeDirection orientation) { + protected void renderFace(final int x, final int y, final int z, final B block, final IIcon ico, + final RenderBlocks renderer, final ForgeDirection orientation) { switch (orientation) { case NORTH: renderer.renderFaceZNeg(block, x, y, z, ico); @@ -812,31 +751,24 @@ protected void renderFace( } } - public void selectFace( - final RenderBlocks renderer, - final ForgeDirection west, - final ForgeDirection up, - final ForgeDirection forward, - final int u1, - final int u2, - int v1, - int v2) { + public void selectFace(final RenderBlocks renderer, final ForgeDirection west, final ForgeDirection up, + final ForgeDirection forward, final int u1, final int u2, int v1, int v2) { v1 = 16 - v1; v2 = 16 - v2; - final double minX = - (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV(west.offsetX, u1) + this.mapFaceUV(up.offsetX, v1); - final double minY = - (forward.offsetY > 0 ? 1 : 0) + this.mapFaceUV(west.offsetY, u1) + this.mapFaceUV(up.offsetY, v1); - final double minZ = - (forward.offsetZ > 0 ? 1 : 0) + this.mapFaceUV(west.offsetZ, u1) + this.mapFaceUV(up.offsetZ, v1); + final double minX = (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV(west.offsetX, u1) + + this.mapFaceUV(up.offsetX, v1); + final double minY = (forward.offsetY > 0 ? 1 : 0) + this.mapFaceUV(west.offsetY, u1) + + this.mapFaceUV(up.offsetY, v1); + final double minZ = (forward.offsetZ > 0 ? 1 : 0) + this.mapFaceUV(west.offsetZ, u1) + + this.mapFaceUV(up.offsetZ, v1); - final double maxX = - (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV(west.offsetX, u2) + this.mapFaceUV(up.offsetX, v2); - final double maxY = - (forward.offsetY > 0 ? 1 : 0) + this.mapFaceUV(west.offsetY, u2) + this.mapFaceUV(up.offsetY, v2); - final double maxZ = - (forward.offsetZ > 0 ? 1 : 0) + this.mapFaceUV(west.offsetZ, u2) + this.mapFaceUV(up.offsetZ, v2); + final double maxX = (forward.offsetX > 0 ? 1 : 0) + this.mapFaceUV(west.offsetX, u2) + + this.mapFaceUV(up.offsetX, v2); + final double maxY = (forward.offsetY > 0 ? 1 : 0) + this.mapFaceUV(west.offsetY, u2) + + this.mapFaceUV(up.offsetY, v2); + final double maxZ = (forward.offsetZ > 0 ? 1 : 0) + this.mapFaceUV(west.offsetZ, u2) + + this.mapFaceUV(up.offsetZ, v2); renderer.renderMinX = Math.max(0.0, Math.min(minX, maxX) - (forward.offsetX != 0 ? 0 : 0.001)); renderer.renderMaxX = Math.min(1.0, Math.max(minX, maxX) + (forward.offsetX != 0 ? 0 : 0.001)); @@ -860,17 +792,9 @@ private double mapFaceUV(final int offset, final int uv) { return (16.0 - uv) / 16.0; } - public void renderTile( - final B block, - final T tile, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, - final RenderBlocks renderer) { - renderer.uvRotateBottom = renderer.uvRotateTop = - renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; + public void renderTile(final B block, final T tile, final Tessellator tess, final double x, final double y, + final double z, final float f, final RenderBlocks renderer) { + renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; final ForgeDirection up = ForgeDirection.UP; final ForgeDirection forward = ForgeDirection.SOUTH; @@ -898,12 +822,11 @@ public void renderTile( tess.setTranslation(0, 0, 0); RenderHelper.enableStandardItemLighting(); - renderer.uvRotateBottom = renderer.uvRotateTop = - renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; + renderer.uvRotateBottom = renderer.uvRotateTop = renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = 0; } - protected void applyTESRRotation( - final double x, final double y, final double z, ForgeDirection forward, ForgeDirection up) { + protected void applyTESRRotation(final double x, final double y, final double z, ForgeDirection forward, + ForgeDirection up) { if (forward != null && up != null) { if (forward == ForgeDirection.UNKNOWN) { forward = ForgeDirection.SOUTH; @@ -944,8 +867,12 @@ protected void applyTESRRotation( public void doRenderItem(final ItemStack itemstack, final TileEntity par1EntityItemFrame) { if (itemstack != null) { - final EntityItem entityitem = - new EntityItem(par1EntityItemFrame.getWorldObj(), 0.0D, 0.0D, 0.0D, itemstack); + final EntityItem entityitem = new EntityItem( + par1EntityItemFrame.getWorldObj(), + 0.0D, + 0.0D, + 0.0D, + itemstack); entityitem.getEntityItem().stackSize = 1; diff --git a/src/main/java/appeng/client/render/BlockPosHighlighter.java b/src/main/java/appeng/client/render/BlockPosHighlighter.java index e5527ee8fe1..01ca1748d0a 100644 --- a/src/main/java/appeng/client/render/BlockPosHighlighter.java +++ b/src/main/java/appeng/client/render/BlockPosHighlighter.java @@ -4,6 +4,7 @@ // taken from McJty's McJtyLib public class BlockPosHighlighter { + private static DimensionalCoord highlightedBlock; private static long expireHighlight; diff --git a/src/main/java/appeng/client/render/BlockRenderInfo.java b/src/main/java/appeng/client/render/BlockRenderInfo.java index 2089b195b2e..f6623f67fd2 100644 --- a/src/main/java/appeng/client/render/BlockRenderInfo.java +++ b/src/main/java/appeng/client/render/BlockRenderInfo.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.AEBaseBlock; import appeng.client.texture.FlippableIcon; import appeng.client.texture.TmpFlippableIcon; import appeng.tile.AEBaseTile; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; public class BlockRenderInfo { @@ -46,13 +39,8 @@ public BlockRenderInfo(final BaseBlockRender. + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; +import java.util.EnumSet; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.exceptions.MissingDefinition; import appeng.api.parts.IBoxProvider; @@ -29,20 +31,16 @@ import appeng.core.AEConfig; import appeng.core.features.AEFeature; import appeng.tile.AEBaseTile; + import com.google.common.base.Function; import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; @SideOnly(Side.CLIENT) public final class BusRenderHelper implements IPartRenderHelper { + public static final BusRenderHelper INSTANCE = new BusRenderHelper(); private static final int HEX_WHITE = 0xffffff; @@ -117,8 +115,7 @@ public double getBound(final ForgeDirection side) { } public void setRenderColor(final int color) { - for (final Block block : - AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet()) { + for (final Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet()) { final BlockCableBus cableBus = (BlockCableBus) block; cableBus.setRenderColor(color); } @@ -131,7 +128,7 @@ public void setOrientation(final ForgeDirection dx, final ForgeDirection dy, fin } public double[] getBounds() { - return new double[] {this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ}; + return new double[] { this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ }; } public void setBounds(final double[] bounds) { @@ -148,6 +145,7 @@ public void setBounds(final double[] bounds) { } private static class BoundBoxCalculator implements IPartCollisionHelper { + private final BusRenderHelper helper; private boolean started = false; @@ -164,13 +162,8 @@ public BoundBoxCalculator(final BusRenderHelper helper) { } @Override - public void addBox( - final double minX, - final double minY, - final double minZ, - final double maxX, - final double maxY, - final double maxZ) { + public void addBox(final double minX, final double minY, final double minZ, final double maxX, + final double maxY, final double maxZ) { if (this.started) { this.minX = Math.min(this.minX, (float) minX); this.minY = Math.min(this.minY, (float) minY); @@ -211,6 +204,7 @@ public boolean isBBCollision() { } private static final class BaseBlockTransformFunction implements Function { + @Nullable @Override public AEBaseBlock apply(final Block input) { @@ -244,12 +238,11 @@ public void normalRendering() { } @Override - public ISimplifiedBundle useSimplifiedRendering( - final int x, final int y, final int z, final IBoxProvider p, final ISimplifiedBundle sim) { + public ISimplifiedBundle useSimplifiedRendering(final int x, final int y, final int z, final IBoxProvider p, + final ISimplifiedBundle sim) { final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.getRenderer(); - if (sim != null - && this.maybeBlock.isPresent() + if (sim != null && this.maybeBlock.isPresent() && rbw.similarLighting(this.maybeBlock.get(), rbw.blockAccess, x, y, z, sim)) { rbw.populate(sim); rbw.setFaces(EnumSet.allOf(ForgeDirection.class)); @@ -294,7 +287,16 @@ public ISimplifiedBundle useSimplifiedRendering( this.setBounds(this.bbc.minX, this.bbc.minY, this.bbc.minZ, this.bbc.maxX, this.bbc.maxY, this.bbc.maxZ); this.bbr.renderBlockBounds( - rbw, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az); + rbw, + this.minX, + this.minY, + this.minZ, + this.maxX, + this.maxY, + this.maxZ, + this.ax, + this.ay, + this.az); for (final Block block : this.maybeBlock.asSet()) { rbw.renderStandardBlock(block, x, y, z); @@ -310,12 +312,7 @@ public ISimplifiedBundle useSimplifiedRendering( } @Override - public void setBounds( - final float minX, - final float minY, - final float minZ, - final float maxX, - final float maxY, + public void setBounds(final float minX, final float minY, final float minZ, final float maxX, final float maxY, final float maxZ) { this.minX = minX; this.minY = minY; @@ -338,12 +335,7 @@ public void setTexture(final IIcon ico) { } @Override - public void setTexture( - final IIcon down, - final IIcon up, - final IIcon north, - final IIcon south, - final IIcon west, + public void setTexture(final IIcon down, final IIcon up, final IIcon north, final IIcon south, final IIcon west, final IIcon east) { final IIcon[] list = new IIcon[6]; @@ -355,15 +347,13 @@ public void setTexture( list[5] = east; for (final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet()) { - baseBlock - .getRendererInstance() - .setTemporaryRenderIcons( - list[this.mapRotation(ForgeDirection.UP).ordinal()], - list[this.mapRotation(ForgeDirection.DOWN).ordinal()], - list[this.mapRotation(ForgeDirection.SOUTH).ordinal()], - list[this.mapRotation(ForgeDirection.NORTH).ordinal()], - list[this.mapRotation(ForgeDirection.EAST).ordinal()], - list[this.mapRotation(ForgeDirection.WEST).ordinal()]); + baseBlock.getRendererInstance().setTemporaryRenderIcons( + list[this.mapRotation(ForgeDirection.UP).ordinal()], + list[this.mapRotation(ForgeDirection.DOWN).ordinal()], + list[this.mapRotation(ForgeDirection.SOUTH).ordinal()], + list[this.mapRotation(ForgeDirection.NORTH).ordinal()], + list[this.mapRotation(ForgeDirection.EAST).ordinal()], + list[this.mapRotation(ForgeDirection.WEST).ordinal()]); } } @@ -422,7 +412,12 @@ public void renderInventoryBox(final RenderBlocks renderer) { for (final AEBaseBlock baseBlock : this.maybeBaseBlock.asSet()) { this.bbr.renderInvBlock( - EnumSet.allOf(ForgeDirection.class), baseBlock, null, Tessellator.instance, this.color, renderer); + EnumSet.allOf(ForgeDirection.class), + baseBlock, + null, + Tessellator.instance, + this.color, + renderer); } } @@ -448,8 +443,7 @@ public void renderBlock(final int x, final int y, final int z, final RenderBlock return; } - for (final Block multiPart : - AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet()) { + for (final Block multiPart : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet()) { final AEBaseBlock block = (AEBaseBlock) multiPart; final BlockRenderInfo info = block.getRendererInstance(); @@ -472,7 +466,15 @@ public void renderBlock(final int x, final int y, final int z, final RenderBlock .setFlip(BaseBlockRender.getOrientation(ForgeDirection.SOUTH, forward, up)); this.bbr.renderBlockBounds( - renderer, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, + renderer, + this.minX, + this.minY, + this.minZ, + this.maxX, + this.maxY, + this.maxZ, + this.ax, + this.ay, this.az); renderer.renderStandardBlock(block, x, y, z); @@ -481,8 +483,7 @@ public void renderBlock(final int x, final int y, final int z, final RenderBlock @Override public Block getBlock() { - for (final Block block : - AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet()) { + for (final Block block : AEApi.instance().definitions().blocks().multiPart().maybeBlock().asSet()) { return block; } @@ -491,7 +492,16 @@ public Block getBlock() { public void prepareBounds(final RenderBlocks renderer) { this.bbr.renderBlockBounds( - renderer, this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ, this.ax, this.ay, this.az); + renderer, + this.minX, + this.minY, + this.minZ, + this.maxX, + this.maxY, + this.maxZ, + this.ax, + this.ay, + this.az); } @Override @@ -511,14 +521,8 @@ public void renderBlockCurrentBounds(final int x, final int y, final int z, fina } @Override - public void renderFaceCutout( - final int x, - final int y, - final int z, - final IIcon ico, - ForgeDirection face, - final float edgeThickness, - final RenderBlocks renderer) { + public void renderFaceCutout(final int x, final int y, final int z, final IIcon ico, ForgeDirection face, + final float edgeThickness, final RenderBlocks renderer) { if (!this.renderThis()) { return; } @@ -554,8 +558,8 @@ public void renderFaceCutout( } @Override - public void renderFace( - final int x, final int y, final int z, final IIcon ico, ForgeDirection face, final RenderBlocks renderer) { + public void renderFace(final int x, final int y, final int z, final IIcon ico, ForgeDirection face, + final RenderBlocks renderer) { if (!this.renderThis()) { return; } diff --git a/src/main/java/appeng/client/render/BusRenderer.java b/src/main/java/appeng/client/render/BusRenderer.java index 94762bf0006..b58140a3980 100644 --- a/src/main/java/appeng/client/render/BusRenderer.java +++ b/src/main/java/appeng/client/render/BusRenderer.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.parts.IAlphaPassItem; import appeng.api.parts.IFacadePart; import appeng.api.parts.IPart; @@ -29,15 +34,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Nullable; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class BusRenderer implements IItemRenderer { @@ -52,8 +48,8 @@ public boolean handleRenderType(final ItemStack item, final ItemRenderType type) } @Override - public boolean shouldUseRenderHelper( - final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, + final ItemRendererHelper helper) { return true; } @@ -69,8 +65,7 @@ public void renderItem(final ItemRenderType type, final ItemStack item, final Ob GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_LIGHTING); - if (AEConfig.instance.isFeatureEnabled(AEFeature.AlphaPass) - && item.getItem() instanceof IAlphaPassItem + if (AEConfig.instance.isFeatureEnabled(AEFeature.AlphaPass) && item.getItem() instanceof IAlphaPassItem && ((IAlphaPassItem) item.getItem()).useAlphaPass(item)) { GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); @@ -110,8 +105,8 @@ public void renderItem(final ItemRenderType type, final ItemStack item, final Ob BusRenderHelper.INSTANCE.setOrientation(ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH); - this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = - this.getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0; + this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = this + .getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0; this.getRenderer().useInventoryTint = false; this.getRenderer().overrideBlockTexture = null; @@ -140,8 +135,8 @@ public void renderItem(final ItemRenderType type, final ItemStack item, final Ob } } - this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = - this.getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0; + this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = this + .getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0; GL11.glPopAttrib(); GL11.glPopMatrix(); diff --git a/src/main/java/appeng/client/render/CableRenderHelper.java b/src/main/java/appeng/client/render/CableRenderHelper.java index 53d89998990..c5699044171 100644 --- a/src/main/java/appeng/client/render/CableRenderHelper.java +++ b/src/main/java/appeng/client/render/CableRenderHelper.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; -import appeng.api.parts.IFacadeContainer; -import appeng.api.parts.IFacadePart; -import appeng.api.parts.IPart; -import appeng.parts.BusCollisionHelper; -import appeng.parts.CableBusContainer; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IFacadeContainer; +import appeng.api.parts.IFacadePart; +import appeng.api.parts.IPart; +import appeng.parts.BusCollisionHelper; +import appeng.parts.CableBusContainer; + public class CableRenderHelper { private static final CableRenderHelper INSTANCE = new CableRenderHelper(); @@ -58,8 +52,7 @@ public void renderStatic(final CableBusContainer cableBusContainer, final IFacad renderer.renderAllFaces = true; renderer.flipTexture = false; - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = - renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; part.renderStatic(te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer); @@ -81,7 +74,12 @@ public void renderStatic(final CableBusContainer cableBusContainer, final IFacad this.setSide(s); final BusRenderHelper brh = BusRenderHelper.INSTANCE; final BusCollisionHelper bch = new BusCollisionHelper( - boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true); + boxes, + brh.getWorldX(), + brh.getWorldY(), + brh.getWorldZ(), + null, + true); part.getBoxes(bch); } } @@ -127,8 +125,7 @@ public void renderStatic(final CableBusContainer cableBusContainer, final IFacad } renderer.flipTexture = false; - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = - renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; this.setSide(s); fPart.renderStatic( @@ -197,8 +194,8 @@ private void setSide(final ForgeDirection s) { BusRenderHelper.INSTANCE.setOrientation(ax, ay, az); } - public void renderDynamic( - final CableBusContainer cableBusContainer, final double x, final double y, final double z) { + public void renderDynamic(final CableBusContainer cableBusContainer, final double x, final double y, + final double z) { for (final ForgeDirection s : ForgeDirection.values()) { final IPart part = cableBusContainer.getPart(s); diff --git a/src/main/java/appeng/client/render/ItemRenderer.java b/src/main/java/appeng/client/render/ItemRenderer.java index e38449a761c..70799b8e588 100644 --- a/src/main/java/appeng/client/render/ItemRenderer.java +++ b/src/main/java/appeng/client/render/ItemRenderer.java @@ -1,25 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; public class ItemRenderer implements IItemRenderer { @@ -32,8 +25,8 @@ public boolean handleRenderType(final ItemStack item, final ItemRenderType type) } @Override - public boolean shouldUseRenderHelper( - final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, + final ItemRendererHelper helper) { return true; } diff --git a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java index ee52c81dabb..419e15bd31b 100644 --- a/src/main/java/appeng/client/render/RenderBlocksWorkaround.java +++ b/src/main/java/appeng/client/render/RenderBlocksWorkaround.java @@ -1,31 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; -import appeng.api.parts.ISimplifiedBundle; -import appeng.core.AELog; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.lang.reflect.Field; import java.util.Arrays; import java.util.EnumSet; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -33,6 +22,11 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.ISimplifiedBundle; +import appeng.core.AELog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class RenderBlocksWorkaround extends RenderBlocks { @@ -80,17 +74,11 @@ private int getCurrentBrightness() { } void setTexture(final IIcon ico) { - this.lightState.rXPos = this.lightState.rXNeg = - this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico; + this.lightState.rXPos = this.lightState.rXNeg = this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico; } - public void setTexture( - final IIcon rYNeg, - final IIcon rYPos, - final IIcon rZNeg, - final IIcon rZPos, - final IIcon rXNeg, - final IIcon rXPos) { + public void setTexture(final IIcon rYNeg, final IIcon rYPos, final IIcon rZNeg, final IIcon rZPos, + final IIcon rXNeg, final IIcon rXPos) { this.lightState.rXPos = rXPos; this.lightState.rXNeg = rXNeg; this.lightState.rYPos = rYPos; @@ -107,8 +95,7 @@ private boolean renderStandardBlockNoCalculations(final Block b, final int x, fi x, y, z, - this.isUseTextures() - ? this.lightState.rXPos + this.isUseTextures() ? this.lightState.rXPos : this.getBlockIcon(b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal())); Tessellator.instance.setBrightness(this.lightState.bXNeg); @@ -118,8 +105,7 @@ private boolean renderStandardBlockNoCalculations(final Block b, final int x, fi x, y, z, - this.isUseTextures() - ? this.lightState.rXNeg + this.isUseTextures() ? this.lightState.rXNeg : this.getBlockIcon(b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal())); Tessellator.instance.setBrightness(this.lightState.bYPos); @@ -129,8 +115,7 @@ private boolean renderStandardBlockNoCalculations(final Block b, final int x, fi x, y, z, - this.isUseTextures() - ? this.lightState.rYPos + this.isUseTextures() ? this.lightState.rYPos : this.getBlockIcon(b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal())); Tessellator.instance.setBrightness(this.lightState.bYNeg); @@ -140,8 +125,7 @@ private boolean renderStandardBlockNoCalculations(final Block b, final int x, fi x, y, z, - this.isUseTextures() - ? this.lightState.rYNeg + this.isUseTextures() ? this.lightState.rYNeg : this.getBlockIcon(b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal())); Tessellator.instance.setBrightness(this.lightState.bZPos); @@ -151,8 +135,7 @@ private boolean renderStandardBlockNoCalculations(final Block b, final int x, fi x, y, z, - this.isUseTextures() - ? this.lightState.rZPos + this.isUseTextures() ? this.lightState.rZPos : this.getBlockIcon(b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal())); Tessellator.instance.setBrightness(this.lightState.bZNeg); @@ -162,8 +145,7 @@ private boolean renderStandardBlockNoCalculations(final Block b, final int x, fi x, y, z, - this.isUseTextures() - ? this.lightState.rZNeg + this.isUseTextures() ? this.lightState.rZNeg : this.getBlockIcon(b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal())); return true; @@ -231,8 +213,8 @@ public boolean renderStandardBlock(final Block blk, final int x, final int y, fi } @Override - public void renderFaceYNeg( - final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon) { + public void renderFaceYNeg(final Block par1Block, final double par2, final double par4, final double par6, + final IIcon par8Icon) { if (this.getFaces().contains(ForgeDirection.DOWN)) { if (!this.getRenderFaces().contains(ForgeDirection.DOWN)) { return; @@ -279,8 +261,8 @@ public void renderFaceYNeg( } @Override - public void renderFaceYPos( - final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon) { + public void renderFaceYPos(final Block par1Block, final double par2, final double par4, final double par6, + final IIcon par8Icon) { if (this.getFaces().contains(ForgeDirection.UP)) { if (!this.getRenderFaces().contains(ForgeDirection.UP)) { return; @@ -327,8 +309,8 @@ public void renderFaceYPos( } @Override - public void renderFaceZNeg( - final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon) { + public void renderFaceZNeg(final Block par1Block, final double par2, final double par4, final double par6, + final IIcon par8Icon) { if (this.getFaces().contains(ForgeDirection.NORTH)) { if (!this.getRenderFaces().contains(ForgeDirection.NORTH)) { return; @@ -375,8 +357,8 @@ public void renderFaceZNeg( } @Override - public void renderFaceZPos( - final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon) { + public void renderFaceZPos(final Block par1Block, final double par2, final double par4, final double par6, + final IIcon par8Icon) { if (this.getFaces().contains(ForgeDirection.SOUTH)) { if (!this.getRenderFaces().contains(ForgeDirection.SOUTH)) { return; @@ -423,8 +405,8 @@ public void renderFaceZPos( } @Override - public void renderFaceXNeg( - final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon) { + public void renderFaceXNeg(final Block par1Block, final double par2, final double par4, final double par6, + final IIcon par8Icon) { if (this.getFaces().contains(ForgeDirection.WEST)) { if (!this.getRenderFaces().contains(ForgeDirection.WEST)) { return; @@ -471,8 +453,8 @@ public void renderFaceXNeg( } @Override - public void renderFaceXPos( - final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon) { + public void renderFaceXPos(final Block par1Block, final double par2, final double par4, final double par6, + final IIcon par8Icon) { if (this.getFaces().contains(ForgeDirection.EAST)) { if (!this.getRenderFaces().contains(ForgeDirection.EAST)) { return; @@ -531,10 +513,10 @@ private void partialLightingColoring(final double u, final double v) { final double bB = this.colorBlueBottomLeft * u + (1.0 - u) * this.colorBlueBottomRight; final float b = (float) (bA * v + bB * (1.0 - v)); - final double highA = - (this.brightnessTopLeft >> 16 & 255) * u + (1.0 - u) * (this.brightnessTopRight >> 16 & 255); - final double highB = - (this.brightnessBottomLeft >> 16 & 255) * u + (1.0 - u) * (this.brightnessBottomRight >> 16 & 255); + final double highA = (this.brightnessTopLeft >> 16 & 255) * u + + (1.0 - u) * (this.brightnessTopRight >> 16 & 255); + final double highB = (this.brightnessBottomLeft >> 16 & 255) * u + + (1.0 - u) * (this.brightnessBottomRight >> 16 & 255); final int high = ((int) (highA * v + highB * (1.0 - v))) & 255; final double lowA = ((this.brightnessTopLeft & 255)) * u + (1.0 - u) * ((this.brightnessTopRight & 255)); @@ -547,8 +529,8 @@ private void partialLightingColoring(final double u, final double v) { Tessellator.instance.setBrightness(out); } - public boolean similarLighting( - final Block blk, final IBlockAccess w, final int x, final int y, final int z, final ISimplifiedBundle sim) { + public boolean similarLighting(final Block blk, final IBlockAccess w, final int x, final int y, final int z, + final ISimplifiedBundle sim) { final int lh = this.getLightingHash(blk, w, x, y, z); return ((LightingCache) sim).lightHash == lh; } @@ -626,6 +608,7 @@ void setRenderFaces(final EnumSet renderFaces) { } private static class LightingCache implements ISimplifiedBundle { + public final int[] aoXPos; public final int[] aoXNeg; public final int[] aoYPos; diff --git a/src/main/java/appeng/client/render/SpatialSkyRender.java b/src/main/java/appeng/client/render/SpatialSkyRender.java index a4683f58abb..097a87fce33 100644 --- a/src/main/java/appeng/client/render/SpatialSkyRender.java +++ b/src/main/java/appeng/client/render/SpatialSkyRender.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; import java.util.Random; + import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.renderer.GLAllocation; @@ -26,6 +19,7 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraftforge.client.IRenderHandler; + import org.lwjgl.opengl.GL11; public class SpatialSkyRender extends IRenderHandler { diff --git a/src/main/java/appeng/client/render/TESRWrapper.java b/src/main/java/appeng/client/render/TESRWrapper.java index 1be13e73fae..51e2c1b9891 100644 --- a/src/main/java/appeng/client/render/TESRWrapper.java +++ b/src/main/java/appeng/client/render/TESRWrapper.java @@ -1,35 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; -import appeng.block.AEBaseBlock; -import appeng.core.AELog; -import appeng.tile.AEBaseTile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; + import org.lwjgl.opengl.GL11; +import appeng.block.AEBaseBlock; +import appeng.core.AELog; +import appeng.tile.AEBaseTile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class TESRWrapper extends TileEntitySpecialRenderer { @@ -44,14 +38,13 @@ public TESRWrapper(final BaseBlockRender render) { } @Override - public final void renderTileEntityAt( - final TileEntity te, final double x, final double y, final double z, final float f) { + public final void renderTileEntityAt(final TileEntity te, final double x, final double y, final double z, + final float f) { if (te instanceof AEBaseTile) { final Block b = te.getBlockType(); if (b instanceof AEBaseBlock && ((AEBaseTile) te).requiresTESR()) { - if (Math.abs(x) > this.maxDistance - || Math.abs(y) > this.maxDistance + if (Math.abs(x) > this.maxDistance || Math.abs(y) > this.maxDistance || Math.abs(z) > this.maxDistance) { return; } @@ -62,8 +55,8 @@ public final void renderTileEntityAt( GL11.glPushMatrix(); this.renderBlocksInstance.blockAccess = te.getWorldObj(); - this.blkRender.renderTile( - (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, this.renderBlocksInstance); + this.blkRender + .renderTile((AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, this.renderBlocksInstance); GL11.glPopMatrix(); } catch (final Throwable t) { diff --git a/src/main/java/appeng/client/render/WorldRender.java b/src/main/java/appeng/client/render/WorldRender.java index e4f881865ee..df74da4430e 100644 --- a/src/main/java/appeng/client/render/WorldRender.java +++ b/src/main/java/appeng/client/render/WorldRender.java @@ -1,37 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render; -import appeng.block.AEBaseBlock; -import appeng.core.AELog; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.HashMap; import java.util.Map; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import appeng.block.AEBaseBlock; +import appeng.core.AELog; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public final class WorldRender implements ISimpleBlockRenderingHandler { @@ -48,20 +42,14 @@ void setRender(final AEBaseBlock in, final BaseBlockRender r) { } @Override - public void renderInventoryBlock( - final Block block, final int metadata, final int modelID, final RenderBlocks renderer) { + public void renderInventoryBlock(final Block block, final int metadata, final int modelID, + final RenderBlocks renderer) { // wtf is this for? } @Override - public boolean renderWorldBlock( - final IBlockAccess world, - final int x, - final int y, - final int z, - final Block block, - final int modelId, - final RenderBlocks renderer) { + public boolean renderWorldBlock(final IBlockAccess world, final int x, final int y, final int z, final Block block, + final int modelId, final RenderBlocks renderer) { final AEBaseBlock blk = (AEBaseBlock) block; renderer.setRenderBoundsFromBlock(block); return this.getRender(blk).renderInWorld(blk, world, x, y, z, renderer); @@ -87,11 +75,9 @@ void renderItemBlock(final ItemStack item, final ItemRenderType type, final Obje final AEBaseBlock block = (AEBaseBlock) blk; this.renderer.setRenderBoundsFromBlock(block); - this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = - this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; + this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; this.getRender(block).renderInventory(block, item, this.renderer, type, data); - this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = - this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; + this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0; } else { if (!this.hasError) { this.hasError = true; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java index 440032b0e7e..fd31357197a 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockAssembler.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridHost; import appeng.api.parts.IBoxProvider; import appeng.api.parts.IPart; @@ -33,15 +36,6 @@ import appeng.parts.networking.PartCable; import appeng.tile.crafting.TileMolecularAssembler; import appeng.util.Platform; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.IItemRenderer.ItemRenderType; -import net.minecraftforge.common.util.ForgeDirection; public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvider { @@ -51,12 +45,8 @@ public RenderBlockAssembler() { } @Override - public void renderInventory( - final BlockMolecularAssembler blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockMolecularAssembler blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.setOverrideBlockTexture(blk.getIcon(0, 0)); this.setInvRenderBounds(renderer, 2, 14, 0, 14, 16, 2); @@ -102,21 +92,26 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockMolecularAssembler maBlock, - final IBlockAccess world, - final int x, - final int y, - final int z, - RenderBlocks renderer) { + public boolean renderInWorld(final BlockMolecularAssembler maBlock, final IBlockAccess world, final int x, + final int y, final int z, RenderBlocks renderer) { final TileMolecularAssembler tma = maBlock.getTileEntity(world, x, y, z); if (BlockMolecularAssembler.isBooleanAlphaPass()) { if (tma.isPowered()) { this.renderBlockBounds( - renderer, 1, 1, 1, 15, 15, 15, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.SOUTH); - final TaughtIcon lights = - new TaughtIcon(ExtraBlockTextures.BlockMolecularAssemblerLights.getIcon(), -2.0f); + renderer, + 1, + 1, + 1, + 15, + 15, + 15, + ForgeDirection.WEST, + ForgeDirection.UP, + ForgeDirection.SOUTH); + final TaughtIcon lights = new TaughtIcon( + ExtraBlockTextures.BlockMolecularAssemblerLights.getIcon(), + -2.0f); Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.3f); Tessellator.instance.setBrightness(14 << 20 | 14 << 4); renderer.renderFaceXNeg(maBlock, x, y, z, lights); @@ -203,15 +198,8 @@ public boolean renderInWorld( return true; } - private void renderCableAt( - final double thickness, - final IBlockAccess world, - final int x, - final int y, - final int z, - final BlockMolecularAssembler block, - final RenderBlocks renderer, - final double pull, + private void renderCableAt(final double thickness, final IBlockAccess world, final int x, final int y, final int z, + final BlockMolecularAssembler block, final RenderBlocks renderer, final double pull, final boolean covered) { IIcon texture = null; @@ -296,13 +284,8 @@ private void renderCableAt( block.getRendererInstance().setTemporaryRenderIcon(null); } - private IIcon getConnectedCable( - final IBlockAccess world, - final int x, - final int y, - final int z, - final ForgeDirection side, - final boolean covered) { + private IIcon getConnectedCable(final IBlockAccess world, final int x, final int y, final int z, + final ForgeDirection side, final boolean covered) { final int tileYPos = y + side.offsetY; if (-1 < tileYPos && tileYPos < 256) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java b/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java index 511b6bb0630..88a94953745 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCharger.java @@ -1,31 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.util.IOrientable; -import appeng.block.misc.BlockCharger; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.core.AELog; -import appeng.tile.misc.TileCharger; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderBlocks; @@ -34,9 +20,18 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import appeng.api.util.IOrientable; +import appeng.block.misc.BlockCharger; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.core.AELog; +import appeng.tile.misc.TileCharger; +import appeng.util.Platform; + public class RenderBlockCharger extends BaseBlockRender { public RenderBlockCharger() { @@ -44,12 +39,8 @@ public RenderBlockCharger() { } @Override - public void renderInventory( - final BlockCharger blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockCharger blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { final Tessellator tess = Tessellator.instance; renderer.renderAllFaces = true; @@ -81,13 +72,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockCharger block, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockCharger block, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { this.preRenderInWorld(block, world, x, y, z, renderer); final IOrientable te = this.getOrientable(block, world, x, y, z); @@ -128,15 +114,8 @@ public boolean renderInWorld( } @Override - public void renderTile( - final BlockCharger block, - final TileCharger tile, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, - final RenderBlocks renderer) { + public void renderTile(final BlockCharger block, final TileCharger tile, final Tessellator tess, final double x, + final double y, final double z, final float f, final RenderBlocks renderer) { if (tile == null) { return; } diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockController.java b/src/main/java/appeng/client/render/blocks/RenderBlockController.java index 1c115017ed5..86d1debbb09 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockController.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockController.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.networking.BlockController; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.networking.TileController; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; +import appeng.block.networking.BlockController; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.networking.TileController; + public class RenderBlockController extends BaseBlockRender { public RenderBlockController() { @@ -34,13 +27,8 @@ public RenderBlockController() { } @Override - public boolean renderInWorld( - final BlockController blk, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockController blk, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final boolean xx = this.getTileEntity(world, x - 1, y, z) instanceof TileController && this.getTileEntity(world, x + 1, y, z) instanceof TileController; @@ -106,8 +94,7 @@ public boolean renderInWorld( } else if ((xx ? 1 : 0) + (yy ? 1 : 0) + (zz ? 1 : 0) >= 2) { final int v = (Math.abs(x) + Math.abs(y) + Math.abs(z)) % 2; - renderer.uvRotateEast = renderer.uvRotateBottom = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateEast = renderer.uvRotateBottom = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; if (v == 0) { blk.getRendererInstance().setTemporaryRenderIcon(ExtraBlockTextures.BlockControllerInsideA.getIcon()); @@ -142,8 +129,7 @@ public boolean renderInWorld( } blk.getRendererInstance().setTemporaryRenderIcon(null); - renderer.uvRotateEast = renderer.uvRotateBottom = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateEast = renderer.uvRotateBottom = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; return out; } diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index bdfe2e8ada6..53d225de599 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.util.AEColor; import appeng.block.crafting.BlockCraftingMonitor; @@ -28,14 +30,6 @@ import appeng.client.texture.ExtraBlockTextures; import appeng.tile.crafting.TileCraftingMonitorTile; import appeng.tile.crafting.TileCraftingTile; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; public class RenderBlockCraftingCPU extends BaseBlockRender { @@ -49,8 +43,8 @@ public RenderBlockCraftingCPU() { } @Override - public boolean renderInWorld( - final B blk, final IBlockAccess w, final int x, final int y, final int z, RenderBlocks renderer) { + public boolean renderInWorld(final B blk, final IBlockAccess w, final int x, final int y, final int z, + RenderBlocks renderer) { final TileCraftingTile craftingTile = blk.getTileEntity(w, x, y, z); if (craftingTile == null) { @@ -65,11 +59,7 @@ public boolean renderInWorld( IIcon nonForward = theIcon; if (isMonitor) { - for (final Block craftingBlock : AEApi.instance() - .definitions() - .blocks() - .craftingUnit() - .maybeBlock() + for (final Block craftingBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock() .asSet()) { nonForward = craftingBlock.getIcon(0, meta | (formed ? 8 : 0)); } @@ -153,8 +143,8 @@ public boolean renderInWorld( } } - private boolean isConnected( - final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side) { + private boolean isConnected(final IBlockAccess w, final int x, final int y, final int z, + final ForgeDirection side) { final int tileYPos = y + side.offsetY; if (0 <= tileYPos && tileYPos <= 255) { @@ -166,18 +156,9 @@ private boolean isConnected( } } - private void renderCorner( - final BusRenderHelper i, - final RenderBlocks renderer, - final IBlockAccess w, - final int x, - final int y, - final int z, - final ForgeDirection up, - final ForgeDirection east, - final ForgeDirection south) { - if (this.isConnected(w, x, y, z, up) - || this.isConnected(w, x, y, z, east) + private void renderCorner(final BusRenderHelper i, final RenderBlocks renderer, final IBlockAccess w, final int x, + final int y, final int z, final ForgeDirection up, final ForgeDirection east, final ForgeDirection south) { + if (this.isConnected(w, x, y, z, up) || this.isConnected(w, x, y, z, east) || this.isConnected(w, x, y, z, south)) { return; } @@ -204,19 +185,9 @@ private float fso(final ForgeDirection side, final float def, final ForgeDirecti return def; } - private void handleSide( - final B blk, - final int meta, - final int x, - final int y, - final int z, - final BusRenderHelper i, - final RenderBlocks renderer, - final IIcon color, - final boolean emitsLight, - final boolean isMonitor, - final ForgeDirection side, - final IBlockAccess w) { + private void handleSide(final B blk, final int meta, final int x, final int y, final int z, final BusRenderHelper i, + final RenderBlocks renderer, final IIcon color, final boolean emitsLight, final boolean isMonitor, + final ForgeDirection side, final IBlockAccess w) { if (this.isConnected(w, x, y, z, side)) { return; } @@ -241,7 +212,10 @@ private void handleSide( if (!emitsLight) { if (color == ExtraBlockTextures.BlockCraftingMonitorFit_Light.getIcon()) { final int b = w.getLightBrightnessForSkyBlocks( - x + side.offsetX, y + side.offsetY, z + side.offsetZ, 0); + x + side.offsetX, + y + side.offsetY, + z + side.offsetZ, + 0); final TileCraftingMonitorTile sr = blk.getTileEntity(w, x, y, z); final AEColor col = sr.getColor(); @@ -252,11 +226,21 @@ private void handleSide( Tessellator.instance.setColorOpaque_I(col.mediumVariant); i.renderFace( - x, y, z, ExtraBlockTextures.BlockCraftingMonitorFit_Medium.getIcon(), side, renderer); + x, + y, + z, + ExtraBlockTextures.BlockCraftingMonitorFit_Medium.getIcon(), + side, + renderer); Tessellator.instance.setColorOpaque_I(col.blackVariant); i.renderFace( - x, y, z, ExtraBlockTextures.BlockCraftingMonitorFit_Dark.getIcon(), side, renderer); + x, + y, + z, + ExtraBlockTextures.BlockCraftingMonitorFit_Dark.getIcon(), + side, + renderer); } else { i.renderBlockCurrentBounds(x, y, z, renderer); } @@ -272,12 +256,22 @@ private void handleSide( Tessellator.instance.setColorOpaque_I(col.mediumVariant); Tessellator.instance.setBrightness(13 << 20 | 13 << 4); i.renderFace( - x, y, z, ExtraBlockTextures.BlockCraftingMonitorFit_Medium.getIcon(), side, renderer); + x, + y, + z, + ExtraBlockTextures.BlockCraftingMonitorFit_Medium.getIcon(), + side, + renderer); Tessellator.instance.setColorOpaque_I(col.blackVariant); Tessellator.instance.setBrightness(13 << 20 | 13 << 4); i.renderFace( - x, y, z, ExtraBlockTextures.BlockCraftingMonitorFit_Dark.getIcon(), side, renderer); + x, + y, + z, + ExtraBlockTextures.BlockCraftingMonitorFit_Dark.getIcon(), + side, + renderer); } else { Tessellator.instance.setColorOpaque_F(1.0f, 1.0f, 1.0f); Tessellator.instance.setBrightness(13 << 20 | 13 << 4); @@ -292,11 +286,9 @@ private void handleSide( continue; } - if ((side.offsetX != 0 || side.offsetZ != 0) - && (a == ForgeDirection.NORTH - || a == ForgeDirection.EAST - || a == ForgeDirection.WEST - || a == ForgeDirection.SOUTH)) { + if ((side.offsetX != 0 || side.offsetZ != 0) && (a == ForgeDirection.NORTH || a == ForgeDirection.EAST + || a == ForgeDirection.WEST + || a == ForgeDirection.SOUTH)) { i.setTexture(ExtraBlockTextures.BlockCraftingUnitRingLongRotated.getIcon()); } else if ((side.offsetY != 0) && (a == ForgeDirection.EAST || a == ForgeDirection.WEST)) { i.setTexture(ExtraBlockTextures.BlockCraftingUnitRingLongRotated.getIcon()); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java index 29452a540e2..05e11e67fab 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPUMonitor.java @@ -1,31 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.storage.data.IAEItemStack; -import appeng.block.crafting.BlockCraftingMonitor; -import appeng.client.ClientHelper; -import appeng.core.AELog; -import appeng.tile.crafting.TileCraftingMonitorTile; -import appeng.util.IWideReadableNumberConverter; -import appeng.util.Platform; -import appeng.util.ReadableNumberConverter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GLAllocation; @@ -34,9 +18,19 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import appeng.api.storage.data.IAEItemStack; +import appeng.block.crafting.BlockCraftingMonitor; +import appeng.client.ClientHelper; +import appeng.core.AELog; +import appeng.tile.crafting.TileCraftingMonitorTile; +import appeng.util.IWideReadableNumberConverter; +import appeng.util.Platform; +import appeng.util.ReadableNumberConverter; + /** * @author AlgorithmX2 * @author thatsIch @@ -45,6 +39,7 @@ */ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU { + private static final IWideReadableNumberConverter NUMBER_CONVERTER = ReadableNumberConverter.INSTANCE; public RenderBlockCraftingCPUMonitor() { @@ -52,15 +47,8 @@ public RenderBlockCraftingCPUMonitor() { } @Override - public void renderTile( - final BlockCraftingMonitor block, - final TileCraftingMonitorTile tile, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, - final RenderBlocks renderer) { + public void renderTile(final BlockCraftingMonitor block, final TileCraftingMonitorTile tile, final Tessellator tess, + final double x, final double y, final double z, final float f, final RenderBlocks renderer) { if (tile != null) { final IAEItemStack ais = tile.getJobProgress(); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java b/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java index 62697e3900c..9a873978d90 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCrank.java @@ -1,26 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.grindstone.BlockCrank; -import appeng.client.render.BaseBlockRender; -import appeng.tile.grindstone.TileCrank; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderHelper; @@ -30,8 +19,13 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import appeng.block.grindstone.BlockCrank; +import appeng.client.render.BaseBlockRender; +import appeng.tile.grindstone.TileCrank; + public class RenderBlockCrank extends BaseBlockRender { public RenderBlockCrank() { @@ -39,12 +33,8 @@ public RenderBlockCrank() { } @Override - public void renderInventory( - final BlockCrank blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockCrank blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.renderAllFaces = true; renderer.setRenderBounds(0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.3, 0.5D + 0.05); @@ -57,26 +47,14 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockCrank imb, - final IBlockAccess world, - final int x, - final int y, - final int z, + public boolean renderInWorld(final BlockCrank imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer) { return true; } @Override - public void renderTile( - final BlockCrank blk, - final TileCrank tile, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, - final RenderBlocks renderBlocks) { + public void renderTile(final BlockCrank blk, final TileCrank tile, final Tessellator tess, final double x, + final double y, final double z, final float f, final RenderBlocks renderBlocks) { if (tile.getUp() == null || tile.getUp() == ForgeDirection.UNKNOWN) { return; } diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java b/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java index 1fe2d3846b9..336ccb00823 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockEnergyCube.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.implementations.items.IAEItemPowerStorage; -import appeng.block.networking.BlockEnergyCell; -import appeng.client.render.BaseBlockRender; -import appeng.tile.networking.TileEnergyCell; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import appeng.api.implementations.items.IAEItemPowerStorage; +import appeng.block.networking.BlockEnergyCell; +import appeng.client.render.BaseBlockRender; +import appeng.tile.networking.TileEnergyCell; + public class RenderBlockEnergyCube extends BaseBlockRender { public RenderBlockEnergyCube() { @@ -34,12 +27,8 @@ public RenderBlockEnergyCube() { } @Override - public void renderInventory( - final BlockEnergyCell blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockEnergyCell blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { final IAEItemPowerStorage myItem = (IAEItemPowerStorage) is.getItem(); final double internalCurrentPower = myItem.getAECurrentPower(is); final double internalMaxPower = myItem.getAEMaxPower(is); @@ -59,13 +48,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockEnergyCell blk, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockEnergyCell blk, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final int meta = world.getBlockMetadata(x, y, z); renderer.overrideBlockTexture = blk.getIcon(0, meta); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java b/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java index 8123d8ccddd..69fc76e1dc6 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockInscriber.java @@ -1,34 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.features.IInscriberRecipe; -import appeng.api.util.IOrientable; -import appeng.block.AEBaseBlock; -import appeng.block.misc.BlockInscriber; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.core.AELog; -import appeng.tile.AEBaseTile; -import appeng.tile.misc.TileInscriber; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; @@ -40,9 +23,21 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import appeng.api.features.IInscriberRecipe; +import appeng.api.util.IOrientable; +import appeng.block.AEBaseBlock; +import appeng.block.misc.BlockInscriber; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.core.AELog; +import appeng.tile.AEBaseTile; +import appeng.tile.misc.TileInscriber; +import appeng.util.Platform; + /** * @author AlgorithmX2 * @author thatsIch @@ -50,6 +45,7 @@ * @since rv0 */ public class RenderBlockInscriber extends BaseBlockRender { + private static final float ITEM_RENDER_SCALE = 1.0f / 1.1f; public RenderBlockInscriber() { @@ -57,12 +53,8 @@ public RenderBlockInscriber() { } @Override - public void renderInventory( - final BlockInscriber blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockInscriber blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { final Tessellator tess = Tessellator.instance; renderer.renderAllFaces = true; @@ -102,13 +94,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockInscriber block, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockInscriber block, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final IOrientable te = this.getOrientable(block, world, x, y, z); if (te == null) { @@ -150,15 +137,8 @@ public boolean renderInWorld( } @Override - public void renderTile( - final BlockInscriber block, - final TileInscriber tile, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, - final RenderBlocks renderer) { + public void renderTile(final BlockInscriber block, final TileInscriber tile, final Tessellator tess, final double x, + final double y, final double z, final float f, final RenderBlocks renderer) { // render inscriber GL11.glPushMatrix(); @@ -209,7 +189,11 @@ public void renderTile( tess.addVertexWithUV(TwoPx, middle + press, TwoPx, ic.getInterpolatedU(2), ic.getInterpolatedV(2)); tess.addVertexWithUV(1.0 - TwoPx, middle + press, TwoPx, ic.getInterpolatedU(14), ic.getInterpolatedV(2)); tess.addVertexWithUV( - 1.0 - TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU(14), ic.getInterpolatedV(13)); + 1.0 - TwoPx, + middle + press, + 1.0 - TwoPx, + ic.getInterpolatedU(14), + ic.getInterpolatedV(13)); tess.addVertexWithUV(TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU(2), ic.getInterpolatedV(13)); tess.addVertexWithUV(TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU(2), ic.getInterpolatedV(3)); @@ -289,16 +273,8 @@ public void renderTile( GL11.glCullFace(GL11.GL_BACK); } - private void renderItem( - ItemStack sis, - final float o, - final AEBaseBlock block, - final AEBaseTile tile, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, + private void renderItem(ItemStack sis, final float o, final AEBaseBlock block, final AEBaseTile tile, + final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer) { if (sis != null) { sis = sis.copy(); @@ -317,8 +293,7 @@ private void renderItem( final Block blk = Block.getBlockFromItem(sis.getItem()); // is a block - if (sis.getItemSpriteNumber() == 0 - && block != null + if (sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(blk.getRenderType())) { // rotate block in angle to make it more plastic GL11.glRotatef(22.5f, 1f, 0f, 0f); @@ -330,8 +305,8 @@ private void renderItem( } // << 20 | light << 4; - final int br = - tile.getWorldObj().getLightBrightnessForSkyBlocks(tile.xCoord, tile.yCoord, tile.zCoord, 0); + final int br = tile.getWorldObj() + .getLightBrightnessForSkyBlocks(tile.xCoord, tile.yCoord, tile.zCoord, 0); final int var11 = br % 65536; final int var12 = br / 65536; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockInterface.java b/src/main/java/appeng/client/render/blocks/RenderBlockInterface.java index 02163e45373..0ec2e7ba464 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockInterface.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockInterface.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.block.misc.BlockInterface; import appeng.client.render.BaseBlockRender; import appeng.client.render.BlockRenderInfo; import appeng.client.texture.ExtraBlockTextures; import appeng.tile.misc.TileInterface; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; public class RenderBlockInterface extends BaseBlockRender { @@ -35,20 +28,20 @@ public RenderBlockInterface() { } @Override - public boolean renderInWorld( - final BlockInterface block, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockInterface block, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final TileInterface ti = block.getTileEntity(world, x, y, z); final BlockRenderInfo info = block.getRendererInstance(); if (ti != null && ti.getForward() != ForgeDirection.UNKNOWN) { final IIcon side = ExtraBlockTextures.BlockInterfaceAlternateArrow.getIcon(); info.setTemporaryRenderIcons( - ExtraBlockTextures.BlockInterfaceAlternate.getIcon(), block.getIcon(0, 0), side, side, side, side); + ExtraBlockTextures.BlockInterfaceAlternate.getIcon(), + block.getIcon(0, 0), + side, + side, + side, + side); } final boolean fz = super.renderInWorld(block, world, x, y, z, renderer); diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java b/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java index 9d406cd46fb..f5682a9bbc6 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockPaint.java @@ -1,29 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.misc.BlockPaint; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.helpers.Splotch; -import appeng.tile.misc.TilePaint; import java.util.EnumSet; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; @@ -32,6 +20,12 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.misc.BlockPaint; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.helpers.Splotch; +import appeng.tile.misc.TilePaint; + public class RenderBlockPaint extends BaseBlockRender { public RenderBlockPaint() { @@ -39,20 +33,11 @@ public RenderBlockPaint() { } @Override - public void renderInventory( - final BlockPaint block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) {} + public void renderInventory(final BlockPaint block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) {} @Override - public boolean renderInWorld( - final BlockPaint imb, - final IBlockAccess world, - final int x, - final int y, - final int z, + public boolean renderInWorld(final BlockPaint imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer) { final TilePaint tp = imb.getTileEntity(world, x, y, z); boolean out = false; @@ -60,9 +45,8 @@ public boolean renderInWorld( if (tp != null) { // super.renderInWorld( imb, world, x, y, z, renderer ); - final IIcon[] icoSet = { - imb.getIcon(0, 0), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() - }; + final IIcon[] icoSet = { imb.getIcon(0, 0), ExtraBlockTextures.BlockPaint2.getIcon(), + ExtraBlockTextures.BlockPaint3.getIcon() }; final Tessellator tess = Tessellator.instance; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java b/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java index 865b37cde3a..80167c2d815 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockQuartzAccelerator.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.misc.BlockQuartzGrowthAccelerator; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.misc.TileQuartzGrowthAccelerator; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import appeng.block.misc.BlockQuartzGrowthAccelerator; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.misc.TileQuartzGrowthAccelerator; + public class RenderBlockQuartzAccelerator extends BaseBlockRender { @@ -35,13 +28,8 @@ public RenderBlockQuartzAccelerator() { } @Override - public boolean renderInWorld( - final BlockQuartzGrowthAccelerator blk, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockQuartzGrowthAccelerator blk, final IBlockAccess world, final int x, + final int y, final int z, final RenderBlocks renderer) { final TileEntity te = world.getTileEntity(x, y, z); if (te instanceof TileQuartzGrowthAccelerator) { diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java b/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java index c28722ee64e..5e694da381d 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockSkyChest.java @@ -1,26 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.storage.BlockSkyChest; -import appeng.client.render.BaseBlockRender; -import appeng.tile.storage.TileSkyChest; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.RenderBlocks; @@ -29,16 +18,23 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import appeng.block.storage.BlockSkyChest; +import appeng.client.render.BaseBlockRender; +import appeng.tile.storage.TileSkyChest; + public class RenderBlockSkyChest extends BaseBlockRender { - private static final ResourceLocation SKY_STONE_CHEST = - new ResourceLocation("appliedenergistics2", "textures/models/skychest.png"); - private static final ResourceLocation SKY_BLOCK_CHEST = - new ResourceLocation("appliedenergistics2", "textures/models/skyblockchest.png"); - private static final ResourceLocation[] METADATA_TO_TEXTURE = {SKY_STONE_CHEST, SKY_BLOCK_CHEST}; + private static final ResourceLocation SKY_STONE_CHEST = new ResourceLocation( + "appliedenergistics2", + "textures/models/skychest.png"); + private static final ResourceLocation SKY_BLOCK_CHEST = new ResourceLocation( + "appliedenergistics2", + "textures/models/skyblockchest.png"); + private static final ResourceLocation[] METADATA_TO_TEXTURE = { SKY_STONE_CHEST, SKY_BLOCK_CHEST }; private final ModelChest model = new ModelChest(); @@ -47,12 +43,8 @@ public RenderBlockSkyChest() { } @Override - public void renderInventory( - final BlockSkyChest blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockSkyChest blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -74,26 +66,14 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockSkyChest blk, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockSkyChest blk, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { return true; } @Override - public void renderTile( - final BlockSkyChest block, - final TileSkyChest skyChest, - final Tessellator tess, - final double x, - final double y, - final double z, - final float partialTick, - final RenderBlocks renderer) { + public void renderTile(final BlockSkyChest block, final TileSkyChest skyChest, final Tessellator tess, + final double x, final double y, final double z, final float partialTick, final RenderBlocks renderer) { if (skyChest == null || !skyChest.hasWorldObj()) { return; } diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java b/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java index f5b8b576ad5..c053d1ef318 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockSkyCompass.java @@ -1,29 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.misc.BlockSkyCompass; -import appeng.client.render.BaseBlockRender; -import appeng.client.render.model.ModelCompass; -import appeng.hooks.CompassManager; -import appeng.hooks.CompassResult; -import appeng.tile.misc.TileSkyCompass; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -34,12 +20,22 @@ import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import appeng.block.misc.BlockSkyCompass; +import appeng.client.render.BaseBlockRender; +import appeng.client.render.model.ModelCompass; +import appeng.hooks.CompassManager; +import appeng.hooks.CompassResult; +import appeng.tile.misc.TileSkyCompass; + public class RenderBlockSkyCompass extends BaseBlockRender { - private static final ResourceLocation TEXTURE_SKY_COMPASS = - new ResourceLocation("appliedenergistics2", "textures/models/compass.png"); + + private static final ResourceLocation TEXTURE_SKY_COMPASS = new ResourceLocation( + "appliedenergistics2", + "textures/models/compass.png"); private final ModelCompass model = new ModelCompass(); @@ -48,12 +44,8 @@ public RenderBlockSkyCompass() { } @Override - public void renderInventory( - final BlockSkyCompass blk, - final ItemStack is, - final RenderBlocks renderer, - ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockSkyCompass blk, final ItemStack is, final RenderBlocks renderer, + ItemRenderType type, final Object[] obj) { if (type == ItemRenderType.INVENTORY) { boolean isGood = false; final IInventory inv = Minecraft.getMinecraft().thePlayer.inventory; @@ -96,8 +88,7 @@ public void renderInventory( long now = System.currentTimeMillis(); - if (type == ItemRenderType.EQUIPPED_FIRST_PERSON - || type == ItemRenderType.INVENTORY + if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY || type == ItemRenderType.EQUIPPED) { EntityPlayer p = Minecraft.getMinecraft().thePlayer; float rYaw = p.rotationYaw; @@ -149,26 +140,14 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockSkyCompass blk, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockSkyCompass blk, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { return true; } @Override - public void renderTile( - final BlockSkyCompass block, - final TileSkyCompass skyCompass, - final Tessellator tess, - final double x, - final double y, - final double z, - final float partialTick, - final RenderBlocks renderer) { + public void renderTile(final BlockSkyCompass block, final TileSkyCompass skyCompass, final Tessellator tess, + final double x, final double y, final double z, final float partialTick, final RenderBlocks renderer) { if (skyCompass == null) { return; } @@ -192,8 +171,8 @@ public void renderTile( CompassResult cr = null; if (skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN) { - cr = CompassManager.INSTANCE.getCompassDirection( - 0, skyCompass.xCoord, skyCompass.yCoord, skyCompass.zCoord); + cr = CompassManager.INSTANCE + .getCompassDirection(0, skyCompass.xCoord, skyCompass.yCoord, skyCompass.zCoord); } else { cr = new CompassResult(false, true, 0); } @@ -203,8 +182,9 @@ public void renderTile( now %= 100000; this.model.renderAll((now / 50000.0f) * (float) Math.PI * 500.0f); } else { - this.model.renderAll((float) - (skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy(cr.getRad()) : cr.getRad())); + this.model.renderAll( + (float) (skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy(cr.getRad()) + : cr.getRad())); } } else { now %= 1000000; diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java b/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java index 68e4cc1148f..55444177e7c 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockWireless.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.util.AEColor; import appeng.block.networking.BlockWireless; import appeng.client.render.BaseBlockRender; @@ -27,14 +29,6 @@ import appeng.client.texture.OffsetIcon; import appeng.tile.networking.TileWireless; import appeng.util.Platform; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.IItemRenderer.ItemRenderType; -import net.minecraftforge.common.util.ForgeDirection; public class RenderBlockWireless extends BaseBlockRender { @@ -50,12 +44,8 @@ public RenderBlockWireless() { } @Override - public void renderInventory( - final BlockWireless blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockWireless blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { this.blk = blk; this.centerX = 0; this.centerY = 0; @@ -70,9 +60,23 @@ public void renderInventory( IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon(); ri.setTemporaryRenderIcons( - r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r); + r, + r, + CableBusTextures.PartMonitorSides.getIcon(), + CableBusTextures.PartMonitorSides.getIcon(), + r, + r); this.renderBlockBounds( - renderer, 5, 5, 0, 11, 11, 1, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH); + renderer, + 5, + 5, + 0, + 11, + 11, + 1, + ForgeDirection.EAST, + ForgeDirection.UP, + ForgeDirection.SOUTH); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); r = CableBusTextures.PartWirelessSides.getIcon(); @@ -84,7 +88,16 @@ public void renderInventory( r, r); this.renderBlockBounds( - renderer, 5, 5, 1, 11, 11, 2, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH); + renderer, + 5, + 5, + 1, + 11, + 11, + 2, + ForgeDirection.EAST, + ForgeDirection.UP, + ForgeDirection.SOUTH); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); tess.startDrawingQuads(); @@ -101,8 +114,8 @@ public void renderInventory( r, r); - final ForgeDirection[] sides = {ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN - }; + final ForgeDirection[] sides = { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, + ForgeDirection.DOWN }; int s = 1; @@ -140,13 +153,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockWireless blk, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockWireless blk, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final TileWireless tw = blk.getTileEntity(world, x, y, z); this.blk = blk; @@ -201,9 +209,8 @@ public boolean renderInWorld( r, r); - final ForgeDirection[] sides = { - ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN - }; + final ForgeDirection[] sides = { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, + ForgeDirection.DOWN }; int s = 1; @@ -282,8 +289,8 @@ public boolean renderInWorld( return true; } - private void renderTorchAtAngle( - final RenderBlocks renderer, final ForgeDirection x, final ForgeDirection y, final ForgeDirection z) { + private void renderTorchAtAngle(final RenderBlocks renderer, final ForgeDirection x, final ForgeDirection y, + final ForgeDirection z) { final IIcon r = (this.hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : this.blk.getIcon(0, 0)); final IIcon sides = new OffsetIcon(r, 0.0f, -2.0f); diff --git a/src/main/java/appeng/client/render/blocks/RenderDrive.java b/src/main/java/appeng/client/render/blocks/RenderDrive.java index 7c383044624..3a072bb30e9 100644 --- a/src/main/java/appeng/client/render/blocks/RenderDrive.java +++ b/src/main/java/appeng/client/render/blocks/RenderDrive.java @@ -1,29 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.storage.BlockDrive; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.storage.TileDrive; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; @@ -32,6 +20,12 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.storage.BlockDrive; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.storage.TileDrive; +import appeng.util.Platform; + public class RenderDrive extends BaseBlockRender { public RenderDrive() { @@ -39,12 +33,8 @@ public RenderDrive() { } @Override - public void renderInventory( - final BlockDrive block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockDrive block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.overrideBlockTexture = ExtraBlockTextures.getMissing(); this.renderInvBlock(EnumSet.of(ForgeDirection.SOUTH), block, is, Tessellator.instance, 0x000000, renderer); @@ -53,12 +43,7 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockDrive imb, - final IBlockAccess world, - final int x, - final int y, - final int z, + public boolean renderInWorld(final BlockDrive imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer) { final TileDrive sp = imb.getTileEntity(world, x, y, z); final ForgeDirection up = sp.getUp(); @@ -72,8 +57,8 @@ public boolean renderInWorld( final Tessellator tess = Tessellator.instance; final IIcon ico = ExtraBlockTextures.MEStorageCellTextures.getIcon(); - final int b = - world.getLightBrightnessForSkyBlocks(x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0); + final int b = world + .getLightBrightnessForSkyBlocks(x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0); for (int yy = 0; yy < 5; yy++) { for (int xx = 0; xx < 2; xx++) { @@ -210,63 +195,159 @@ public boolean renderInWorld( switch (forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3) { case 1: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMinZ, + u4, + v4); break; case -1: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u4, + v4); break; case -2: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u4, + v4); break; case 2: tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u4, + v4); break; case 3: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4); + x + renderer.renderMinX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u4, + v4); break; case -3: tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1); + x + renderer.renderMinX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u4, + v4); break; } @@ -307,63 +388,159 @@ public boolean renderInWorld( switch (forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3) { case 1: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMinZ, + u4, + v4); break; case -1: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u4, + v4); break; case -2: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u4, + v4); break; case 2: tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMinZ, + u4, + v4); break; case 3: tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4); + x + renderer.renderMinX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u4, + v4); break; case -3: tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1); + x + renderer.renderMinX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u1, + v1); tess.addVertexWithUV( - x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2); + x + renderer.renderMinX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u2, + v2); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3); + x + renderer.renderMaxX, + y + renderer.renderMaxY, + z + renderer.renderMaxZ, + u3, + v3); tess.addVertexWithUV( - x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4); + x + renderer.renderMaxX, + y + renderer.renderMinY, + z + renderer.renderMaxZ, + u4, + v4); break; } } diff --git a/src/main/java/appeng/client/render/blocks/RenderMEChest.java b/src/main/java/appeng/client/render/blocks/RenderMEChest.java index f749fd3deb6..585c89cbdd0 100644 --- a/src/main/java/appeng/client/render/blocks/RenderMEChest.java +++ b/src/main/java/appeng/client/render/blocks/RenderMEChest.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.storage.ICellHandler; import appeng.api.util.AEColor; @@ -28,14 +30,6 @@ import appeng.client.texture.OffsetIcon; import appeng.tile.storage.TileChest; import appeng.util.Platform; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.IItemRenderer.ItemRenderType; -import net.minecraftforge.common.util.ForgeDirection; public class RenderMEChest extends BaseBlockRender { @@ -44,12 +38,8 @@ public RenderMEChest() { } @Override - public void renderInventory( - final BlockChest block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockChest block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { Tessellator.instance.setBrightness(0); renderer.overrideBlockTexture = ExtraBlockTextures.getMissing(); @@ -69,12 +59,7 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockChest imb, - final IBlockAccess world, - final int x, - final int y, - final int z, + public boolean renderInWorld(final BlockChest imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer) { final TileChest sp = imb.getTileEntity(world, x, y, z); @@ -105,8 +90,8 @@ public boolean renderInWorld( Tessellator.instance.setColorOpaque_I(0xffffff); final int offsetU = -4; - final FlippableIcon flippableIcon = - new FlippableIcon(new OffsetIcon(ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV)); + final FlippableIcon flippableIcon = new FlippableIcon( + new OffsetIcon(ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV)); if (forward == ForgeDirection.EAST && (up == ForgeDirection.NORTH || up == ForgeDirection.SOUTH)) { flippableIcon.setFlip(true, false); diff --git a/src/main/java/appeng/client/render/blocks/RenderNull.java b/src/main/java/appeng/client/render/blocks/RenderNull.java index bd4f9800277..782afdd4563 100644 --- a/src/main/java/appeng/client/render/blocks/RenderNull.java +++ b/src/main/java/appeng/client/render/blocks/RenderNull.java @@ -1,31 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.AEBaseBlock; -import appeng.client.render.BaseBlockRender; -import appeng.tile.AEBaseTile; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import appeng.block.AEBaseBlock; +import appeng.client.render.BaseBlockRender; +import appeng.tile.AEBaseTile; + public class RenderNull extends BaseBlockRender { public RenderNull() { @@ -33,21 +26,12 @@ public RenderNull() { } @Override - public void renderInventory( - final AEBaseBlock block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) {} + public void renderInventory(final AEBaseBlock block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) {} @Override - public boolean renderInWorld( - final AEBaseBlock block, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final AEBaseBlock block, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { return true; } } diff --git a/src/main/java/appeng/client/render/blocks/RenderQNB.java b/src/main/java/appeng/client/render/blocks/RenderQNB.java index b47f4e23f76..9a42438a56d 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQNB.java +++ b/src/main/java/appeng/client/render/blocks/RenderQNB.java @@ -1,34 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.AEApi; -import appeng.api.definitions.IBlocks; -import appeng.api.definitions.IDefinitions; -import appeng.api.definitions.IParts; -import appeng.api.util.AEColor; -import appeng.block.qnb.BlockQuantumBase; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.qnb.TileQuantumBridge; import java.util.Collection; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -39,7 +23,18 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; +import appeng.api.definitions.IBlocks; +import appeng.api.definitions.IDefinitions; +import appeng.api.definitions.IParts; +import appeng.api.util.AEColor; +import appeng.block.qnb.BlockQuantumBase; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.qnb.TileQuantumBridge; + public class RenderQNB extends BaseBlockRender { + private static final float DEFAULT_RENDER_MIN = 2.0f / 16.0f; private static final float DEFAULT_RENDER_MAX = 14.0f / 16.0f; @@ -50,12 +45,8 @@ public class RenderQNB extends BaseBlockRender connections) { block.getRendererInstance().setTemporaryRenderIcon(texture); diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java index 0871b5e774d..fe55093d8af 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzGlass.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.AEApi; -import appeng.block.solids.BlockQuartzGlass; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.client.texture.OffsetIcon; -import appeng.tile.AEBaseTile; import java.util.Random; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; +import appeng.block.solids.BlockQuartzGlass; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.client.texture.OffsetIcon; +import appeng.tile.AEBaseTile; + public class RenderQuartzGlass extends BaseBlockRender { private static final byte[][][] OFFSETS = generateOffsets(); @@ -53,12 +47,8 @@ private static byte[][][] generateOffsets() { } @Override - public void renderInventory( - final BlockQuartzGlass block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockQuartzGlass block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.overrideBlockTexture = ExtraBlockTextures.GlassFrame.getIcon(); super.renderInventory(block, is, renderer, type, obj); renderer.overrideBlockTexture = null; @@ -66,13 +56,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockQuartzGlass imb, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockQuartzGlass imb, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { renderer.setRenderBounds(0, 0, 0, 1, 1, 1); final int cx = Math.abs(x % 10); @@ -87,8 +72,10 @@ public boolean renderInWorld( renderer.overrideBlockTexture = new OffsetIcon(imb.getIcon(0, 0), u / 2, v / 2); break; case 1: - renderer.overrideBlockTexture = - new OffsetIcon(ExtraBlockTextures.BlockQuartzGlassB.getIcon(), u / 2, v / 2); + renderer.overrideBlockTexture = new OffsetIcon( + ExtraBlockTextures.BlockQuartzGlassB.getIcon(), + u / 2, + v / 2); break; case 2: renderer.overrideBlockTexture = new OffsetIcon(ExtraBlockTextures.BlockQuartzGlassC.getIcon(), u, v); @@ -134,15 +121,8 @@ public boolean renderInWorld( return result; } - private void renderEdge( - final BlockQuartzGlass imb, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer, - final ForgeDirection side, - final ForgeDirection direction) { + private void renderEdge(final BlockQuartzGlass imb, final IBlockAccess world, final int x, final int y, final int z, + final RenderBlocks renderer, final ForgeDirection side, final ForgeDirection direction) { if (!this.isFlush(imb, world, x + side.offsetX, y + side.offsetY, z + side.offsetZ)) { if (!this.isFlush(imb, world, x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ)) { float minX = 0.5f + (side.offsetX + direction.offsetX) / 2.0f; @@ -213,13 +193,13 @@ private void renderEdge( } } - private boolean isFlush( - final BlockQuartzGlass imb, final IBlockAccess world, final int x, final int y, final int z) { + private boolean isFlush(final BlockQuartzGlass imb, final IBlockAccess world, final int x, final int y, + final int z) { return this.isGlass(imb, world, x, y, z); } - private boolean isGlass( - final BlockQuartzGlass imb, final IBlockAccess world, final int x, final int y, final int z) { + private boolean isGlass(final BlockQuartzGlass imb, final IBlockAccess world, final int x, final int y, + final int z) { return this.isQuartzGlass(world, x, y, z) || this.isVibrantQuartzGlass(world, x, y, z); } diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzOre.java b/src/main/java/appeng/client/render/blocks/RenderQuartzOre.java index 6a70b957db0..e110c0b5d35 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzOre.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzOre.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.solids.OreQuartz; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.AEBaseTile; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import appeng.block.solids.OreQuartz; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.AEBaseTile; + public class RenderQuartzOre extends BaseBlockRender { public RenderQuartzOre() { @@ -34,12 +27,8 @@ public RenderQuartzOre() { } @Override - public void renderInventory( - final OreQuartz blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final OreQuartz blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { super.renderInventory(blk, is, renderer, type, obj); blk.getRendererInstance().setTemporaryRenderIcon(ExtraBlockTextures.OreQuartzStone.getIcon()); super.renderInventory(blk, is, renderer, type, obj); @@ -47,13 +36,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final OreQuartz quartz, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final OreQuartz quartz, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { quartz.setEnhanceBrightness(true); super.renderInWorld(quartz, world, x, y, z, renderer); quartz.setEnhanceBrightness(false); diff --git a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java index 0e6ab497797..77d1938a478 100644 --- a/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java +++ b/src/main/java/appeng/client/render/blocks/RenderQuartzTorch.java @@ -1,28 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.util.IOrientable; -import appeng.block.AEBaseBlock; -import appeng.client.render.BaseBlockRender; -import appeng.tile.AEBaseTile; import java.util.EnumSet; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.init.Blocks; @@ -31,6 +20,11 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; +import appeng.block.AEBaseBlock; +import appeng.client.render.BaseBlockRender; +import appeng.tile.AEBaseTile; + public class RenderQuartzTorch extends BaseBlockRender { public RenderQuartzTorch() { @@ -38,12 +32,8 @@ public RenderQuartzTorch() { } @Override - public void renderInventory( - final AEBaseBlock blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final AEBaseBlock blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { final Tessellator tess = Tessellator.instance; final float Point3 = 7.0f / 16.0f; @@ -57,7 +47,12 @@ public void renderInventory( final float zOff = 0.0f; renderer.setRenderBounds( - Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff); + Point3 + xOff, + renderBottom + yOff, + Point3 + zOff, + Point12 + xOff, + renderTop + yOff, + Point12 + zOff); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); final float singlePixel = 1.0f / 16.0f; @@ -88,19 +83,39 @@ public void renderInventory( final float Point13 = 10.0f / 16.0f; final float Point2 = 6.0f / 16.0f; renderer.setRenderBounds( - Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff); + Point2 + xOff, + bottom + yOff, + Point2 + zOff, + Point13 + xOff, + top + yOff, + Point3 + zOff); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); renderer.setRenderBounds( - Point2 + xOff, bottom + yOff, Point12 + zOff, Point13 + xOff, top + yOff, Point13 + zOff); + Point2 + xOff, + bottom + yOff, + Point12 + zOff, + Point13 + xOff, + top + yOff, + Point13 + zOff); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); renderer.setRenderBounds( - Point2 + xOff, bottom + yOff, Point3 + zOff, Point3 + xOff, top + yOff, Point12 + zOff); + Point2 + xOff, + bottom + yOff, + Point3 + zOff, + Point3 + xOff, + top + yOff, + Point12 + zOff); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); renderer.setRenderBounds( - Point12 + xOff, bottom + yOff, Point3 + zOff, Point13 + xOff, top + yOff, Point12 + zOff); + Point12 + xOff, + bottom + yOff, + Point3 + zOff, + Point13 + xOff, + top + yOff, + Point12 + zOff); this.renderInvBlock(EnumSet.allOf(ForgeDirection.class), blk, is, tess, 0xffffff, renderer); @@ -109,13 +124,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final AEBaseBlock block, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final AEBaseBlock block, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final IOrientable te = block.getOrientable(world, x, y, z); float xOff = 0.0f; @@ -136,7 +146,12 @@ public boolean renderInWorld( final float Point12 = 9.0f / 16.0f; final float Point3 = 7.0f / 16.0f; renderer.setRenderBounds( - Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff); + Point3 + xOff, + renderBottom + yOff, + Point3 + zOff, + Point12 + xOff, + renderTop + yOff, + Point12 + zOff); super.renderInWorld(block, world, x, y, z, renderer); final int r = (x + y + z) % 2; @@ -186,19 +201,39 @@ public boolean renderInWorld( final float Point13 = 10.0f / 16.0f; final float Point2 = 6.0f / 16.0f; renderer.setRenderBounds( - Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff); + Point2 + xOff, + bottom + yOff, + Point2 + zOff, + Point13 + xOff, + top + yOff, + Point3 + zOff); final boolean out = renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds( - Point2 + xOff, bottom + yOff, Point12 + zOff, Point13 + xOff, top + yOff, Point13 + zOff); + Point2 + xOff, + bottom + yOff, + Point12 + zOff, + Point13 + xOff, + top + yOff, + Point13 + zOff); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds( - Point2 + xOff, bottom + yOff, Point3 + zOff, Point3 + xOff, top + yOff, Point12 + zOff); + Point2 + xOff, + bottom + yOff, + Point3 + zOff, + Point3 + xOff, + top + yOff, + Point12 + zOff); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds( - Point12 + xOff, bottom + yOff, Point3 + zOff, Point13 + xOff, top + yOff, Point12 + zOff); + Point12 + xOff, + bottom + yOff, + Point3 + zOff, + Point13 + xOff, + top + yOff, + Point12 + zOff); renderer.renderStandardBlock(block, x, y, z); if (te != null) { diff --git a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java index 25060e6e0a9..91499ec94c6 100644 --- a/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java +++ b/src/main/java/appeng/client/render/blocks/RenderSpatialPylon.java @@ -1,28 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.spatial.BlockSpatialPylon; -import appeng.client.render.BaseBlockRender; -import appeng.client.render.BlockRenderInfo; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.spatial.TileSpatialPylon; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; @@ -31,6 +18,12 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.spatial.BlockSpatialPylon; +import appeng.client.render.BaseBlockRender; +import appeng.client.render.BlockRenderInfo; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.spatial.TileSpatialPylon; + public class RenderSpatialPylon extends BaseBlockRender { public RenderSpatialPylon() { @@ -38,12 +31,8 @@ public RenderSpatialPylon() { } @Override - public void renderInventory( - final BlockSpatialPylon block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockSpatialPylon block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.overrideBlockTexture = ExtraBlockTextures.BlockSpatialPylon_dim.getIcon(); super.renderInventory(block, is, renderer, type, obj); renderer.overrideBlockTexture = null; @@ -51,13 +40,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockSpatialPylon imb, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockSpatialPylon imb, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { renderer.setRenderBounds(0, 0, 0, 1, 1, 1); final TileSpatialPylon sp = imb.getTileEntity(world, x, y, z); @@ -150,8 +134,7 @@ public boolean renderInWorld( } bri.setTemporaryRenderIcon(null); - renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = - renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateBottom = 0; + renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateBottom = 0; return r; } @@ -166,12 +149,8 @@ public boolean renderInWorld( return result; } - private IIcon getBlockTextureFromSideOutside( - final BlockSpatialPylon blk, - final TileSpatialPylon sp, - final int displayBits, - final ForgeDirection ori, - final ForgeDirection dir) { + private IIcon getBlockTextureFromSideOutside(final BlockSpatialPylon blk, final TileSpatialPylon sp, + final int displayBits, final ForgeDirection ori, final ForgeDirection dir) { if (ori == dir || ori.getOpposite() == dir) { return blk.getRendererInstance().getTexture(dir); @@ -188,31 +167,23 @@ private IIcon getBlockTextureFromSideOutside( return blk.getIcon(0, 0); } - private IIcon getBlockTextureFromSideInside( - final BlockSpatialPylon blk, - final TileSpatialPylon sp, - final int displayBits, - final ForgeDirection ori, - final ForgeDirection dir) { + private IIcon getBlockTextureFromSideInside(final BlockSpatialPylon blk, final TileSpatialPylon sp, + final int displayBits, final ForgeDirection ori, final ForgeDirection dir) { final boolean good = (displayBits & TileSpatialPylon.DISPLAY_ENABLED) == TileSpatialPylon.DISPLAY_ENABLED; if (ori == dir || ori.getOpposite() == dir) { - return good - ? ExtraBlockTextures.BlockSpatialPylon_dim.getIcon() + return good ? ExtraBlockTextures.BlockSpatialPylon_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylon_red.getIcon(); } if ((displayBits & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_MIDDLE) { - return good - ? ExtraBlockTextures.BlockSpatialPylonC_dim.getIcon() + return good ? ExtraBlockTextures.BlockSpatialPylonC_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylonC_red.getIcon(); } else if ((displayBits & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MIN) { - return good - ? ExtraBlockTextures.BlockSpatialPylonE_dim.getIcon() + return good ? ExtraBlockTextures.BlockSpatialPylonE_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylonE_red.getIcon(); } else if ((displayBits & TileSpatialPylon.DISPLAY_MIDDLE) == TileSpatialPylon.DISPLAY_END_MAX) { - return good - ? ExtraBlockTextures.BlockSpatialPylonE_dim.getIcon() + return good ? ExtraBlockTextures.BlockSpatialPylonE_dim.getIcon() : ExtraBlockTextures.BlockSpatialPylonE_red.getIcon(); } diff --git a/src/main/java/appeng/client/render/blocks/RenderTinyTNT.java b/src/main/java/appeng/client/render/blocks/RenderTinyTNT.java index 1041872583f..90d89fce675 100644 --- a/src/main/java/appeng/client/render/blocks/RenderTinyTNT.java +++ b/src/main/java/appeng/client/render/blocks/RenderTinyTNT.java @@ -1,31 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.block.misc.BlockTinyTNT; -import appeng.client.render.BaseBlockRender; -import appeng.tile.AEBaseTile; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import appeng.block.misc.BlockTinyTNT; +import appeng.client.render.BaseBlockRender; +import appeng.tile.AEBaseTile; + public class RenderTinyTNT extends BaseBlockRender { public RenderTinyTNT() { @@ -33,24 +26,15 @@ public RenderTinyTNT() { } @Override - public void renderInventory( - final BlockTinyTNT block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockTinyTNT block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.setRenderBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f); super.renderInventory(block, is, renderer, type, obj); } @Override - public boolean renderInWorld( - final BlockTinyTNT imb, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockTinyTNT imb, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { renderer.renderAllFaces = true; renderer.setRenderBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f); final boolean out = super.renderInWorld(imb, world, x, y, z, renderer); diff --git a/src/main/java/appeng/client/render/blocks/RendererCableBus.java b/src/main/java/appeng/client/render/blocks/RendererCableBus.java index 4f19064aac6..9f31c81e9b5 100644 --- a/src/main/java/appeng/client/render/blocks/RendererCableBus.java +++ b/src/main/java/appeng/client/render/blocks/RendererCableBus.java @@ -1,34 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; + import appeng.block.networking.BlockCableBus; import appeng.client.render.BaseBlockRender; import appeng.client.render.BusRenderHelper; import appeng.client.render.BusRenderer; import appeng.tile.AEBaseTile; import appeng.tile.networking.TileCableBus; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.client.IItemRenderer.ItemRenderType; public class RendererCableBus extends BaseBlockRender { @@ -37,23 +30,14 @@ public RendererCableBus() { } @Override - public void renderInventory( - final BlockCableBus blk, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockCableBus blk, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { // nothing. } @Override - public boolean renderInWorld( - final BlockCableBus block, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockCableBus block, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final AEBaseTile t = block.getTileEntity(world, x, y, z); if (t instanceof TileCableBus) { @@ -68,15 +52,8 @@ public boolean renderInWorld( } @Override - public void renderTile( - final BlockCableBus block, - final TileCableBus cableBus, - final Tessellator tess, - final double x, - final double y, - final double z, - final float f, - final RenderBlocks renderer) { + public void renderTile(final BlockCableBus block, final TileCableBus cableBus, final Tessellator tess, + final double x, final double y, final double z, final float f, final RenderBlocks renderer) { if (cableBus != null) { BusRenderer.INSTANCE.getRenderer().overrideBlockTexture = null; cableBus.getCableBus().renderDynamic(x, y, z); diff --git a/src/main/java/appeng/client/render/blocks/RendererSecurity.java b/src/main/java/appeng/client/render/blocks/RendererSecurity.java index 8f220ed7c83..6bee530afc8 100644 --- a/src/main/java/appeng/client/render/blocks/RendererSecurity.java +++ b/src/main/java/appeng/client/render/blocks/RendererSecurity.java @@ -1,29 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.blocks; -import appeng.api.util.AEColor; -import appeng.block.misc.BlockSecurity; -import appeng.client.render.BaseBlockRender; -import appeng.client.texture.ExtraBlockTextures; -import appeng.tile.misc.TileSecurity; import java.util.EnumSet; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; @@ -32,6 +20,12 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.AEColor; +import appeng.block.misc.BlockSecurity; +import appeng.client.render.BaseBlockRender; +import appeng.client.texture.ExtraBlockTextures; +import appeng.tile.misc.TileSecurity; + public class RendererSecurity extends BaseBlockRender { public RendererSecurity() { @@ -39,12 +33,8 @@ public RendererSecurity() { } @Override - public void renderInventory( - final BlockSecurity block, - final ItemStack is, - final RenderBlocks renderer, - final ItemRenderType type, - final Object[] obj) { + public void renderInventory(final BlockSecurity block, final ItemStack is, final RenderBlocks renderer, + final ItemRenderType type, final Object[] obj) { renderer.overrideBlockTexture = ExtraBlockTextures.getMissing(); this.renderInvBlock(EnumSet.of(ForgeDirection.SOUTH), block, is, Tessellator.instance, 0x000000, renderer); @@ -62,13 +52,8 @@ public void renderInventory( } @Override - public boolean renderInWorld( - final BlockSecurity imb, - final IBlockAccess world, - final int x, - final int y, - final int z, - final RenderBlocks renderer) { + public boolean renderInWorld(final BlockSecurity imb, final IBlockAccess world, final int x, final int y, + final int z, final RenderBlocks renderer) { final TileSecurity sp = imb.getTileEntity(world, x, y, z); renderer.setRenderBounds(0, 0, 0, 1, 1, 1); @@ -89,21 +74,18 @@ public boolean renderInWorld( renderer.setRenderBounds(0, 0, 0, 1, 1, 1); Tessellator.instance.setColorOpaque_I(sp.getColor().whiteVariant); - IIcon ico = sp.isActive() - ? ExtraBlockTextures.BlockMESecurityOn_Light.getIcon() + IIcon ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Light.getIcon() : ExtraBlockTextures.MEChest.getIcon(); this.renderFace(x, y, z, imb, ico, renderer, up); if (sp.isActive()) { Tessellator.instance.setColorOpaque_I(sp.getColor().mediumVariant); - ico = sp.isActive() - ? ExtraBlockTextures.BlockMESecurityOn_Medium.getIcon() + ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Medium.getIcon() : ExtraBlockTextures.MEChest.getIcon(); this.renderFace(x, y, z, imb, ico, renderer, up); Tessellator.instance.setColorOpaque_I(sp.getColor().blackVariant); - ico = sp.isActive() - ? ExtraBlockTextures.BlockMESecurityOn_Dark.getIcon() + ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Dark.getIcon() : ExtraBlockTextures.MEChest.getIcon(); this.renderFace(x, y, z, imb, ico, renderer, up); } diff --git a/src/main/java/appeng/client/render/effects/AssemblerFX.java b/src/main/java/appeng/client/render/effects/AssemblerFX.java index a07cbbbf8f4..78386247b28 100644 --- a/src/main/java/appeng/client/render/effects/AssemblerFX.java +++ b/src/main/java/appeng/client/render/effects/AssemblerFX.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + import appeng.api.storage.data.IAEItemStack; import appeng.client.EffectType; import appeng.core.CommonHelper; import appeng.entity.EntityFloatingItem; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.world.World; public class AssemblerFX extends EntityFX { @@ -32,16 +25,8 @@ public class AssemblerFX extends EntityFX { private final float speed; private float time = 0; - public AssemblerFX( - final World w, - final double x, - final double y, - final double z, - final double r, - final double g, - final double b, - final float speed, - final IAEItemStack is) { + public AssemblerFX(final World w, final double x, final double y, final double z, final double r, final double g, + final double b, final float speed, final IAEItemStack is) { super(w, x, y, z, r, g, b); this.motionX = 0; this.motionY = 0; @@ -72,22 +57,16 @@ public void onUpdate() { } @Override - public void renderParticle( - final Tessellator tess, - final float l, - final float rX, - final float rY, - final float rZ, - final float rYZ, - final float rXY) { + public void renderParticle(final Tessellator tess, final float l, final float rX, final float rY, final float rZ, + final float rYZ, final float rXY) { this.time += l; if (this.time > 4.0) { this.time -= 4.0; // if ( CommonHelper.proxy.shouldAddParticles( r ) ) for (int x = 0; x < (int) Math.ceil(this.speed / 5); x++) { - CommonHelper.proxy.spawnEffect( - EffectType.Crafting, this.worldObj, this.posX, this.posY, this.posZ, null); + CommonHelper.proxy + .spawnEffect(EffectType.Crafting, this.worldObj, this.posX, this.posY, this.posZ, null); } } } diff --git a/src/main/java/appeng/client/render/effects/ChargedOreFX.java b/src/main/java/appeng/client/render/effects/ChargedOreFX.java index 7d0ddf30c8f..2cfdad8e4cf 100644 --- a/src/main/java/appeng/client/render/effects/ChargedOreFX.java +++ b/src/main/java/appeng/client/render/effects/ChargedOreFX.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; @@ -23,13 +15,7 @@ public class ChargedOreFX extends EntityReddustFX { - public ChargedOreFX( - final World w, - final double x, - final double y, - final double z, - final float r, - final float g, + public ChargedOreFX(final World w, final double x, final double y, final double z, final float r, final float g, final float b) { super(w, x, y, z, 0.21f, 0.61f, 1.0f); } diff --git a/src/main/java/appeng/client/render/effects/CraftingFx.java b/src/main/java/appeng/client/render/effects/CraftingFx.java index d5eec8cc66c..e0f0ec907c2 100644 --- a/src/main/java/appeng/client/render/effects/CraftingFx.java +++ b/src/main/java/appeng/client/render/effects/CraftingFx.java @@ -1,26 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; -import appeng.client.texture.ExtraBlockTextures; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityBreakingFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.Item; @@ -29,6 +18,10 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.client.texture.ExtraBlockTextures; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class CraftingFx extends EntityBreakingFX { @@ -38,8 +31,8 @@ public class CraftingFx extends EntityBreakingFX { private final int startBlkY; private final int startBlkZ; - public CraftingFx( - final World par1World, final double par2, final double par4, final double par6, final Item par8Item) { + public CraftingFx(final World par1World, final double par2, final double par4, final double par6, + final Item par8Item) { super(par1World, par2, par4, par6, par8Item); this.particleGravity = 0; this.particleBlue = 1; @@ -63,14 +56,8 @@ public int getFXLayer() { } @Override - public void renderParticle( - final Tessellator par1Tessellator, - final float partialTick, - final float x, - final float y, - final float z, - final float rx, - final float rz) { + public void renderParticle(final Tessellator par1Tessellator, final float partialTick, final float x, final float y, + final float z, final float rx, final float rz) { if (partialTick < 0 || partialTick > 1) { return; } @@ -97,15 +84,34 @@ public void renderParticle( // AELog.info( "" + partialTick ); final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( - this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha); + this.particleRed * f14, + this.particleGreen * f14, + this.particleBlue * f14, + this.particleAlpha); par1Tessellator.addVertexWithUV( - offX - x * scale - rx * scale, offY - y * scale, offZ - z * scale - rz * scale, f7, f9); + offX - x * scale - rx * scale, + offY - y * scale, + offZ - z * scale - rz * scale, + f7, + f9); par1Tessellator.addVertexWithUV( - offX - x * scale + rx * scale, offY + y * scale, offZ - z * scale + rz * scale, f7, f8); + offX - x * scale + rx * scale, + offY + y * scale, + offZ - z * scale + rz * scale, + f7, + f8); par1Tessellator.addVertexWithUV( - offX + x * scale + rx * scale, offY + y * scale, offZ + z * scale + rz * scale, f6, f8); + offX + x * scale + rx * scale, + offY + y * scale, + offZ + z * scale + rz * scale, + f6, + f8); par1Tessellator.addVertexWithUV( - offX + x * scale - rx * scale, offY - y * scale, offZ + z * scale - rz * scale, f6, f9); + offX + x * scale - rx * scale, + offY - y * scale, + offZ + z * scale - rz * scale, + f6, + f9); } } diff --git a/src/main/java/appeng/client/render/effects/EnergyFx.java b/src/main/java/appeng/client/render/effects/EnergyFx.java index 7e8727ba593..1dc4c46649e 100644 --- a/src/main/java/appeng/client/render/effects/EnergyFx.java +++ b/src/main/java/appeng/client/render/effects/EnergyFx.java @@ -1,26 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; -import appeng.client.texture.ExtraBlockTextures; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityBreakingFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.Item; @@ -29,6 +18,10 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.client.texture.ExtraBlockTextures; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class EnergyFx extends EntityBreakingFX { @@ -38,8 +31,8 @@ public class EnergyFx extends EntityBreakingFX { private final int startBlkY; private final int startBlkZ; - public EnergyFx( - final World par1World, final double par2, final double par4, final double par6, final Item par8Item) { + public EnergyFx(final World par1World, final double par2, final double par4, final double par6, + final Item par8Item) { super(par1World, par2, par4, par6, par8Item); this.particleGravity = 0; this.particleBlue = 255; @@ -62,14 +55,8 @@ public int getFXLayer() { } @Override - public void renderParticle( - final Tessellator par1Tessellator, - final float par2, - final float par3, - final float par4, - final float par5, - final float par6, - final float par7) { + public void renderParticle(final Tessellator par1Tessellator, final float par2, final float par3, final float par4, + final float par5, final float par6, final float par7) { final float f6 = this.particleTextureIndex.getMinU(); final float f7 = this.particleTextureIndex.getMaxU(); final float f8 = this.particleTextureIndex.getMinV(); @@ -87,15 +74,34 @@ public void renderParticle( if (blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ) { final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( - this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha); + this.particleRed * f14, + this.particleGreen * f14, + this.particleBlue * f14, + this.particleAlpha); par1Tessellator.addVertexWithUV( - f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9); + f11 - par3 * f10 - par6 * f10, + f12 - par4 * f10, + f13 - par5 * f10 - par7 * f10, + f7, + f9); par1Tessellator.addVertexWithUV( - f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8); + f11 - par3 * f10 + par6 * f10, + f12 + par4 * f10, + f13 - par5 * f10 + par7 * f10, + f7, + f8); par1Tessellator.addVertexWithUV( - f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f6, f8); + f11 + par3 * f10 + par6 * f10, + f12 + par4 * f10, + f13 + par5 * f10 + par7 * f10, + f6, + f8); par1Tessellator.addVertexWithUV( - f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f6, f9); + f11 + par3 * f10 - par6 * f10, + f12 - par4 * f10, + f13 + par5 * f10 - par7 * f10, + f6, + f9); } } diff --git a/src/main/java/appeng/client/render/effects/LightningArcFX.java b/src/main/java/appeng/client/render/effects/LightningArcFX.java index f064b8edabc..b521634b42f 100644 --- a/src/main/java/appeng/client/render/effects/LightningArcFX.java +++ b/src/main/java/appeng/client/render/effects/LightningArcFX.java @@ -1,44 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; import java.util.Random; + import net.minecraft.world.World; public class LightningArcFX extends LightningFX { + private static final Random RANDOM_GENERATOR = new Random(); private final double rx; private final double ry; private final double rz; - public LightningArcFX( - final World w, - final double x, - final double y, - final double z, - final double ex, - final double ey, - final double ez, - final double r, - final double g, - final double b) { + public LightningArcFX(final World w, final double x, final double y, final double z, final double ex, + final double ey, final double ez, final double r, final double g, final double b) { super(w, x, y, z, r, g, b, 6); this.noClip = true; diff --git a/src/main/java/appeng/client/render/effects/LightningFX.java b/src/main/java/appeng/client/render/effects/LightningFX.java index 4e93ee12a41..0520f8c5dfb 100644 --- a/src/main/java/appeng/client/render/effects/LightningFX.java +++ b/src/main/java/appeng/client/render/effects/LightningFX.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; import java.util.Random; + import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; @@ -27,6 +20,7 @@ import net.minecraft.world.World; public class LightningFX extends EntityFX { + private static final Random RANDOM_GENERATOR = new Random(); private static final int STEPS = 5; @@ -35,27 +29,14 @@ public class LightningFX extends EntityFX { private final double[] verticesWithUV = new double[3]; private boolean hasData = false; - public LightningFX( - final World w, - final double x, - final double y, - final double z, - final double r, - final double g, + public LightningFX(final World w, final double x, final double y, final double z, final double r, final double g, final double b) { this(w, x, y, z, r, g, b, 6); this.regen(); } - protected LightningFX( - final World w, - final double x, - final double y, - final double z, - final double r, - final double g, - final double b, - final int maxAge) { + protected LightningFX(final World w, final double x, final double y, final double z, final double r, final double g, + final double b, final int maxAge) { super(w, x, y, z, r, g, b); this.precomputedSteps = new double[LightningFX.STEPS][3]; this.motionX = 0; @@ -71,12 +52,12 @@ protected void regen() { double lastDirectionZ = (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9; for (int s = 0; s < LightningFX.STEPS; s++) { - this.precomputedSteps[s][0] = - lastDirectionX = (lastDirectionX + (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0; - this.precomputedSteps[s][1] = - lastDirectionY = (lastDirectionY + (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0; - this.precomputedSteps[s][2] = - lastDirectionZ = (lastDirectionZ + (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0; + this.precomputedSteps[s][0] = lastDirectionX = (lastDirectionX + + (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0; + this.precomputedSteps[s][1] = lastDirectionY = (lastDirectionY + + (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0; + this.precomputedSteps[s][2] = lastDirectionZ = (lastDirectionZ + + (RANDOM_GENERATOR.nextDouble() - 0.5) * 0.9) / 2.0; } } @@ -91,18 +72,15 @@ public int getBrightnessForRender(final float par1) { } @Override - public void renderParticle( - final Tessellator tess, - final float l, - final float rX, - final float rY, - final float rZ, - final float rYZ, - final float rXY) { + public void renderParticle(final Tessellator tess, final float l, final float rX, final float rY, final float rZ, + final float rYZ, final float rXY) { final float j = 1.0f; tess.setColorRGBA_F( - this.particleRed * j * 0.9f, this.particleGreen * j * 0.95f, this.particleBlue * j, this.particleAlpha); + this.particleRed * j * 0.9f, + this.particleGreen * j * 0.95f, + this.particleBlue * j, + this.particleAlpha); if (this.particleAge == 3) { this.regen(); diff --git a/src/main/java/appeng/client/render/effects/MatterCannonFX.java b/src/main/java/appeng/client/render/effects/MatterCannonFX.java index f17a4303643..5f57f3f7568 100644 --- a/src/main/java/appeng/client/render/effects/MatterCannonFX.java +++ b/src/main/java/appeng/client/render/effects/MatterCannonFX.java @@ -1,24 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; -import appeng.client.texture.ExtraBlockTextures; import net.minecraft.client.particle.EntityBreakingFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.Item; @@ -26,12 +17,14 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.client.texture.ExtraBlockTextures; + public class MatterCannonFX extends EntityBreakingFX { private final IIcon particleTextureIndex; - public MatterCannonFX( - final World par1World, final double par2, final double par4, final double par6, final Item par8Item) { + public MatterCannonFX(final World par1World, final double par2, final double par4, final double par6, + final Item par8Item) { super(par1World, par2, par4, par6, par8Item); this.particleGravity = 0; this.particleBlue = 255; @@ -63,14 +56,8 @@ public int getFXLayer() { } @Override - public void renderParticle( - final Tessellator par1Tessellator, - final float par2, - final float par3, - final float par4, - final float par5, - final float par6, - final float par7) { + public void renderParticle(final Tessellator par1Tessellator, final float par2, final float par3, final float par4, + final float par5, final float par6, final float par7) { final float f6 = this.particleTextureIndex.getMinU(); final float f7 = this.particleTextureIndex.getMaxU(); final float f8 = this.particleTextureIndex.getMinV(); @@ -83,14 +70,33 @@ public void renderParticle( final float f14 = 1.0F; par1Tessellator.setColorRGBA_F( - this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha); + this.particleRed * f14, + this.particleGreen * f14, + this.particleBlue * f14, + this.particleAlpha); par1Tessellator.addVertexWithUV( - f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9); + f11 - par3 * f10 - par6 * f10, + f12 - par4 * f10, + f13 - par5 * f10 - par7 * f10, + f7, + f9); par1Tessellator.addVertexWithUV( - f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8); + f11 - par3 * f10 + par6 * f10, + f12 + par4 * f10, + f13 - par5 * f10 + par7 * f10, + f7, + f8); par1Tessellator.addVertexWithUV( - f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f6, f8); + f11 + par3 * f10 + par6 * f10, + f12 + par4 * f10, + f13 + par5 * f10 + par7 * f10, + f6, + f8); par1Tessellator.addVertexWithUV( - f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f6, f9); + f11 + par3 * f10 - par6 * f10, + f12 - par4 * f10, + f13 + par5 * f10 - par7 * f10, + f6, + f9); } } diff --git a/src/main/java/appeng/client/render/effects/VibrantFX.java b/src/main/java/appeng/client/render/effects/VibrantFX.java index 41b80f80b21..4ddbb5f491e 100644 --- a/src/main/java/appeng/client/render/effects/VibrantFX.java +++ b/src/main/java/appeng/client/render/effects/VibrantFX.java @@ -1,39 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.effects; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityFX; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class VibrantFX extends EntityFX { - public VibrantFX( - final World par1World, - final double x, - final double y, - final double z, - final double par8, - final double par10, - final double par12) { + public VibrantFX(final World par1World, final double x, final double y, final double z, final double par8, + final double par10, final double par12) { super(par1World, x, y, z, par8, par10, par12); final float f = this.rand.nextFloat() * 0.1F + 0.8F; this.particleRed = f * 0.7f; diff --git a/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java b/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java index cc8fd771cd8..4376f762885 100644 --- a/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java +++ b/src/main/java/appeng/client/render/items/ItemEncodedPatternRenderer.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.items; -import appeng.items.misc.ItemEncodedPattern; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; +import appeng.items.misc.ItemEncodedPattern; + public class ItemEncodedPatternRenderer implements IItemRenderer { private final RenderItem ri = new RenderItem(); @@ -48,8 +42,8 @@ public boolean handleRenderType(final ItemStack item, final ItemRenderType type) } @Override - public boolean shouldUseRenderHelper( - final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, + final ItemRendererHelper helper) { return false; } diff --git a/src/main/java/appeng/client/render/items/PaintBallRender.java b/src/main/java/appeng/client/render/items/PaintBallRender.java index 4c98d0f9ffd..1cbb88dc270 100644 --- a/src/main/java/appeng/client/render/items/PaintBallRender.java +++ b/src/main/java/appeng/client/render/items/PaintBallRender.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.items; -import appeng.api.util.AEColor; -import appeng.client.texture.ExtraItemTextures; -import appeng.items.misc.ItemPaintBall; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import appeng.api.util.AEColor; +import appeng.client.texture.ExtraItemTextures; +import appeng.items.misc.ItemPaintBall; + public class PaintBallRender implements IItemRenderer { @Override @@ -36,8 +30,8 @@ public boolean handleRenderType(final ItemStack item, final ItemRenderType type) } @Override - public boolean shouldUseRenderHelper( - final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, + final ItemRendererHelper helper) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @@ -98,7 +92,14 @@ public void renderItem(final ItemRenderType type, final ItemStack item, final Ob } final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( - tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12); + tessellator, + f5, + f6, + f4, + f7, + par2Icon.getIconWidth(), + par2Icon.getIconHeight(), + f12); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glColor4f(1, 1, 1, 1.0F); diff --git a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java index 6b8cb7b9b06..b22f9dd22f8 100644 --- a/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java +++ b/src/main/java/appeng/client/render/items/ToolBiometricCardRender.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.items; -import appeng.api.implementations.items.IBiometricCard; -import appeng.api.util.AEColor; -import appeng.client.texture.ExtraItemTextures; -import com.mojang.authlib.GameProfile; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import appeng.api.implementations.items.IBiometricCard; +import appeng.api.util.AEColor; +import appeng.client.texture.ExtraItemTextures; + +import com.mojang.authlib.GameProfile; + public class ToolBiometricCardRender implements IItemRenderer { @Override @@ -37,8 +32,8 @@ public boolean handleRenderType(final ItemStack item, final ItemRenderType type) } @Override - public boolean shouldUseRenderHelper( - final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, + final ItemRendererHelper helper) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @@ -74,7 +69,14 @@ public void renderItem(final ItemRenderType type, final ItemStack item, final Ob GL11.glTranslatef(-0.5F, -0.3F, 0.01F); final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( - tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12); + tessellator, + f5, + f6, + f4, + f7, + par2Icon.getIconWidth(), + par2Icon.getIconHeight(), + f12); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glColor4f(1, 1, 1, 1.0F); diff --git a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java index fde89a2033e..acb0633cc1b 100644 --- a/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java +++ b/src/main/java/appeng/client/render/items/ToolColorApplicatorRender.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.items; -import appeng.api.util.AEColor; -import appeng.client.texture.ExtraItemTextures; -import appeng.items.tools.powered.ToolColorApplicator; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import appeng.api.util.AEColor; +import appeng.client.texture.ExtraItemTextures; +import appeng.items.tools.powered.ToolColorApplicator; + public class ToolColorApplicatorRender implements IItemRenderer { @Override @@ -36,8 +30,8 @@ public boolean handleRenderType(final ItemStack item, final ItemRenderType type) } @Override - public boolean shouldUseRenderHelper( - final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, + final ItemRendererHelper helper) { return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; } @@ -79,7 +73,14 @@ public void renderItem(final ItemRenderType type, final ItemStack item, final Ob } final float f12 = 0.0625F; ItemRenderer.renderItemIn2D( - tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12); + tessellator, + f5, + f6, + f4, + f7, + par2Icon.getIconWidth(), + par2Icon.getIconHeight(), + f12); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glColor4f(1, 1, 1, 1.0F); diff --git a/src/main/java/appeng/client/render/model/ModelCompass.java b/src/main/java/appeng/client/render/model/ModelCompass.java index 179c5b3e720..ee088e63106 100644 --- a/src/main/java/appeng/client/render/model/ModelCompass.java +++ b/src/main/java/appeng/client/render/model/ModelCompass.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.render.model; diff --git a/src/main/java/appeng/client/texture/CableBusTextures.java b/src/main/java/appeng/client/texture/CableBusTextures.java index 894edb67d4a..df7d1754815 100644 --- a/src/main/java/appeng/client/texture/CableBusTextures.java +++ b/src/main/java/appeng/client/texture/CableBusTextures.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public enum CableBusTextures { + Channels00("MECableSmart00"), Channels01("MECableSmart01"), Channels02("MECableSmart02"), diff --git a/src/main/java/appeng/client/texture/ExtraBlockTextures.java b/src/main/java/appeng/client/texture/ExtraBlockTextures.java index 6ee0ec9d1f6..14da154baef 100644 --- a/src/main/java/appeng/client/texture/ExtraBlockTextures.java +++ b/src/main/java/appeng/client/texture/ExtraBlockTextures.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public enum ExtraBlockTextures { + BlockVibrationChamberFrontOn("BlockVibrationChamberFrontOn"), OreQuartzStone("OreQuartzStone"), diff --git a/src/main/java/appeng/client/texture/ExtraItemTextures.java b/src/main/java/appeng/client/texture/ExtraItemTextures.java index 9c55ebd7d22..ce2b08fa818 100644 --- a/src/main/java/appeng/client/texture/ExtraItemTextures.java +++ b/src/main/java/appeng/client/texture/ExtraItemTextures.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public enum ExtraItemTextures { + White("White"), ItemPaintBallShimmer("ItemPaintBallShimmer"), diff --git a/src/main/java/appeng/client/texture/FlippableIcon.java b/src/main/java/appeng/client/texture/FlippableIcon.java index eea8fc569ad..0b7aa9229be 100644 --- a/src/main/java/appeng/client/texture/FlippableIcon.java +++ b/src/main/java/appeng/client/texture/FlippableIcon.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; import javax.annotation.Nonnull; + import net.minecraft.util.IIcon; public class FlippableIcon implements IIcon { diff --git a/src/main/java/appeng/client/texture/FullIcon.java b/src/main/java/appeng/client/texture/FullIcon.java index a372a31b084..84cfa26f88e 100644 --- a/src/main/java/appeng/client/texture/FullIcon.java +++ b/src/main/java/appeng/client/texture/FullIcon.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.util.IIcon; public class FullIcon implements IIcon { diff --git a/src/main/java/appeng/client/texture/MissingIcon.java b/src/main/java/appeng/client/texture/MissingIcon.java index 9d619f207f5..26347d546e0 100644 --- a/src/main/java/appeng/client/texture/MissingIcon.java +++ b/src/main/java/appeng/client/texture/MissingIcon.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class MissingIcon implements IIcon { private final boolean isBlock; @@ -40,10 +33,9 @@ public int getIconWidth() { @SideOnly(Side.CLIENT) private IIcon getMissing() { - return ((TextureMap) Minecraft.getMinecraft() - .getTextureManager() - .getTexture(this.isBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture)) - .getAtlasSprite("missingno"); + return ((TextureMap) Minecraft.getMinecraft().getTextureManager() + .getTexture(this.isBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture)) + .getAtlasSprite("missingno"); } @Override diff --git a/src/main/java/appeng/client/texture/OffsetIcon.java b/src/main/java/appeng/client/texture/OffsetIcon.java index 6c384feb30c..fea69774343 100644 --- a/src/main/java/appeng/client/texture/OffsetIcon.java +++ b/src/main/java/appeng/client/texture/OffsetIcon.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.util.IIcon; public class OffsetIcon implements IIcon { diff --git a/src/main/java/appeng/client/texture/TaughtIcon.java b/src/main/java/appeng/client/texture/TaughtIcon.java index 4de9c80dd74..e8d8b6eba2f 100644 --- a/src/main/java/appeng/client/texture/TaughtIcon.java +++ b/src/main/java/appeng/client/texture/TaughtIcon.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.util.IIcon; public class TaughtIcon implements IIcon { diff --git a/src/main/java/appeng/client/texture/TmpFlippableIcon.java b/src/main/java/appeng/client/texture/TmpFlippableIcon.java index bef860efad4..97bad4102f6 100644 --- a/src/main/java/appeng/client/texture/TmpFlippableIcon.java +++ b/src/main/java/appeng/client/texture/TmpFlippableIcon.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.client.texture; diff --git a/src/main/java/appeng/container/AEBaseContainer.java b/src/main/java/appeng/container/AEBaseContainer.java index 1894163e00d..2daeb56bf80 100644 --- a/src/main/java/appeng/container/AEBaseContainer.java +++ b/src/main/java/appeng/container/AEBaseContainer.java @@ -1,23 +1,36 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.*; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +import org.apache.commons.lang3.ArrayUtils; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.SecurityPermissions; @@ -49,24 +62,6 @@ import appeng.util.Platform; import appeng.util.inv.AdaptorPlayerHand; import appeng.util.item.AEItemStack; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.*; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import org.apache.commons.lang3.ArrayUtils; public abstract class AEBaseContainer extends Container { @@ -91,8 +86,8 @@ public AEBaseContainer(final InventoryPlayer ip, final TileEntity myTile, final this(ip, myTile, myPart, null); } - public AEBaseContainer( - final InventoryPlayer ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio) { + public AEBaseContainer(final InventoryPlayer ip, final TileEntity myTile, final IPart myPart, + final IGuiItemObject gio) { this.invPlayer = ip; this.tileEntity = myTile; this.part = myPart; @@ -126,7 +121,9 @@ private void walkSyncFields(int offset, final Field[] fields, final Field[] curr if (f.isAnnotationPresent(GuiSync.Recurse.class)) { final GuiSync.Recurse annotation = f.getAnnotation(GuiSync.Recurse.class); walkSyncFields( - offset + annotation.value(), f.getType().getFields(), ArrayUtils.add(currentIndirections, f)); + offset + annotation.value(), + f.getType().getFields(), + ArrayUtils.add(currentIndirections, f)); } if (f.isAnnotationPresent(GuiSync.class)) { final GuiSync annotation = f.getAnnotation(GuiSync.class); @@ -195,8 +192,8 @@ public void setTargetStack(final IAEItemStack stack) { // client doesn't need to re-send, makes for lower overhead rapid packets. if (Platform.isClient()) { final ItemStack a = stack == null ? null : stack.getItemStack(); - final ItemStack b = - this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack(); + final ItemStack b = this.clientRequestedTargetItem == null ? null + : this.clientRequestedTargetItem.getItemStack(); if (Platform.isSameItemPrecise(a, b)) { return; @@ -719,7 +716,10 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, } ais = Platform.poweredExtraction( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + this.getPowerSource(), + this.getCellInventory(), + ais, + this.getActionSource()); if (ais != null) { adp.addItems(ais.getItemStack()); } @@ -738,8 +738,8 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, ais.setStackSize(1); final IAEItemStack extracted = ais.copy(); - ais = Platform.poweredInsert( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + ais = Platform + .poweredInsert(this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); if (ais == null) { final InventoryAdaptor ia = new AdaptorPlayerHand(player); @@ -777,7 +777,10 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, IAEItemStack ais = slotItem.copy(); ais.setStackSize(1); ais = Platform.poweredExtraction( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + this.getPowerSource(), + this.getCellInventory(), + ais, + this.getActionSource()); if (ais != null) { final InventoryAdaptor ia = new AdaptorPlayerHand(player); @@ -801,7 +804,10 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, IAEItemStack ais = slotItem.copy(); ais.setStackSize(ais.getItemStack().getMaxStackSize()); ais = Platform.poweredExtraction( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + this.getPowerSource(), + this.getCellInventory(), + ais, + this.getActionSource()); if (ais != null) { player.inventory.setItemStack(ais.getItemStack()); } else { @@ -811,8 +817,8 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, } } else { IAEItemStack ais = AEApi.instance().storage().createItemStack(player.inventory.getItemStack()); - ais = Platform.poweredInsert( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + ais = Platform + .poweredInsert(this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); if (ais != null) { player.inventory.setItemStack(ais.getItemStack()); } else { @@ -838,7 +844,10 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, final long stackSize = Math.min(maxSize, ais.getStackSize()); ais.setStackSize((stackSize + 1) >> 1); ais = Platform.poweredExtraction( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + this.getPowerSource(), + this.getCellInventory(), + ais, + this.getActionSource()); } if (ais != null) { @@ -851,8 +860,8 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, } else { IAEItemStack ais = AEApi.instance().storage().createItemStack(player.inventory.getItemStack()); ais.setStackSize(1); - ais = Platform.poweredInsert( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + ais = Platform + .poweredInsert(this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); if (ais == null) { final ItemStack is = player.inventory.getItemStack(); is.stackSize--; @@ -894,7 +903,10 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, } ais = Platform.poweredExtraction( - this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource()); + this.getPowerSource(), + this.getCellInventory(), + ais, + this.getActionSource()); if (ais != null) { adp.addItems(ais.getItemStack()); } else { @@ -914,7 +926,9 @@ protected void updateHeld(final EntityPlayerMP p) { try { NetworkHandler.instance.sendTo( new PacketInventoryAction( - InventoryAction.UPDATE_HAND, 0, AEItemStack.create(p.inventory.getItemStack())), + InventoryAction.UPDATE_HAND, + 0, + AEItemStack.create(p.inventory.getItemStack())), p); } catch (final IOException e) { AELog.debug(e); diff --git a/src/main/java/appeng/container/ContainerNull.java b/src/main/java/appeng/container/ContainerNull.java index 2f649f9f60c..41ef52dd68c 100644 --- a/src/main/java/appeng/container/ContainerNull.java +++ b/src/main/java/appeng/container/ContainerNull.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container; diff --git a/src/main/java/appeng/container/ContainerOpenContext.java b/src/main/java/appeng/container/ContainerOpenContext.java index 59e61497510..04ba55911ce 100644 --- a/src/main/java/appeng/container/ContainerOpenContext.java +++ b/src/main/java/appeng/container/ContainerOpenContext.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container; -import appeng.api.parts.IPart; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPart; + public class ContainerOpenContext { private final boolean isItem; diff --git a/src/main/java/appeng/container/guisync/GuiSync.java b/src/main/java/appeng/container/guisync/GuiSync.java index 31c2ef27fd8..19a6a5a3cd2 100644 --- a/src/main/java/appeng/container/guisync/GuiSync.java +++ b/src/main/java/appeng/container/guisync/GuiSync.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.guisync; @@ -24,8 +16,7 @@ import java.lang.annotation.Target; /** - * Annotates that this field should be synchronized between the server and client. - * Requires the field to be public. + * Annotates that this field should be synchronized between the server and client. Requires the field to be public. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) @@ -39,6 +30,7 @@ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public static @interface Recurse { + int value(); } } diff --git a/src/main/java/appeng/container/guisync/SyncData.java b/src/main/java/appeng/container/guisync/SyncData.java index cbda6d60b45..92e76567ccb 100644 --- a/src/main/java/appeng/container/guisync/SyncData.java +++ b/src/main/java/appeng/container/guisync/SyncData.java @@ -1,34 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.guisync; -import appeng.container.AEBaseContainer; -import appeng.core.AELog; -import appeng.core.sync.network.NetworkHandler; -import appeng.core.sync.packets.PacketProgressBar; -import appeng.core.sync.packets.PacketValueConfig; import java.io.IOException; import java.lang.reflect.Field; import java.util.EnumSet; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.ICrafting; +import appeng.container.AEBaseContainer; +import appeng.core.AELog; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketProgressBar; +import appeng.core.sync.packets.PacketValueConfig; + public class SyncData { private final AEBaseContainer source; @@ -97,8 +91,8 @@ public void tick(final ICrafting c) { private void send(final ICrafting o, final Object val) throws IOException { if (val instanceof String) { if (o instanceof EntityPlayerMP) { - NetworkHandler.instance.sendTo( - new PacketValueConfig("SyncDat." + this.channel, (String) val), (EntityPlayerMP) o); + NetworkHandler.instance + .sendTo(new PacketValueConfig("SyncDat." + this.channel, (String) val), (EntityPlayerMP) o); } } else if (this.field.getType().isEnum()) { o.sendProgressBarUpdate(this.source, this.channel, ((Enum) val).ordinal()); diff --git a/src/main/java/appeng/container/implementations/ContainerCPUTable.java b/src/main/java/appeng/container/implementations/ContainerCPUTable.java index 86aa06107da..f254e0b4f89 100644 --- a/src/main/java/appeng/container/implementations/ContainerCPUTable.java +++ b/src/main/java/appeng/container/implementations/ContainerCPUTable.java @@ -1,5 +1,12 @@ package appeng.container.implementations; +import java.io.IOException; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import net.minecraft.entity.player.EntityPlayerMP; + import appeng.api.networking.IGrid; import appeng.api.networking.crafting.ICraftingCPU; import appeng.api.networking.crafting.ICraftingGrid; @@ -10,14 +17,11 @@ import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketCraftingCPUsUpdate; import appeng.util.Platform; + import com.google.common.collect.ImmutableSet; -import java.io.IOException; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; -import net.minecraft.entity.player.EntityPlayerMP; public class ContainerCPUTable implements ICraftingCPUSelectorContainer { + private final AEBaseContainer parent; private ImmutableSet lastCpuSet = null; @@ -33,20 +37,16 @@ public class ContainerCPUTable implements ICraftingCPUSelectorContainer { private final boolean preferBusyCPUs; private final Predicate cpuFilter; - private static final Comparator CPU_COMPARATOR = Comparator.comparing( - (CraftingCPUStatus e) -> e.getName() == null || e.getName().isEmpty()) - .thenComparing(e -> e.getName() != null ? e.getName() : "") - .thenComparingInt(CraftingCPUStatus::getSerial); + private static final Comparator CPU_COMPARATOR = Comparator + .comparing((CraftingCPUStatus e) -> e.getName() == null || e.getName().isEmpty()) + .thenComparing(e -> e.getName() != null ? e.getName() : "").thenComparingInt(CraftingCPUStatus::getSerial); /** - * @param parent Container parent, of which this is a field - * @param onCPUChange Called whenever the current CPU is changed + * @param parent Container parent, of which this is a field + * @param onCPUChange Called whenever the current CPU is changed * @param preferBusyCPUs Whether busy CPUs should be picked first (e.g. crafting status vs. picking a CPU for a job) */ - public ContainerCPUTable( - AEBaseContainer parent, - Consumer onCPUChange, - boolean preferBusyCPUs, + public ContainerCPUTable(AEBaseContainer parent, Consumer onCPUChange, boolean preferBusyCPUs, Predicate cpuFilter) { this.parent = parent; this.onCPUChange = onCPUChange; @@ -159,10 +159,7 @@ public List getCPUs() { } public CraftingCPUStatus getSelectedCPU() { - return this.cpus.stream() - .filter(c -> c.getSerial() == selectedCpuSerial) - .findFirst() - .orElse(null); + return this.cpus.stream().filter(c -> c.getSerial() == selectedCpuSerial).findFirst().orElse(null); } public void handleCPUUpdate(CraftingCPUStatus[] cpus) { diff --git a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java index beb057df0f1..4fe731c40d4 100644 --- a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java +++ b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.util.Iterator; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.CopyMode; import appeng.api.config.FuzzyMode; @@ -35,15 +36,9 @@ import appeng.tile.misc.TileCellWorkbench; import appeng.util.Platform; import appeng.util.iterators.NullIterator; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class ContainerCellWorkbench extends ContainerUpgradeable { + private final TileCellWorkbench workBench; private final AppEngNullInventory nullInventory = new AppEngNullInventory(); @@ -66,8 +61,7 @@ public void setFuzzy(final FuzzyMode valueOf) { } public void nextWorkBenchCopyMode() { - this.workBench - .getConfigManager() + this.workBench.getConfigManager() .putSetting(Settings.COPY_MODE, Platform.nextEnum(this.getWorkBenchCopyMode())); } @@ -83,8 +77,14 @@ protected int getHeight() { @Override protected void setupConfig() { final IInventory cell = this.getUpgradeable().getInventoryByName("cell"); - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, + cell, + 0, + 152, + 8, + this.getInventoryPlayer())); final IInventory inv = this.getUpgradeable().getInventoryByName("config"); final IInventory upgradeInventory = new Upgrades(); @@ -103,24 +103,24 @@ protected void setupConfig() { for (int zz = 0; zz < 3; zz++) { for (int z = 0; z < 8; z++) { final int iSLot = zz * 8 + z; - this.addSlotToContainer(new OptionalSlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.UPGRADES, - upgradeInventory, - this, - iSLot, - 187 + zz * 18, - 8 + 18 * z, - iSLot, - this.getInventoryPlayer())); + this.addSlotToContainer( + new OptionalSlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.UPGRADES, + upgradeInventory, + this, + iSLot, + 187 + zz * 18, + 8 + 18 * z, + iSLot, + this.getInventoryPlayer())); } } /* * if ( supportCapacity() ) { for (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++) addSlotToContainer( new - * OptionalSlotFakeTypeOnly( inv, this, offset++, x, y, z, w, 1 ) ); - * for (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++) addSlotToContainer( new OptionalSlotFakeTypeOnly( - * inv, this, offset++, x, y, z, w + 2, 2 ) ); - * for (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++) addSlotToContainer( new OptionalSlotFakeTypeOnly( - * inv, this, offset++, x, y, z, w + 4, 3 ) ); } + * OptionalSlotFakeTypeOnly( inv, this, offset++, x, y, z, w, 1 ) ); for (int w = 0; w < 2; w++) for (int z = 0; + * z < 9; z++) addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, offset++, x, y, z, w + 2, 2 ) ); for + * (int w = 0; w < 2; w++) for (int z = 0; z < 9; z++) addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, + * this, offset++, x, y, z, w + 4, 3 ) ); } */ } @@ -138,9 +138,8 @@ public int availableUpgrades() { public void detectAndSendChanges() { final ItemStack is = this.workBench.getInventoryByName("cell").getStackInSlot(0); if (Platform.isServer()) { - if (this.workBench - .getWorldObj() - .getTileEntity(this.workBench.xCoord, this.workBench.yCoord, this.workBench.zCoord) + if (this.workBench.getWorldObj() + .getTileEntity(this.workBench.xCoord, this.workBench.yCoord, this.workBench.zCoord) != this.workBench) { this.setValidContainer(false); } @@ -207,16 +206,14 @@ private FuzzyMode getWorkBenchFuzzyMode() { public void partition() { final IInventory inv = this.getUpgradeable().getInventoryByName("config"); - final IMEInventory cellInv = AEApi.instance() - .registries() - .cell() - .getCellInventory( - this.getUpgradeable().getInventoryByName("cell").getStackInSlot(0), null, StorageChannel.ITEMS); + final IMEInventory cellInv = AEApi.instance().registries().cell().getCellInventory( + this.getUpgradeable().getInventoryByName("cell").getStackInSlot(0), + null, + StorageChannel.ITEMS); Iterator i = new NullIterator(); if (cellInv != null) { - final IItemList list = - cellInv.getAvailableItems(AEApi.instance().storage().createItemList()); + final IItemList list = cellInv.getAvailableItems(AEApi.instance().storage().createItemList()); i = list.iterator(); } diff --git a/src/main/java/appeng/container/implementations/ContainerChest.java b/src/main/java/appeng/container/implementations/ContainerChest.java index b1aea0dff32..139b9c55356 100644 --- a/src/main/java/appeng/container/implementations/ContainerChest.java +++ b/src/main/java/appeng/container/implementations/ContainerChest.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.storage.TileChest; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerChest extends AEBaseContainer { @@ -31,8 +24,14 @@ public ContainerChest(final InventoryPlayer ip, final TileChest chest) { super(ip, chest, null); this.chest = chest; - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest, 1, 80, 37, this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, + this.chest, + 1, + 80, + 37, + this.getInventoryPlayer())); this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */ 82); } diff --git a/src/main/java/appeng/container/implementations/ContainerCondenser.java b/src/main/java/appeng/container/implementations/ContainerCondenser.java index 6008a97dd06..f318713d29f 100644 --- a/src/main/java/appeng/container/implementations/ContainerCondenser.java +++ b/src/main/java/appeng/container/implementations/ContainerCondenser.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.api.config.CondenserOutput; import appeng.api.config.Settings; import appeng.container.AEBaseContainer; @@ -27,7 +21,6 @@ import appeng.container.slot.SlotRestrictedInput; import appeng.tile.misc.TileCondenser; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerCondenser extends AEBaseContainer implements IProgressProvider { @@ -49,14 +42,14 @@ public ContainerCondenser(final InventoryPlayer ip, final TileCondenser condense this.addSlotToContainer( new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.TRASH, condenser, 0, 51, 52, ip)); this.addSlotToContainer(new SlotOutput(condenser, 1, 105, 52, -1)); - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, condenser.getInternalInventory(), 2, 101, 26, - ip)) - .setStackLimit(1)); + ip)).setStackLimit(1)); this.bindPlayerInventory(ip, 0, 197 - /* height of player inventory */ 82); } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java index 09d9d4cb38f..687052996f3 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import javax.annotation.Nonnull; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import appeng.api.config.SecurityPermissions; import appeng.api.networking.IGrid; import appeng.api.networking.security.BaseActionSource; @@ -30,12 +30,6 @@ import appeng.core.sync.GuiBridge; import appeng.tile.inventory.AppEngInternalInventory; import appeng.util.Platform; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class ContainerCraftAmount extends AEBaseContainer { diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index df5bdab854b..43e13fac3a7 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.io.IOException; +import java.util.concurrent.Future; + +import javax.annotation.Nonnull; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.SecurityPermissions; @@ -48,16 +53,6 @@ import appeng.parts.reporting.PartPatternTerminalEx; import appeng.parts.reporting.PartTerminal; import appeng.util.Platform; -import java.io.IOException; -import java.util.concurrent.Future; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.world.World; public class ContainerCraftConfirm extends AEBaseContainer implements ICraftingCPUSelectorContainer { @@ -141,11 +136,11 @@ public void detectAndSendChanges() { try { final PacketMEInventoryUpdate storageUpdate = new PacketMEInventoryUpdate((byte) 0); final PacketMEInventoryUpdate pendingUpdate = new PacketMEInventoryUpdate((byte) 1); - final PacketMEInventoryUpdate missingUpdate = - this.result.isSimulation() ? new PacketMEInventoryUpdate((byte) 2) : null; + final PacketMEInventoryUpdate missingUpdate = this.result.isSimulation() + ? new PacketMEInventoryUpdate((byte) 2) + : null; - final IItemList plan = - AEApi.instance().storage().createItemList(); + final IItemList plan = AEApi.instance().storage().createItemList(); this.result.populatePlan(plan); this.setUsedBytes(this.result.getByteTotal()); @@ -265,12 +260,11 @@ public void switchToOriginalGUI() { } if (originalGui != null && this.getOpenContext() != null) { - NetworkHandler.instance.sendTo( - new PacketSwitchGuis(originalGui), (EntityPlayerMP) this.getInventoryPlayer().player); + NetworkHandler.instance + .sendTo(new PacketSwitchGuis(originalGui), (EntityPlayerMP) this.getInventoryPlayer().player); final TileEntity te = this.getOpenContext().getTile(); - Platform.openGUI( - this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui); + Platform.openGUI(this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui); } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index 58e2c2ebece..f702072648e 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; @@ -40,12 +40,6 @@ import appeng.me.cluster.implementations.CraftingCPUCluster; import appeng.tile.crafting.TileCraftingTile; import appeng.util.Platform; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraftforge.common.util.ForgeDirection; public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorHandlerReceiver, ICustomNameObject { @@ -99,8 +93,8 @@ protected void setCPU(final ICraftingCPU c) { for (final Object g : this.crafters) { if (g instanceof EntityPlayer) { try { - NetworkHandler.instance.sendTo( - new PacketValueConfig("CraftingStatus", "Clear"), (EntityPlayerMP) g); + NetworkHandler.instance + .sendTo(new PacketValueConfig("CraftingStatus", "Clear"), (EntityPlayerMP) g); } catch (final IOException e) { AELog.debug(e); } @@ -153,8 +147,8 @@ public void detectAndSendChanges() { final long elapsedTime = this.getMonitor().getElapsedTime(); final double remainingItems = this.getMonitor().getRemainingItemCount(); final double startItems = this.getMonitor().getStartItemCount(); - final long eta = - (long) (elapsedTime / Math.max(1d, (startItems - remainingItems)) * remainingItems); + final long eta = (long) (elapsedTime / Math.max(1d, (startItems - remainingItems)) + * remainingItems); this.setEstimatedTime(eta); } @@ -198,9 +192,7 @@ public boolean isValid(final Object verificationToken) { } @Override - public void postChange( - final IBaseMonitor monitor, - final Iterable change, + public void postChange(final IBaseMonitor monitor, final Iterable change, final BaseActionSource actionSource) { for (IAEItemStack is : change) { is = is.copy(); diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java index 42ec078ae3e..c52e7a9fca1 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingStatus.java @@ -1,30 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.util.*; + +import net.minecraft.entity.player.InventoryPlayer; + import appeng.api.storage.ITerminalHost; import appeng.container.guisync.GuiSync; import appeng.container.interfaces.ICraftingCPUSelectorContainer; -import java.util.*; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerCraftingStatus extends ContainerCraftingCPU implements ICraftingCPUSelectorContainer { + @GuiSync.Recurse(5) public ContainerCPUTable cpuTable; diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java index 1c8501d3f99..aa99de6cbb1 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; + import appeng.api.storage.ITerminalHost; import appeng.container.ContainerNull; import appeng.container.slot.SlotCraftingMatrix; @@ -27,11 +25,6 @@ import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.IAEAppEngInventory; import appeng.tile.inventory.InvOperation; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IContainerCraftingPacket { @@ -50,8 +43,12 @@ public ContainerCraftingTerm(final InventoryPlayer ip, final ITerminalHost monit for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { this.addSlotToContainer( - this.craftingSlots[x + y * 3] = - new SlotCraftingMatrix(this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18)); + this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( + this, + crafting, + x + y * 3, + 37 + x * 18, + -72 + y * 18)); } } @@ -85,20 +82,16 @@ public void onCraftMatrixChanged(final IInventory par1IInventory) { ic.setInventorySlotContents(x, this.craftingSlots[x].getStack()); } - this.outputSlot.putStack( - CraftingManager.getInstance().findMatchingRecipe(ic, this.getPlayerInv().player.worldObj)); + this.outputSlot + .putStack(CraftingManager.getInstance().findMatchingRecipe(ic, this.getPlayerInv().player.worldObj)); } @Override public void saveChanges() {} @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) {} + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) {} @Override public IInventory getInventoryByName(final String name) { diff --git a/src/main/java/appeng/container/implementations/ContainerDrive.java b/src/main/java/appeng/container/implementations/ContainerDrive.java index eb86c7ce25f..0b717ec81a1 100644 --- a/src/main/java/appeng/container/implementations/ContainerDrive.java +++ b/src/main/java/appeng/container/implementations/ContainerDrive.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.storage.TileDrive; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerDrive extends AEBaseContainer { @@ -30,13 +23,14 @@ public ContainerDrive(final InventoryPlayer ip, final TileDrive drive) { for (int y = 0; y < 5; y++) { for (int x = 0; x < 2; x++) { - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, - drive, - x + y * 2, - 71 + x * 18, - 14 + y * 18, - this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, + drive, + x + y * 2, + 71 + x * 18, + 14 + y * 18, + this.getInventoryPlayer())); } } diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index 42e93ac4177..a2275581118 100644 --- a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java +++ b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; + import appeng.api.config.*; import appeng.container.guisync.GuiSync; import appeng.container.slot.OptionalSlotFakeTypeOnly; @@ -25,8 +20,6 @@ import appeng.container.slot.SlotRestrictedInput; import appeng.parts.automation.PartFormationPlane; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; public class ContainerFormationPlane extends ContainerUpgradeable { @@ -59,41 +52,46 @@ protected void setupConfig() { } final IInventory upgrades = this.getUpgradeable().getInventoryByName("upgrades"); - this.addSlotToContainer((new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.UPGRADES, + upgrades, + 0, + 187, + 8, + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } @Override @@ -111,8 +109,7 @@ public void detectAndSendChanges() { this.verifyPermissions(SecurityPermissions.BUILD, false); if (Platform.isServer()) { - this.setFuzzyMode( - (FuzzyMode) this.getUpgradeable().getConfigManager().getSetting(Settings.FUZZY_MODE)); + this.setFuzzyMode((FuzzyMode) this.getUpgradeable().getConfigManager().getSetting(Settings.FUZZY_MODE)); this.setPlaceMode((YesNo) this.getUpgradeable().getConfigManager().getSetting(Settings.PLACE_BLOCK)); } diff --git a/src/main/java/appeng/container/implementations/ContainerGrinder.java b/src/main/java/appeng/container/implementations/ContainerGrinder.java index cc8d3e6b068..4e8ddc8a7de 100644 --- a/src/main/java/appeng/container/implementations/ContainerGrinder.java +++ b/src/main/java/appeng/container/implementations/ContainerGrinder.java @@ -1,41 +1,52 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.slot.SlotInaccessible; import appeng.container.slot.SlotOutput; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.grindstone.TileGrinder; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerGrinder extends AEBaseContainer { public ContainerGrinder(final InventoryPlayer ip, final TileGrinder grinder) { super(ip, grinder, null); - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.ORE, grinder, 0, 12, 17, this.getInventoryPlayer())); - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.ORE, grinder, 1, 12 + 18, 17, this.getInventoryPlayer())); - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.ORE, grinder, 2, 12 + 36, 17, this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.ORE, + grinder, + 0, + 12, + 17, + this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.ORE, + grinder, + 1, + 12 + 18, + 17, + this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.ORE, + grinder, + 2, + 12 + 36, + 17, + this.getInventoryPlayer())); this.addSlotToContainer(new SlotInaccessible(grinder, 6, 80, 40)); diff --git a/src/main/java/appeng/container/implementations/ContainerIOPort.java b/src/main/java/appeng/container/implementations/ContainerIOPort.java index 39990b22493..60ad6f2b73e 100644 --- a/src/main/java/appeng/container/implementations/ContainerIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerIOPort.java @@ -1,31 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; + import appeng.api.config.*; import appeng.container.guisync.GuiSync; import appeng.container.slot.SlotOutput; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.storage.TileIOPort; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; public class ContainerIOPort extends ContainerUpgradeable { @@ -53,13 +46,14 @@ protected void setupConfig() { for (int y = 0; y < 3; y++) { for (int x = 0; x < 2; x++) { - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, - cells, - x + y * 2, - offX + x * 18, - offY + y * 18, - this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, + cells, + x + y * 2, + offX + x * 18, + offY + y * 18, + this.getInventoryPlayer())); } } @@ -67,35 +61,41 @@ protected void setupConfig() { offY = 17; for (int y = 0; y < 3; y++) { for (int x = 0; x < 2; x++) { - this.addSlotToContainer(new SlotOutput( - cells, - 6 + x + y * 2, - offX + x * 18, - offY + y * 18, - SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon)); + this.addSlotToContainer( + new SlotOutput( + cells, + 6 + x + y * 2, + offX + x * 18, + offY + y * 18, + SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon)); } } final IInventory upgrades = this.getUpgradeable().getInventoryByName("upgrades"); - this.addSlotToContainer((new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.UPGRADES, + upgrades, + 0, + 187, + 8, + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerInscriber.java b/src/main/java/appeng/container/implementations/ContainerInscriber.java index ef8e9794ea7..9817617768e 100644 --- a/src/main/java/appeng/container/implementations/ContainerInscriber.java +++ b/src/main/java/appeng/container/implementations/ContainerInscriber.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IItemDefinition; import appeng.api.features.IInscriberRecipe; @@ -27,9 +23,6 @@ import appeng.container.slot.SlotRestrictedInput; import appeng.tile.misc.TileInscriber; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; /** * @author AlgorithmX2 @@ -122,8 +115,7 @@ public boolean isValidForSlot(final Slot s, final ItemStack is) { final ItemStack bot = this.ti.getStackInSlot(1); if (s == this.middle) { - for (final ItemStack optional : - AEApi.instance().registries().inscriber().getOptionals()) { + for (final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals()) { if (Platform.isSameItemPrecise(optional, is)) { return false; } @@ -132,23 +124,16 @@ public boolean isValidForSlot(final Slot s, final ItemStack is) { boolean matches = false; boolean found = false; - for (final IInscriberRecipe recipe : - AEApi.instance().registries().inscriber().getRecipes()) { + for (final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) { final boolean matchA = (top == null && !recipe.getTopOptional().isPresent()) - || (Platform.isSameItemPrecise( - top, recipe.getTopOptional().orNull())) - && // and... + || (Platform.isSameItemPrecise(top, recipe.getTopOptional().orNull())) && // and... (bot == null && !recipe.getBottomOptional().isPresent()) - | (Platform.isSameItemPrecise( - bot, recipe.getBottomOptional().orNull())); + | (Platform.isSameItemPrecise(bot, recipe.getBottomOptional().orNull())); final boolean matchB = (bot == null && !recipe.getTopOptional().isPresent()) - || (Platform.isSameItemPrecise( - bot, recipe.getTopOptional().orNull())) - && // and... + || (Platform.isSameItemPrecise(bot, recipe.getTopOptional().orNull())) && // and... (top == null && !recipe.getBottomOptional().isPresent()) - | (Platform.isSameItemPrecise( - top, recipe.getBottomOptional().orNull())); + | (Platform.isSameItemPrecise(top, recipe.getBottomOptional().orNull())); if (matchA || matchB) { matches = true; @@ -174,22 +159,18 @@ public boolean isValidForSlot(final Slot s, final ItemStack is) { } // name presses - final IItemDefinition namePress = - AEApi.instance().definitions().materials().namePress(); + final IItemDefinition namePress = AEApi.instance().definitions().materials().namePress(); if (namePress.isSameAs(otherSlot)) { return namePress.isSameAs(is); } // everything else boolean isValid = false; - for (final IInscriberRecipe recipe : - AEApi.instance().registries().inscriber().getRecipes()) { + for (final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) { if (Platform.isSameItemPrecise(recipe.getTopOptional().orNull(), otherSlot)) { - isValid = Platform.isSameItemPrecise( - is, recipe.getBottomOptional().orNull()); + isValid = Platform.isSameItemPrecise(is, recipe.getBottomOptional().orNull()); } else if (Platform.isSameItemPrecise(recipe.getBottomOptional().orNull(), otherSlot)) { - isValid = Platform.isSameItemPrecise( - is, recipe.getTopOptional().orNull()); + isValid = Platform.isSameItemPrecise(is, recipe.getTopOptional().orNull()); } if (isValid) { diff --git a/src/main/java/appeng/container/implementations/ContainerInterface.java b/src/main/java/appeng/container/implementations/ContainerInterface.java index 56f73048c6c..42830eb250d 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterface.java +++ b/src/main/java/appeng/container/implementations/ContainerInterface.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.util.ArrayList; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import appeng.api.config.*; import appeng.api.util.IConfigManager; import appeng.container.guisync.GuiSync; @@ -25,10 +23,6 @@ import appeng.helpers.DualityInterface; import appeng.helpers.IInterfaceHost; import appeng.util.Platform; -import java.util.ArrayList; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class ContainerInterface extends ContainerUpgradeable implements IOptionalSlotHost { @@ -57,7 +51,8 @@ public ContainerInterface(final InventoryPlayer ip, final IInterfaceHost te) { for (int row = 0; row < 4; ++row) { for (int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++) { - this.addSlotToContainer(new OptionalSlotRestrictedInput( + this.addSlotToContainer( + new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), this, @@ -65,8 +60,7 @@ public ContainerInterface(final InventoryPlayer ip, final IInterfaceHost te) { 8 + 18 * x, 108 - row * 18, row, - this.getInventoryPlayer()) - .setStackLimit(1)); + this.getInventoryPlayer()).setStackLimit(1)); } } diff --git a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java index 8a0e8402dac..103d9d9c1c8 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Settings; import appeng.api.config.Upgrades; import appeng.api.config.YesNo; @@ -42,20 +46,12 @@ import appeng.util.inv.AdaptorPlayerHand; import appeng.util.inv.ItemSlot; import appeng.util.inv.WrapperInvSlot; + import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public final class ContainerInterfaceTerminal extends AEBaseContainer { + /** * this stuff is all server side.. */ @@ -130,8 +126,8 @@ public void detectAndSendChanges() { if (!this.data.hasNoTags()) { try { - NetworkHandler.instance.sendTo( - new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player); + NetworkHandler.instance + .sendTo(new PacketCompressedNBT(this.data), (EntityPlayerMP) this.getPlayerInv().player); } catch (final IOException e) { // :P } @@ -162,7 +158,8 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, if (hasItemInHand) { for (int s = 0; s < interfaceHandler.getSizeInventory(); s++) { if (Platform.isSameItemPrecise( - interfaceHandler.getStackInSlot(s), player.inventory.getItemStack())) { + interfaceHandler.getStackInSlot(s), + player.inventory.getItemStack())) { canInsert = false; break; } @@ -173,8 +170,7 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, player.inventory.setItemStack(interfaceSlot.addItems(player.inventory.getItemStack())); } else { inSlot = inSlot.copy(); - final ItemStack inHand = - player.inventory.getItemStack().copy(); + final ItemStack inHand = player.inventory.getItemStack().copy(); theSlot.setInventorySlotContents(0, null); player.inventory.setItemStack(null); @@ -199,7 +195,8 @@ public void doAction(final EntityPlayerMP player, final InventoryAction action, if (hasItemInHand) { for (int s = 0; s < interfaceHandler.getSizeInventory(); s++) { if (Platform.isSameItemPrecise( - interfaceHandler.getStackInSlot(s), player.inventory.getItemStack())) { + interfaceHandler.getStackInSlot(s), + player.inventory.getItemStack())) { canInsert = false; break; } @@ -297,8 +294,7 @@ private void regenList(final NBTTagCompound data) { for (final IGridNode gn : this.grid.getMachines(PartP2PInterface.class)) { final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); final DualityInterface dual = ih.getInterfaceDuality(); - if (gn.isActive() - && dual.getConfigManager().getSetting(Settings.INTERFACE_TERMINAL) == YesNo.YES + if (gn.isActive() && dual.getConfigManager().getSetting(Settings.INTERFACE_TERMINAL) == YesNo.YES && !((PartP2PInterface) ih).isOutput()) { for (int i = 0; i <= dual.getInstalledUpgrades(Upgrades.PATTERN_CAPACITY); ++i) { this.diList.put(ih, new InvTracker(dual, dual.getPatterns(), dual.getTermName(), i * 9, 9)); @@ -372,12 +368,8 @@ private static class InvTracker { private final int Z; private final int dim; - public InvTracker( - final DualityInterface dual, - final IInventory patterns, - final String unlocalizedName, - int offset, - int size) { + public InvTracker(final DualityInterface dual, final IInventory patterns, final String unlocalizedName, + int offset, int size) { this.server = patterns; this.client = new AppEngInternalInventory(null, size); this.unlocalizedName = unlocalizedName; diff --git a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java index 5fa687b247e..5d50d180482 100644 --- a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java +++ b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; + import appeng.api.config.*; import appeng.container.guisync.GuiSync; import appeng.container.slot.SlotFakeTypeOnly; @@ -26,10 +23,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; public class ContainerLevelEmitter extends ContainerUpgradeable { @@ -67,44 +60,44 @@ public void setLevel(final long l, final EntityPlayer player) { protected void setupConfig() { final IInventory upgrades = this.getUpgradeable().getInventoryByName("upgrades"); if (this.availableUpgrades() > 0) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } if (this.availableUpgrades() > 1) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } if (this.availableUpgrades() > 2) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } if (this.availableUpgrades() > 3) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } final IInventory inv = this.getUpgradeable().getInventoryByName("config"); @@ -133,10 +126,8 @@ public void detectAndSendChanges() { this.EmitterValue = this.lvlEmitter.getReportingValue(); this.setCraftingMode( (YesNo) this.getUpgradeable().getConfigManager().getSetting(Settings.CRAFT_VIA_REDSTONE)); - this.setLevelMode( - (LevelType) this.getUpgradeable().getConfigManager().getSetting(Settings.LEVEL_TYPE)); - this.setFuzzyMode( - (FuzzyMode) this.getUpgradeable().getConfigManager().getSetting(Settings.FUZZY_MODE)); + this.setLevelMode((LevelType) this.getUpgradeable().getConfigManager().getSetting(Settings.LEVEL_TYPE)); + this.setFuzzyMode((FuzzyMode) this.getUpgradeable().getConfigManager().getSetting(Settings.FUZZY_MODE)); this.setRedStoneMode( (RedstoneMode) this.getUpgradeable().getConfigManager().getSetting(Settings.REDSTONE_EMITTER)); } diff --git a/src/main/java/appeng/container/implementations/ContainerMAC.java b/src/main/java/appeng/container/implementations/ContainerMAC.java index 6f7180d6938..691bc81a894 100644 --- a/src/main/java/appeng/container/implementations/ContainerMAC.java +++ b/src/main/java/appeng/container/implementations/ContainerMAC.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import appeng.api.config.RedstoneMode; import appeng.api.config.SecurityPermissions; import appeng.api.config.Settings; @@ -30,10 +27,6 @@ import appeng.items.misc.ItemEncodedPattern; import appeng.tile.crafting.TileMolecularAssembler; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class ContainerMAC extends ContainerUpgradeable implements IProgressProvider { @@ -90,54 +83,60 @@ protected void setupConfig() { offX = 126; offY = 16; - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, - mac, - 10, - offX, - offY, - this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, + mac, + 10, + offX, + offY, + this.getInventoryPlayer())); this.addSlotToContainer(new SlotOutput(mac, 9, offX, offY + 32, -1)); offX = 122; offY = 17; final IInventory upgrades = this.getUpgradeable().getInventoryByName("upgrades"); - this.addSlotToContainer((new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.UPGRADES, + upgrades, + 0, + 187, + 8, + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index f665ced0193..f3b6867a157 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.io.IOException; +import java.nio.BufferOverflowException; + +import javax.annotation.Nonnull; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.implementations.guiobjects.IPortableCell; @@ -50,16 +55,6 @@ import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; import appeng.util.Platform; -import java.io.IOException; -import java.nio.BufferOverflowException; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class ContainerMEMonitorable extends AEBaseContainer implements IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver { @@ -84,8 +79,8 @@ public ContainerMEMonitorable(final InventoryPlayer ip, final ITerminalHost moni this(ip, monitorable, true); } - protected ContainerMEMonitorable( - final InventoryPlayer ip, final ITerminalHost monitorable, final boolean bindInventory) { + protected ContainerMEMonitorable(final InventoryPlayer ip, final ITerminalHost monitorable, + final boolean bindInventory) { super( ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null, @@ -117,8 +112,10 @@ protected ContainerMEMonitorable( this.networkNode = node; final IGrid g = node.getGrid(); if (g != null) { - this.setPowerSource(new ChannelPowerSrc( - this.networkNode, (IEnergySource) g.getCache(IEnergyGrid.class))); + this.setPowerSource( + new ChannelPowerSrc( + this.networkNode, + (IEnergySource) g.getCache(IEnergyGrid.class))); } } } @@ -169,7 +166,8 @@ public void detectAndSendChanges() { for (final Object crafter : this.crafters) { try { NetworkHandler.instance.sendTo( - new PacketValueConfig(set.name(), sideLocal.name()), (EntityPlayerMP) crafter); + new PacketValueConfig(set.name(), sideLocal.name()), + (EntityPlayerMP) crafter); } catch (final IOException e) { AELog.debug(e); } @@ -210,8 +208,8 @@ public void detectAndSendChanges() { this.updatePowerStatus(); final boolean oldAccessible = this.canAccessViewCells; - this.canAccessViewCells = - this.host instanceof WirelessTerminalGuiObject || this.hasAccess(SecurityPermissions.BUILD, false); + this.canAccessViewCells = this.host instanceof WirelessTerminalGuiObject + || this.hasAccess(SecurityPermissions.BUILD, false); if (this.canAccessViewCells != oldAccessible) { for (int y = 0; y < 5; y++) { if (this.cellView[y] != null) { @@ -305,9 +303,7 @@ public boolean isValid(final Object verificationToken) { } @Override - public void postChange( - final IBaseMonitor monitor, - final Iterable change, + public void postChange(final IBaseMonitor monitor, final Iterable change, final BaseActionSource source) { for (final IAEItemStack is : change) { this.items.add(is); diff --git a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java index 5e1cc46aec6..8f4f68f6151 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java +++ b/src/main/java/appeng/container/implementations/ContainerMEPortableCell.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; import appeng.api.implementations.guiobjects.IPortableCell; import appeng.container.interfaces.IInventorySlotAware; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; public class ContainerMEPortableCell extends ContainerMEMonitorable { @@ -50,8 +43,7 @@ public ContainerMEPortableCell(final InventoryPlayer ip, final IPortableCell mon @Override public void detectAndSendChanges() { - final ItemStack currentItem = this.slot < 0 - ? this.getPlayerInv().getCurrentItem() + final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem() : this.getPlayerInv().getStackInSlot(this.slot); if (this.civ != null) { @@ -75,7 +67,9 @@ public void detectAndSendChanges() { this.ticks++; if (this.ticks > 10) { this.civ.extractAEPower( - this.getPowerMultiplier() * this.ticks, Actionable.MODULATE, PowerMultiplier.CONFIG); + this.getPowerMultiplier() * this.ticks, + Actionable.MODULATE, + PowerMultiplier.CONFIG); this.ticks = 0; } super.detectAndSendChanges(); diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java index 92645826c15..e612f9a3ee4 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.PowerMultiplier; import appeng.api.implementations.guiobjects.INetworkTool; @@ -34,12 +34,6 @@ import appeng.core.sync.packets.PacketMEInventoryUpdate; import appeng.util.Platform; import appeng.util.item.AEItemStack; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class ContainerNetworkStatus extends AEBaseContainer { @@ -101,8 +95,7 @@ public void detectAndSendChanges() { final PacketMEInventoryUpdate piu = new PacketMEInventoryUpdate(); for (final Class machineClass : this.network.getMachinesClasses()) { - final IItemList list = - AEApi.instance().storage().createItemList(); + final IItemList list = AEApi.instance().storage().createItemList(); for (final IGridNode machine : this.network.getMachines(machineClass)) { final IGridBlock blk = machine.getGridBlock(); final ItemStack is = blk.getMachineRepresentation(); diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java index 8eaf77d60a0..5905f44dc70 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java @@ -1,31 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.implementations.guiobjects.INetworkTool; import appeng.container.AEBaseContainer; import appeng.container.guisync.GuiSync; import appeng.container.slot.SlotRestrictedInput; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class ContainerNetworkTool extends AEBaseContainer { @@ -42,13 +35,14 @@ public ContainerNetworkTool(final InventoryPlayer ip, final INetworkTool te) { for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { - this.addSlotToContainer((new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.UPGRADES, - te, - y * 3 + x, - 80 - 18 + x * 18, - 37 - 18 + y * 18, - this.getInventoryPlayer()))); + this.addSlotToContainer( + (new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.UPGRADES, + te, + y * 3 + x, + 80 - 18 + x * 18, + 37 - 18 + y * 18, + this.getInventoryPlayer()))); } } diff --git a/src/main/java/appeng/container/implementations/ContainerOreFilter.java b/src/main/java/appeng/container/implementations/ContainerOreFilter.java index 2c21101b288..2156069d624 100644 --- a/src/main/java/appeng/container/implementations/ContainerOreFilter.java +++ b/src/main/java/appeng/container/implementations/ContainerOreFilter.java @@ -1,5 +1,8 @@ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.tileentity.TileEntity; + import appeng.api.parts.IPart; import appeng.client.gui.widgets.MEGuiTextField; import appeng.container.AEBaseContainer; @@ -8,10 +11,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.tileentity.TileEntity; public class ContainerOreFilter extends AEBaseContainer { + private final IOreFilterable filterHost; @SideOnly(Side.CLIENT) diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java index b540485c5c5..5a5047b1e0a 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java @@ -1,23 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.*; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.definitions.IDefinitions; @@ -40,22 +50,6 @@ import appeng.util.Platform; import appeng.util.inv.AdaptorPlayerHand; import appeng.util.item.AEItemStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.common.util.ForgeDirection; public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket { @@ -90,8 +84,11 @@ public ContainerPatternTerm(final InventoryPlayer ip, final ITerminalHost monito for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { this.addSlotToContainer( - this.craftingSlots[x + y * 3] = - new SlotFakeCraftingMatrix(this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18)); + this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( + this.crafting, + x + y * 3, + 18 + x * 18, + -76 + y * 18)); } } @@ -184,12 +181,8 @@ private ItemStack getAndUpdateOutput() { public void saveChanges() {} @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) {} + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) {} public void encodeAndMoveToInventory(boolean encodeWholeStack) { encode(); @@ -235,12 +228,8 @@ else if (output == null) { } // add a new encoded pattern. - for (final ItemStack encodedPatternStack : AEApi.instance() - .definitions() - .items() - .encodedPattern() - .maybeStack(1) - .asSet()) { + for (final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern() + .maybeStack(1).asSet()) { output = encodedPatternStack; this.patternSlotOUT.putStack(output); } @@ -292,7 +281,7 @@ private ItemStack[] getOutputs() { final ItemStack out = this.getAndUpdateOutput(); if (out != null && out.stackSize > 0) { - return new ItemStack[] {out}; + return new ItemStack[] { out }; } } else { final List list = new ArrayList<>(3); @@ -354,8 +343,8 @@ public void craftOrGetItem(final PacketPatternSlot packetPatternSlot) { if (packetPatternSlot.slotItem != null && this.getCellInventory() != null) { final IAEItemStack out = packetPatternSlot.slotItem.copy(); InventoryAdaptor inv = new AdaptorPlayerHand(this.getPlayerInv().player); - final InventoryAdaptor playerInv = - InventoryAdaptor.getAdaptor(this.getPlayerInv().player, ForgeDirection.UNKNOWN); + final InventoryAdaptor playerInv = InventoryAdaptor + .getAdaptor(this.getPlayerInv().player, ForgeDirection.UNKNOWN); if (packetPatternSlot.shift) { inv = playerInv; @@ -365,8 +354,8 @@ public void craftOrGetItem(final PacketPatternSlot packetPatternSlot) { return; } - final IAEItemStack extracted = Platform.poweredExtraction( - this.getPowerSource(), this.getCellInventory(), out, this.getActionSource()); + final IAEItemStack extracted = Platform + .poweredExtraction(this.getPowerSource(), this.getCellInventory(), out, this.getActionSource()); final EntityPlayer p = this.getPlayerInv().player; if (extracted != null) { @@ -383,7 +372,8 @@ public void craftOrGetItem(final PacketPatternSlot packetPatternSlot) { for (int x = 0; x < 9; x++) { ic.setInventorySlotContents( - x, packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack()); + x, + packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack()); } final IRecipe r = Platform.findMatchingRecipe(ic, p.worldObj); @@ -439,11 +429,10 @@ public void craftOrGetItem(final PacketPatternSlot packetPatternSlot) { for (int x = 0; x < real.getSizeInventory(); x++) { final ItemStack failed = real.getStackInSlot(x); if (failed != null) { - this.getCellInventory() - .injectItems( - AEItemStack.create(failed), - Actionable.MODULATE, - new MachineSource(this.getPatternTerminal())); + this.getCellInventory().injectItems( + AEItemStack.create(failed), + Actionable.MODULATE, + new MachineSource(this.getPatternTerminal())); } } } @@ -554,20 +543,16 @@ public void setCanBeSubstitute(final boolean beSubstitute) { } static boolean canDoubleStacks(SlotFake[] slots) { - List enabledSlots = - Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList()); - long emptyStots = - enabledSlots.stream().filter(s -> s.getStack() == null).count(); - long fullSlots = enabledSlots.stream() - .filter(s -> s.getStack() != null && s.getStack().stackSize * 2 > 127) + List enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList()); + long emptyStots = enabledSlots.stream().filter(s -> s.getStack() == null).count(); + long fullSlots = enabledSlots.stream().filter(s -> s.getStack() != null && s.getStack().stackSize * 2 > 127) .count(); return fullSlots <= emptyStots && emptyStots < enabledSlots.size(); } static void doubleStacksInternal(SlotFake[] slots) { List overFlowStacks = new ArrayList<>(); - List enabledSlots = - Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList()); + List enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList()); for (final Slot s : enabledSlots) { ItemStack st = s.getStack(); if (st == null) continue; diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTermEx.java b/src/main/java/appeng/container/implementations/ContainerPatternTermEx.java index 901b04cdeed..f393a89547d 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTermEx.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTermEx.java @@ -3,16 +3,9 @@ import static appeng.container.implementations.ContainerPatternTerm.canDoubleStacks; import static appeng.container.implementations.ContainerPatternTerm.doubleStacksInternal; -import appeng.api.AEApi; -import appeng.api.definitions.IDefinitions; -import appeng.api.storage.ITerminalHost; -import appeng.container.guisync.GuiSync; -import appeng.container.slot.*; -import appeng.helpers.IContainerCraftingPacket; -import appeng.parts.reporting.PartPatternTerminalEx; -import appeng.util.Platform; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -23,8 +16,18 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import appeng.api.AEApi; +import appeng.api.definitions.IDefinitions; +import appeng.api.storage.ITerminalHost; +import appeng.container.guisync.GuiSync; +import appeng.container.slot.*; +import appeng.helpers.IContainerCraftingPacket; +import appeng.parts.reporting.PartPatternTerminalEx; +import appeng.util.Platform; + public class ContainerPatternTermEx extends ContainerMEMonitorable implements IOptionalSlotHost, IContainerCraftingPacket { + private static final int CRAFTING_GRID_PAGES = 2; private static final int CRAFTING_GRID_WIDTH = 4; private static final int CRAFTING_GRID_HEIGHT = 4; @@ -35,15 +38,8 @@ private static class ProcessingSlotFake extends OptionalSlotFake { private static final int POSITION_SHIFT = 9000; private boolean hidden = false; - public ProcessingSlotFake( - IInventory inv, - IOptionalSlotHost containerBus, - int idx, - int x, - int y, - int offX, - int offY, - int groupNum) { + public ProcessingSlotFake(IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, + int offY, int groupNum) { super(inv, containerBus, idx, x, y, offX, offY, groupNum); this.setRenderDisabled(false); } @@ -58,8 +54,8 @@ public void setHidden(boolean hide) { private final PartPatternTerminalEx patternTerminal; - private final ProcessingSlotFake[] craftingSlots = - new ProcessingSlotFake[CRAFTING_GRID_SLOTS * CRAFTING_GRID_PAGES]; + private final ProcessingSlotFake[] craftingSlots = new ProcessingSlotFake[CRAFTING_GRID_SLOTS + * CRAFTING_GRID_PAGES]; private final ProcessingSlotFake[] outputSlots = new ProcessingSlotFake[CRAFTING_GRID_SLOTS * CRAFTING_GRID_PAGES]; private final SlotRestrictedInput patternSlotIN; @@ -89,8 +85,8 @@ public ContainerPatternTermEx(final InventoryPlayer ip, final ITerminalHost moni for (int y = 0; y < CRAFTING_GRID_HEIGHT; y++) { for (int x = 0; x < CRAFTING_GRID_WIDTH; x++) { this.addSlotToContainer( - this.craftingSlots[x + y * CRAFTING_GRID_WIDTH + page * CRAFTING_GRID_SLOTS] = - new ProcessingSlotFake( + this.craftingSlots[x + y * CRAFTING_GRID_WIDTH + + page * CRAFTING_GRID_SLOTS] = new ProcessingSlotFake( crafting, this, x + y * CRAFTING_GRID_WIDTH + page * CRAFTING_GRID_SLOTS, @@ -105,8 +101,8 @@ public ContainerPatternTermEx(final InventoryPlayer ip, final ITerminalHost moni for (int x = 0; x < CRAFTING_GRID_WIDTH; x++) { for (int y = 0; y < CRAFTING_GRID_HEIGHT; y++) { this.addSlotToContainer( - this.outputSlots[x * CRAFTING_GRID_HEIGHT + y + page * CRAFTING_GRID_SLOTS] = - new ProcessingSlotFake( + this.outputSlots[x * CRAFTING_GRID_HEIGHT + y + + page * CRAFTING_GRID_SLOTS] = new ProcessingSlotFake( output, this, x * CRAFTING_GRID_HEIGHT + y + page * CRAFTING_GRID_SLOTS, @@ -185,12 +181,8 @@ else if (output == null) { } // add a new encoded pattern. - for (final ItemStack encodedPatternStack : AEApi.instance() - .definitions() - .items() - .encodedPattern() - .maybeStack(1) - .asSet()) { + for (final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern() + .maybeStack(1).asSet()) { output = encodedPatternStack; this.patternSlotOUT.putStack(output); } @@ -313,10 +305,10 @@ private void offsetSlots() { for (int page = 0; page < CRAFTING_GRID_PAGES; page++) { for (int y = 0; y < CRAFTING_GRID_HEIGHT; y++) { for (int x = 0; x < CRAFTING_GRID_WIDTH; x++) { - this.craftingSlots[x + y * CRAFTING_GRID_WIDTH + page * CRAFTING_GRID_SLOTS].setHidden( - page != activePage || x > 0 && inverted); - this.outputSlots[x * CRAFTING_GRID_HEIGHT + y + page * CRAFTING_GRID_SLOTS].setHidden( - page != activePage || x > 0 && !inverted); + this.craftingSlots[x + y * CRAFTING_GRID_WIDTH + page * CRAFTING_GRID_SLOTS] + .setHidden(page != activePage || x > 0 && inverted); + this.outputSlots[x * CRAFTING_GRID_HEIGHT + y + page * CRAFTING_GRID_SLOTS] + .setHidden(page != activePage || x > 0 && !inverted); } } } diff --git a/src/main/java/appeng/container/implementations/ContainerPatternValueAmount.java b/src/main/java/appeng/container/implementations/ContainerPatternValueAmount.java index 37740d8e7c2..3cee46598b4 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternValueAmount.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternValueAmount.java @@ -1,5 +1,9 @@ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.world.World; + import appeng.api.config.SecurityPermissions; import appeng.api.networking.IGrid; import appeng.api.networking.security.BaseActionSource; @@ -9,11 +13,9 @@ import appeng.container.AEBaseContainer; import appeng.container.slot.SlotInaccessible; import appeng.tile.inventory.AppEngInternalInventory; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.world.World; public class ContainerPatternValueAmount extends AEBaseContainer { + private final Slot patternValue; private int valueIndex; diff --git a/src/main/java/appeng/container/implementations/ContainerPriority.java b/src/main/java/appeng/container/implementations/ContainerPriority.java index 7e3d21efbdf..9cb7b25d9f6 100644 --- a/src/main/java/appeng/container/implementations/ContainerPriority.java +++ b/src/main/java/appeng/container/implementations/ContainerPriority.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.tileentity.TileEntity; + import appeng.api.config.SecurityPermissions; import appeng.api.parts.IPart; import appeng.container.AEBaseContainer; @@ -26,10 +23,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.tileentity.TileEntity; public class ContainerPriority extends AEBaseContainer { diff --git a/src/main/java/appeng/container/implementations/ContainerQNB.java b/src/main/java/appeng/container/implementations/ContainerQNB.java index c77343d1608..55ca2bc91b3 100644 --- a/src/main/java/appeng/container/implementations/ContainerQNB.java +++ b/src/main/java/appeng/container/implementations/ContainerQNB.java @@ -1,41 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.qnb.TileQuantumBridge; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerQNB extends AEBaseContainer { public ContainerQNB(final InventoryPlayer ip, final TileQuantumBridge quantumBridge) { super(ip, quantumBridge, null); - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge, 0, 80, 37, - this.getInventoryPlayer())) - .setStackLimit(1)); + this.getInventoryPlayer())).setStackLimit(1)); this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */ 82); } diff --git a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java index 1db456352f4..80065467e14 100644 --- a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java +++ b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; + import appeng.api.AEApi; import appeng.container.AEBaseContainer; import appeng.container.slot.QuartzKnifeOutput; @@ -27,13 +27,6 @@ import appeng.tile.inventory.IAEAppEngInventory; import appeng.tile.inventory.InvOperation; import appeng.util.Platform; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngInventory, IInventory { @@ -48,8 +41,13 @@ public ContainerQuartzKnife(final InventoryPlayer ip, final QuartzKnifeObj te) { super(ip, null, null); this.toolInv = te; - this.metals = - new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip); + this.metals = new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.METAL_INGOTS, + this.inSlot, + 0, + 94, + 44, + ip); this.addSlotToContainer(this.metals); this.output = new QuartzKnifeOutput(this, 0, 134, 44, -1); @@ -95,12 +93,8 @@ public void onContainerClosed(final EntityPlayer par1EntityPlayer) { public void saveChanges() {} @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) {} + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) {} @Override public int getSizeInventory() { @@ -116,12 +110,8 @@ public ItemStack getStackInSlot(final int var1) { if (SlotRestrictedInput.isMetalIngot(input)) { if (this.myName.length() > 0) { - for (final ItemStack namePressStack : AEApi.instance() - .definitions() - .materials() - .namePress() - .maybeStack(1) - .asSet()) { + for (final ItemStack namePressStack : AEApi.instance().definitions().materials().namePress() + .maybeStack(1).asSet()) { final NBTTagCompound compound = Platform.openNbtData(namePressStack); compound.setString("InscribeName", this.myName); diff --git a/src/main/java/appeng/container/implementations/ContainerRenamer.java b/src/main/java/appeng/container/implementations/ContainerRenamer.java index d419c0fecc8..f44e00febf7 100644 --- a/src/main/java/appeng/container/implementations/ContainerRenamer.java +++ b/src/main/java/appeng/container/implementations/ContainerRenamer.java @@ -1,5 +1,8 @@ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.tileentity.TileEntity; + import appeng.api.config.SecurityPermissions; import appeng.api.parts.IPart; import appeng.client.gui.widgets.MEGuiTextField; @@ -8,10 +11,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.tileentity.TileEntity; public class ContainerRenamer extends AEBaseContainer { + private final ICustomNameObject namedObject; @SideOnly(Side.CLIENT) diff --git a/src/main/java/appeng/container/implementations/ContainerSecurity.java b/src/main/java/appeng/container/implementations/ContainerSecurity.java index 7ba54cac3ab..72710a2d779 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurity.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurity.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.SecurityPermissions; import appeng.api.features.INetworkEncodable; @@ -31,11 +29,6 @@ import appeng.tile.inventory.IAEAppEngInventory; import appeng.tile.inventory.InvOperation; import appeng.tile.misc.TileSecurity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppEngInventory { @@ -67,7 +60,12 @@ public ContainerSecurity(final InventoryPlayer ip, final ITerminalHost monitorab this.addSlotToContainer( this.wirelessIn = new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, this.wirelessEncoder, 0, 212, 10, ip)); + SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, + this.wirelessEncoder, + 0, + 212, + 10, + ip)); this.addSlotToContainer(this.wirelessOut = new SlotOutput(this.wirelessEncoder, 1, 212, 68, -1)); this.bindPlayerInventory(ip, 0, 0); @@ -130,12 +128,8 @@ public void saveChanges() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { if (!this.wirelessOut.getHasStack()) { if (this.wirelessIn.getHasStack()) { final ItemStack term = this.wirelessIn.getStack().copy(); @@ -145,8 +139,8 @@ public void onChangeInventory( networkEncodable = (INetworkEncodable) term.getItem(); } - final IWirelessTermHandler wTermHandler = - AEApi.instance().registries().wireless().getWirelessTerminalHandler(term); + final IWirelessTermHandler wTermHandler = AEApi.instance().registries().wireless() + .getWirelessTerminalHandler(term); if (wTermHandler != null) { networkEncodable = wTermHandler; } diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index 51d24be23c4..ff1601ef0cb 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.slot.SlotNormal; import appeng.tile.storage.TileSkyChest; import invtweaks.api.container.ChestContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; @ChestContainer public class ContainerSkyChest extends AEBaseContainer { diff --git a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java index 8a0bb13802e..91bd38e8834 100644 --- a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.SecurityPermissions; import appeng.api.networking.IGrid; import appeng.api.networking.energy.IEnergyGrid; @@ -28,8 +23,6 @@ import appeng.container.slot.SlotRestrictedInput; import appeng.tile.spatial.TileSpatialIOPort; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraftforge.common.util.ForgeDirection; public class ContainerSpatialIOPort extends AEBaseContainer { @@ -55,15 +48,21 @@ public ContainerSpatialIOPort(final InventoryPlayer ip, final TileSpatialIOPort this.network = spatialIOPort.getGridNode(ForgeDirection.UNKNOWN).getGrid(); } - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, - spatialIOPort, - 0, - 52, - 48, - this.getInventoryPlayer())); - this.addSlotToContainer(new SlotOutput( - spatialIOPort, 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon)); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, + spatialIOPort, + 0, + 52, + 48, + this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotOutput( + spatialIOPort, + 1, + 113, + 48, + SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon)); this.bindPlayerInventory(ip, 0, 197 - /* height of player inventory */ 82); } diff --git a/src/main/java/appeng/container/implementations/ContainerStorageBus.java b/src/main/java/appeng/container/implementations/ContainerStorageBus.java index a3bc35d81ee..11f51903d8c 100644 --- a/src/main/java/appeng/container/implementations/ContainerStorageBus.java +++ b/src/main/java/appeng/container/implementations/ContainerStorageBus.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import java.util.Iterator; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.storage.IMEInventory; @@ -29,10 +27,6 @@ import appeng.parts.misc.PartStorageBus; import appeng.util.Platform; import appeng.util.iterators.NullIterator; -import java.util.Iterator; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class ContainerStorageBus extends ContainerUpgradeable { @@ -67,41 +61,46 @@ protected void setupConfig() { } final IInventory upgrades = this.getUpgradeable().getInventoryByName("upgrades"); - this.addSlotToContainer((new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.UPGRADES, + upgrades, + 0, + 187, + 8, + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, - this.getInventoryPlayer())) - .setNotDraggable()); - this.addSlotToContainer((new SlotRestrictedInput( + this.getInventoryPlayer())).setNotDraggable()); + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } @Override @@ -119,8 +118,7 @@ public void detectAndSendChanges() { this.verifyPermissions(SecurityPermissions.BUILD, false); if (Platform.isServer()) { - this.setFuzzyMode( - (FuzzyMode) this.getUpgradeable().getConfigManager().getSetting(Settings.FUZZY_MODE)); + this.setFuzzyMode((FuzzyMode) this.getUpgradeable().getConfigManager().getSetting(Settings.FUZZY_MODE)); this.setReadWriteMode( (AccessRestriction) this.getUpgradeable().getConfigManager().getSetting(Settings.ACCESS)); this.setStorageFilter( @@ -154,8 +152,7 @@ public void partition() { Iterator i = new NullIterator(); if (cellInv != null) { - final IItemList list = - cellInv.getAvailableItems(AEApi.instance().storage().createItemList()); + final IItemList list = cellInv.getAvailableItems(AEApi.instance().storage().createItemList()); i = list.iterator(); } diff --git a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java index 0cf1b43ae19..bfd0c90db72 100644 --- a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java +++ b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import appeng.api.config.*; import appeng.api.implementations.IUpgradeableHost; import appeng.api.implementations.guiobjects.IGuiItem; @@ -30,11 +28,6 @@ import appeng.items.tools.ToolNetworkTool; import appeng.parts.automation.PartExportBus; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSlotHost { @@ -86,8 +79,8 @@ public ContainerUpgradeable(final InventoryPlayer ip, final IUpgradeableHost te) if (pii != null && pii.getItem() instanceof ToolNetworkTool) { this.lockPlayerInventorySlot(x); this.tbSlot = x; - this.tbInventory = - (NetworkToolViewer) ((IGuiItem) pii.getItem()).getGuiObject(pii, w, xCoord, yCoord, zCoord); + this.tbInventory = (NetworkToolViewer) ((IGuiItem) pii.getItem()) + .getGuiObject(pii, w, xCoord, yCoord, zCoord); break; } } @@ -95,14 +88,14 @@ public ContainerUpgradeable(final InventoryPlayer ip, final IUpgradeableHost te) if (this.hasToolbox()) { for (int v = 0; v < 3; v++) { for (int u = 0; u < 3; u++) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.tbInventory, u + v * 3, 186 + u * 18, this.getHeight() - 82 + v * 18, - this.getInventoryPlayer())) - .setPlayerSide()); + this.getInventoryPlayer())).setPlayerSide()); } } } @@ -143,44 +136,44 @@ protected void setupConfig() { protected void setupUpgrades() { final IInventory upgrades = this.getUpgradeable().getInventoryByName("upgrades"); if (this.availableUpgrades() > 0) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } if (this.availableUpgrades() > 1) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } if (this.availableUpgrades() > 2) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } if (this.availableUpgrades() > 3) { - this.addSlotToContainer((new SlotRestrictedInput( + this.addSlotToContainer( + (new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, - this.getInventoryPlayer())) - .setNotDraggable()); + this.getInventoryPlayer())).setNotDraggable()); } } diff --git a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java index 91354f5b6e1..1452cbfaa22 100644 --- a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java +++ b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.guisync.GuiSync; import appeng.container.interfaces.IProgressProvider; import appeng.container.slot.SlotRestrictedInput; import appeng.tile.misc.TileVibrationChamber; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerVibrationChamber extends AEBaseContainer implements IProgressProvider { @@ -42,8 +35,14 @@ public ContainerVibrationChamber(final InventoryPlayer ip, final TileVibrationCh super(ip, vibrationChamber, null); this.vibrationChamber = vibrationChamber; - this.addSlotToContainer(new SlotRestrictedInput( - SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber, 0, 80, 37, this.getInventoryPlayer())); + this.addSlotToContainer( + new SlotRestrictedInput( + SlotRestrictedInput.PlacableItemType.FUEL, + vibrationChamber, + 0, + 80, + 37, + this.getInventoryPlayer())); this.bindPlayerInventory(ip, 0, 166 - /* height of player inventory */ 82); } @@ -51,10 +50,8 @@ public ContainerVibrationChamber(final InventoryPlayer ip, final TileVibrationCh @Override public void detectAndSendChanges() { if (Platform.isServer()) { - this.burnProgress = (int) - (this.vibrationChamber.getMaxBurnTime() <= 0 - ? 0 - : 12 * this.vibrationChamber.getBurnTime() / this.vibrationChamber.getMaxBurnTime()); + this.burnProgress = (int) (this.vibrationChamber.getMaxBurnTime() <= 0 ? 0 + : 12 * this.vibrationChamber.getBurnTime() / this.vibrationChamber.getMaxBurnTime()); this.burnSpeed = this.vibrationChamber.getBurnSpeed(); } diff --git a/src/main/java/appeng/container/implementations/ContainerWireless.java b/src/main/java/appeng/container/implementations/ContainerWireless.java index 8906732bae1..9d3e1107622 100644 --- a/src/main/java/appeng/container/implementations/ContainerWireless.java +++ b/src/main/java/appeng/container/implementations/ContainerWireless.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.container.AEBaseContainer; import appeng.container.guisync.GuiSync; import appeng.container.slot.SlotRestrictedInput; import appeng.core.AEConfig; import appeng.tile.networking.TileWireless; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerWireless extends AEBaseContainer { diff --git a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java index cf3fe033931..3dc60943455 100644 --- a/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerWirelessTerm.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import net.minecraft.entity.player.InventoryPlayer; + import appeng.core.AEConfig; import appeng.core.localization.PlayerMessages; import appeng.helpers.WirelessTerminalGuiObject; import appeng.util.Platform; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerWirelessTerm extends ContainerMEPortableCell { diff --git a/src/main/java/appeng/container/implementations/CraftingCPURecord.java b/src/main/java/appeng/container/implementations/CraftingCPURecord.java index b968b3342da..72d3fa51c8e 100644 --- a/src/main/java/appeng/container/implementations/CraftingCPURecord.java +++ b/src/main/java/appeng/container/implementations/CraftingCPURecord.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.implementations; +import javax.annotation.Nonnull; + import appeng.api.networking.crafting.ICraftingCPU; import appeng.util.ItemSorters; -import javax.annotation.Nonnull; public class CraftingCPURecord implements Comparable { diff --git a/src/main/java/appeng/container/implementations/CraftingCPUStatus.java b/src/main/java/appeng/container/implementations/CraftingCPUStatus.java index 729c4a65655..2e6658e6b47 100644 --- a/src/main/java/appeng/container/implementations/CraftingCPUStatus.java +++ b/src/main/java/appeng/container/implementations/CraftingCPUStatus.java @@ -1,19 +1,23 @@ package appeng.container.implementations; +import java.io.*; + +import javax.annotation.Nullable; + +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.networking.crafting.ICraftingCPU; import appeng.api.storage.data.IAEItemStack; import appeng.util.ItemSorters; import appeng.util.item.AEItemStack; import io.netty.buffer.ByteBuf; -import java.io.*; -import javax.annotation.Nullable; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; /** * Summary status for the crafting CPU selection widget */ public class CraftingCPUStatus implements Comparable { + @Nullable private final ICraftingCPU serverCluster; diff --git a/src/main/java/appeng/container/interfaces/ICraftingCPUSelectorContainer.java b/src/main/java/appeng/container/interfaces/ICraftingCPUSelectorContainer.java index f2cac85cd6d..933912f104a 100644 --- a/src/main/java/appeng/container/interfaces/ICraftingCPUSelectorContainer.java +++ b/src/main/java/appeng/container/interfaces/ICraftingCPUSelectorContainer.java @@ -1,5 +1,6 @@ package appeng.container.interfaces; public interface ICraftingCPUSelectorContainer { + void selectCPU(int cpu); } diff --git a/src/main/java/appeng/container/interfaces/IInventorySlotAware.java b/src/main/java/appeng/container/interfaces/IInventorySlotAware.java index be9f4bfbc91..f2fe4c48f16 100644 --- a/src/main/java/appeng/container/interfaces/IInventorySlotAware.java +++ b/src/main/java/appeng/container/interfaces/IInventorySlotAware.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.interfaces; @@ -21,10 +13,11 @@ /** * Any item providing a GUI and depending on an exact inventory slot. *

- * This interface is likely a volatile one until a general GUI refactoring occurred. - * Use it with care and expect changes. + * This interface is likely a volatile one until a general GUI refactoring occurred. Use it with care and expect + * changes. */ public interface IInventorySlotAware { + /** * This is needed to select the correct slot index. * diff --git a/src/main/java/appeng/container/interfaces/IProgressProvider.java b/src/main/java/appeng/container/interfaces/IProgressProvider.java index e00e486435e..7f630e05b47 100644 --- a/src/main/java/appeng/container/interfaces/IProgressProvider.java +++ b/src/main/java/appeng/container/interfaces/IProgressProvider.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.interfaces; diff --git a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java index f5ceb3560f4..ab0b3068e57 100644 --- a/src/main/java/appeng/container/slot/AppEngCraftingSlot.java +++ b/src/main/java/appeng/container/slot/AppEngCraftingSlot.java @@ -1,24 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; -import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -28,6 +19,8 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import cpw.mods.fml.common.FMLCommonHandler; + public class AppEngCraftingSlot extends AppEngSlot { /** @@ -45,13 +38,8 @@ public class AppEngCraftingSlot extends AppEngSlot { */ private int amountCrafted; - public AppEngCraftingSlot( - final EntityPlayer par1EntityPlayer, - final IInventory par2IInventory, - final IInventory par3IInventory, - final int par4, - final int par5, - final int par6) { + public AppEngCraftingSlot(final EntityPlayer par1EntityPlayer, final IInventory par2IInventory, + final IInventory par3IInventory, final int par4, final int par5, final int par6) { super(par3IInventory, par4, par5, par6); this.thePlayer = par1EntityPlayer; this.craftMatrix = par2IInventory; @@ -139,8 +127,7 @@ public void onPickupFromSlot(final EntityPlayer par1EntityPlayer, final ItemStac if (itemstack1.getItem().hasContainerItem(itemstack1)) { final ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); - if (itemstack2 != null - && itemstack2.isItemStackDamageable() + if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) { MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2)); continue; diff --git a/src/main/java/appeng/container/slot/AppEngSlot.java b/src/main/java/appeng/container/slot/AppEngSlot.java index e2397076707..bb8df9baca1 100644 --- a/src/main/java/appeng/container/slot/AppEngSlot.java +++ b/src/main/java/appeng/container/slot/AppEngSlot.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; -import appeng.container.AEBaseContainer; -import appeng.tile.inventory.AppEngInternalInventory; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import appeng.container.AEBaseContainer; +import appeng.tile.inventory.AppEngInternalInventory; + public class AppEngSlot extends Slot { private final int defX; diff --git a/src/main/java/appeng/container/slot/IOptionalSlotHost.java b/src/main/java/appeng/container/slot/IOptionalSlotHost.java index 72102091b33..17b54c469c5 100644 --- a/src/main/java/appeng/container/slot/IOptionalSlotHost.java +++ b/src/main/java/appeng/container/slot/IOptionalSlotHost.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/NullSlot.java b/src/main/java/appeng/container/slot/NullSlot.java index ff0f827a0b2..fb31ee2a32d 100644 --- a/src/main/java/appeng/container/slot/NullSlot.java +++ b/src/main/java/appeng/container/slot/NullSlot.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/OptionalSlotFake.java b/src/main/java/appeng/container/slot/OptionalSlotFake.java index 4a1e0f506f4..3ccbf574982 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFake.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFake.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; @@ -29,15 +21,8 @@ public class OptionalSlotFake extends SlotFake { private final IOptionalSlotHost host; private boolean renderDisabled = true; - public OptionalSlotFake( - final IInventory inv, - final IOptionalSlotHost containerBus, - final int idx, - final int x, - final int y, - final int offX, - final int offY, - final int groupNum) { + public OptionalSlotFake(final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, + final int y, final int offX, final int offY, final int groupNum) { super(inv, idx, x + offX * 18, y + offY * 18); this.srcX = x; this.srcY = y; diff --git a/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java b/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java index 6cd47705c5a..765db321c0a 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java +++ b/src/main/java/appeng/container/slot/OptionalSlotFakeTypeOnly.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; @@ -23,15 +15,8 @@ public class OptionalSlotFakeTypeOnly extends OptionalSlotFake { - public OptionalSlotFakeTypeOnly( - final IInventory inv, - final IOptionalSlotHost containerBus, - final int idx, - final int x, - final int y, - final int offX, - final int offY, - final int groupNum) { + public OptionalSlotFakeTypeOnly(final IInventory inv, final IOptionalSlotHost containerBus, final int idx, + final int x, final int y, final int offX, final int offY, final int groupNum) { super(inv, containerBus, idx, x, y, offX, offY, groupNum); } diff --git a/src/main/java/appeng/container/slot/OptionalSlotNormal.java b/src/main/java/appeng/container/slot/OptionalSlotNormal.java index 8bca16eea2a..455edccd1a0 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotNormal.java +++ b/src/main/java/appeng/container/slot/OptionalSlotNormal.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; @@ -25,13 +17,8 @@ public class OptionalSlotNormal extends AppEngSlot { private final int groupNum; private final IOptionalSlotHost host; - public OptionalSlotNormal( - final IInventory inv, - final IOptionalSlotHost containerBus, - final int slot, - final int xPos, - final int yPos, - final int groupNum) { + public OptionalSlotNormal(final IInventory inv, final IOptionalSlotHost containerBus, final int slot, + final int xPos, final int yPos, final int groupNum) { super(inv, slot, xPos, yPos); this.groupNum = groupNum; this.host = containerBus; diff --git a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java index 1e9b81304a6..fdd749b3ee2 100644 --- a/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/OptionalSlotRestrictedInput.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; @@ -26,15 +18,8 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput { private final int groupNum; private final IOptionalSlotHost host; - public OptionalSlotRestrictedInput( - final PlacableItemType valid, - final IInventory i, - final IOptionalSlotHost host, - final int slotIndex, - final int x, - final int y, - final int grpNum, - final InventoryPlayer invPlayer) { + public OptionalSlotRestrictedInput(final PlacableItemType valid, final IInventory i, final IOptionalSlotHost host, + final int slotIndex, final int x, final int y, final int grpNum, final InventoryPlayer invPlayer) { super(valid, i, slotIndex, x, y, invPlayer); this.groupNum = grpNum; this.host = host; diff --git a/src/main/java/appeng/container/slot/QuartzKnifeOutput.java b/src/main/java/appeng/container/slot/QuartzKnifeOutput.java index d17a140e486..5887bc39900 100644 --- a/src/main/java/appeng/container/slot/QuartzKnifeOutput.java +++ b/src/main/java/appeng/container/slot/QuartzKnifeOutput.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java index 28fe3dae9ab..769f77a4708 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotCraftingMatrix.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; @@ -26,8 +18,8 @@ public class SlotCraftingMatrix extends AppEngSlot { private final Container c; - public SlotCraftingMatrix( - final Container c, final IInventory par1iInventory, final int par2, final int par3, final int par4) { + public SlotCraftingMatrix(final Container c, final IInventory par1iInventory, final int par2, final int par3, + final int par4) { super(par1iInventory, par2, par3, par4); this.c = c; } diff --git a/src/main/java/appeng/container/slot/SlotCraftingTerm.java b/src/main/java/appeng/container/slot/SlotCraftingTerm.java index f5a142122b6..81344b77739 100644 --- a/src/main/java/appeng/container/slot/SlotCraftingTerm.java +++ b/src/main/java/appeng/container/slot/SlotCraftingTerm.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; + import appeng.api.config.Actionable; import appeng.api.networking.energy.IEnergySource; import appeng.api.networking.security.BaseActionSource; @@ -34,14 +36,6 @@ import appeng.util.inv.AdaptorPlayerHand; import appeng.util.item.AEItemStack; import appeng.util.prioitylist.IPartitionList; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; public class SlotCraftingTerm extends AppEngCraftingSlot { @@ -53,17 +47,9 @@ public class SlotCraftingTerm extends AppEngCraftingSlot { private final IStorageMonitorable storage; private final IContainerCraftingPacket container; - public SlotCraftingTerm( - final EntityPlayer player, - final BaseActionSource mySrc, - final IEnergySource energySrc, - final IStorageMonitorable storage, - final IInventory cMatrix, - final IInventory secondMatrix, - final IInventory output, - final int x, - final int y, - final IContainerCraftingPacket ccp) { + public SlotCraftingTerm(final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, + final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, + final IInventory output, final int x, final int y, final IContainerCraftingPacket ccp) { super(player, cMatrix, output, 0, x, y); this.energySrc = energySrc; this.storage = storage; @@ -140,8 +126,8 @@ private int capCraftingAttempts(final int maxTimesToCraft) { return maxTimesToCraft; } - private ItemStack craftItem( - final EntityPlayer p, final ItemStack request, final IMEMonitor inv, final IItemList all) { + private ItemStack craftItem(final EntityPlayer p, final ItemStack request, final IMEMonitor inv, + final IItemList all) { // update crafting matrix... ItemStack is = this.getStack(); @@ -160,7 +146,7 @@ private ItemStack craftItem( if (r == null) { if (request.stackSize > is.stackSize) // do not try to batch invalid recipes - return null; + return null; final Item target = request.getItem(); if (target.isDamageable() && target.isRepairable()) { boolean isBad = false; @@ -217,16 +203,8 @@ private ItemStack craftItem( return null; } - private boolean extractItems( - EntityPlayer p, - IMEMonitor inv, - IItemList all, - ItemStack is, - ItemStack[] set, - int multiple, - InventoryCrafting ic, - IRecipe r, - IPartitionList filter) { + private boolean extractItems(EntityPlayer p, IMEMonitor inv, IItemList all, ItemStack is, + ItemStack[] set, int multiple, InventoryCrafting ic, IRecipe r, IPartitionList filter) { for (int x = 0; x < this.getPattern().getSizeInventory(); x++) { if (this.getPattern().getStackInSlot(x) != null) { set[x] = Platform.extractItemsByRecipe( @@ -253,8 +231,8 @@ private boolean extractItems( return true; } - private boolean preCraft( - final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, final ItemStack result) { + private boolean preCraft(final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, + final ItemStack result) { return true; } @@ -262,8 +240,8 @@ private void makeItem(final EntityPlayer p, final ItemStack is) { super.onPickupFromSlot(p, is); } - private boolean postCraft( - final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, final ItemStack result) { + private boolean postCraft(final EntityPlayer p, final IMEMonitor inv, final ItemStack[] set, + final ItemStack result) { final List drops = new ArrayList(); boolean hadEmptyStacks = false; @@ -284,8 +262,8 @@ private boolean postCraft( } else if (set[x] != null) { if (!Platform.isSameItem(this.craftInv.getStackInSlot(x), set[x])) { // for the recipes that leave e.g. empty buckets in the grid, can't batch them - final IAEItemStack fail = - inv.injectItems(AEItemStack.create(set[x]), Actionable.MODULATE, this.mySrc); + final IAEItemStack fail = inv + .injectItems(AEItemStack.create(set[x]), Actionable.MODULATE, this.mySrc); if (fail != null) { drops.add(fail.getItemStack()); } @@ -307,8 +285,8 @@ private void cleanup(final EntityPlayer p, final IMEMonitor inv, f final List drops = new ArrayList(); for (int i = 0; i < set.length; ++i) { if (set[i] != null && set[i].stackSize > 0) { - final IAEItemStack fail = - inv.injectItems(AEItemStack.create(set[i]), Actionable.MODULATE, this.mySrc); + final IAEItemStack fail = inv + .injectItems(AEItemStack.create(set[i]), Actionable.MODULATE, this.mySrc); if (fail != null) { drops.add(fail.getItemStack()); } diff --git a/src/main/java/appeng/container/slot/SlotDisabled.java b/src/main/java/appeng/container/slot/SlotDisabled.java index f038cbdb1f2..2278cf87f9d 100644 --- a/src/main/java/appeng/container/slot/SlotDisabled.java +++ b/src/main/java/appeng/container/slot/SlotDisabled.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotFake.java b/src/main/java/appeng/container/slot/SlotFake.java index a3898386004..8270f26c406 100644 --- a/src/main/java/appeng/container/slot/SlotFake.java +++ b/src/main/java/appeng/container/slot/SlotFake.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; -import appeng.api.storage.data.IAEItemStack; -import appeng.util.item.AEItemStack; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import appeng.api.storage.data.IAEItemStack; +import appeng.util.item.AEItemStack; + public class SlotFake extends AppEngSlot { private IAEItemStack aeStack; diff --git a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java index 0e3e7b97ae1..2ea312ca4a5 100644 --- a/src/main/java/appeng/container/slot/SlotFakeBlacklist.java +++ b/src/main/java/appeng/container/slot/SlotFakeBlacklist.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java b/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java index a9f058efb31..7069b7e5a1c 100644 --- a/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java +++ b/src/main/java/appeng/container/slot/SlotFakeCraftingMatrix.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java b/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java index afd01cdd4dd..13b001f7788 100644 --- a/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java +++ b/src/main/java/appeng/container/slot/SlotFakeTypeOnly.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotInaccessible.java b/src/main/java/appeng/container/slot/SlotInaccessible.java index 86511378547..546bafb6d9a 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessible.java +++ b/src/main/java/appeng/container/slot/SlotInaccessible.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotInaccessibleHD.java b/src/main/java/appeng/container/slot/SlotInaccessibleHD.java index 1de9668a3ed..d670d556262 100644 --- a/src/main/java/appeng/container/slot/SlotInaccessibleHD.java +++ b/src/main/java/appeng/container/slot/SlotInaccessibleHD.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotMACPattern.java b/src/main/java/appeng/container/slot/SlotMACPattern.java index 0022fe91d23..13e6e38a19a 100644 --- a/src/main/java/appeng/container/slot/SlotMACPattern.java +++ b/src/main/java/appeng/container/slot/SlotMACPattern.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; -import appeng.container.implementations.ContainerMAC; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import appeng.container.implementations.ContainerMAC; + public class SlotMACPattern extends AppEngSlot { private final ContainerMAC mac; diff --git a/src/main/java/appeng/container/slot/SlotNormal.java b/src/main/java/appeng/container/slot/SlotNormal.java index 413b31e928d..c25e8490fa5 100644 --- a/src/main/java/appeng/container/slot/SlotNormal.java +++ b/src/main/java/appeng/container/slot/SlotNormal.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotOutput.java b/src/main/java/appeng/container/slot/SlotOutput.java index fb785209d43..d820e20962c 100644 --- a/src/main/java/appeng/container/slot/SlotOutput.java +++ b/src/main/java/appeng/container/slot/SlotOutput.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotPatternOutputs.java b/src/main/java/appeng/container/slot/SlotPatternOutputs.java index 9aecce0c59e..0ae53f639b4 100644 --- a/src/main/java/appeng/container/slot/SlotPatternOutputs.java +++ b/src/main/java/appeng/container/slot/SlotPatternOutputs.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; @@ -22,15 +14,8 @@ public class SlotPatternOutputs extends OptionalSlotFake { - public SlotPatternOutputs( - final IInventory inv, - final IOptionalSlotHost containerBus, - final int idx, - final int x, - final int y, - final int offX, - final int offY, - final int groupNum) { + public SlotPatternOutputs(final IInventory inv, final IOptionalSlotHost containerBus, final int idx, final int x, + final int y, final int offX, final int offY, final int groupNum) { super(inv, containerBus, idx, x, y, offX, offY, groupNum); } diff --git a/src/main/java/appeng/container/slot/SlotPatternTerm.java b/src/main/java/appeng/container/slot/SlotPatternTerm.java index ddd584741c2..cc93a23e7b5 100644 --- a/src/main/java/appeng/container/slot/SlotPatternTerm.java +++ b/src/main/java/appeng/container/slot/SlotPatternTerm.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.networking.energy.IEnergySource; import appeng.api.networking.security.BaseActionSource; @@ -25,28 +23,15 @@ import appeng.core.sync.AppEngPacket; import appeng.core.sync.packets.PacketPatternSlot; import appeng.helpers.IContainerCraftingPacket; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class SlotPatternTerm extends SlotCraftingTerm { private final int groupNum; private final IOptionalSlotHost host; - public SlotPatternTerm( - final EntityPlayer player, - final BaseActionSource mySrc, - final IEnergySource energySrc, - final IStorageMonitorable storage, - final IInventory cMatrix, - final IInventory secondMatrix, - final IInventory output, - final int x, - final int y, - final IOptionalSlotHost h, - final int groupNumber, + public SlotPatternTerm(final EntityPlayer player, final BaseActionSource mySrc, final IEnergySource energySrc, + final IStorageMonitorable storage, final IInventory cMatrix, final IInventory secondMatrix, + final IInventory output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c) { super(player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c); @@ -56,7 +41,9 @@ public SlotPatternTerm( public AppEngPacket getRequest(final boolean shift) throws IOException { return new PacketPatternSlot( - this.getPattern(), AEApi.instance().storage().createItemStack(this.getStack()), shift); + this.getPattern(), + AEApi.instance().storage().createItemStack(this.getStack()), + shift); } @Override diff --git a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java index e8d89b5b670..6121bae7689 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerHotBar.java +++ b/src/main/java/appeng/container/slot/SlotPlayerHotBar.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotPlayerInv.java b/src/main/java/appeng/container/slot/SlotPlayerInv.java index c832464ac1a..58514db0e69 100644 --- a/src/main/java/appeng/container/slot/SlotPlayerInv.java +++ b/src/main/java/appeng/container/slot/SlotPlayerInv.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; diff --git a/src/main/java/appeng/container/slot/SlotRestrictedInput.java b/src/main/java/appeng/container/slot/SlotRestrictedInput.java index 9a2ab97c3ed..45393d51565 100644 --- a/src/main/java/appeng/container/slot/SlotRestrictedInput.java +++ b/src/main/java/appeng/container/slot/SlotRestrictedInput.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.container.slot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IItems; @@ -32,15 +34,6 @@ import appeng.api.storage.ICellWorkbenchItem; import appeng.items.misc.ItemEncodedPattern; import appeng.util.Platform; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; /** * @author AlgorithmX2 @@ -55,13 +48,8 @@ public class SlotRestrictedInput extends AppEngSlot { private boolean allowEdit = true; private int stackLimit = -1; - public SlotRestrictedInput( - final PlacableItemType valid, - final IInventory i, - final int slotIndex, - final int x, - final int y, - final InventoryPlayer p) { + public SlotRestrictedInput(final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, + final int y, final InventoryPlayer p) { super(i, slotIndex, x, y); this.which = valid; this.setIIcon(valid.IIcon); @@ -153,8 +141,7 @@ public boolean isItemValid(final ItemStack i) { return true; } - for (final ItemStack optional : - AEApi.instance().registries().inscriber().getOptionals()) { + for (final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals()) { if (Platform.isSameItemPrecise(optional, i)) { return true; } @@ -165,8 +152,7 @@ public boolean isItemValid(final ItemStack i) { case INSCRIBER_INPUT: return true; /* * for (ItemStack is : Inscribe.inputs) if ( Platform.isSameItemPrecise( is, i ) ) return - * true; - * return false; + * true; return false; */ case METAL_INGOTS: @@ -242,8 +228,8 @@ public static boolean isMetalIngot(final ItemStack i) { return true; } - for (final String name : - new String[] {"Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", "Nickel", "Aluminium"}) { + for (final String name : new String[] { "Copper", "Tin", "Obsidian", "Iron", "Lead", "Bronze", "Brass", + "Nickel", "Aluminium" }) { for (final ItemStack ingot : OreDictionary.getOres("ingot" + name)) { if (Platform.isSameItemPrecise(i, ingot)) { return true; @@ -263,6 +249,7 @@ public void setAllowEdit(final boolean allowEdit) { } public enum PlacableItemType { + STORAGE_CELLS(15), ORE(16 + 15), STORAGE_COMPONENT(3 * 16 + 15), diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index 7a675ce48f6..632dc23a9a6 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; +import java.io.File; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.List; + +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; + import appeng.api.config.*; import appeng.api.util.IConfigManager; import appeng.api.util.IConfigurableObject; @@ -31,23 +31,18 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import java.io.File; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.List; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; public final class AEConfig extends Configuration implements IConfigurableObject, IConfigManagerHost { + public static double TUNNEL_POWER_LOSS = 0.05; public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String PACKET_CHANNEL = "AE"; public static AEConfig instance; public final IConfigManager settings = new ConfigManager(this); public final EnumSet featureFlags = EnumSet.noneOf(AEFeature.class); - public final int[] craftByStacks = {1, 10, 100, 1000}; - public final int[] priorityByStacks = {1, 10, 100, 1000}; - public final int[] levelByStacks = {1, 10, 100, 1000}; + public final int[] craftByStacks = { 1, 10, 100, 1000 }; + public final int[] priorityByStacks = { 1, 10, 100, 1000 }; + public final int[] levelByStacks = { 1, 10, 100, 1000 }; private final double WirelessHighWirelessCount = 64; private final File configFile; public int storageBiomeID = -1; @@ -62,35 +57,14 @@ public final class AEConfig extends Configuration implements IConfigurableObject public double spatialPowerExponent = 1.35; public double spatialPowerMultiplier = 1250.0; public String[] grinderOres = { - // Vanilla Items - "Obsidian", - "Ender", - "EnderPearl", - "Coal", - "Iron", - "Gold", - "Charcoal", - "NetherQuartz", - // Common Mod Ores - "Copper", - "Tin", - "Silver", - "Lead", - "Bronze", - // AE - "CertusQuartz", - "Wheat", - "Fluix", - // Other Mod Ores - "Brass", - "Platinum", - "Nickel", - "Invar", - "Aluminium", - "Electrum", - "Osmium", - "Zinc" - }; + // Vanilla Items + "Obsidian", "Ender", "EnderPearl", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz", + // Common Mod Ores + "Copper", "Tin", "Silver", "Lead", "Bronze", + // AE + "CertusQuartz", "Wheat", "Fluix", + // Other Mod Ores + "Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum", "Osmium", "Zinc" }; public double oreDoublePercentage = 90.0; public boolean enableEffects = true; public boolean useLargeFonts = false; @@ -114,7 +88,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject public boolean updatable = false; public double meteoriteClusterChance = 0.1; public double meteoriteSpawnChance = 0.3; - public int[] meteoriteDimensionWhitelist = {0}; + public int[] meteoriteDimensionWhitelist = { 0 }; public int craftingCalculationTimePerTick = 5; PowerUnits selectedPowerUnit = PowerUnits.AE; private double WirelessBaseCost = 8; @@ -133,33 +107,29 @@ public AEConfig(final File configFile) { FMLCommonHandler.instance().bus().register(this); final double DEFAULT_MEKANISM_EXCHANGE = 0.2; - PowerUnits.MK.conversionRatio = - this.get("PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE).getDouble(DEFAULT_MEKANISM_EXCHANGE); + PowerUnits.MK.conversionRatio = this.get("PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE) + .getDouble(DEFAULT_MEKANISM_EXCHANGE); final double DEFAULT_IC2_EXCHANGE = 2.0; - PowerUnits.EU.conversionRatio = - this.get("PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE).getDouble(DEFAULT_IC2_EXCHANGE); + PowerUnits.EU.conversionRatio = this.get("PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE) + .getDouble(DEFAULT_IC2_EXCHANGE); final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0; - PowerUnits.WA.conversionRatio = - this.get("PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE).getDouble(DEFAULT_RTC_EXCHANGE); + PowerUnits.WA.conversionRatio = this.get("PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE) + .getDouble(DEFAULT_RTC_EXCHANGE); final double DEFAULT_RF_EXCHANGE = 0.5; - PowerUnits.RF.conversionRatio = - this.get("PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE).getDouble(DEFAULT_RF_EXCHANGE); + PowerUnits.RF.conversionRatio = this.get("PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE) + .getDouble(DEFAULT_RF_EXCHANGE); final double DEFAULT_TUNNEL_POWER_LOSS = 0.05; TUNNEL_POWER_LOSS = this.get("PowerRatios", "TunnelPowerLoss", DEFAULT_TUNNEL_POWER_LOSS) .getDouble(DEFAULT_TUNNEL_POWER_LOSS); if (TUNNEL_POWER_LOSS < 0 || TUNNEL_POWER_LOSS >= 1) TUNNEL_POWER_LOSS = DEFAULT_TUNNEL_POWER_LOSS; - final double usageEffective = - this.get("PowerRatios", "UsageMultiplier", 1.0).getDouble(1.0); + final double usageEffective = this.get("PowerRatios", "UsageMultiplier", 1.0).getDouble(1.0); PowerMultiplier.CONFIG.multiplier = Math.max(0.01, usageEffective); - CondenserOutput.MATTER_BALLS.requiredPower = - this.get("Condenser", "MatterBalls", 256).getInt(256); - CondenserOutput.SINGULARITY.requiredPower = - this.get("Condenser", "Singularity", 256000).getInt(256000); + CondenserOutput.MATTER_BALLS.requiredPower = this.get("Condenser", "MatterBalls", 256).getInt(256); + CondenserOutput.SINGULARITY.requiredPower = this.get("Condenser", "Singularity", 256000).getInt(256000); - this.grinderOres = - this.get("GrindStone", "grinderOres", this.grinderOres).getStringList(); + this.grinderOres = this.get("GrindStone", "grinderOres", this.grinderOres).getStringList(); this.oreDoublePercentage = this.get("GrindStone", "oreDoublePercentage", this.oreDoublePercentage) .getDouble(this.oreDoublePercentage); @@ -178,9 +148,8 @@ public AEConfig(final File configFile) { .getDouble(this.meteoriteClusterChance); this.meteoriteSpawnChance = this.get("worldGen", "meteoriteSpawnChance", this.meteoriteSpawnChance) .getDouble(this.meteoriteSpawnChance); - this.meteoriteDimensionWhitelist = this.get( - "worldGen", "meteoriteDimensionWhitelist", this.meteoriteDimensionWhitelist) - .getIntList(); + this.meteoriteDimensionWhitelist = this + .get("worldGen", "meteoriteDimensionWhitelist", this.meteoriteDimensionWhitelist).getIntList(); this.quartzOresPerCluster = this.get("worldGen", "quartzOresPerCluster", this.quartzOresPerCluster) .getInt(this.quartzOresPerCluster); @@ -193,48 +162,47 @@ public AEConfig(final File configFile) { "wireless", "Range= WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp )\nPowerDrain= WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount )"); - this.WirelessBaseCost = - this.get("wireless", "WirelessBaseCost", this.WirelessBaseCost).getDouble(this.WirelessBaseCost); + this.WirelessBaseCost = this.get("wireless", "WirelessBaseCost", this.WirelessBaseCost) + .getDouble(this.WirelessBaseCost); this.WirelessCostMultiplier = this.get("wireless", "WirelessCostMultiplier", this.WirelessCostMultiplier) .getDouble(this.WirelessCostMultiplier); this.WirelessBaseRange = this.get("wireless", "WirelessBaseRange", this.WirelessBaseRange) .getDouble(this.WirelessBaseRange); - this.WirelessBoosterRangeMultiplier = this.get( - "wireless", "WirelessBoosterRangeMultiplier", this.WirelessBoosterRangeMultiplier) + this.WirelessBoosterRangeMultiplier = this + .get("wireless", "WirelessBoosterRangeMultiplier", this.WirelessBoosterRangeMultiplier) .getDouble(this.WirelessBoosterRangeMultiplier); this.WirelessBoosterExp = this.get("wireless", "WirelessBoosterExp", this.WirelessBoosterExp) .getDouble(this.WirelessBoosterExp); - this.WirelessTerminalDrainMultiplier = this.get( - "wireless", "WirelessTerminalDrainMultiplier", this.WirelessTerminalDrainMultiplier) + this.WirelessTerminalDrainMultiplier = this + .get("wireless", "WirelessTerminalDrainMultiplier", this.WirelessTerminalDrainMultiplier) .getDouble(this.WirelessTerminalDrainMultiplier); - this.formationPlaneEntityLimit = this.get( - "automation", "formationPlaneEntityLimit", this.formationPlaneEntityLimit) + this.formationPlaneEntityLimit = this + .get("automation", "formationPlaneEntityLimit", this.formationPlaneEntityLimit) .getInt(this.formationPlaneEntityLimit); this.wirelessTerminalBattery = this.get("battery", "wirelessTerminal", this.wirelessTerminalBattery) .getInt(this.wirelessTerminalBattery); - this.chargedStaffBattery = - this.get("battery", "chargedStaff", this.chargedStaffBattery).getInt(this.chargedStaffBattery); + this.chargedStaffBattery = this.get("battery", "chargedStaff", this.chargedStaffBattery) + .getInt(this.chargedStaffBattery); this.entropyManipulatorBattery = this.get("battery", "entropyManipulator", this.entropyManipulatorBattery) .getInt(this.entropyManipulatorBattery); - this.portableCellBattery = - this.get("battery", "portableCell", this.portableCellBattery).getInt(this.portableCellBattery); + this.portableCellBattery = this.get("battery", "portableCell", this.portableCellBattery) + .getInt(this.portableCellBattery); this.colorApplicatorBattery = this.get("battery", "colorApplicator", this.colorApplicatorBattery) .getInt(this.colorApplicatorBattery); - this.matterCannonBattery = - this.get("battery", "matterCannon", this.matterCannonBattery).getInt(this.matterCannonBattery); + this.matterCannonBattery = this.get("battery", "matterCannon", this.matterCannonBattery) + .getInt(this.matterCannonBattery); this.levelEmitterDelay = this.get("tickrates", "LevelEmitterDelay", this.levelEmitterDelay) .getInt(this.levelEmitterDelay); - this.debugLogTiming = - this.get("debug", "LogTiming", this.debugLogTiming).getBoolean(this.debugLogTiming); - this.debugPathFinding = - this.get("debug", "LogPathFinding", this.debugPathFinding).getBoolean(this.debugPathFinding); + this.debugLogTiming = this.get("debug", "LogTiming", this.debugLogTiming).getBoolean(this.debugLogTiming); + this.debugPathFinding = this.get("debug", "LogPathFinding", this.debugPathFinding) + .getBoolean(this.debugPathFinding); this.p2pBackboneTransfer = this.get("debug", "EnableP2pBackboneTransfer", this.p2pBackboneTransfer) .getBoolean(this.p2pBackboneTransfer); - this.quantumBridgeBackboneTransfer = this.get( - "debug", "EnableQuantumBridgeBackboneTransfer", this.quantumBridgeBackboneTransfer) + this.quantumBridgeBackboneTransfer = this + .get("debug", "EnableQuantumBridgeBackboneTransfer", this.quantumBridgeBackboneTransfer) .getBoolean(this.quantumBridgeBackboneTransfer); this.craftingCalculatorVersion = this.get("debug", "CraftingCalculatorVersion", this.craftingCalculatorVersion) .getInt(this.craftingCalculatorVersion); @@ -252,8 +220,7 @@ public AEConfig(final File configFile) { } } - final ModContainer imb = - cpw.mods.fml.common.Loader.instance().getIndexedModList().get("ImmibisCore"); + final ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get("ImmibisCore"); if (imb != null) { final List version = Arrays.asList("59.0.0", "59.0.1", "59.0.2"); if (version.contains(imb.getVersion())) { @@ -262,12 +229,12 @@ public AEConfig(final File configFile) { } try { - this.selectedPowerUnit = PowerUnits.valueOf(this.get( + this.selectedPowerUnit = PowerUnits.valueOf( + this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), - this.getListComment(this.selectedPowerUnit)) - .getString()); + this.getListComment(this.selectedPowerUnit)).getString()); } catch (final Throwable t) { this.selectedPowerUnit = PowerUnits.AE; } @@ -277,8 +244,8 @@ public AEConfig(final File configFile) { } if (this.isFeatureEnabled(AEFeature.SpatialIO)) { - this.storageBiomeID = - this.get("spatialio", "storageBiomeID", this.storageBiomeID).getInt(this.storageBiomeID); + this.storageBiomeID = this.get("spatialio", "storageBiomeID", this.storageBiomeID) + .getInt(this.storageBiomeID); this.storageProviderID = this.get("spatialio", "storageProviderID", this.storageProviderID) .getInt(this.storageProviderID); this.spatialPowerMultiplier = this.get("spatialio", "spatialPowerMultiplier", this.spatialPowerMultiplier) @@ -288,8 +255,8 @@ public AEConfig(final File configFile) { } if (this.isFeatureEnabled(AEFeature.CraftingCPU)) { - this.craftingCalculationTimePerTick = this.get( - "craftingCPU", "craftingCalculationTimePerTick", this.craftingCalculationTimePerTick) + this.craftingCalculationTimePerTick = this + .get("craftingCPU", "craftingCalculationTimePerTick", this.craftingCalculationTimePerTick) .getInt(this.craftingCalculationTimePerTick); } @@ -297,21 +264,16 @@ public AEConfig(final File configFile) { } private void clientSync() { - this.disableColoredCableRecipesInNEI = - this.get("Client", "disableColoredCableRecipesInNEI", true).getBoolean(true); + this.disableColoredCableRecipesInNEI = this.get("Client", "disableColoredCableRecipesInNEI", true) + .getBoolean(true); this.enableEffects = this.get("Client", "enableEffects", true).getBoolean(true); - this.useLargeFonts = - this.get("Client", "useTerminalUseLargeFont", false).getBoolean(false); - this.useColoredCraftingStatus = - this.get("Client", "useColoredCraftingStatus", true).getBoolean(true); + this.useLargeFonts = this.get("Client", "useTerminalUseLargeFont", false).getBoolean(false); + this.useColoredCraftingStatus = this.get("Client", "useColoredCraftingStatus", true).getBoolean(true); this.preserveSearchBar = this.get("Client", "preserveSearchBar", true).getBoolean(true); - this.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal = this.get( - "Client", "showOnlyInterfacesWithFreeSlotsInInterfaceTerminal", false) - .getBoolean(false); - this.MEMonitorableSmallSize = - this.get("Client", "MEMonitorableSmallSize", 6).getInt(6); - this.InterfaceTerminalSmallSize = - this.get("Client", "InterfaceTerminalSmallSize", 6).getInt(6); + this.showOnlyInterfacesWithFreeSlotsInInterfaceTerminal = this + .get("Client", "showOnlyInterfacesWithFreeSlotsInInterfaceTerminal", false).getBoolean(false); + this.MEMonitorableSmallSize = this.get("Client", "MEMonitorableSmallSize", 6).getInt(6); + this.InterfaceTerminalSmallSize = this.get("Client", "InterfaceTerminalSmallSize", 6).getInt(6); // load buttons.. for (int btnNum = 0; btnNum < 4; btnNum++) { final Property cmb = this.get("Client", "craftAmtButton" + (btnNum + 1), this.craftByStacks[btnNum]); @@ -342,8 +304,9 @@ private void clientSync() { try { value = Enum.valueOf(value.getClass(), p.getString()); } catch (final IllegalArgumentException er) { - AELog.info("Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() - + "' instead"); + AELog.info( + "Invalid value '" + p + .getString() + "' for " + e.name() + " using '" + value.name() + "' instead"); } this.settings.putSetting(e, value); @@ -388,11 +351,7 @@ public double wireless_getPowerDrain(final int boosters) { } @Override - public Property get( - final String category, - final String key, - final String defaultValue, - final String comment, + public Property get(final String category, final String key, final String defaultValue, final String comment, final Property.Type type) { final Property prop = super.get(category, key, defaultValue, comment, type); @@ -454,8 +413,8 @@ public void updateSetting(final IConfigManager manager, final Enum setting, fina for (final Settings e : this.settings.getSettings()) { if (e == setting) { final String Category = "Client"; - final Property p = - this.get(Category, e.name(), this.settings.getSetting(e).name(), this.getListComment(newValue)); + final Property p = this + .get(Category, e.name(), this.settings.getSetting(e).name(), this.getListComment(newValue)); p.set(newValue.name()); } } @@ -543,8 +502,8 @@ public PowerUnits selectedPowerUnit() { } public void nextPowerUnit(final boolean backwards) { - this.selectedPowerUnit = - Platform.rotateEnum(this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues()); + this.selectedPowerUnit = Platform + .rotateEnum(this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues()); this.save(); } } diff --git a/src/main/java/appeng/core/AELog.java b/src/main/java/appeng/core/AELog.java index 986c59138f7..2f8772450ca 100644 --- a/src/main/java/appeng/core/AELog.java +++ b/src/main/java/appeng/core/AELog.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import appeng.core.features.AEFeature; -import appeng.tile.AEBaseTile; -import appeng.util.Platform; import javax.annotation.Nonnull; + import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; +import appeng.core.features.AEFeature; +import appeng.tile.AEBaseTile; +import appeng.util.Platform; + /** * Utility class for easier logging. */ @@ -97,10 +91,7 @@ public static void log(@Nonnull final Level level, @Nonnull final String message * @param params the parameters used for {@link String#format(String, Object...)}. * @see AELog#log(Level, String, Object...) */ - public static void log( - @Nonnull final Level level, - @Nonnull final Throwable exception, - @Nonnull String message, + public static void log(@Nonnull final Level level, @Nonnull final Throwable exception, @Nonnull String message, final Object... params) { if (AELog.isLogEnabled()) { final String formattedMessage = String.format(message, params); @@ -286,8 +277,8 @@ public static void integration(@Nonnull final Throwable exception) { * @param aeBaseTile * @see AELog#log(Level, String, Object...) */ - public static void blockUpdate( - final int xCoord, final int yCoord, final int zCoord, @Nonnull final AEBaseTile aeBaseTile) { + public static void blockUpdate(final int xCoord, final int yCoord, final int zCoord, + @Nonnull final AEBaseTile aeBaseTile) { if (AEConfig.instance.isFeatureEnabled(AEFeature.UpdateLogging)) { info(BLOCK_UPDATE, aeBaseTile.getClass().getName(), xCoord, +yCoord, +zCoord); } diff --git a/src/main/java/appeng/core/Api.java b/src/main/java/appeng/core/Api.java index 86607ebdfcb..fec53a5e2dc 100644 --- a/src/main/java/appeng/core/Api.java +++ b/src/main/java/appeng/core/Api.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.IAppEngApi; import appeng.api.definitions.Blocks; import appeng.api.definitions.Items; @@ -35,9 +29,9 @@ import appeng.me.GridConnection; import appeng.me.GridNode; import appeng.util.Platform; -import net.minecraftforge.common.util.ForgeDirection; public final class Api implements IAppEngApi { + public static final Api INSTANCE = new Api(); private final ApiPart partHelper; diff --git a/src/main/java/appeng/core/ApiDefinitions.java b/src/main/java/appeng/core/ApiDefinitions.java index 49d1c5ac37b..b0ac927a62a 100644 --- a/src/main/java/appeng/core/ApiDefinitions.java +++ b/src/main/java/appeng/core/ApiDefinitions.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; @@ -26,6 +18,7 @@ * Internal implementation of the definitions for the API */ public final class ApiDefinitions implements IDefinitions { + private final ApiBlocks blocks; private final ApiItems items; private final ApiMaterials materials; diff --git a/src/main/java/appeng/core/AppEng.java b/src/main/java/appeng/core/AppEng.java index 10517d7a7e4..06bc7aa3740 100644 --- a/src/main/java/appeng/core/AppEng.java +++ b/src/main/java/appeng/core/AppEng.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; +import java.io.File; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Nonnull; + +import net.minecraftforge.common.config.Configuration; + import appeng.core.crash.CrashInfo; import appeng.core.crash.IntegrationCrashEnhancement; import appeng.core.crash.ModCrashEnhancement; @@ -34,17 +33,15 @@ import appeng.services.export.ExportProcess; import appeng.services.export.ForgeExportConfig; import appeng.util.Platform; + import com.google.common.base.Stopwatch; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.NetworkRegistry; -import java.io.File; -import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; -import net.minecraftforge.common.config.Configuration; @Mod( modid = AppEng.MOD_ID, @@ -54,6 +51,7 @@ dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory") public final class AppEng { + public static final String MOD_ID = "appliedenergistics2"; public static final String MOD_NAME = "Applied Energistics 2"; public static final String MOD_DEPENDENCIES = @@ -63,10 +61,14 @@ public final class AppEng { // depend on version of forge used for build. "after:appliedenergistics2-core;" + "required-after:Forge@[" // require forge. - + net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion - + net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion - + net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion - + net.minecraftforge.common.ForgeVersion.buildVersion + ",)"; // buildVersion + + net.minecraftforge.common.ForgeVersion.majorVersion + + '.' // majorVersion + + net.minecraftforge.common.ForgeVersion.minorVersion + + '.' // minorVersion + + net.minecraftforge.common.ForgeVersion.revisionVersion + + '.' // revisionVersion + + net.minecraftforge.common.ForgeVersion.buildVersion + + ",)"; // buildVersion @Nonnull private static final AppEng INSTANCE = new AppEng(); diff --git a/src/main/java/appeng/core/CommonHelper.java b/src/main/java/appeng/core/CommonHelper.java index 97eb5122de1..430f5eae2b2 100644 --- a/src/main/java/appeng/core/CommonHelper.java +++ b/src/main/java/appeng/core/CommonHelper.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import appeng.api.parts.CableRenderMode; -import appeng.block.AEBaseBlock; -import appeng.client.ActionKey; -import appeng.client.EffectType; -import appeng.core.sync.AppEngPacket; -import cpw.mods.fml.common.SidedProxy; import java.util.List; import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import appeng.api.parts.CableRenderMode; +import appeng.block.AEBaseBlock; +import appeng.client.ActionKey; +import appeng.client.EffectType; +import appeng.core.sync.AppEngPacket; +import cpw.mods.fml.common.SidedProxy; + public abstract class CommonHelper { @SidedProxy(clientSide = "appeng.client.ClientHelper", serverSide = "appeng.server.ServerHelper") @@ -44,11 +38,11 @@ public abstract class CommonHelper { public abstract List getPlayers(); - public abstract void sendToAllNearExcept( - EntityPlayer p, double x, double y, double z, double dist, World w, AppEngPacket packet); + public abstract void sendToAllNearExcept(EntityPlayer p, double x, double y, double z, double dist, World w, + AppEngPacket packet); - public abstract void spawnEffect( - EffectType effect, World worldObj, double posX, double posY, double posZ, Object extra); + public abstract void spawnEffect(EffectType effect, World worldObj, double posX, double posY, double posZ, + Object extra); public abstract boolean shouldAddParticles(Random r); diff --git a/src/main/java/appeng/core/CreativeTab.java b/src/main/java/appeng/core/CreativeTab.java index a3d61fc7c5c..f4b430fa4a1 100644 --- a/src/main/java/appeng/core/CreativeTab.java +++ b/src/main/java/appeng/core/CreativeTab.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import appeng.api.AEApi; -import appeng.api.definitions.*; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import appeng.api.AEApi; +import appeng.api.definitions.*; + public final class CreativeTab extends CreativeTabs { + public static CreativeTab instance = null; public CreativeTab() { diff --git a/src/main/java/appeng/core/CreativeTabFacade.java b/src/main/java/appeng/core/CreativeTabFacade.java index 53c7d28759d..bfe39f38a71 100644 --- a/src/main/java/appeng/core/CreativeTabFacade.java +++ b/src/main/java/appeng/core/CreativeTabFacade.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import appeng.api.AEApi; -import appeng.items.parts.ItemFacade; -import com.google.common.base.Optional; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import appeng.api.AEApi; +import appeng.items.parts.ItemFacade; + +import com.google.common.base.Optional; + public final class CreativeTabFacade extends CreativeTabs { public static CreativeTabFacade instance = null; @@ -45,8 +39,7 @@ public Item getTabIconItem() { @Override public ItemStack getIconItemStack() { - final Optional maybeFacade = - AEApi.instance().definitions().items().facade().maybeItem(); + final Optional maybeFacade = AEApi.instance().definitions().items().facade().maybeItem(); if (maybeFacade.isPresent()) { return ((ItemFacade) maybeFacade.get()).getCreativeTabIcon(); } diff --git a/src/main/java/appeng/core/FacadeConfig.java b/src/main/java/appeng/core/FacadeConfig.java index fd9de1f1aac..ba5ac1e00d1 100644 --- a/src/main/java/appeng/core/FacadeConfig.java +++ b/src/main/java/appeng/core/FacadeConfig.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; import java.io.File; import java.lang.reflect.Field; import java.util.regex.Matcher; import java.util.regex.Pattern; + import net.minecraft.block.Block; import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; + public class FacadeConfig extends Configuration { public static FacadeConfig instance; diff --git a/src/main/java/appeng/core/FeatureHandlerRegistry.java b/src/main/java/appeng/core/FeatureHandlerRegistry.java index 6328b82e663..86dc5fed83a 100644 --- a/src/main/java/appeng/core/FeatureHandlerRegistry.java +++ b/src/main/java/appeng/core/FeatureHandlerRegistry.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import appeng.core.features.IFeatureHandler; import java.util.LinkedHashSet; import java.util.Set; +import appeng.core.features.IFeatureHandler; + public final class FeatureHandlerRegistry { + private final Set registry = new LinkedHashSet(); public void addFeatureHandler(final IFeatureHandler feature) { diff --git a/src/main/java/appeng/core/FeatureRegistry.java b/src/main/java/appeng/core/FeatureRegistry.java index 8e5c8cff58d..1a7101aff29 100644 --- a/src/main/java/appeng/core/FeatureRegistry.java +++ b/src/main/java/appeng/core/FeatureRegistry.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; -import appeng.core.features.IAEFeature; import java.util.LinkedHashSet; import java.util.Set; +import appeng.core.features.IAEFeature; + public final class FeatureRegistry { + private final Set registry = new LinkedHashSet(); public void addFeature(final IAEFeature feature) { diff --git a/src/main/java/appeng/core/IMCHandler.java b/src/main/java/appeng/core/IMCHandler.java index 8ba8b4c9727..3e307a26c1c 100644 --- a/src/main/java/appeng/core/IMCHandler.java +++ b/src/main/java/appeng/core/IMCHandler.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + import appeng.api.config.TunnelType; import appeng.core.api.IIMCProcessor; import appeng.core.api.imc.*; import cpw.mods.fml.common.event.FMLInterModComms; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; /** * Handles the delegation of the corresponding IMC messages to the suitable IMC processors @@ -34,6 +27,7 @@ * @since rv1 */ public class IMCHandler { + private static final int INITIAL_PROCESSORS_CAPACITY = 20; /** @@ -62,7 +56,8 @@ public IMCHandler() { } /** - * Tries to find every message matching the internal IMC keys. When found the corresponding handler will process the attached message. + * Tries to find every message matching the internal IMC keys. When found the corresponding handler will process the + * attached message. * * @param event Event carrying the identifier and message for the handlers */ diff --git a/src/main/java/appeng/core/RecipeLoader.java b/src/main/java/appeng/core/RecipeLoader.java index 0bff225adcd..60a285bc2ec 100644 --- a/src/main/java/appeng/core/RecipeLoader.java +++ b/src/main/java/appeng/core/RecipeLoader.java @@ -1,34 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; + +import javax.annotation.Nonnull; + +import org.apache.commons.io.FileUtils; + import appeng.api.recipes.IRecipeHandler; import appeng.recipes.CustomRecipeConfig; import appeng.recipes.loader.ConfigLoader; import appeng.recipes.loader.JarLoader; import appeng.recipes.loader.RecipeResourceCopier; + import com.google.common.base.Preconditions; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import javax.annotation.Nonnull; -import org.apache.commons.io.FileUtils; /** * handles the decision if recipes should be loaded from jar, loaded from file system or force copied from jar @@ -38,6 +34,7 @@ * @since rv3 12.05.2015 */ public class RecipeLoader implements Runnable { + /** * recipe path in the jar */ @@ -57,9 +54,7 @@ public class RecipeLoader implements Runnable { * @param handler handler to load the recipes * @throws NullPointerException if handler is null */ - public RecipeLoader( - @Nonnull final File recipeDirectory, - @Nonnull final CustomRecipeConfig config, + public RecipeLoader(@Nonnull final File recipeDirectory, @Nonnull final CustomRecipeConfig config, @Nonnull final IRecipeHandler handler) { this.recipeDirectory = Preconditions.checkNotNull(recipeDirectory); Preconditions.checkArgument(!recipeDirectory.isFile()); diff --git a/src/main/java/appeng/core/Registration.java b/src/main/java/appeng/core/Registration.java index 20dfa59ecb8..5d733962b36 100644 --- a/src/main/java/appeng/core/Registration.java +++ b/src/main/java/appeng/core/Registration.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core; +import java.io.File; + +import javax.annotation.Nonnull; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.oredict.RecipeSorter.Category; + import appeng.api.AEApi; import appeng.api.IAppEngApi; import appeng.api.config.Upgrades; @@ -68,27 +75,18 @@ import appeng.util.Platform; import appeng.worldgen.MeteoriteWorldGen; import appeng.worldgen.QuartzWorldGen; + import com.google.common.base.Preconditions; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.VillagerRegistry; -import java.io.File; -import javax.annotation.Nonnull; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.RecipeSorter; -import net.minecraftforge.oredict.RecipeSorter.Category; public final class Registration { + private final RecipeHandler recipeHandler; private final DefinitionConverter converter; private BiomeGenBase storageBiome; @@ -133,8 +131,7 @@ void preInitialize(final FMLPreInitializationEvent event) { this.assignItems(items, apiItems); // Register all detected handlers and features (items, blocks) in pre-init - for (final IFeatureHandler handler : - definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers()) { + for (final IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers()) { handler.register(); } @@ -174,8 +171,8 @@ private void registerSpatial(final boolean force) { if (config.storageProviderID == -1 && force) { config.storageProviderID = -11; - while (!DimensionManager.registerProviderType( - config.storageProviderID, StorageWorldProvider.class, false)) { + while (!DimensionManager + .registerProviderType(config.storageProviderID, StorageWorldProvider.class, false)) { config.storageProviderID--; } @@ -464,9 +461,7 @@ private void assignItems(final Items target, final IItems source) { target.itemLumenPaintBall = source.coloredLumenPaintBall(); } - void initialize( - @Nonnull final FMLInitializationEvent event, - @Nonnull final File recipeDirectory, + void initialize(@Nonnull final FMLInitializationEvent event, @Nonnull final File recipeDirectory, @Nonnull final CustomRecipeConfig customRecipeConfig) { Preconditions.checkNotNull(event); Preconditions.checkNotNull(recipeDirectory); @@ -484,9 +479,10 @@ void initialize( recipeLoader.run(); partHelper.registerNewLayer( - "appeng.parts.layers.LayerISidedInventory", "net.minecraft.inventory.ISidedInventory"); - partHelper.registerNewLayer( - "appeng.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler"); + "appeng.parts.layers.LayerISidedInventory", + "net.minecraft.inventory.ISidedInventory"); + partHelper + .registerNewLayer("appeng.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler"); partHelper.registerNewLayer( "appeng.parts.layers.LayerITileStorageMonitorable", "appeng.api.implementations.tiles.ITileStorageMonitorable"); @@ -513,8 +509,7 @@ void initialize( registries.cell().addCellHandler(new BasicCellHandler()); registries.cell().addCellHandler(new CreativeCellHandler()); - for (final ItemStack ammoStack : - api.definitions().materials().matterBall().maybeStack(1).asSet()) { + for (final ItemStack ammoStack : api.definitions().materials().matterBall().maybeStack(1).asSet()) { final double weight = 32; registries.matterCannon().registerAmmo(ammoStack, weight); @@ -522,8 +517,9 @@ void initialize( this.recipeHandler.injectRecipes(); - final PlayerStatsRegistration registration = - new PlayerStatsRegistration(FMLCommonHandler.instance().bus(), AEConfig.instance); + final PlayerStatsRegistration registration = new PlayerStatsRegistration( + FMLCommonHandler.instance().bus(), + AEConfig.instance); registration.registerAchievementHandlers(); registration.registerAchievements(); @@ -539,7 +535,10 @@ void initialize( if (AEConfig.instance.isFeatureEnabled(AEFeature.EnableFacadeCrafting)) { GameRegistry.addRecipe(new FacadeRecipe()); RecipeSorter.register( - "appliedenergistics2:facade", FacadeRecipe.class, Category.SHAPED, "after:minecraft:shaped"); + "appliedenergistics2:facade", + FacadeRecipe.class, + Category.SHAPED, + "after:minecraft:shaped"); } } @@ -661,8 +660,7 @@ void postInit(final FMLPostInitializationEvent event) { // Inscriber Upgrades.SPEED.registerItem(blocks.inscriber(), 3); - for (final Item wirelessTerminalItem : - items.wirelessTerminal().maybeItem().asSet()) { + for (final Item wirelessTerminalItem : items.wirelessTerminal().maybeItem().asSet()) { registries.wireless().registerWirelessHandler((IWirelessTermHandler) wirelessTerminalItem); } @@ -671,12 +669,10 @@ void postInit(final FMLPostInitializationEvent event) { final IMaterials materials = definitions.materials(); - for (final ItemStack crystal : - materials.certusQuartzCrystal().maybeStack(1).asSet()) { + for (final ItemStack crystal : materials.certusQuartzCrystal().maybeStack(1).asSet()) { d.addItem(new WeightedRandomChestContent(crystal, 1, 4, 2)); } - for (final ItemStack dust : - materials.certusQuartzDust().maybeStack(1).asSet()) { + for (final ItemStack dust : materials.certusQuartzDust().maybeStack(1).asSet()) { d.addItem(new WeightedRandomChestContent(dust, 1, 4, 2)); } } diff --git a/src/main/java/appeng/core/api/ApiPart.java b/src/main/java/appeng/core/api/ApiPart.java index 406d55f6a94..70ffc65247b 100644 --- a/src/main/java/appeng/core/api/ApiPart.java +++ b/src/main/java/appeng/core/api/ApiPart.java @@ -1,47 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api; -import appeng.api.parts.CableRenderMode; -import appeng.api.parts.IPartHelper; -import appeng.api.parts.IPartItem; -import appeng.api.parts.LayerBase; -import appeng.client.render.BusRenderer; -import appeng.core.AELog; -import appeng.core.CommonHelper; -import appeng.integration.IntegrationRegistry; -import appeng.integration.IntegrationType; -import appeng.integration.abstraction.IFMP; -import appeng.parts.PartPlacement; -import appeng.tile.networking.TileCableBus; -import appeng.util.Platform; -import com.google.common.base.Joiner; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Method; import java.util.*; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; + import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.commons.Remapper; @@ -51,6 +31,22 @@ import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodNode; +import appeng.api.parts.CableRenderMode; +import appeng.api.parts.IPartHelper; +import appeng.api.parts.IPartItem; +import appeng.api.parts.LayerBase; +import appeng.client.render.BusRenderer; +import appeng.core.AELog; +import appeng.core.CommonHelper; +import appeng.integration.IntegrationRegistry; +import appeng.integration.IntegrationType; +import appeng.integration.abstraction.IFMP; +import appeng.parts.PartPlacement; +import appeng.tile.networking.TileCableBus; +import appeng.util.Platform; + +import com.google.common.base.Joiner; + public class ApiPart implements IPartHelper { private final Map tileImplementations = new HashMap(); @@ -222,18 +218,18 @@ private Class loadClass(final String name, byte[] b) { final ClassLoader loader = this.getClass().getClassLoader(); // ClassLoader.getSystemClassLoader(); final Class root = ClassLoader.class; final Class cls = loader.getClass(); - final Method defineClassMethod = - root.getDeclaredMethod("defineClass", String.class, byte[].class, int.class, int.class); - final Method runTransformersMethod = - cls.getDeclaredMethod("runTransformers", String.class, String.class, byte[].class); + final Method defineClassMethod = root + .getDeclaredMethod("defineClass", String.class, byte[].class, int.class, int.class); + final Method runTransformersMethod = cls + .getDeclaredMethod("runTransformers", String.class, String.class, byte[].class); runTransformersMethod.setAccessible(true); defineClassMethod.setAccessible(true); try { - final Object[] argsA = {name, name, b}; + final Object[] argsA = { name, name, b }; b = (byte[]) runTransformersMethod.invoke(loader, argsA); - final Object[] args = {name, b, 0, b.length}; + final Object[] args = { name, b, 0, b.length }; clazz = (Class) defineClassMethod.invoke(loader, args); } finally { runTransformersMethod.setAccessible(false); @@ -257,8 +253,7 @@ public boolean registerNewLayer(final String layer, final String layerInterface) } else { AELog.info("Layer " + layer + " not registered, " + layerInterface + " already has a layer."); } - } catch (final Throwable ignored) { - } + } catch (final Throwable ignored) {} return false; } @@ -271,14 +266,8 @@ public void setItemBusRenderer(final IPartItem i) { } @Override - public boolean placeBus( - final ItemStack is, - final int x, - final int y, - final int z, - final int side, - final EntityPlayer player, - final World w) { + public boolean placeBus(final ItemStack is, final int x, final int y, final int z, final int side, + final EntityPlayer player, final World w) { return PartPlacement.place(is, x, y, z, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0); } diff --git a/src/main/java/appeng/core/api/ApiStorage.java b/src/main/java/appeng/core/api/ApiStorage.java index f5146d6c317..ec047441543 100644 --- a/src/main/java/appeng/core/api/ApiStorage.java +++ b/src/main/java/appeng/core/api/ApiStorage.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api; +import java.io.IOException; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import appeng.api.networking.crafting.ICraftingLink; import appeng.api.networking.crafting.ICraftingRequester; import appeng.api.networking.energy.IEnergySource; @@ -31,10 +29,6 @@ import appeng.util.Platform; import appeng.util.item.*; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; public class ApiStorage implements IStorageHelper { @@ -79,20 +73,14 @@ public IAEFluidStack readFluidFromPacket(final ByteBuf input) throws IOException } @Override - public IAEItemStack poweredExtraction( - final IEnergySource energy, - final IMEInventory cell, - final IAEItemStack request, - final BaseActionSource src) { + public IAEItemStack poweredExtraction(final IEnergySource energy, final IMEInventory cell, + final IAEItemStack request, final BaseActionSource src) { return Platform.poweredExtraction(energy, cell, request, src); } @Override - public IAEItemStack poweredInsert( - final IEnergySource energy, - final IMEInventory cell, - final IAEItemStack input, - final BaseActionSource src) { + public IAEItemStack poweredInsert(final IEnergySource energy, final IMEInventory cell, + final IAEItemStack input, final BaseActionSource src) { return Platform.poweredInsert(energy, cell, input, src); } } diff --git a/src/main/java/appeng/core/api/IIMCProcessor.java b/src/main/java/appeng/core/api/IIMCProcessor.java index e449d07f54b..9ae367f49b6 100644 --- a/src/main/java/appeng/core/api/IIMCProcessor.java +++ b/src/main/java/appeng/core/api/IIMCProcessor.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api; @@ -21,5 +13,6 @@ import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; public interface IIMCProcessor { + void process(IMCMessage m); } diff --git a/src/main/java/appeng/core/api/definitions/ApiBlocks.java b/src/main/java/appeng/core/api/definitions/ApiBlocks.java index ec10c3db5b5..791204053ff 100644 --- a/src/main/java/appeng/core/api/definitions/ApiBlocks.java +++ b/src/main/java/appeng/core/api/definitions/ApiBlocks.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api.definitions; +import java.util.EnumSet; +import java.util.Set; + import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlocks; import appeng.api.definitions.ITileDefinition; @@ -45,14 +40,14 @@ import appeng.debug.BlockCubeGenerator; import appeng.debug.BlockItemGen; import appeng.debug.BlockPhantomNode; + import com.google.common.collect.ImmutableSet; -import java.util.EnumSet; -import java.util.Set; /** * Internal implementation for the API blocks */ public final class ApiBlocks implements IBlocks { + private final IBlockDefinition quartzOre; private final IBlockDefinition quartzOreCharged; private final IBlockDefinition matrixFrame; @@ -201,8 +196,8 @@ public ApiBlocks(final DefinitionConstructor constructor) { this.skyStoneStair = constructor.registerBlockDefinition(new SkyStoneStairBlock(skyStone, 0)); this.skyStoneBlockStair = constructor.registerBlockDefinition(new SkyStoneBlockStairBlock(skyStone, 1)); this.skyStoneBrickStair = constructor.registerBlockDefinition(new SkyStoneBrickStairBlock(skyStone, 2)); - this.skyStoneSmallBrickStair = - constructor.registerBlockDefinition(new SkyStoneSmallBrickStairBlock(skyStone, 3)); + this.skyStoneSmallBrickStair = constructor + .registerBlockDefinition(new SkyStoneSmallBrickStairBlock(skyStone, 3)); this.fluixStair = constructor.registerBlockDefinition(new FluixStairBlock(fluixBlock)); @@ -212,22 +207,62 @@ public ApiBlocks(final DefinitionConstructor constructor) { this.quartzPillarStair = constructor.registerBlockDefinition(new QuartzPillarStairBlock(quartzPillar)); - this.skyStoneSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - skyStone, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock")); - this.skyStoneBlockSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - skyStone, 1, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock")); - this.skyStoneBrickSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - skyStone, 2, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock")); - this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - skyStone, 3, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock")); - this.fluixSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - fluixBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock")); - this.quartzSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - quartzBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock")); - this.chiseledQuartzSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - chiseledQuartz, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock")); - this.quartzPillarSlab = constructor.registerBlockDefinition(new AEBaseSlabBlock( - quartzPillar, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock")); + this.skyStoneSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + skyStone, + 0, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "SkyStoneSlabBlock")); + this.skyStoneBlockSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + skyStone, + 1, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "SkyStoneBlockSlabBlock")); + this.skyStoneBrickSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + skyStone, + 2, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "SkyStoneBrickSlabBlock")); + this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + skyStone, + 3, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "SkyStoneSmallBrickSlabBlock")); + this.fluixSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + fluixBlock, + 0, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "FluixSlabBlock")); + this.quartzSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + quartzBlock, + 0, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "QuartzSlabBlock")); + this.chiseledQuartzSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + chiseledQuartz, + 0, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "ChiseledQuartzSlabBlock")); + this.quartzPillarSlab = constructor.registerBlockDefinition( + new AEBaseSlabBlock( + quartzPillar, + 0, + EnumSet.of(AEFeature.DecorativeQuartzBlocks), + false, + "QuartzPillarSlabBlock")); this.itemGen = constructor.registerBlockDefinition(new BlockItemGen()); this.chunkLoader = constructor.registerBlockDefinition(new BlockChunkloader()); diff --git a/src/main/java/appeng/core/api/definitions/ApiItems.java b/src/main/java/appeng/core/api/definitions/ApiItems.java index 309e3980f21..8316760f8c7 100644 --- a/src/main/java/appeng/core/api/definitions/ApiItems.java +++ b/src/main/java/appeng/core/api/definitions/ApiItems.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api.definitions; @@ -42,6 +34,7 @@ * Internal implementation for the API items */ public final class ApiItems implements IItems { + private final IItemDefinition certusQuartzAxe; private final IItemDefinition certusQuartzHoe; private final IItemDefinition certusQuartzShovel; @@ -107,8 +100,8 @@ public ApiItems(final DefinitionConstructor constructor) { this.certusQuartzPick = constructor.registerItemDefinition(new ToolQuartzPickaxe(AEFeature.CertusQuartzTools)); this.certusQuartzSword = constructor.registerItemDefinition(new ToolQuartzSword(AEFeature.CertusQuartzTools)); this.certusQuartzWrench = constructor.registerItemDefinition(new ToolQuartzWrench(AEFeature.CertusQuartzTools)); - this.certusQuartzKnife = - constructor.registerItemDefinition(new ToolQuartzCuttingKnife(AEFeature.CertusQuartzTools)); + this.certusQuartzKnife = constructor + .registerItemDefinition(new ToolQuartzCuttingKnife(AEFeature.CertusQuartzTools)); this.netherQuartzAxe = constructor.registerItemDefinition(new ToolQuartzAxe(AEFeature.NetherQuartzTools)); this.netherQuartzHoe = constructor.registerItemDefinition(new ToolQuartzHoe(AEFeature.NetherQuartzTools)); @@ -116,8 +109,8 @@ public ApiItems(final DefinitionConstructor constructor) { this.netherQuartzPick = constructor.registerItemDefinition(new ToolQuartzPickaxe(AEFeature.NetherQuartzTools)); this.netherQuartzSword = constructor.registerItemDefinition(new ToolQuartzSword(AEFeature.NetherQuartzTools)); this.netherQuartzWrench = constructor.registerItemDefinition(new ToolQuartzWrench(AEFeature.NetherQuartzTools)); - this.netherQuartzKnife = - constructor.registerItemDefinition(new ToolQuartzCuttingKnife(AEFeature.NetherQuartzTools)); + this.netherQuartzKnife = constructor + .registerItemDefinition(new ToolQuartzCuttingKnife(AEFeature.NetherQuartzTools)); this.entropyManipulator = constructor.registerItemDefinition(new ToolEntropyManipulator()); this.wirelessTerminal = constructor.registerItemDefinition(new ToolWirelessTerminal()); @@ -136,12 +129,12 @@ public ApiItems(final DefinitionConstructor constructor) { this.cell16k = constructor.registerItemDefinition(new ItemBasicStorageCell(MaterialType.Cell16kPart, 16)); this.cell64k = constructor.registerItemDefinition(new ItemBasicStorageCell(MaterialType.Cell64kPart, 64)); this.cell256k = constructor.registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell256kPart, 256)); - this.cell1024k = - constructor.registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell1024kPart, 1024)); - this.cell4096k = - constructor.registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell4096kPart, 4096)); - this.cell16384k = - constructor.registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell16384kPart, 16384)); + this.cell1024k = constructor + .registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell1024kPart, 1024)); + this.cell4096k = constructor + .registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell4096kPart, 4096)); + this.cell16384k = constructor + .registerItemDefinition(new ItemAdvancedStorageCell(MaterialType.Cell16384kPart, 16384)); this.spatialCell2 = constructor.registerItemDefinition(new ItemSpatialStorageCell(2)); this.spatialCell16 = constructor.registerItemDefinition(new ItemSpatialStorageCell(16)); diff --git a/src/main/java/appeng/core/api/definitions/ApiMaterials.java b/src/main/java/appeng/core/api/definitions/ApiMaterials.java index 245b852a038..d79d4e89384 100644 --- a/src/main/java/appeng/core/api/definitions/ApiMaterials.java +++ b/src/main/java/appeng/core/api/definitions/ApiMaterials.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api.definitions; @@ -28,6 +20,7 @@ * Internal implementation for the API materials */ public final class ApiMaterials implements IMaterials { + private final IItemDefinition cell2SpatialPart; private final IItemDefinition cell16SpatialPart; private final IItemDefinition cell128SpatialPart; @@ -111,29 +104,29 @@ public ApiMaterials(final DefinitionConstructor constructor) { final ItemMultiMaterial itemMultiMaterial = new ItemMultiMaterial(); constructor.registerItemDefinition(itemMultiMaterial); - this.cell2SpatialPart = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell2SpatialPart)); - this.cell16SpatialPart = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell16SpatialPart)); - this.cell128SpatialPart = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell128SpatialPart)); + this.cell2SpatialPart = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.Cell2SpatialPart)); + this.cell16SpatialPart = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.Cell16SpatialPart)); + this.cell128SpatialPart = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.Cell128SpatialPart)); this.silicon = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Silicon)); this.skyDust = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.SkyDust)); - this.calcProcessorPress = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CalcProcessorPress)); - this.engProcessorPress = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.EngProcessorPress)); - this.logicProcessorPress = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.LogicProcessorPress)); + this.calcProcessorPress = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.CalcProcessorPress)); + this.engProcessorPress = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.EngProcessorPress)); + this.logicProcessorPress = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.LogicProcessorPress)); - this.calcProcessorPrint = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CalcProcessorPrint)); - this.engProcessorPrint = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.EngProcessorPrint)); - this.logicProcessorPrint = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.LogicProcessorPrint)); + this.calcProcessorPrint = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.CalcProcessorPrint)); + this.engProcessorPrint = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.EngProcessorPrint)); + this.logicProcessorPrint = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.LogicProcessorPrint)); this.siliconPress = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.SiliconPress)); this.siliconPrint = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.SiliconPrint)); @@ -147,32 +140,32 @@ public ApiMaterials(final DefinitionConstructor constructor) { this.basicCard = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.BasicCard)); this.advCard = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.AdvCard)); - this.purifiedCertusQuartzCrystal = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.PurifiedCertusQuartzCrystal)); - this.purifiedNetherQuartzCrystal = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.PurifiedNetherQuartzCrystal)); - this.purifiedFluixCrystal = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.PurifiedFluixCrystal)); + this.purifiedCertusQuartzCrystal = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.PurifiedCertusQuartzCrystal)); + this.purifiedNetherQuartzCrystal = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.PurifiedNetherQuartzCrystal)); + this.purifiedFluixCrystal = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.PurifiedFluixCrystal)); this.cell1kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell1kPart)); this.cell4kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell4kPart)); this.cell16kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell16kPart)); this.cell64kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell64kPart)); - this.emptyStorageCell = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.EmptyStorageCell)); + this.emptyStorageCell = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.EmptyStorageCell)); this.cell256kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell256kPart)); this.cell1024kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell1024kPart)); this.cell4096kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell4096kPart)); this.cell16384kPart = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Cell16384kPart)); - this.emptyAdvancedStorageCell = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.EmptyAdvancedStorageCell)); + this.emptyAdvancedStorageCell = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.EmptyAdvancedStorageCell)); this.cardRedstone = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardRedstone)); this.cardSpeed = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardSpeed)); this.cardSuperSpeed = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardSuperSpeed)); this.cardCapacity = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardCapacity)); - this.cardPatternCapacity = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardPatternCapacity)); + this.cardPatternCapacity = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.CardPatternCapacity)); this.cardFuzzy = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardFuzzy)); this.cardInverter = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardInverter)); this.cardCrafting = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CardCrafting)); @@ -183,29 +176,29 @@ public ApiMaterials(final DefinitionConstructor constructor) { this.goldDust = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.GoldDust)); this.ironDust = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.IronDust)); this.fluixDust = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.FluixDust)); - this.certusQuartzDust = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CertusQuartzDust)); - this.netherQuartzDust = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.NetherQuartzDust)); + this.certusQuartzDust = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.CertusQuartzDust)); + this.netherQuartzDust = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.NetherQuartzDust)); this.matterBall = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.MatterBall)); this.ironNugget = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.IronNugget)); - this.certusQuartzCrystal = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CertusQuartzCrystal)); - this.certusQuartzCrystalCharged = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.CertusQuartzCrystalCharged)); + this.certusQuartzCrystal = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.CertusQuartzCrystal)); + this.certusQuartzCrystalCharged = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.CertusQuartzCrystalCharged)); this.fluixCrystal = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.FluixCrystal)); this.fluixPearl = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.FluixPearl)); this.woodenGear = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.WoodenGear)); this.wireless = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Wireless)); - this.wirelessBooster = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.WirelessBooster)); + this.wirelessBooster = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.WirelessBooster)); - this.annihilationCore = - new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.AnnihilationCore)); + this.annihilationCore = new DamagedItemDefinition( + itemMultiMaterial.createMaterial(MaterialType.AnnihilationCore)); this.formationCore = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.FormationCore)); this.singularity = new DamagedItemDefinition(itemMultiMaterial.createMaterial(MaterialType.Singularity)); diff --git a/src/main/java/appeng/core/api/definitions/ApiParts.java b/src/main/java/appeng/core/api/definitions/ApiParts.java index 3e4304f7a29..4d4722c5ec7 100644 --- a/src/main/java/appeng/core/api/definitions/ApiParts.java +++ b/src/main/java/appeng/core/api/definitions/ApiParts.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api.definitions; @@ -31,6 +23,7 @@ * Internal implementation for the API parts */ public final class ApiParts implements IParts { + private final AEColoredItemDefinition cableSmart; private final AEColoredItemDefinition cableCovered; private final AEColoredItemDefinition cableGlass; @@ -85,10 +78,10 @@ public ApiParts(final DefinitionConstructor constructor, final IPartHelper partH this.cableGlass = constructor.constructColoredDefinition(itemMultiPart, PartType.CableGlass); this.cableDense = constructor.constructColoredDefinition(itemMultiPart, PartType.CableDense); this.cableDenseCovered = constructor.constructColoredDefinition(itemMultiPart, PartType.CableDenseCovered); - this.cableUltraDenseSmart = - constructor.constructColoredDefinition(itemMultiPart, PartType.CableUltraDenseSmart); - this.cableUltraDenseCovered = - constructor.constructColoredDefinition(itemMultiPart, PartType.CableUltraDenseCovered); + this.cableUltraDenseSmart = constructor + .constructColoredDefinition(itemMultiPart, PartType.CableUltraDenseSmart); + this.cableUltraDenseCovered = constructor + .constructColoredDefinition(itemMultiPart, PartType.CableUltraDenseCovered); // this.lumenCableSmart = Optional.absent(); // has yet to be implemented, no PartType defined for it yet // this.lumenCableCovered = Optional.absent(); // has yet to be implemented, no PartType defined for it yet // this.lumenCableGlass = Optional.absent(); // has yet to be implemented, no PartType defined for it yet @@ -102,8 +95,8 @@ public ApiParts(final DefinitionConstructor constructor, final IPartHelper partH this.iface = new DamagedItemDefinition(itemMultiPart.createPart(PartType.Interface)); this.levelEmitter = new DamagedItemDefinition(itemMultiPart.createPart(PartType.LevelEmitter)); this.annihilationPlane = new DamagedItemDefinition(itemMultiPart.createPart(PartType.AnnihilationPlane)); - this.identityAnnihilationPlane = - new DamagedItemDefinition(itemMultiPart.createPart(PartType.IdentityAnnihilationPlane)); + this.identityAnnihilationPlane = new DamagedItemDefinition( + itemMultiPart.createPart(PartType.IdentityAnnihilationPlane)); this.formationPlane = new DamagedItemDefinition(itemMultiPart.createPart(PartType.FormationPlane)); this.p2PTunnelME = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelME)); this.p2PTunnelRedstone = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelRedstone)); @@ -112,8 +105,8 @@ public ApiParts(final DefinitionConstructor constructor, final IPartHelper partH this.p2PTunnelEU = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelEU)); this.p2PTunnelRF = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelRF)); this.p2PTunnelLight = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelLight)); - this.p2PTunnelOpenComputers = - new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelOpenComputers)); + this.p2PTunnelOpenComputers = new DamagedItemDefinition( + itemMultiPart.createPart(PartType.P2PTunnelOpenComputers)); this.p2PTunnelPneumaticCraft = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelPressure)); this.p2PTunnelGregtech = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelGT)); this.p2PTunnelInterface = new DamagedItemDefinition(itemMultiPart.createPart(PartType.P2PTunnelInterface)); diff --git a/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java b/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java index 740d15fba6c..1763f5a2ac6 100644 --- a/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java +++ b/src/main/java/appeng/core/api/definitions/DefinitionConstructor.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api.definitions; +import net.minecraft.item.Item; + import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IItemDefinition; import appeng.api.definitions.ITileDefinition; @@ -28,9 +22,9 @@ import appeng.core.features.*; import appeng.items.parts.ItemMultiPart; import appeng.items.parts.PartType; -import net.minecraft.item.Item; public class DefinitionConstructor { + private final FeatureRegistry features; private final FeatureHandlerRegistry handlers; diff --git a/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java b/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java index 8f3c87cc0c8..c9a30aa00c7 100644 --- a/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java +++ b/src/main/java/appeng/core/api/imc/IMCBlackListSpatial.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.api.imc; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.core.AELog; import appeng.core.api.IIMCProcessor; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class IMCBlackListSpatial implements IIMCProcessor { diff --git a/src/main/java/appeng/core/api/imc/IMCGrinder.java b/src/main/java/appeng/core/api/imc/IMCGrinder.java index 3b6fb992ccd..295ab4f6997 100644 --- a/src/main/java/appeng/core/api/imc/IMCGrinder.java +++ b/src/main/java/appeng/core/api/imc/IMCGrinder.java @@ -1,66 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ -/* Example: - -NBTTagCompound msg = new NBTTagCompound(); -NBTTagCompound in = new NBTTagCompound(); -NBTTagCompound out = new NBTTagCompound(); - -new ItemStack( Blocks.iron_ore ).writeToNBT( in ); -new ItemStack( Items.iron_ingot ).writeToNBT( out ); -msg.setTag( "in", in ); -msg.setTag( "out", out ); -msg.setInteger( "turns", 8 ); - -FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg ); - --- or -- - -NBTTagCompound msg = new NBTTagCompound(); -NBTTagCompound in = new NBTTagCompound(); -NBTTagCompound out = new NBTTagCompound(); -NBTTagCompound optional = new NBTTagCompound(); - -new ItemStack( Blocks.iron_ore ).writeToNBT( in ); -new ItemStack( Items.iron_ingot ).writeToNBT( out ); -new ItemStack( Blocks.gravel ).writeToNBT( optional ); -msg.setTag( "in", in ); -msg.setTag( "out", out ); -msg.setTag( "optional", optional ); -msg.setFloat( "chance", 0.5 ); -msg.setInteger( "turns", 8 ); - -FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg ); - -*/ +/* + * Example: NBTTagCompound msg = new NBTTagCompound(); NBTTagCompound in = new NBTTagCompound(); NBTTagCompound out = + * new NBTTagCompound(); new ItemStack( Blocks.iron_ore ).writeToNBT( in ); new ItemStack( Items.iron_ingot + * ).writeToNBT( out ); msg.setTag( "in", in ); msg.setTag( "out", out ); msg.setInteger( "turns", 8 ); + * FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg ); -- or -- NBTTagCompound msg = new + * NBTTagCompound(); NBTTagCompound in = new NBTTagCompound(); NBTTagCompound out = new NBTTagCompound(); NBTTagCompound + * optional = new NBTTagCompound(); new ItemStack( Blocks.iron_ore ).writeToNBT( in ); new ItemStack( Items.iron_ingot + * ).writeToNBT( out ); new ItemStack( Blocks.gravel ).writeToNBT( optional ); msg.setTag( "in", in ); msg.setTag( + * "out", out ); msg.setTag( "optional", optional ); msg.setFloat( "chance", 0.5 ); msg.setInteger( "turns", 8 ); + * FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg ); + */ package appeng.core.api.imc; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.AEApi; import appeng.core.AEConfig; import appeng.core.api.IIMCProcessor; import appeng.core.features.AEFeature; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class IMCGrinder implements IIMCProcessor { + @Override public void process(final IMCMessage m) { if (!AEConfig.instance.isFeatureEnabled(AEFeature.GrindStone)) diff --git a/src/main/java/appeng/core/api/imc/IMCMatterCannon.java b/src/main/java/appeng/core/api/imc/IMCMatterCannon.java index 8e9e42ba513..8a5500b262b 100644 --- a/src/main/java/appeng/core/api/imc/IMCMatterCannon.java +++ b/src/main/java/appeng/core/api/imc/IMCMatterCannon.java @@ -1,41 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ -/* Example: - -NBTTagCompound msg = new NBTTagCompound(); -NBTTagCompound item = new NBTTagCompound(); - -new ItemStack( Blocks.anvil ).writeToNBT( item ); -msg.setTag( "item", item ); -msg.setDouble( "weight", 32.0 ); - -FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg ); - -*/ +/* + * Example: NBTTagCompound msg = new NBTTagCompound(); NBTTagCompound item = new NBTTagCompound(); new ItemStack( + * Blocks.anvil ).writeToNBT( item ); msg.setTag( "item", item ); msg.setDouble( "weight", 32.0 ); + * FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg ); + */ package appeng.core.api.imc; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.AEApi; import appeng.core.api.IIMCProcessor; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class IMCMatterCannon implements IIMCProcessor { diff --git a/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java b/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java index ed49ed75652..88d1fa61338 100644 --- a/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java +++ b/src/main/java/appeng/core/api/imc/IMCP2PAttunement.java @@ -1,48 +1,39 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ -/* Example: +/* + * Example: FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) + * ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) + * ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem + * ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem + * ) ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) + * ); FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) ); + */ -FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) ); -FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) ); -FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) ); -FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) ); -FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) ); -FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) ); +package appeng.core.api.imc; -*/ +import java.util.Arrays; +import java.util.Locale; -package appeng.core.api.imc; +import net.minecraft.item.ItemStack; import appeng.api.AEApi; import appeng.api.config.TunnelType; import appeng.core.api.IIMCProcessor; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; -import java.util.Arrays; -import java.util.Locale; -import net.minecraft.item.ItemStack; public class IMCP2PAttunement implements IIMCProcessor { @Override public void process(final IMCMessage m) { - final String key = m.key.substring("add-p2p-attunement-".length()) - .replace('-', '_') + final String key = m.key.substring("add-p2p-attunement-".length()).replace('-', '_') .toUpperCase(Locale.ENGLISH); final TunnelType type = TunnelType.valueOf(key); diff --git a/src/main/java/appeng/core/api/imc/IMCSpatial.java b/src/main/java/appeng/core/api/imc/IMCSpatial.java index f2445cdf293..ee038ae2739 100644 --- a/src/main/java/appeng/core/api/imc/IMCSpatial.java +++ b/src/main/java/appeng/core/api/imc/IMCSpatial.java @@ -1,26 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ -/* Example: - -FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" ); - -*/ +/* + * Example: FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" + * ); + */ package appeng.core.api.imc; diff --git a/src/main/java/appeng/core/crash/BaseCrashEnhancement.java b/src/main/java/appeng/core/crash/BaseCrashEnhancement.java index b710b4fa242..51276d8aac6 100644 --- a/src/main/java/appeng/core/crash/BaseCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/BaseCrashEnhancement.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.crash; @@ -21,6 +13,7 @@ import cpw.mods.fml.common.ICrashCallable; abstract class BaseCrashEnhancement implements ICrashCallable { + private final String name; private final String value; diff --git a/src/main/java/appeng/core/crash/CrashInfo.java b/src/main/java/appeng/core/crash/CrashInfo.java index ba9a23c6b0d..b295dc9287d 100644 --- a/src/main/java/appeng/core/crash/CrashInfo.java +++ b/src/main/java/appeng/core/crash/CrashInfo.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.crash; diff --git a/src/main/java/appeng/core/crash/IntegrationCrashEnhancement.java b/src/main/java/appeng/core/crash/IntegrationCrashEnhancement.java index daa8de1252d..c0b557f1b85 100644 --- a/src/main/java/appeng/core/crash/IntegrationCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/IntegrationCrashEnhancement.java @@ -3,6 +3,7 @@ import appeng.integration.IntegrationRegistry; public class IntegrationCrashEnhancement extends BaseCrashEnhancement { + public IntegrationCrashEnhancement() { super("AE2 Integration", IntegrationRegistry.INSTANCE.getStatus()); } diff --git a/src/main/java/appeng/core/crash/ModCrashEnhancement.java b/src/main/java/appeng/core/crash/ModCrashEnhancement.java index 38122ea846b..a9e43a864ff 100644 --- a/src/main/java/appeng/core/crash/ModCrashEnhancement.java +++ b/src/main/java/appeng/core/crash/ModCrashEnhancement.java @@ -3,11 +3,14 @@ import appeng.core.AEConfig; public class ModCrashEnhancement extends BaseCrashEnhancement { + private static final String MOD_VERSION = AEConfig.VERSION + " for Forge " + // WHAT? net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion - + net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion - + net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion + + net.minecraftforge.common.ForgeVersion.minorVersion + + '.' // minorVersion + + net.minecraftforge.common.ForgeVersion.revisionVersion + + '.' // revisionVersion + net.minecraftforge.common.ForgeVersion.buildVersion; public ModCrashEnhancement(final CrashInfo output) { diff --git a/src/main/java/appeng/core/features/AEBlockFeatureHandler.java b/src/main/java/appeng/core/features/AEBlockFeatureHandler.java index 89fd6a9d40b..5dd5cbc47f4 100644 --- a/src/main/java/appeng/core/features/AEBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/AEBlockFeatureHandler.java @@ -1,38 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import java.util.EnumSet; + import appeng.api.definitions.IBlockDefinition; import appeng.block.AEBaseBlock; import appeng.core.CreativeTab; + import com.google.common.base.Optional; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.EnumSet; public final class AEBlockFeatureHandler implements IFeatureHandler { + private final AEBaseBlock featured; private final FeatureNameExtractor extractor; private final boolean enabled; private final BlockDefinition definition; - public AEBlockFeatureHandler( - final EnumSet features, final AEBaseBlock featured, final Optional subName) { + public AEBlockFeatureHandler(final EnumSet features, final AEBaseBlock featured, + final Optional subName) { final ActivityState state = new FeaturedActiveChecker(features).getActivityState(); this.featured = featured; diff --git a/src/main/java/appeng/core/features/AECableBusFeatureHandler.java b/src/main/java/appeng/core/features/AECableBusFeatureHandler.java index 7c9349c1c13..df343d1921c 100644 --- a/src/main/java/appeng/core/features/AECableBusFeatureHandler.java +++ b/src/main/java/appeng/core/features/AECableBusFeatureHandler.java @@ -1,42 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import java.util.EnumSet; + +import net.minecraft.tileentity.TileEntity; + import appeng.api.definitions.ITileDefinition; import appeng.block.AEBaseTileBlock; import appeng.block.networking.BlockCableBus; import appeng.core.CommonHelper; import appeng.core.CreativeTab; import appeng.util.Platform; + import com.google.common.base.Optional; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.EnumSet; -import net.minecraft.tileentity.TileEntity; public final class AECableBusFeatureHandler implements IFeatureHandler { + private final AEBaseTileBlock featured; private final FeatureNameExtractor extractor; private final boolean enabled; private final TileDefinition definition; - public AECableBusFeatureHandler( - final EnumSet features, final BlockCableBus featured, final Optional subName) { + public AECableBusFeatureHandler(final EnumSet features, final BlockCableBus featured, + final Optional subName) { final ActivityState state = new FeaturedActiveChecker(features).getActivityState(); this.featured = featured; diff --git a/src/main/java/appeng/core/features/AEFeature.java b/src/main/java/appeng/core/features/AEFeature.java index c8821e8c2af..7b840e3db2c 100644 --- a/src/main/java/appeng/core/features/AEFeature.java +++ b/src/main/java/appeng/core/features/AEFeature.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; public enum AEFeature { + // stuff that has no reason for ever being turned off, or that // is just flat out required by tons of // important stuff. Core(null) { + @Override public boolean isVisible() { return false; diff --git a/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java b/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java index 30199d5bc87..f9439180665 100644 --- a/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/AETileBlockFeatureHandler.java @@ -1,41 +1,36 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import java.util.EnumSet; + import appeng.api.definitions.ITileDefinition; import appeng.block.AEBaseTileBlock; import appeng.core.CommonHelper; import appeng.core.CreativeTab; import appeng.tile.AEBaseTile; import appeng.util.Platform; + import com.google.common.base.Optional; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.EnumSet; public final class AETileBlockFeatureHandler implements IFeatureHandler { + private final AEBaseTileBlock featured; private final FeatureNameExtractor extractor; private final boolean enabled; private final TileDefinition definition; - public AETileBlockFeatureHandler( - final EnumSet features, final AEBaseTileBlock featured, final Optional subName) { + public AETileBlockFeatureHandler(final EnumSet features, final AEBaseTileBlock featured, + final Optional subName) { final ActivityState state = new FeaturedActiveChecker(features).getActivityState(); this.featured = featured; diff --git a/src/main/java/appeng/core/features/ActivityState.java b/src/main/java/appeng/core/features/ActivityState.java index 7c25adbf739..11bb7571a7f 100644 --- a/src/main/java/appeng/core/features/ActivityState.java +++ b/src/main/java/appeng/core/features/ActivityState.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; public enum ActivityState { + Enabled, Disabled; diff --git a/src/main/java/appeng/core/features/BlockDefinition.java b/src/main/java/appeng/core/features/BlockDefinition.java index 688028f4bc8..db044488d3e 100644 --- a/src/main/java/appeng/core/features/BlockDefinition.java +++ b/src/main/java/appeng/core/features/BlockDefinition.java @@ -1,37 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.api.definitions.IBlockDefinition; -import appeng.block.AEBaseBlock; -import com.google.common.base.Function; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; -import com.google.common.collect.ObjectArrays; import java.lang.reflect.Constructor; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; +import appeng.api.definitions.IBlockDefinition; +import appeng.block.AEBaseBlock; + +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.google.common.collect.ObjectArrays; + public class BlockDefinition extends ItemDefinition implements IBlockDefinition { + private static final ItemBlockTransformer ITEMBLOCK_TRANSFORMER = new ItemBlockTransformer(); private final Optional block; @@ -125,6 +121,7 @@ public final boolean isSameAs(final IBlockAccess world, final int x, final int y } private static class ItemBlockTransformer implements Function { + @Override public ItemBlock apply(final Block input) { return new ItemBlock(input); @@ -132,6 +129,7 @@ public ItemBlock apply(final Block input) { } private static class ItemStackTransformer implements Function { + private final int stackSize; public ItemStackTransformer(final int stackSize) { diff --git a/src/main/java/appeng/core/features/BlockStackSrc.java b/src/main/java/appeng/core/features/BlockStackSrc.java index 93a2f1551d6..03621887d42 100644 --- a/src/main/java/appeng/core/features/BlockStackSrc.java +++ b/src/main/java/appeng/core/features/BlockStackSrc.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import com.google.common.base.Preconditions; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import com.google.common.base.Preconditions; + public class BlockStackSrc implements IStackSrc { private final Block block; diff --git a/src/main/java/appeng/core/features/ColoredItemDefinition.java b/src/main/java/appeng/core/features/ColoredItemDefinition.java index 93b2d004577..62b716869d8 100644 --- a/src/main/java/appeng/core/features/ColoredItemDefinition.java +++ b/src/main/java/appeng/core/features/ColoredItemDefinition.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.api.util.AEColor; -import appeng.api.util.AEColoredItemDefinition; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import appeng.api.util.AEColor; +import appeng.api.util.AEColoredItemDefinition; + public final class ColoredItemDefinition implements AEColoredItemDefinition { private final ItemStackSrc[] colors = new ItemStackSrc[17]; diff --git a/src/main/java/appeng/core/features/DamagedItemDefinition.java b/src/main/java/appeng/core/features/DamagedItemDefinition.java index e46b747e6eb..34e83ec3a85 100644 --- a/src/main/java/appeng/core/features/DamagedItemDefinition.java +++ b/src/main/java/appeng/core/features/DamagedItemDefinition.java @@ -1,33 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.api.definitions.IItemDefinition; -import com.google.common.base.Function; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; import javax.annotation.Nonnull; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; +import appeng.api.definitions.IItemDefinition; + +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; + public final class DamagedItemDefinition implements IItemDefinition { + private static final ItemTransformer ITEM_TRANSFORMER = new ItemTransformer(); private final Optional source; @@ -62,8 +58,7 @@ public boolean isSameAs(final ItemStack comparableStack) { return false; } - return this.isEnabled() - && comparableStack.getItem() == this.source.get().getItem() + return this.isEnabled() && comparableStack.getItem() == this.source.get().getItem() && comparableStack.getItemDamage() == this.source.get().getDamage(); } @@ -73,6 +68,7 @@ public boolean isSameAs(final IBlockAccess world, final int x, final int y, fina } private static class ItemTransformer implements Function { + @Override public Item apply(final IStackSrc input) { return input.getItem(); @@ -80,6 +76,7 @@ public Item apply(final IStackSrc input) { } private static class ItemStackTransformer implements Function { + private final int stackSize; public ItemStackTransformer(final int stackSize) { diff --git a/src/main/java/appeng/core/features/DefinitionConverter.java b/src/main/java/appeng/core/features/DefinitionConverter.java index 6d5b130c6b9..140272be18b 100644 --- a/src/main/java/appeng/core/features/DefinitionConverter.java +++ b/src/main/java/appeng/core/features/DefinitionConverter.java @@ -1,22 +1,25 @@ package appeng.core.features; -import appeng.api.definitions.IBlockDefinition; -import appeng.api.definitions.IComparableDefinition; -import appeng.api.definitions.IItemDefinition; -import appeng.api.definitions.ITileDefinition; -import appeng.api.util.AEItemDefinition; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; +import appeng.api.definitions.IBlockDefinition; +import appeng.api.definitions.IComparableDefinition; +import appeng.api.definitions.IItemDefinition; +import appeng.api.definitions.ITileDefinition; +import appeng.api.util.AEItemDefinition; + /** * @deprecated */ @Deprecated public final class DefinitionConverter { + public AEItemDefinition of(final ITileDefinition definition) { return new AETile(definition); } @@ -34,6 +37,7 @@ public AEItemDefinition of(final IComparableDefinition definition) { } private static class AEComparable implements AEItemDefinition { + private final IComparableDefinition definition; public AEComparable(final IComparableDefinition definition) { @@ -76,6 +80,7 @@ public boolean sameAsBlock(final IBlockAccess world, final int x, final int y, f } private static class AEItem extends AEComparable { + private final IItemDefinition definition; public AEItem(final IItemDefinition definition) { @@ -98,6 +103,7 @@ public Item item() { } private static class AEBlock extends AEItem { + private final IBlockDefinition definition; public AEBlock(final IBlockDefinition definition) { @@ -119,6 +125,7 @@ public boolean sameAsBlock(final IBlockAccess world, final int x, final int y, f } private static class AETile extends AEBlock { + private final ITileDefinition definition; public AETile(final ITileDefinition definition) { diff --git a/src/main/java/appeng/core/features/FeatureNameExtractor.java b/src/main/java/appeng/core/features/FeatureNameExtractor.java index 92c5b913ed8..52b41ab817a 100644 --- a/src/main/java/appeng/core/features/FeatureNameExtractor.java +++ b/src/main/java/appeng/core/features/FeatureNameExtractor.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import com.google.common.base.Optional; import java.util.regex.Pattern; +import com.google.common.base.Optional; + public class FeatureNameExtractor { + private static final Pattern PATTERN_ITEM_MULTI_PART = Pattern.compile("ItemMultiPart", Pattern.LITERAL); private static final Pattern PATTERN_ITEM_MULTI_MATERIAL = Pattern.compile("ItemMultiMaterial", Pattern.LITERAL); private static final Pattern PATTERN_QUARTZ = Pattern.compile("Quartz", Pattern.LITERAL); diff --git a/src/main/java/appeng/core/features/FeaturedActiveChecker.java b/src/main/java/appeng/core/features/FeaturedActiveChecker.java index 15b09d8b61a..acac4d45d8d 100644 --- a/src/main/java/appeng/core/features/FeaturedActiveChecker.java +++ b/src/main/java/appeng/core/features/FeaturedActiveChecker.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.core.AEConfig; import java.util.Set; +import appeng.core.AEConfig; + public final class FeaturedActiveChecker { + private final Set features; public FeaturedActiveChecker(final Set features) { diff --git a/src/main/java/appeng/core/features/IAEFeature.java b/src/main/java/appeng/core/features/IAEFeature.java index 6ce85f310dc..523f19e5417 100644 --- a/src/main/java/appeng/core/features/IAEFeature.java +++ b/src/main/java/appeng/core/features/IAEFeature.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; public interface IAEFeature { + IFeatureHandler handler(); void postInit(); diff --git a/src/main/java/appeng/core/features/IFeatureHandler.java b/src/main/java/appeng/core/features/IFeatureHandler.java index 737ff43e2d3..6688c8eea68 100644 --- a/src/main/java/appeng/core/features/IFeatureHandler.java +++ b/src/main/java/appeng/core/features/IFeatureHandler.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; @@ -21,6 +13,7 @@ import appeng.api.definitions.IItemDefinition; public interface IFeatureHandler { + boolean isFeatureAvailable(); IItemDefinition getDefinition(); diff --git a/src/main/java/appeng/core/features/IStackSrc.java b/src/main/java/appeng/core/features/IStackSrc.java index 89c70849707..f70adb75d89 100644 --- a/src/main/java/appeng/core/features/IStackSrc.java +++ b/src/main/java/appeng/core/features/IStackSrc.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; diff --git a/src/main/java/appeng/core/features/ItemDefinition.java b/src/main/java/appeng/core/features/ItemDefinition.java index 169f03710a8..555ade901eb 100644 --- a/src/main/java/appeng/core/features/ItemDefinition.java +++ b/src/main/java/appeng/core/features/ItemDefinition.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; + import appeng.api.definitions.IItemDefinition; import appeng.util.Platform; + import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; public class ItemDefinition implements IItemDefinition { + private final Optional item; public ItemDefinition(final Item item, final ActivityState state) { @@ -58,8 +53,7 @@ public boolean isEnabled() { @Override public final boolean isSameAs(final ItemStack comparableStack) { - return this.isEnabled() - && Platform.isSameItemType(comparableStack, this.maybeStack(1).get()); + return this.isEnabled() && Platform.isSameItemType(comparableStack, this.maybeStack(1).get()); } @Override @@ -68,6 +62,7 @@ public boolean isSameAs(final IBlockAccess world, final int x, final int y, fina } private static class ItemStackTransformer implements Function { + private final int stackSize; public ItemStackTransformer(final int stackSize) { diff --git a/src/main/java/appeng/core/features/ItemFeatureHandler.java b/src/main/java/appeng/core/features/ItemFeatureHandler.java index 5c828e6438d..fe5c51fff5b 100644 --- a/src/main/java/appeng/core/features/ItemFeatureHandler.java +++ b/src/main/java/appeng/core/features/ItemFeatureHandler.java @@ -1,42 +1,35 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import java.util.EnumSet; + +import net.minecraft.item.Item; + import appeng.api.definitions.IItemDefinition; import appeng.core.CreativeTab; import appeng.core.CreativeTabFacade; import appeng.items.parts.ItemFacade; + import com.google.common.base.Optional; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.EnumSet; -import net.minecraft.item.Item; public final class ItemFeatureHandler implements IFeatureHandler { + private final Item item; private final FeatureNameExtractor extractor; private final boolean enabled; private final ItemDefinition definition; - public ItemFeatureHandler( - final EnumSet features, - final Item item, - final IAEFeature featured, + public ItemFeatureHandler(final EnumSet features, final Item item, final IAEFeature featured, final Optional subName) { final ActivityState state = new FeaturedActiveChecker(features).getActivityState(); diff --git a/src/main/java/appeng/core/features/ItemStackSrc.java b/src/main/java/appeng/core/features/ItemStackSrc.java index 732cee0a2d1..d8fcbd2658c 100644 --- a/src/main/java/appeng/core/features/ItemStackSrc.java +++ b/src/main/java/appeng/core/features/ItemStackSrc.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import com.google.common.base.Preconditions; import javax.annotation.Nullable; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import com.google.common.base.Preconditions; + public class ItemStackSrc implements IStackSrc { private final Item item; diff --git a/src/main/java/appeng/core/features/MaterialStackSrc.java b/src/main/java/appeng/core/features/MaterialStackSrc.java index 32abb81cc4c..e00fe16a465 100644 --- a/src/main/java/appeng/core/features/MaterialStackSrc.java +++ b/src/main/java/appeng/core/features/MaterialStackSrc.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.items.materials.MaterialType; -import com.google.common.base.Preconditions; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import appeng.items.materials.MaterialType; + +import com.google.common.base.Preconditions; + public class MaterialStackSrc implements IStackSrc { + private final MaterialType src; public MaterialStackSrc(final MaterialType src) { diff --git a/src/main/java/appeng/core/features/NameResolver.java b/src/main/java/appeng/core/features/NameResolver.java index c193c1d0ab4..22344fba67d 100644 --- a/src/main/java/appeng/core/features/NameResolver.java +++ b/src/main/java/appeng/core/features/NameResolver.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.items.AEBaseItem; import java.util.regex.Pattern; +import appeng.items.AEBaseItem; + /** * This class is used to rename items to match the persistent stored items. *

- * This can be removed, when a new iteration of minecraft arrives or a new world is used. - * Remember to differentiate the currently renamed items later on correctly. + * This can be removed, when a new iteration of minecraft arrives or a new world is used. Remember to differentiate the + * currently renamed items later on correctly. * * @deprecated only a temporary solution for a rename */ @Deprecated public final class NameResolver { + private static final Pattern ITEM_MULTI_PART = Pattern.compile("ItemMultiPart", Pattern.LITERAL); private static final Pattern ITEM_MULTI_MATERIAL = Pattern.compile("ItemMultiMaterial", Pattern.LITERAL); private static final Pattern QUARTZ = Pattern.compile("Quartz", Pattern.LITERAL); diff --git a/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java b/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java index cc88d190a70..f5d5abf06ff 100644 --- a/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/SlabBlockFeatureHandler.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import java.util.EnumSet; + import appeng.api.definitions.IBlockDefinition; import appeng.block.AEBaseItemBlockSlab; import appeng.block.AEBaseSlabBlock; import appeng.core.CreativeTab; + import com.google.common.base.Optional; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.EnumSet; public class SlabBlockFeatureHandler implements IFeatureHandler { + private final AEBaseSlabBlock slabs; private final FeatureNameExtractor extractor; private final boolean enabled; diff --git a/src/main/java/appeng/core/features/StairBlockFeatureHandler.java b/src/main/java/appeng/core/features/StairBlockFeatureHandler.java index 1bedb511685..6b2c6ba3634 100644 --- a/src/main/java/appeng/core/features/StairBlockFeatureHandler.java +++ b/src/main/java/appeng/core/features/StairBlockFeatureHandler.java @@ -1,38 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import java.util.EnumSet; + +import net.minecraft.block.BlockStairs; + import appeng.api.definitions.IBlockDefinition; import appeng.core.CreativeTab; + import com.google.common.base.Optional; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.EnumSet; -import net.minecraft.block.BlockStairs; public class StairBlockFeatureHandler implements IFeatureHandler { + private final BlockStairs stairs; private final FeatureNameExtractor extractor; private final boolean enabled; private final BlockDefinition definition; - public StairBlockFeatureHandler( - final EnumSet features, final BlockStairs stairs, final Optional subName) { + public StairBlockFeatureHandler(final EnumSet features, final BlockStairs stairs, + final Optional subName) { final ActivityState state = new FeaturedActiveChecker(features).getActivityState(); this.stairs = stairs; diff --git a/src/main/java/appeng/core/features/TileDefinition.java b/src/main/java/appeng/core/features/TileDefinition.java index e61a6840ec9..90ccbc87ae9 100644 --- a/src/main/java/appeng/core/features/TileDefinition.java +++ b/src/main/java/appeng/core/features/TileDefinition.java @@ -1,31 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; +import net.minecraft.tileentity.TileEntity; + import appeng.api.definitions.ITileDefinition; import appeng.block.AEBaseTileBlock; + import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import net.minecraft.tileentity.TileEntity; public final class TileDefinition extends BlockDefinition implements ITileDefinition { + private static final TileEntityTransformer TILEENTITY_TRANSFORMER = new TileEntityTransformer(); private final Optional block; @@ -49,6 +44,7 @@ public Optional> maybeEntity() { } private static class TileEntityTransformer implements Function> { + @Override public Class apply(final AEBaseTileBlock input) { final Class entity = input.getTileEntityClass(); diff --git a/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java b/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java index cfd83a4dc38..cd14c533ce6 100644 --- a/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java +++ b/src/main/java/appeng/core/features/WrappedDamageItemDefinition.java @@ -1,27 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features; -import appeng.api.definitions.ITileDefinition; -import com.google.common.base.Function; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; @@ -29,7 +17,14 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; +import appeng.api.definitions.ITileDefinition; + +import com.google.common.base.Function; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; + public final class WrappedDamageItemDefinition implements ITileDefinition { + private final ITileDefinition definition; private final int damage; @@ -89,6 +84,7 @@ public boolean isSameAs(final IBlockAccess world, final int x, final int y, fina } private static final class BlockTransformFunction implements Function { + private final int stackSize; private final int damage; diff --git a/src/main/java/appeng/core/features/registries/CellRegistry.java b/src/main/java/appeng/core/features/registries/CellRegistry.java index b067a11a571..37a3fbff993 100644 --- a/src/main/java/appeng/core/features/registries/CellRegistry.java +++ b/src/main/java/appeng/core/features/registries/CellRegistry.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; -import appeng.api.storage.*; import java.util.ArrayList; import java.util.List; + import net.minecraft.item.ItemStack; +import appeng.api.storage.*; + public class CellRegistry implements ICellRegistry { private final List handlers; @@ -65,8 +59,8 @@ public ICellHandler getHandler(final ItemStack is) { } @Override - public IMEInventoryHandler getCellInventory( - final ItemStack is, final ISaveProvider container, final StorageChannel chan) { + public IMEInventoryHandler getCellInventory(final ItemStack is, final ISaveProvider container, + final StorageChannel chan) { if (is == null) { return null; } diff --git a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java index b2a0e357e98..52a0a4d1f4f 100644 --- a/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java +++ b/src/main/java/appeng/core/features/registries/ExternalStorageRegistry.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IExternalStorageRegistry; import appeng.api.storage.StorageChannel; import appeng.core.features.registries.entries.ExternalIInv; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class ExternalStorageRegistry implements IExternalStorageRegistry { @@ -43,8 +37,8 @@ public void addExternalStorageInterface(final IExternalStorageHandler ei) { } @Override - public IExternalStorageHandler getHandler( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc) { + public IExternalStorageHandler getHandler(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource mySrc) { for (final IExternalStorageHandler x : this.Handlers) { if (x.canHandle(te, d, chan, mySrc)) { return x; diff --git a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java index 50911c22e77..a3655326084 100644 --- a/src/main/java/appeng/core/features/registries/GridCacheRegistry.java +++ b/src/main/java/appeng/core/features/registries/GridCacheRegistry.java @@ -1,57 +1,50 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; -import appeng.api.networking.IGrid; -import appeng.api.networking.IGridCache; -import appeng.api.networking.IGridCacheRegistry; -import appeng.core.AELog; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import appeng.api.networking.IGrid; +import appeng.api.networking.IGridCache; +import appeng.api.networking.IGridCacheRegistry; +import appeng.core.AELog; + public final class GridCacheRegistry implements IGridCacheRegistry { - private final Map, Class> caches = - new HashMap, Class>(); + + private final Map, Class> caches = new HashMap, Class>(); @Override - public void registerGridCache( - final Class iface, final Class implementation) { + public void registerGridCache(final Class iface, + final Class implementation) { if (iface.isAssignableFrom(implementation)) { this.caches.put(iface, implementation); } else { throw new IllegalArgumentException( "Invalid setup, grid cache must either be the same class, or an interface that the implementation implements. Gotten: " - + iface + " and " + implementation); + + iface + + " and " + + implementation); } } @Override public HashMap, IGridCache> createCacheInstance(final IGrid g) { - final HashMap, IGridCache> map = - new HashMap, IGridCache>(); + final HashMap, IGridCache> map = new HashMap, IGridCache>(); for (final Class iface : this.caches.keySet()) { try { - final Constructor c = - this.caches.get(iface).getConstructor(IGrid.class); + final Constructor c = this.caches.get(iface).getConstructor(IGrid.class); map.put(iface, c.newInstance(g)); } catch (final NoSuchMethodException e) { AELog.error("Grid Caches must have a constructor with IGrid as the single param."); diff --git a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java index b17e1624427..e7a7ab43588 100644 --- a/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java +++ b/src/main/java/appeng/core/features/registries/GrinderRecipeManager.java @@ -1,41 +1,36 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; -import appeng.api.features.IGrinderEntry; -import appeng.api.features.IGrinderRegistry; -import appeng.core.AEConfig; -import appeng.core.AELog; -import appeng.core.features.registries.entries.AppEngGrinderRecipe; -import appeng.recipes.ores.IOreListener; -import appeng.recipes.ores.OreDictionaryHandler; -import appeng.util.Platform; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import appeng.api.features.IGrinderEntry; +import appeng.api.features.IGrinderRegistry; +import appeng.core.AEConfig; +import appeng.core.AELog; +import appeng.core.features.registries.entries.AppEngGrinderRecipe; +import appeng.recipes.ores.IOreListener; +import appeng.recipes.ores.OreDictionaryHandler; +import appeng.util.Platform; + public final class GrinderRecipeManager implements IGrinderRegistry, IOreListener { + private final List recipes; private final Map ores; private final Map ingots; @@ -82,42 +77,56 @@ public void addRecipe(final ItemStack in, final ItemStack out, final int cost) { return; } - this.log("Allow Grinding of " + Platform.getItemDisplayName(in) + " to " + Platform.getItemDisplayName(out) - + " for " + cost); + this.log( + "Allow Grinding of " + Platform + .getItemDisplayName(in) + " to " + Platform.getItemDisplayName(out) + " for " + cost); this.injectRecipe(new AppEngGrinderRecipe(this.copy(in), this.copy(out), cost)); } @Override - public void addRecipe( - final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, final int cost) { + public void addRecipe(final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, + final int cost) { if (in == null || (optional == null && out == null)) { this.log("Invalid Grinder Recipe Specified."); return; } - this.log("Allow Grinding of " + Platform.getItemDisplayName(in) + " to " + Platform.getItemDisplayName(out) - + " with optional " + Platform.getItemDisplayName(optional) + " for " + cost); + this.log( + "Allow Grinding of " + Platform.getItemDisplayName(in) + + " to " + + Platform.getItemDisplayName(out) + + " with optional " + + Platform.getItemDisplayName(optional) + + " for " + + cost); this.injectRecipe(new AppEngGrinderRecipe(this.copy(in), this.copy(out), this.copy(optional), chance, cost)); } @Override - public void addRecipe( - final ItemStack in, - final ItemStack out, - final ItemStack optional, - final float chance, - final ItemStack optional2, - final float chance2, - final int cost) { + public void addRecipe(final ItemStack in, final ItemStack out, final ItemStack optional, final float chance, + final ItemStack optional2, final float chance2, final int cost) { if (in == null || (optional == null && out == null && optional2 == null)) { this.log("Invalid Grinder Recipe Specified."); return; } - this.log("Allow Grinding of " + Platform.getItemDisplayName(in) + " to " + Platform.getItemDisplayName(out) - + " with optional " + Platform.getItemDisplayName(optional) + " for " + cost); - this.injectRecipe(new AppEngGrinderRecipe( - this.copy(in), this.copy(out), this.copy(optional), this.copy(optional2), chance, chance2, cost)); + this.log( + "Allow Grinding of " + Platform.getItemDisplayName(in) + + " to " + + Platform.getItemDisplayName(out) + + " with optional " + + Platform.getItemDisplayName(optional) + + " for " + + cost); + this.injectRecipe( + new AppEngGrinderRecipe( + this.copy(in), + this.copy(out), + this.copy(optional), + this.copy(optional2), + chance, + chance2, + cost)); } private void injectRecipe(final AppEngGrinderRecipe appEngGrinderRecipe) { @@ -143,8 +152,10 @@ public IGrinderEntry getRecipeForInput(final ItemStack input) { if (input != null) { for (final IGrinderEntry r : this.recipes) { if (Platform.isSameItem(input, r.getInput())) { - this.log("Recipe for " + input.getUnlocalizedName() + " found " - + Platform.getItemDisplayName(r.getOutput())); + this.log( + "Recipe for " + input.getUnlocalizedName() + + " found " + + Platform.getItemDisplayName(r.getOutput())); return r; } } @@ -243,8 +254,7 @@ private void addDust(final String name, final ItemStack item) { @Override public void oreRegistered(final String name, final ItemStack item) { - if (name.startsWith("ore") - || name.startsWith("crystal") + if (name.startsWith("ore") || name.startsWith("crystal") || name.startsWith("gem") || name.startsWith("ingot") || name.startsWith("dust")) { diff --git a/src/main/java/appeng/core/features/registries/InscriberRegistry.java b/src/main/java/appeng/core/features/registries/InscriberRegistry.java index b39684892f4..2c79262fc3a 100644 --- a/src/main/java/appeng/core/features/registries/InscriberRegistry.java +++ b/src/main/java/appeng/core/features/registries/InscriberRegistry.java @@ -1,31 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.*; + +import javax.annotation.Nonnull; + +import net.minecraft.item.ItemStack; + import appeng.api.features.IInscriberRecipe; import appeng.api.features.IInscriberRecipeBuilder; import appeng.api.features.IInscriberRegistry; import appeng.api.features.InscriberProcessType; import appeng.core.features.registries.entries.InscriberRecipe; -import java.util.*; -import javax.annotation.Nonnull; -import net.minecraft.item.ItemStack; /** * @author thatsIch @@ -33,6 +28,7 @@ * @since rv2 */ public final class InscriberRegistry implements IInscriberRegistry { + private final Set recipes; private final Set optionals; private final Set inputs; @@ -83,7 +79,7 @@ public void addRecipe(final IInscriberRecipe recipe) { @Override public void removeRecipe(final IInscriberRecipe toBeRemovedRecipe) { - for (final Iterator iterator = this.recipes.iterator(); iterator.hasNext(); ) { + for (final Iterator iterator = this.recipes.iterator(); iterator.hasNext();) { final IInscriberRecipe recipe = iterator.next(); if (recipe.equals(toBeRemovedRecipe)) { iterator.remove(); @@ -92,10 +88,11 @@ public void removeRecipe(final IInscriberRecipe toBeRemovedRecipe) { } /** - * Internal {@link IInscriberRecipeBuilder} implementation. - * Needs to be adapted to represent a correct {@link IInscriberRecipe} + * Internal {@link IInscriberRecipeBuilder} implementation. Needs to be adapted to represent a correct + * {@link IInscriberRecipe} */ private static final class Builder implements IInscriberRecipeBuilder { + private List inputs; private ItemStack output; private ItemStack topOptional; diff --git a/src/main/java/appeng/core/features/registries/LocatableRegistry.java b/src/main/java/appeng/core/features/registries/LocatableRegistry.java index e241efa8182..4c3ca459a5f 100644 --- a/src/main/java/appeng/core/features/registries/LocatableRegistry.java +++ b/src/main/java/appeng/core/features/registries/LocatableRegistry.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.HashMap; +import java.util.Map; + +import net.minecraftforge.common.MinecraftForge; + import appeng.api.events.LocatableEventAnnounce; import appeng.api.events.LocatableEventAnnounce.LocatableEvent; import appeng.api.features.ILocatable; import appeng.api.features.ILocatableRegistry; import appeng.util.Platform; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import java.util.HashMap; -import java.util.Map; -import net.minecraftforge.common.MinecraftForge; public final class LocatableRegistry implements ILocatableRegistry { + private final Map set; public LocatableRegistry() { diff --git a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java index f3b060c6449..0f0542a94c3 100644 --- a/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java +++ b/src/main/java/appeng/core/features/registries/MatterCannonAmmoRegistry.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.HashMap; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + import appeng.api.features.IMatterCannonAmmoRegistry; import appeng.recipes.ores.IOreListener; import appeng.recipes.ores.OreDictionaryHandler; import appeng.util.Platform; -import java.util.HashMap; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmoRegistry { diff --git a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java index a70395b69e7..0bdf2cfe8cb 100644 --- a/src/main/java/appeng/core/features/registries/MovableTileRegistry.java +++ b/src/main/java/appeng/core/features/registries/MovableTileRegistry.java @@ -1,40 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; -import appeng.api.exceptions.AppEngException; -import appeng.api.movable.IMovableHandler; -import appeng.api.movable.IMovableRegistry; -import appeng.api.movable.IMovableTile; -import appeng.spatial.DefaultSpatialHandler; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; +import appeng.api.exceptions.AppEngException; +import appeng.api.movable.IMovableHandler; +import appeng.api.movable.IMovableRegistry; +import appeng.api.movable.IMovableTile; +import appeng.spatial.DefaultSpatialHandler; + public class MovableTileRegistry implements IMovableRegistry { private final HashSet blacklisted = new HashSet(); - private final HashMap, IMovableHandler> Valid = - new HashMap, IMovableHandler>(); + private final HashMap, IMovableHandler> Valid = new HashMap, IMovableHandler>(); private final LinkedList> test = new LinkedList>(); private final LinkedList handlers = new LinkedList(); private final DefaultSpatialHandler dsh = new DefaultSpatialHandler(); @@ -49,8 +42,10 @@ public void blacklistBlock(final Block blk) { @Override public void whiteListTileEntity(final Class c) { if (c.getName().equals(TileEntity.class.getName())) { - throw new IllegalArgumentException(new AppEngException("Someone tried to make all tiles movable with " + c - + ", this is a clear violation of the purpose of the white list.")); + throw new IllegalArgumentException( + new AppEngException( + "Someone tried to make all tiles movable with " + c + + ", this is a clear violation of the purpose of the white list.")); } this.test.add(c); diff --git a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java index 8edcdf84a9b..79d9cb1fbbd 100644 --- a/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java +++ b/src/main/java/appeng/core/features/registries/P2PTunnelRegistry.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.config.TunnelType; import appeng.api.definitions.IBlocks; @@ -28,16 +31,9 @@ import appeng.api.util.AEColor; import appeng.util.Platform; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Nullable; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.oredict.OreDictionary; public final class P2PTunnelRegistry implements IP2PTunnelRegistry { + private static final int INITIAL_CAPACITY = 40; private final Map tunnels = new HashMap(INITIAL_CAPACITY); @@ -64,7 +60,8 @@ public void configure() { this.addNewAttunement(new ItemStack(Blocks.redstone_block), TunnelType.REDSTONE); this.addNewAttunement(new ItemStack(Blocks.lever), TunnelType.REDSTONE); this.addNewAttunement( - this.getModItem("EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE), TunnelType.REDSTONE); + this.getModItem("EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE), + TunnelType.REDSTONE); /** * attune based on lots of random item related stuff @@ -83,7 +80,8 @@ public void configure() { this.addNewAttunement(this.getModItem("ExtraUtilities", "extractor_base", 0), TunnelType.ITEM); this.addNewAttunement(this.getModItem("Mekanism", "PartTransmitter", 9), TunnelType.ITEM); this.addNewAttunement( - this.getModItem("EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE), TunnelType.ITEM); + this.getModItem("EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE), + TunnelType.ITEM); this.addNewAttunement(this.getModItem("ThermalDynamics", "ThermalDynamics_32", 0), TunnelType.ITEM); /** @@ -97,9 +95,11 @@ public void configure() { this.addNewAttunement(this.getModItem("Mekanism", "PartTransmitter", 4), TunnelType.FLUID); this.addNewAttunement(this.getModItem("ExtraUtilities", "extractor_base", 6), TunnelType.FLUID); this.addNewAttunement( - this.getModItem("ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE), TunnelType.FLUID); + this.getModItem("ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE), + TunnelType.FLUID); this.addNewAttunement( - this.getModItem("EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE), TunnelType.FLUID); + this.getModItem("EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE), + TunnelType.FLUID); this.addNewAttunement(this.getModItem("ThermalDynamics", "ThermalDynamics_16", 0), TunnelType.FLUID); for (final AEColor c : AEColor.values()) { diff --git a/src/main/java/appeng/core/features/registries/PlayerRegistry.java b/src/main/java/appeng/core/features/registries/PlayerRegistry.java index b56c6316e2a..298e3897e78 100644 --- a/src/main/java/appeng/core/features/registries/PlayerRegistry.java +++ b/src/main/java/appeng/core/features/registries/PlayerRegistry.java @@ -1,28 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import javax.annotation.Nullable; + +import net.minecraft.entity.player.EntityPlayer; + import appeng.api.features.IPlayerRegistry; import appeng.core.worlddata.WorldData; + import com.mojang.authlib.GameProfile; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; public class PlayerRegistry implements IPlayerRegistry { diff --git a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java index 800d0e4501c..7e98de0f111 100644 --- a/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java +++ b/src/main/java/appeng/core/features/registries/RecipeHandlerRegistry.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.*; + +import javax.annotation.Nullable; + import appeng.api.features.IRecipeHandlerRegistry; import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.IRecipeHandler; import appeng.api.recipes.ISubItemResolver; import appeng.core.AELog; import appeng.recipes.RecipeHandler; -import java.util.*; -import javax.annotation.Nullable; /** * @author AlgorithmX2 @@ -34,8 +28,9 @@ * @since rv0 */ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry { - private final Map> handlers = - new HashMap>(20); + + private final Map> handlers = new HashMap>( + 20); private final Collection resolvers = new LinkedList(); @Override diff --git a/src/main/java/appeng/core/features/registries/RegistryContainer.java b/src/main/java/appeng/core/features/registries/RegistryContainer.java index ffea120c86f..7c68db45bc9 100644 --- a/src/main/java/appeng/core/features/registries/RegistryContainer.java +++ b/src/main/java/appeng/core/features/registries/RegistryContainer.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; @@ -33,6 +25,7 @@ * @since rv0 */ public class RegistryContainer implements IRegistryContainer { + private final IGrinderRegistry grinder = new GrinderRecipeManager(); private final IInscriberRegistry inscriber = new InscriberRegistry(); private final IExternalStorageRegistry storage = new ExternalStorageRegistry(); diff --git a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java index 395f5329817..a457b980f67 100644 --- a/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java +++ b/src/main/java/appeng/core/features/registries/SpecialComparisonRegistry.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; -import appeng.api.features.IItemComparison; -import appeng.api.features.IItemComparisonProvider; -import appeng.api.features.ISpecialComparisonRegistry; import java.util.ArrayList; import java.util.List; + import net.minecraft.item.ItemStack; +import appeng.api.features.IItemComparison; +import appeng.api.features.IItemComparisonProvider; +import appeng.api.features.ISpecialComparisonRegistry; + public class SpecialComparisonRegistry implements ISpecialComparisonRegistry { private final List CompRegistry; diff --git a/src/main/java/appeng/core/features/registries/WirelessRegistry.java b/src/main/java/appeng/core/features/registries/WirelessRegistry.java index 7a5028a31cd..6cfaece4df3 100644 --- a/src/main/java/appeng/core/features/registries/WirelessRegistry.java +++ b/src/main/java/appeng/core/features/registries/WirelessRegistry.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.features.ILocatable; import appeng.api.features.IWirelessTermHandler; @@ -25,13 +24,9 @@ import appeng.core.localization.PlayerMessages; import appeng.core.sync.GuiBridge; import appeng.util.Platform; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public final class WirelessRegistry implements IWirelessTermRegistry { + private final List handlers; public WirelessRegistry() { @@ -84,8 +79,7 @@ public void openWirelessTerminalGui(final ItemStack item, final World w, final E } final long parsedKey = Long.parseLong(unparsedKey); - final ILocatable securityStation = - AEApi.instance().registries().locatable().getLocatableBy(parsedKey); + final ILocatable securityStation = AEApi.instance().registries().locatable().getLocatableBy(parsedKey); if (securityStation == null) { player.addChatMessage(PlayerMessages.StationCanNotBeLocated.get()); return; diff --git a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java index 589f0d47c3f..c3de243f42d 100644 --- a/src/main/java/appeng/core/features/registries/WorldGenRegistry.java +++ b/src/main/java/appeng/core/features/registries/WorldGenRegistry.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries; -import appeng.api.features.IWorldGen; import java.util.HashSet; + import net.minecraft.world.World; import net.minecraft.world.WorldProvider; +import appeng.api.features.IWorldGen; + public final class WorldGenRegistry implements IWorldGen { public static final WorldGenRegistry INSTANCE = new WorldGenRegistry(); diff --git a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java index b24bcf5fdfa..2adeec6bb53 100644 --- a/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/AppEngGrinderRecipe.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries.entries; -import appeng.api.features.IGrinderEntry; import net.minecraft.item.ItemStack; +import appeng.api.features.IGrinderEntry; + public class AppEngGrinderRecipe implements IGrinderEntry { private ItemStack in; @@ -40,8 +33,8 @@ public AppEngGrinderRecipe(final ItemStack a, final ItemStack b, final int cost) this.energy = cost; } - public AppEngGrinderRecipe( - final ItemStack a, final ItemStack b, final ItemStack c, final float chance, final int cost) { + public AppEngGrinderRecipe(final ItemStack a, final ItemStack b, final ItemStack c, final float chance, + final int cost) { this.in = a; this.out = b; @@ -51,14 +44,8 @@ public AppEngGrinderRecipe( this.energy = cost; } - public AppEngGrinderRecipe( - final ItemStack a, - final ItemStack b, - final ItemStack c, - final ItemStack d, - final float chance, - final float chance2, - final int cost) { + public AppEngGrinderRecipe(final ItemStack a, final ItemStack b, final ItemStack c, final ItemStack d, + final float chance, final float chance2, final int cost) { this.in = a; this.out = b; diff --git a/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java b/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java index 68cee45b70e..1d780f7e979 100644 --- a/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java +++ b/src/main/java/appeng/core/features/registries/entries/BasicCellHandler.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries.entries; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; + import appeng.api.implementations.tiles.IChestOrDrive; import appeng.api.storage.*; import appeng.client.texture.ExtraBlockTextures; @@ -25,10 +22,6 @@ import appeng.me.storage.CellInventory; import appeng.me.storage.CellInventoryHandler; import appeng.util.Platform; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; public class BasicCellHandler implements ICellHandler { @@ -38,8 +31,8 @@ public boolean isCell(final ItemStack is) { } @Override - public IMEInventoryHandler getCellInventory( - final ItemStack is, final ISaveProvider container, final StorageChannel channel) { + public IMEInventoryHandler getCellInventory(final ItemStack is, final ISaveProvider container, + final StorageChannel channel) { if (channel == StorageChannel.ITEMS) { return CellInventory.getCell(is, container); } @@ -62,13 +55,8 @@ public IIcon getTopTexture_Dark() { } @Override - public void openChestGui( - final EntityPlayer player, - final IChestOrDrive chest, - final ICellHandler cellHandler, - final IMEInventoryHandler inv, - final ItemStack is, - final StorageChannel chan) { + public void openChestGui(final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, + final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan) { Platform.openGUI(player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME); } diff --git a/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java b/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java index c8794fbc981..f88586cd4ea 100644 --- a/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java +++ b/src/main/java/appeng/core/features/registries/entries/CreativeCellHandler.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries.entries; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; + import appeng.api.implementations.tiles.IChestOrDrive; import appeng.api.storage.*; import appeng.client.texture.ExtraBlockTextures; @@ -25,10 +22,6 @@ import appeng.items.storage.ItemCreativeStorageCell; import appeng.me.storage.CreativeCellInventory; import appeng.util.Platform; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; public class CreativeCellHandler implements ICellHandler { @@ -38,8 +31,8 @@ public boolean isCell(final ItemStack is) { } @Override - public IMEInventoryHandler getCellInventory( - final ItemStack is, final ISaveProvider container, final StorageChannel channel) { + public IMEInventoryHandler getCellInventory(final ItemStack is, final ISaveProvider container, + final StorageChannel channel) { if (channel == StorageChannel.ITEMS && is != null && is.getItem() instanceof ItemCreativeStorageCell) { return CreativeCellInventory.getCell(is); } @@ -62,13 +55,8 @@ public IIcon getTopTexture_Dark() { } @Override - public void openChestGui( - final EntityPlayer player, - final IChestOrDrive chest, - final ICellHandler cellHandler, - final IMEInventoryHandler inv, - final ItemStack is, - final StorageChannel chan) { + public void openChestGui(final EntityPlayer player, final IChestOrDrive chest, final ICellHandler cellHandler, + final IMEInventoryHandler inv, final ItemStack is, final StorageChannel chan) { Platform.openGUI(player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME); } diff --git a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java index 955ef3c6f9a..b9a4d90c084 100644 --- a/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java +++ b/src/main/java/appeng/core/features/registries/entries/ExternalIInv.java @@ -1,44 +1,37 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.features.registries.entries; +import net.minecraft.inventory.IInventory; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IMEInventory; import appeng.api.storage.StorageChannel; import appeng.me.storage.MEMonitorIInventory; import appeng.util.InventoryAdaptor; -import net.minecraft.inventory.IInventory; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class ExternalIInv implements IExternalStorageHandler { @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel channel, + final BaseActionSource mySrc) { return channel == StorageChannel.ITEMS && te instanceof IInventory; } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, final StorageChannel channel, + final BaseActionSource src) { final InventoryAdaptor ad = InventoryAdaptor.getAdaptor(te, d); if (channel == StorageChannel.ITEMS && ad != null) { diff --git a/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java b/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java index ea4b2455928..91f086e1a0c 100644 --- a/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/InscriberInscribeRecipe.java @@ -1,11 +1,14 @@ package appeng.core.features.registries.entries; -import appeng.api.features.InscriberProcessType; import java.util.Collection; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; +import appeng.api.features.InscriberProcessType; + /** * inscribe recipes do not use up the provided optional upon craft * @@ -14,11 +17,9 @@ * @since rv2 */ public class InscriberInscribeRecipe extends InscriberRecipe { - public InscriberInscribeRecipe( - @Nonnull final Collection inputs, - @Nonnull final ItemStack output, - @Nullable final ItemStack top, - @Nullable final ItemStack bot) { + + public InscriberInscribeRecipe(@Nonnull final Collection inputs, @Nonnull final ItemStack output, + @Nullable final ItemStack top, @Nullable final ItemStack bot) { super(inputs, output, top, bot, InscriberProcessType.Inscribe); } } diff --git a/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java b/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java index 85f5df95134..f93776ef649 100644 --- a/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java +++ b/src/main/java/appeng/core/features/registries/entries/InscriberRecipe.java @@ -1,15 +1,19 @@ package appeng.core.features.registries.entries; -import appeng.api.features.IInscriberRecipe; -import appeng.api.features.InscriberProcessType; -import com.google.common.base.Optional; import java.util.ArrayList; import java.util.Collection; import java.util.List; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; +import appeng.api.features.IInscriberRecipe; +import appeng.api.features.InscriberProcessType; + +import com.google.common.base.Optional; + /** * Basic inscriber recipe * @@ -18,6 +22,7 @@ * @since rv2 */ public class InscriberRecipe implements IInscriberRecipe { + @Nonnull private final List inputs; @@ -33,12 +38,8 @@ public class InscriberRecipe implements IInscriberRecipe { @Nonnull private final InscriberProcessType type; - public InscriberRecipe( - @Nonnull final Collection inputs, - @Nonnull final ItemStack output, - @Nullable final ItemStack top, - @Nullable final ItemStack bot, - @Nonnull final InscriberProcessType type) { + public InscriberRecipe(@Nonnull final Collection inputs, @Nonnull final ItemStack output, + @Nullable final ItemStack top, @Nullable final ItemStack bot, @Nonnull final InscriberProcessType type) { this.inputs = new ArrayList(inputs.size()); this.inputs.addAll(inputs); diff --git a/src/main/java/appeng/core/localization/ButtonToolTips.java b/src/main/java/appeng/core/localization/ButtonToolTips.java index a806ef768d8..a2f393060a2 100644 --- a/src/main/java/appeng/core/localization/ButtonToolTips.java +++ b/src/main/java/appeng/core/localization/ButtonToolTips.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.localization; @@ -21,6 +13,7 @@ import net.minecraft.util.StatCollector; public enum ButtonToolTips { + PowerUnits, IOMode, CondenserOutput, @@ -176,8 +169,7 @@ public enum ButtonToolTips { SidelessModeSided, SidelessModeSidedDesc, SidelessModeSideless, - SidelessModeSidelessDesc, - ; + SidelessModeSidelessDesc,; private final String root; diff --git a/src/main/java/appeng/core/localization/GuiColors.java b/src/main/java/appeng/core/localization/GuiColors.java index 32728b6c87a..31e1bdb5d97 100644 --- a/src/main/java/appeng/core/localization/GuiColors.java +++ b/src/main/java/appeng/core/localization/GuiColors.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.localization; -import appeng.core.AELog; import net.minecraft.util.StatCollector; +import appeng.core.AELog; + public enum GuiColors { + // ARGB Colors: Name and default value SearchboxFocused(0x6E000000), SearchboxUnfocused(0x00000000), diff --git a/src/main/java/appeng/core/localization/GuiText.java b/src/main/java/appeng/core/localization/GuiText.java index fba03c91caf..89a110ec39d 100644 --- a/src/main/java/appeng/core/localization/GuiText.java +++ b/src/main/java/appeng/core/localization/GuiText.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.localization; @@ -21,6 +13,7 @@ import net.minecraft.util.StatCollector; public enum GuiText { + inventory("container"), // mc's default Inventory localization. Chest, diff --git a/src/main/java/appeng/core/localization/PlayerMessages.java b/src/main/java/appeng/core/localization/PlayerMessages.java index 3af443b7ee6..0242e2f5859 100644 --- a/src/main/java/appeng/core/localization/PlayerMessages.java +++ b/src/main/java/appeng/core/localization/PlayerMessages.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.localization; @@ -22,6 +14,7 @@ import net.minecraft.util.IChatComponent; public enum PlayerMessages { + ChestCannotReadStorageCell, InvalidMachine, LoadedSettings, diff --git a/src/main/java/appeng/core/localization/WailaText.java b/src/main/java/appeng/core/localization/WailaText.java index fa1193fc514..c146f7b14bc 100644 --- a/src/main/java/appeng/core/localization/WailaText.java +++ b/src/main/java/appeng/core/localization/WailaText.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.localization; @@ -21,6 +13,7 @@ import net.minecraft.util.StatCollector; public enum WailaText { + Crafting, DeviceOnline, diff --git a/src/main/java/appeng/core/settings/TickRates.java b/src/main/java/appeng/core/settings/TickRates.java index 405b6159cb9..37306cb7760 100644 --- a/src/main/java/appeng/core/settings/TickRates.java +++ b/src/main/java/appeng/core/settings/TickRates.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.settings; @@ -21,6 +13,7 @@ import appeng.core.AEConfig; public enum TickRates { + Interface(5, 120), ImportBus(5, 40), diff --git a/src/main/java/appeng/core/stats/AchievementCraftingHandler.java b/src/main/java/appeng/core/stats/AchievementCraftingHandler.java index 21be0856149..eafa153a3a5 100644 --- a/src/main/java/appeng/core/stats/AchievementCraftingHandler.java +++ b/src/main/java/appeng/core/stats/AchievementCraftingHandler.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; @@ -23,13 +15,14 @@ import cpw.mods.fml.common.gameevent.PlayerEvent; /** - * handles the achievement when an {@link net.minecraft.item.Item} is crafted by a player. - * The achievement is only added if its a real {@link net.minecraft.entity.player.EntityPlayer}. + * handles the achievement when an {@link net.minecraft.item.Item} is crafted by a player. The achievement is only added + * if its a real {@link net.minecraft.entity.player.EntityPlayer}. * * @author thatsIch * @since rv2 */ public class AchievementCraftingHandler { + private final PlayerDifferentiator differentiator; public AchievementCraftingHandler(final PlayerDifferentiator differentiator) { @@ -52,8 +45,7 @@ public void onPlayerCraftingEvent(final PlayerEvent.ItemCraftedEvent event) { break; case CraftItem: if (achievement.getStack() != null - && achievement.getStack().getItem().getClass() - == event.crafting.getItem().getClass()) { + && achievement.getStack().getItem().getClass() == event.crafting.getItem().getClass()) { achievement.addToPlayer(event.player); return; } diff --git a/src/main/java/appeng/core/stats/AchievementHierarchy.java b/src/main/java/appeng/core/stats/AchievementHierarchy.java index d99d42d8900..0d7c5fd89cf 100644 --- a/src/main/java/appeng/core/stats/AchievementHierarchy.java +++ b/src/main/java/appeng/core/stats/AchievementHierarchy.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; @@ -25,6 +17,7 @@ * @since rv2 */ public class AchievementHierarchy { + /** * Setup hierarchy through assigning parents. */ diff --git a/src/main/java/appeng/core/stats/AchievementPickupHandler.java b/src/main/java/appeng/core/stats/AchievementPickupHandler.java index 9031a13e25c..b2bdc133bd1 100644 --- a/src/main/java/appeng/core/stats/AchievementPickupHandler.java +++ b/src/main/java/appeng/core/stats/AchievementPickupHandler.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; +import net.minecraft.item.ItemStack; + import appeng.util.Platform; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; -import net.minecraft.item.ItemStack; /** - * handles the achievement when an {@link net.minecraft.item.Item} is picked up by a player. - * The achievement is only added if its a real {@link net.minecraft.entity.player.EntityPlayer}. + * handles the achievement when an {@link net.minecraft.item.Item} is picked up by a player. The achievement is only + * added if its a real {@link net.minecraft.entity.player.EntityPlayer}. * * @author thatsIch * @since rv2 */ public class AchievementPickupHandler { + private final PlayerDifferentiator differentiator; public AchievementPickupHandler(final PlayerDifferentiator differentiator) { @@ -39,8 +33,7 @@ public AchievementPickupHandler(final PlayerDifferentiator differentiator) { @SubscribeEvent public void onItemPickUp(final PlayerEvent.ItemPickupEvent event) { - if (this.differentiator.isNoPlayer(event.player) - || event.pickedUp == null + if (this.differentiator.isNoPlayer(event.player) || event.pickedUp == null || event.pickedUp.getEntityItem() == null) { return; } diff --git a/src/main/java/appeng/core/stats/AchievementType.java b/src/main/java/appeng/core/stats/AchievementType.java index d8ec67f1571..3ccad68b408 100644 --- a/src/main/java/appeng/core/stats/AchievementType.java +++ b/src/main/java/appeng/core/stats/AchievementType.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; diff --git a/src/main/java/appeng/core/stats/Achievements.java b/src/main/java/appeng/core/stats/Achievements.java index bcf4e2d636d..3f1e3f32c45 100644 --- a/src/main/java/appeng/core/stats/Achievements.java +++ b/src/main/java/appeng/core/stats/Achievements.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; + import appeng.api.AEApi; import appeng.api.definitions.IItemDefinition; import appeng.api.util.AEColor; import appeng.api.util.AEColoredItemDefinition; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; public enum Achievements { + // done Compass(-2, -4, AEApi.instance().definitions().blocks().skyCompass(), AchievementType.Craft), @@ -52,8 +46,8 @@ public enum Achievements { PatternTerminal(-8, -2, AEApi.instance().definitions().parts().patternTerminal(), AchievementType.Craft), // done - ChargedQuartz( - 0, -4, AEApi.instance().definitions().materials().certusQuartzCrystalCharged(), AchievementType.Pickup), + ChargedQuartz(0, -4, AEApi.instance().definitions().materials().certusQuartzCrystalCharged(), + AchievementType.Pickup), // done Fluix(0, -2, AEApi.instance().definitions().materials().fluixCrystal(), AchievementType.Pickup), @@ -62,8 +56,8 @@ public enum Achievements { Charger(0, 0, AEApi.instance().definitions().blocks().charger(), AchievementType.Craft), // done - CrystalGrowthAccelerator( - -2, 0, AEApi.instance().definitions().blocks().quartzGrowthAccelerator(), AchievementType.Craft), + CrystalGrowthAccelerator(-2, 0, AEApi.instance().definitions().blocks().quartzGrowthAccelerator(), + AchievementType.Craft), // done GlassCable(2, 0, AEApi.instance().definitions().parts().cableGlass(), AchievementType.Craft), @@ -78,11 +72,9 @@ public enum Achievements { Networking2(4, 0, AEApi.instance().definitions().parts().cableSmart(), AchievementType.Custom), // done - Networking3( - 4, - 2, - AEApi.instance().definitions().parts().cableDense(), - AchievementType.Custom), // todo achievement for dense covered cables + Networking3(4, 2, AEApi.instance().definitions().parts().cableDense(), AchievementType.Custom), // todo achievement + // for dense covered + // cables // done P2P(2, -2, AEApi.instance().definitions().parts().p2PTunnelME(), AchievementType.Craft), diff --git a/src/main/java/appeng/core/stats/PlayerDifferentiator.java b/src/main/java/appeng/core/stats/PlayerDifferentiator.java index a9b502ea907..367ec33e56e 100644 --- a/src/main/java/appeng/core/stats/PlayerDifferentiator.java +++ b/src/main/java/appeng/core/stats/PlayerDifferentiator.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; @@ -28,12 +20,10 @@ * @since rv2 */ public class PlayerDifferentiator { + /** - * Can determine if an {@link net.minecraft.entity.player.EntityPlayer} is not a real player. - * This is based on if the {@param player} is: - * - null - * - dead - * - fake + * Can determine if an {@link net.minecraft.entity.player.EntityPlayer} is not a real player. This is based on if + * the {@param player} is: - null - dead - fake * * @param player to be checked player * @return true if {@param player} is not a real player diff --git a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java index 22c918fe8c7..7fb8df29a33 100644 --- a/src/main/java/appeng/core/stats/PlayerStatsRegistration.java +++ b/src/main/java/appeng/core/stats/PlayerStatsRegistration.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; -import appeng.core.AEConfig; -import appeng.core.features.AEFeature; -import cpw.mods.fml.common.eventhandler.EventBus; import java.util.ArrayList; + import net.minecraft.stats.Achievement; import net.minecraftforge.common.AchievementPage; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; +import cpw.mods.fml.common.eventhandler.EventBus; + /** - * Registers any items a player is picking up or is crafting. - * Registered items are added to the player stats. - * This will only happen if the {@link AEFeature#Achievements} feature is enabled. + * Registers any items a player is picking up or is crafting. Registered items are added to the player stats. This will + * only happen if the {@link AEFeature#Achievements} feature is enabled. */ public class PlayerStatsRegistration { + /** * {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the * feature is enabled @@ -95,8 +89,9 @@ public void registerAchievements() { } } - final AchievementPage ae2AchievementPage = - new AchievementPage("Applied Energistics 2", list.toArray(new Achievement[list.size()])); + final AchievementPage ae2AchievementPage = new AchievementPage( + "Applied Energistics 2", + list.toArray(new Achievement[list.size()])); AchievementPage.registerAchievementPage(ae2AchievementPage); } } diff --git a/src/main/java/appeng/core/stats/Stats.java b/src/main/java/appeng/core/stats/Stats.java index b4787e8afbc..00680384ff0 100644 --- a/src/main/java/appeng/core/stats/Stats.java +++ b/src/main/java/appeng/core/stats/Stats.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.stats; @@ -43,8 +35,9 @@ public void addToPlayer(final EntityPlayer player, final int howMany) { StatBasic getStat() { if (this.stat == null) { - this.stat = - new StatBasic("stat.ae2." + this.name(), new ChatComponentTranslation("stat.ae2." + this.name())); + this.stat = new StatBasic( + "stat.ae2." + this.name(), + new ChatComponentTranslation("stat.ae2." + this.name())); this.stat.registerStat(); } diff --git a/src/main/java/appeng/core/sync/AppEngPacket.java b/src/main/java/appeng/core/sync/AppEngPacket.java index e04195b742b..730413ea6fd 100644 --- a/src/main/java/appeng/core/sync/AppEngPacket.java +++ b/src/main/java/appeng/core/sync/AppEngPacket.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync; +import net.minecraft.entity.player.EntityPlayer; + import appeng.core.AEConfig; import appeng.core.AELog; import appeng.core.features.AEFeature; @@ -25,7 +19,6 @@ import appeng.core.sync.network.NetworkHandler; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; public abstract class AppEngPacket { diff --git a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java index 535406c1a42..d03e402fd98 100644 --- a/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java +++ b/src/main/java/appeng/core/sync/AppEngPacketHandlerBase.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync; -import appeng.core.sync.packets.*; -import io.netty.buffer.ByteBuf; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import appeng.core.sync.packets.*; +import io.netty.buffer.ByteBuf; + public class AppEngPacketHandlerBase { + private static final Map, PacketTypes> REVERSE_LOOKUP = new HashMap<>(); public enum PacketTypes { + PACKET_COMPASS_REQUEST(PacketCompassRequest.class), PACKET_COMPASS_RESPONSE(PacketCompassResponse.class), @@ -92,8 +87,7 @@ public enum PacketTypes { Constructor x = null; try { x = this.packetClass.getConstructor(ByteBuf.class); - } catch (final NoSuchMethodException | SecurityException ignored) { - } + } catch (final NoSuchMethodException | SecurityException ignored) {} this.packetConstructor = x; REVERSE_LOOKUP.put(this.packetClass, this); @@ -112,9 +106,8 @@ static PacketTypes getID(final Class c) { return REVERSE_LOOKUP.get(c); } - public AppEngPacket parsePacket(final ByteBuf in) - throws InstantiationException, IllegalAccessException, IllegalArgumentException, - InvocationTargetException { + public AppEngPacket parsePacket(final ByteBuf in) throws InstantiationException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException { return this.packetConstructor.newInstance(in); } } diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index 1c0a022045b..6f3baedea1f 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync; +import java.lang.reflect.Constructor; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.SecurityPermissions; import appeng.api.definitions.IComparableDefinition; @@ -64,20 +67,14 @@ import appeng.tile.storage.TileIOPort; import appeng.tile.storage.TileSkyChest; import appeng.util.Platform; + import com.google.common.collect.Lists; + import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.relauncher.ReflectionHelper; -import java.lang.reflect.Constructor; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public enum GuiBridge implements IGuiHandler { + GUI_Handler(), GUI_GRINDER(ContainerGrinder.class, TileGrinder.class, GuiHostType.WORLD, null), @@ -118,28 +115,28 @@ public enum GuiBridge implements IGuiHandler { GUI_STORAGEBUS(ContainerStorageBus.class, PartStorageBus.class, GuiHostType.WORLD, SecurityPermissions.BUILD), - GUI_FORMATION_PLANE( - ContainerFormationPlane.class, PartFormationPlane.class, GuiHostType.WORLD, SecurityPermissions.BUILD), + GUI_FORMATION_PLANE(ContainerFormationPlane.class, PartFormationPlane.class, GuiHostType.WORLD, + SecurityPermissions.BUILD), GUI_PRIORITY(ContainerPriority.class, IPriorityHost.class, GuiHostType.WORLD, SecurityPermissions.BUILD), GUI_SECURITY(ContainerSecurity.class, TileSecurity.class, GuiHostType.WORLD, SecurityPermissions.SECURITY), - GUI_CRAFTING_TERMINAL( - ContainerCraftingTerm.class, PartCraftingTerminal.class, GuiHostType.WORLD, SecurityPermissions.CRAFT), + GUI_CRAFTING_TERMINAL(ContainerCraftingTerm.class, PartCraftingTerminal.class, GuiHostType.WORLD, + SecurityPermissions.CRAFT), - GUI_PATTERN_TERMINAL( - ContainerPatternTerm.class, PartPatternTerminal.class, GuiHostType.WORLD, SecurityPermissions.CRAFT), + GUI_PATTERN_TERMINAL(ContainerPatternTerm.class, PartPatternTerminal.class, GuiHostType.WORLD, + SecurityPermissions.CRAFT), - GUI_PATTERN_TERMINAL_EX( - ContainerPatternTermEx.class, PartPatternTerminalEx.class, GuiHostType.WORLD, SecurityPermissions.CRAFT), + GUI_PATTERN_TERMINAL_EX(ContainerPatternTermEx.class, PartPatternTerminalEx.class, GuiHostType.WORLD, + SecurityPermissions.CRAFT), // extends (Container/Gui) + Bus - GUI_LEVEL_EMITTER( - ContainerLevelEmitter.class, PartLevelEmitter.class, GuiHostType.WORLD, SecurityPermissions.BUILD), + GUI_LEVEL_EMITTER(ContainerLevelEmitter.class, PartLevelEmitter.class, GuiHostType.WORLD, + SecurityPermissions.BUILD), - GUI_SPATIAL_IO_PORT( - ContainerSpatialIOPort.class, TileSpatialIOPort.class, GuiHostType.WORLD, SecurityPermissions.BUILD), + GUI_SPATIAL_IO_PORT(ContainerSpatialIOPort.class, TileSpatialIOPort.class, GuiHostType.WORLD, + SecurityPermissions.BUILD), GUI_INSCRIBER(ContainerInscriber.class, TileInscriber.class, GuiHostType.WORLD, null), @@ -147,23 +144,20 @@ public enum GuiBridge implements IGuiHandler { GUI_MAC(ContainerMAC.class, TileMolecularAssembler.class, GuiHostType.WORLD, null), - GUI_CRAFTING_AMOUNT( - ContainerCraftAmount.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT), + GUI_CRAFTING_AMOUNT(ContainerCraftAmount.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, + SecurityPermissions.CRAFT), - GUI_PATTERN_VALUE_AMOUNT( - ContainerPatternValueAmount.class, ITerminalHost.class, GuiHostType.WORLD, SecurityPermissions.CRAFT), + GUI_PATTERN_VALUE_AMOUNT(ContainerPatternValueAmount.class, ITerminalHost.class, GuiHostType.WORLD, + SecurityPermissions.CRAFT), - GUI_CRAFTING_CONFIRM( - ContainerCraftConfirm.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT), + GUI_CRAFTING_CONFIRM(ContainerCraftConfirm.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, + SecurityPermissions.CRAFT), - GUI_INTERFACE_TERMINAL( - ContainerInterfaceTerminal.class, - PartInterfaceTerminal.class, - GuiHostType.WORLD, + GUI_INTERFACE_TERMINAL(ContainerInterfaceTerminal.class, PartInterfaceTerminal.class, GuiHostType.WORLD, SecurityPermissions.BUILD), - GUI_CRAFTING_STATUS( - ContainerCraftingStatus.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT), + GUI_CRAFTING_STATUS(ContainerCraftingStatus.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, + SecurityPermissions.CRAFT), GUI_RENAMER(ContainerRenamer.class, ICustomNameObject.class, GuiHostType.WORLD, SecurityPermissions.BUILD), @@ -195,8 +189,7 @@ public enum GuiBridge implements IGuiHandler { private void getGui() { if (Platform.isClient()) { final String start = this.containerClass.getName(); - final String guiClass = - start.replaceFirst("container.", "client.gui.").replace(".Container", ".Gui"); + final String guiClass = start.replaceFirst("container.", "client.gui.").replace(".Container", ".Gui"); if (start.equals(guiClass)) { throw new IllegalStateException("Unable to find gui class"); @@ -208,10 +201,7 @@ private void getGui() { } } - GuiBridge( - final Class containerClass, - final Class tileClass, - final GuiHostType type, + GuiBridge(final Class containerClass, final Class tileClass, final GuiHostType type, final SecurityPermissions requiredPermission) { this.requiredPermission = requiredPermission; this.containerClass = containerClass; @@ -221,8 +211,8 @@ private void getGui() { } @Override - public Object getServerGuiElement( - final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) { + public Object getServerGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, + final int y, final int z) { final ForgeDirection side = ForgeDirection.getOrientation(ordinal & 0x07); final GuiBridge ID = values()[ordinal >> 5]; final boolean stem = ((ordinal >> 3) & 1) == 1; @@ -256,15 +246,14 @@ public Object getServerGuiElement( return new ContainerNull(); } - private Object getGuiObject( - final ItemStack it, final EntityPlayer player, final World w, final int x, final int y, final int z) { + private Object getGuiObject(final ItemStack it, final EntityPlayer player, final World w, final int x, final int y, + final int z) { if (it != null) { if (it.getItem() instanceof IGuiItem) { return ((IGuiItem) it.getItem()).getGuiObject(it, w, x, y, z); } - final IWirelessTermHandler wh = - AEApi.instance().registries().wireless().getWirelessTerminalHandler(it); + final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler(it); if (wh != null) { return new WirelessTerminalGuiObject(wh, it, player, w, x, y, z); } @@ -281,14 +270,8 @@ public boolean CorrectTileOrPart(final Object tE) { return this.tileClass.isInstance(tE); } - private Object updateGui( - final Object newContainer, - final World w, - final int x, - final int y, - final int z, - final ForgeDirection side, - final Object myItem) { + private Object updateGui(final Object newContainer, final World w, final int x, final int y, final int z, + final ForgeDirection side, final Object myItem) { if (newContainer instanceof AEBaseContainer) { final AEBaseContainer bc = (AEBaseContainer) newContainer; bc.setOpenContext(new ContainerOpenContext(myItem)); @@ -312,8 +295,9 @@ public Object ConstructContainer(final InventoryPlayer inventory, final ForgeDir final Constructor target = this.findConstructor(c, inventory, tE); if (target == null) { - throw new IllegalStateException("Cannot find " + this.containerClass.getName() + "( " - + this.typeName(inventory) + ", " + this.typeName(tE) + " )"); + throw new IllegalStateException( + "Cannot find " + this.containerClass + .getName() + "( " + this.typeName(inventory) + ", " + this.typeName(tE) + " )"); } final Object o = target.newInstance(inventory, tE); @@ -327,8 +311,7 @@ public Object ConstructContainer(final InventoryPlayer inventory, final ForgeDir if (so instanceof Slot) { final ItemStack is = ((Slot) so).getStack(); - final IMaterials materials = - AEApi.instance().definitions().materials(); + final IMaterials materials = AEApi.instance().definitions().materials(); this.addPressAchievementToPlayer(is, materials, inventory.player); } } @@ -360,8 +343,8 @@ private String typeName(final Object inventory) { return inventory.getClass().getName(); } - private void addPressAchievementToPlayer( - final ItemStack newItem, final IMaterials possibleMaterials, final EntityPlayer player) { + private void addPressAchievementToPlayer(final ItemStack newItem, final IMaterials possibleMaterials, + final EntityPlayer player) { final IComparableDefinition logic = possibleMaterials.logicProcessorPress(); final IComparableDefinition eng = possibleMaterials.engProcessorPress(); final IComparableDefinition calc = possibleMaterials.calcProcessorPress(); @@ -379,8 +362,8 @@ private void addPressAchievementToPlayer( } @Override - public Object getClientGuiElement( - final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) { + public Object getClientGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, + final int y, final int z) { final ForgeDirection side = ForgeDirection.getOrientation(ordinal & 0x07); final GuiBridge ID = values()[ordinal >> 5]; final boolean stem = ((ordinal >> 3) & 1) == 1; @@ -424,8 +407,9 @@ public Object ConstructGui(final InventoryPlayer inventory, final ForgeDirection final Constructor target = this.findConstructor(c, inventory, tE); if (target == null) { - throw new IllegalStateException("Cannot find " + this.containerClass.getName() + "( " - + this.typeName(inventory) + ", " + this.typeName(tE) + " )"); + throw new IllegalStateException( + "Cannot find " + this.containerClass + .getName() + "( " + this.typeName(inventory) + ", " + this.typeName(tE) + " )"); } return target.newInstance(inventory, tE); @@ -434,17 +418,13 @@ public Object ConstructGui(final InventoryPlayer inventory, final ForgeDirection } } - public boolean hasPermissions( - final TileEntity te, - final int x, - final int y, - final int z, - final ForgeDirection side, + public boolean hasPermissions(final TileEntity te, final int x, final int y, final int z, final ForgeDirection side, final EntityPlayer player) { final World w = player.getEntityWorld(); if (Platform.hasPermissions( - te != null ? new DimensionalCoord(te) : new DimensionalCoord(player.worldObj, x, y, z), player)) { + te != null ? new DimensionalCoord(te) : new DimensionalCoord(player.worldObj, x, y, z), + player)) { if (this.type.isItem()) { final ItemStack it = player.inventory.getCurrentItem(); if (it != null && it.getItem() instanceof IGuiItem) { diff --git a/src/main/java/appeng/core/sync/GuiHostType.java b/src/main/java/appeng/core/sync/GuiHostType.java index 35041153428..8d872bdde05 100644 --- a/src/main/java/appeng/core/sync/GuiHostType.java +++ b/src/main/java/appeng/core/sync/GuiHostType.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync; public enum GuiHostType { + ITEM_OR_WORLD, ITEM, WORLD; diff --git a/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java index 04e6f965779..3879da00a12 100644 --- a/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngClientPacketHandler.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.network; +import java.lang.reflect.InvocationTargetException; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; + import appeng.core.AELog; import appeng.core.sync.AppEngPacket; import appeng.core.sync.AppEngPacketHandlerBase; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import io.netty.buffer.ByteBuf; -import java.lang.reflect.InvocationTargetException; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implements IPacketHandler { diff --git a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java index 76e9c5f3e0e..6e481c3126a 100644 --- a/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/AppEngServerPacketHandler.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.network; +import java.lang.reflect.InvocationTargetException; + +import net.minecraft.entity.player.EntityPlayer; + import appeng.core.AELog; import appeng.core.sync.AppEngPacket; import appeng.core.sync.AppEngPacketHandlerBase; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import io.netty.buffer.ByteBuf; -import java.lang.reflect.InvocationTargetException; -import net.minecraft.entity.player.EntityPlayer; public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase implements IPacketHandler { diff --git a/src/main/java/appeng/core/sync/network/INetworkInfo.java b/src/main/java/appeng/core/sync/network/INetworkInfo.java index c2f914b3ad5..6a09ccf89be 100644 --- a/src/main/java/appeng/core/sync/network/INetworkInfo.java +++ b/src/main/java/appeng/core/sync/network/INetworkInfo.java @@ -1,21 +1,14 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.network; -public interface INetworkInfo {} +public interface INetworkInfo { +} diff --git a/src/main/java/appeng/core/sync/network/IPacketHandler.java b/src/main/java/appeng/core/sync/network/IPacketHandler.java index 479b01ef796..bdfb20478e8 100644 --- a/src/main/java/appeng/core/sync/network/IPacketHandler.java +++ b/src/main/java/appeng/core/sync/network/IPacketHandler.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.network; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; import net.minecraft.entity.player.EntityPlayer; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; + public interface IPacketHandler { void onPacketData(INetworkInfo manager, FMLProxyPacket packet, EntityPlayer player); diff --git a/src/main/java/appeng/core/sync/network/NetworkHandler.java b/src/main/java/appeng/core/sync/network/NetworkHandler.java index 6e0ed36d9cb..fb26cd30f99 100644 --- a/src/main/java/appeng/core/sync/network/NetworkHandler.java +++ b/src/main/java/appeng/core/sync/network/NetworkHandler.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.network; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetHandlerPlayServer; + import appeng.core.sync.AppEngPacket; import appeng.core.worlddata.WorldData; import cpw.mods.fml.common.FMLCommonHandler; @@ -28,8 +23,6 @@ import cpw.mods.fml.common.network.FMLNetworkEvent.ServerConnectionFromClientEvent; import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent; import cpw.mods.fml.common.network.NetworkRegistry; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.NetHandlerPlayServer; public class NetworkHandler { diff --git a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java index 9a3e28cec8c..b3a654da8e4 100644 --- a/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java +++ b/src/main/java/appeng/core/sync/packets/PacketAssemblerAnimation.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; + import appeng.api.storage.data.IAEItemStack; import appeng.client.EffectType; import appeng.core.CommonHelper; @@ -28,8 +24,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; public class PacketAssemblerAnimation extends AppEngPacket { @@ -73,6 +67,11 @@ public void clientPacketData(final INetworkInfo network, final AppEngPacket pack final double d2 = 0.5d; // + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D); CommonHelper.proxy.spawnEffect( - EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this); + EffectType.Assembler, + player.getEntityWorld(), + this.x + d0, + this.y + d1, + this.z + d2, + this); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketClick.java b/src/main/java/appeng/core/sync/packets/PacketClick.java index 72b16ab68de..b3a292b33a4 100644 --- a/src/main/java/appeng/core/sync/packets/PacketClick.java +++ b/src/main/java/appeng/core/sync/packets/PacketClick.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IComparableDefinition; import appeng.api.definitions.IItems; @@ -29,8 +24,6 @@ import appeng.items.tools.powered.ToolColorApplicator; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class PacketClick extends AppEngPacket { @@ -54,13 +47,7 @@ public PacketClick(final ByteBuf stream) { } // api - public PacketClick( - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, + public PacketClick(final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { final ByteBuf data = Unpooled.buffer(); diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java index aefe319f9c6..5fdf343b8a0 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassRequest.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; + import appeng.api.util.DimensionalCoord; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; @@ -26,8 +21,6 @@ import appeng.services.compass.ICompassCallback; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketCompassRequest extends AppEngPacket implements ICompassCallback { @@ -61,10 +54,10 @@ public PacketCompassRequest(final long attunement, final int cx, final int cz, f } @Override - public void calculatedDirection( - final boolean hasResult, final boolean spin, final double radians, final double dist) { - NetworkHandler.instance.sendTo( - new PacketCompassResponse(this, hasResult, spin, radians), (EntityPlayerMP) this.talkBackTo); + public void calculatedDirection(final boolean hasResult, final boolean spin, final double radians, + final double dist) { + NetworkHandler.instance + .sendTo(new PacketCompassResponse(this, hasResult, spin, radians), (EntityPlayerMP) this.talkBackTo); } @Override diff --git a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java index 3e06af88241..ffde82d91df 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompassResponse.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; + import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import appeng.hooks.CompassManager; import appeng.hooks.CompassResult; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; public class PacketCompassResponse extends AppEngPacket { @@ -46,8 +39,8 @@ public PacketCompassResponse(final ByteBuf stream) { } // api - public PacketCompassResponse( - final PacketCompassRequest req, final boolean hasResult, final boolean spin, final double radians) { + public PacketCompassResponse(final PacketCompassRequest req, final boolean hasResult, final boolean spin, + final double radians) { final ByteBuf data = Unpooled.buffer(); diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index b81d3678d2a..559c7c48721 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -1,39 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; -import appeng.client.gui.implementations.GuiInterfaceTerminal; -import appeng.core.sync.AppEngPacket; -import appeng.core.sync.network.INetworkInfo; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import java.io.*; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; +import appeng.client.gui.implementations.GuiInterfaceTerminal; +import appeng.core.sync.AppEngPacket; +import appeng.core.sync.network.INetworkInfo; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + public class PacketCompressedNBT extends AppEngPacket { // input. diff --git a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java index 9e15f52c36f..6551d0d17ed 100644 --- a/src/main/java/appeng/core/sync/packets/PacketConfigButton.java +++ b/src/main/java/appeng/core/sync/packets/PacketConfigButton.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; + import appeng.api.config.Settings; import appeng.api.util.IConfigManager; import appeng.api.util.IConfigurableObject; @@ -28,10 +23,9 @@ import appeng.util.Platform; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; public final class PacketConfigButton extends AppEngPacket { + private final Settings option; private final boolean rotationDirection; @@ -64,7 +58,9 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack if (baseContainer.getTarget() instanceof IConfigurableObject) { final IConfigManager cm = ((IConfigurableObject) baseContainer.getTarget()).getConfigManager(); final Enum newState = Platform.rotateEnum( - cm.getSetting(this.option), this.rotationDirection, this.option.getPossibleValues()); + cm.getSetting(this.option), + this.rotationDirection, + this.option.getPossibleValues()); cm.putSetting(this.option, newState); } } diff --git a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java index d1a9fb2a2d3..c7442b7e4cd 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java +++ b/src/main/java/appeng/core/sync/packets/PacketCraftRequest.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.util.concurrent.Future; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -31,10 +29,6 @@ import appeng.core.sync.network.INetworkInfo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.util.concurrent.Future; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class PacketCraftRequest extends AppEngPacket { @@ -83,7 +77,11 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack try { final ICraftingGrid cg = g.getCache(ICraftingGrid.class); futureJob = cg.beginCraftingJob( - cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.getItemToCraft(), null); + cca.getWorld(), + cca.getGrid(), + cca.getActionSrc(), + cca.getItemToCraft(), + null); final ContainerOpenContext context = cca.getOpenContext(); if (context != null) { diff --git a/src/main/java/appeng/core/sync/packets/PacketCraftingCPUsUpdate.java b/src/main/java/appeng/core/sync/packets/PacketCraftingCPUsUpdate.java index 93a58f63791..34a7172eb95 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCraftingCPUsUpdate.java +++ b/src/main/java/appeng/core/sync/packets/PacketCraftingCPUsUpdate.java @@ -1,18 +1,21 @@ package appeng.core.sync.packets; +import java.io.IOException; +import java.util.Collection; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; + import appeng.client.gui.widgets.ICraftingCPUTableHolder; import appeng.container.implementations.CraftingCPUStatus; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.IOException; -import java.util.Collection; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; public class PacketCraftingCPUsUpdate extends AppEngPacket { + private final CraftingCPUStatus[] cpus; public PacketCraftingCPUsUpdate(final ByteBuf stream) { diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index 5527bbdb17a..36b089726d5 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; + import appeng.api.storage.data.IAEItemStack; import appeng.client.ClientHelper; import appeng.container.AEBaseContainer; @@ -32,10 +30,6 @@ import appeng.util.item.AEItemStack; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; public class PacketInventoryAction extends AppEngPacket { @@ -115,14 +109,16 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack if (context != null) { final TileEntity te = context.getTile(); Platform.openGUI( - sender, te, baseContainer.getOpenContext().getSide(), GuiBridge.GUI_CRAFTING_AMOUNT); + sender, + te, + baseContainer.getOpenContext().getSide(), + GuiBridge.GUI_CRAFTING_AMOUNT); if (sender.openContainer instanceof ContainerCraftAmount) { final ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer; if (baseContainer.getTargetStack() != null) { - cca.getCraftingItem() - .putStack(baseContainer.getTargetStack().getItemStack()); + cca.getCraftingItem().putStack(baseContainer.getTargetStack().getItemStack()); cca.setItemToCraft(baseContainer.getTargetStack()); } @@ -134,13 +130,15 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack if (context != null) { final TileEntity te = context.getTile(); Platform.openGUI( - sender, te, baseContainer.getOpenContext().getSide(), GuiBridge.GUI_PATTERN_VALUE_AMOUNT); + sender, + te, + baseContainer.getOpenContext().getSide(), + GuiBridge.GUI_PATTERN_VALUE_AMOUNT); if (sender.openContainer instanceof ContainerPatternValueAmount) { final ContainerPatternValueAmount cpv = (ContainerPatternValueAmount) sender.openContainer; if (baseContainer.getTargetStack() != null) { cpv.setValueIndex(this.slot); - cpv.getPatternValue() - .putStack(baseContainer.getTargetStack().getItemStack()); + cpv.getPatternValue().putStack(baseContainer.getTargetStack().getItemStack()); } cpv.detectAndSendChanges(); } diff --git a/src/main/java/appeng/core/sync/packets/PacketLightning.java b/src/main/java/appeng/core/sync/packets/PacketLightning.java index d81582ee72e..8558d21d009 100644 --- a/src/main/java/appeng/core/sync/packets/PacketLightning.java +++ b/src/main/java/appeng/core/sync/packets/PacketLightning.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; + import appeng.client.ClientHelper; import appeng.client.render.effects.LightningFX; import appeng.core.AEConfig; @@ -28,8 +23,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; public class PacketLightning extends AppEngPacket { @@ -65,11 +58,16 @@ public PacketLightning(final double x, final double y, final double z) { public void clientPacketData(final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player) { try { if (Platform.isClient() && AEConfig.instance.enableEffects) { - final LightningFX fx = - new LightningFX(ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f); + final LightningFX fx = new LightningFX( + ClientHelper.proxy.getWorld(), + this.x, + this.y, + this.z, + 0.0f, + 0.0f, + 0.0f); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } - } catch (final Exception ignored) { - } + } catch (final Exception ignored) {} } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java index ce697965ed9..1ea042592da 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java +++ b/src/main/java/appeng/core/sync/packets/PacketMEInventoryUpdate.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.BufferOverflowException; +import java.util.LinkedList; +import java.util.List; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +import javax.annotation.Nullable; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; + import appeng.api.storage.data.IAEItemStack; import appeng.client.gui.implementations.GuiCraftConfirm; import appeng.client.gui.implementations.GuiCraftingCPU; @@ -32,20 +39,9 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.BufferOverflowException; -import java.util.LinkedList; -import java.util.List; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; -import javax.annotation.Nullable; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; public class PacketMEInventoryUpdate extends AppEngPacket { + private static final int UNCOMPRESSED_PACKET_BYTE_LIMIT = 16 * 1024 * 1024; private static final int OPERATION_BYTE_LIMIT = 2 * 1024; private static final int TEMP_BUFFER_SIZE = 1024; @@ -76,6 +72,7 @@ public PacketMEInventoryUpdate(final ByteBuf stream) throws IOException { // int originalBytes = stream.readableBytes(); final GZIPInputStream gzReader = new GZIPInputStream(new InputStream() { + @Override public int read() throws IOException { if (stream.readableBytes() <= 0) { @@ -119,6 +116,7 @@ public PacketMEInventoryUpdate(final byte ref) throws IOException { this.data.writeByte(this.ref); this.compressFrame = new GZIPOutputStream(new OutputStream() { + @Override public void write(final int value) throws IOException { PacketMEInventoryUpdate.this.data.writeByte(value); diff --git a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java index 5ae84c65248..23225aecd92 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java +++ b/src/main/java/appeng/core/sync/packets/PacketMatterCannon.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + import appeng.client.render.effects.MatterCannonFX; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; @@ -26,10 +23,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.world.World; public class PacketMatterCannon extends AppEngPacket { @@ -53,14 +46,8 @@ public PacketMatterCannon(final ByteBuf stream) { } // api - public PacketMatterCannon( - final double x, - final double y, - final double z, - final float dx, - final float dy, - final float dz, - final byte len) { + public PacketMatterCannon(final double x, final double y, final double z, final float dx, final float dy, + final float dz, final byte len) { final float dl = dx * dx + dy * dy + dz * dz; final float dlz = (float) Math.sqrt(dl); @@ -94,11 +81,14 @@ public void clientPacketData(final INetworkInfo network, final AppEngPacket pack final World world = FMLClientHandler.instance().getClient().theWorld; for (int a = 1; a < this.len; a++) { final MatterCannonFX fx = new MatterCannonFX( - world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond); + world, + this.x + this.dx * a, + this.y + this.dy * a, + this.z + this.dz * a, + Items.diamond); Minecraft.getMinecraft().effectRenderer.addEffect(fx); } - } catch (final Exception ignored) { - } + } catch (final Exception ignored) {} } } diff --git a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java index da31415a713..08ae901ed73 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java +++ b/src/main/java/appeng/core/sync/packets/PacketMockExplosion.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + import appeng.core.CommonHelper; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; @@ -25,8 +20,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; public class PacketMockExplosion extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java index 9ca2e667d2a..c21ba41ad6f 100644 --- a/src/main/java/appeng/core/sync/packets/PacketMultiPart.java +++ b/src/main/java/appeng/core/sync/packets/PacketMultiPart.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraftforge.common.MinecraftForge; + import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import appeng.integration.IntegrationRegistry; @@ -25,9 +21,6 @@ import appeng.integration.abstraction.IFMP; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraftforge.common.MinecraftForge; public class PacketMultiPart extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketNEIDragClick.java b/src/main/java/appeng/core/sync/packets/PacketNEIDragClick.java index cdc955de351..617a1676905 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNEIDragClick.java +++ b/src/main/java/appeng/core/sync/packets/PacketNEIDragClick.java @@ -1,14 +1,15 @@ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class PacketNEIDragClick extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java index bfa18a0b217..5ca2bc054f4 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java +++ b/src/main/java/appeng/core/sync/packets/PacketNEIRecipe.java @@ -1,23 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; import appeng.api.config.SecurityPermissions; @@ -40,22 +50,6 @@ import appeng.util.prioitylist.IPartitionList; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; public class PacketNEIRecipe extends AppEngPacket { @@ -141,17 +135,17 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack ItemStack currentItem = craftMatrix.getStackInSlot(x); if (currentItem != null) { testInv.setInventorySlotContents(x, currentItem); - final ItemStack newItemStack = - r.matches(testInv, pmp.worldObj) ? r.getCraftingResult(testInv) : null; + final ItemStack newItemStack = r.matches(testInv, pmp.worldObj) + ? r.getCraftingResult(testInv) + : null; testInv.setInventorySlotContents(x, patternItem); if (newItemStack == null || !Platform.isSameItemPrecise(newItemStack, is)) { final IAEItemStack in = AEItemStack.create(currentItem); if (in != null) { - final IAEItemStack out = realForFake == Actionable.SIMULATE - ? null - : Platform.poweredInsert( - energy, storage, in, cct.getActionSource()); + final IAEItemStack out = realForFake == Actionable.SIMULATE ? null + : Platform + .poweredInsert(energy, storage, in, cct.getActionSource()); if (out != null) { craftMatrix.setInventorySlotContents(x, out.getItemStack()); } else { @@ -189,7 +183,10 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack if (filter == null || filter.isListed(request)) { request.setStackSize(1); final IAEItemStack out = Platform.poweredExtraction( - energy, storage, request, cct.getActionSource()); + energy, + storage, + request, + cct.getActionSource()); if (out != null) { whichItem = out.getItemStack(); break; @@ -201,8 +198,8 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack // If that doesn't work, grab from the player's inventory if (whichItem == null && playerInventory != null) { - whichItem = - this.extractItemFromPlayerInventory(player, realForFake, patternItem); + whichItem = this + .extractItemFromPlayerInventory(player, realForFake, patternItem); } craftMatrix.setInventorySlotContents(x, whichItem); @@ -224,13 +221,12 @@ public void serverPacketData(final INetworkInfo manager, final AppEngPacket pack * @param patternItem which {@link ItemStack} to extract * @return null or a found {@link ItemStack} */ - private ItemStack extractItemFromPlayerInventory( - final EntityPlayer player, final Actionable mode, final ItemStack patternItem) { + private ItemStack extractItemFromPlayerInventory(final EntityPlayer player, final Actionable mode, + final ItemStack patternItem) { final InventoryAdaptor ia = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN); final AEItemStack request = AEItemStack.create(patternItem); final boolean isSimulated = mode == Actionable.SIMULATE; - final boolean checkFuzzy = request.isOre() - || patternItem.getItemDamage() == OreDictionary.WILDCARD_VALUE + final boolean checkFuzzy = request.isOre() || patternItem.getItemDamage() == OreDictionary.WILDCARD_VALUE || patternItem.hasTagCompound() || patternItem.isItemStackDamageable(); diff --git a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java index b191d017453..b5ad2c28b96 100644 --- a/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java +++ b/src/main/java/appeng/core/sync/packets/PacketNewStorageDimension.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.common.DimensionManager; + import appeng.core.AEConfig; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; @@ -25,8 +20,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.DimensionManager; public class PacketNewStorageDimension extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java index 4b844c28a53..eaa52a70905 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java +++ b/src/main/java/appeng/core/sync/packets/PacketPaintedEntity.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; + import appeng.api.util.AEColor; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; @@ -25,7 +19,6 @@ import appeng.hooks.TickHandler.PlayerColor; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; public class PacketPaintedEntity extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java index 25b0fcf191d..1d38a731f84 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java @@ -1,31 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; + import appeng.core.CommonHelper; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import appeng.parts.PartPlacement; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketPartPlacement extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java index 4af81b6dc1a..fe136aac053 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartialItem.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartialItem.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; + import appeng.container.AEBaseContainer; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; public class PacketPartialItem extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java index 6879b0a967b..126f33819d7 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; + import appeng.api.AEApi; import appeng.api.storage.data.IAEItemStack; import appeng.container.implementations.ContainerPatternTerm; @@ -26,10 +24,6 @@ import appeng.util.item.AEItemStack; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.IInventory; public class PacketPatternSlot extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternValueSet.java b/src/main/java/appeng/core/sync/packets/PacketPatternValueSet.java index a0005e78f27..efa3c91d031 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternValueSet.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternValueSet.java @@ -1,5 +1,10 @@ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import appeng.api.networking.IGridHost; import appeng.container.ContainerOpenContext; import appeng.container.implementations.ContainerPatternTerm; @@ -11,10 +16,6 @@ import appeng.util.Platform; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class PacketPatternValueSet extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java index 205766a59dc..b44c2a6a5b9 100644 --- a/src/main/java/appeng/core/sync/packets/PacketProgressBar.java +++ b/src/main/java/appeng/core/sync/packets/PacketProgressBar.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + import appeng.container.AEBaseContainer; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; public class PacketProgressBar extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java index a9b6f3e6c34..37c7273ae6e 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwapSlots.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; + import appeng.container.AEBaseContainer; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.INetworkInfo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; public class PacketSwapSlots extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java index 0c744e25166..f1ea0c8ae48 100644 --- a/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java +++ b/src/main/java/appeng/core/sync/packets/PacketSwitchGuis.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.tileentity.TileEntity; + import appeng.client.gui.AEBaseGui; import appeng.container.AEBaseContainer; import appeng.container.ContainerOpenContext; @@ -27,9 +23,6 @@ import appeng.util.Platform; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.tileentity.TileEntity; public class PacketSwitchGuis extends AppEngPacket { diff --git a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java index 1864085b99a..37dc24c05be 100644 --- a/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java +++ b/src/main/java/appeng/core/sync/packets/PacketTransitionEffect.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.client.ClientHelper; import appeng.client.render.effects.EnergyFx; import appeng.core.CommonHelper; @@ -28,14 +29,6 @@ import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class PacketTransitionEffect extends AppEngPacket { @@ -55,8 +48,8 @@ public PacketTransitionEffect(final ByteBuf stream) { } // api - public PacketTransitionEffect( - final double x, final double y, final double z, final ForgeDirection dir, final boolean wasBlock) { + public PacketTransitionEffect(final double x, final double y, final double z, final ForgeDirection dir, + final boolean wasBlock) { this.x = x; this.y = y; this.z = z; @@ -84,18 +77,12 @@ public void clientPacketData(final INetworkInfo network, final AppEngPacket pack if (CommonHelper.proxy.shouldAddParticles(Platform.getRandom())) { final EnergyFx fx = new EnergyFx( world, - this.x - + (this.mode - ? (Platform.getRandomInt() % 100) * 0.01 - : (Platform.getRandomInt() % 100) * 0.005 - 0.25), - this.y - + (this.mode - ? (Platform.getRandomInt() % 100) * 0.01 - : (Platform.getRandomInt() % 100) * 0.005 - 0.25), - this.z - + (this.mode - ? (Platform.getRandomInt() % 100) * 0.01 - : (Platform.getRandomInt() % 100) * 0.005 - 0.25), + this.x + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 + : (Platform.getRandomInt() % 100) * 0.005 - 0.25), + this.y + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 + : (Platform.getRandomInt() % 100) * 0.005 - 0.25), + this.z + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 + : (Platform.getRandomInt() % 100) * 0.005 - 0.25), Items.diamond); if (!this.mode) { @@ -113,9 +100,8 @@ public void clientPacketData(final INetworkInfo network, final AppEngPacket pack if (this.mode) { final Block block = world.getBlock((int) this.x, (int) this.y, (int) this.z); - Minecraft.getMinecraft() - .getSoundHandler() - .playSound(new PositionedSoundRecord( + Minecraft.getMinecraft().getSoundHandler().playSound( + new PositionedSoundRecord( new ResourceLocation(block.stepSound.getBreakSound()), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F, diff --git a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java index 5c3a0eb5770..e0d7fe32a47 100644 --- a/src/main/java/appeng/core/sync/packets/PacketValueConfig.java +++ b/src/main/java/appeng/core/sync/packets/PacketValueConfig.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.sync.packets; +import java.io.*; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; + import appeng.api.config.FuzzyMode; import appeng.api.config.Settings; import appeng.api.util.IConfigManager; @@ -31,12 +31,6 @@ import appeng.helpers.IMouseWheelItem; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.*; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; public class PacketValueConfig extends AppEngPacket { @@ -76,8 +70,7 @@ public PacketValueConfig(final String name, final String value) throws IOExcepti public void serverPacketData(final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player) { final Container c = player.openContainer; - if (this.Name.equals("Item") - && player.getHeldItem() != null + if (this.Name.equals("Item") && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem) { final ItemStack is = player.getHeldItem(); final IMouseWheelItem si = (IMouseWheelItem) is.getItem(); diff --git a/src/main/java/appeng/core/worlddata/CompassData.java b/src/main/java/appeng/core/worlddata/CompassData.java index 7b0625a78de..f71f9a01ab4 100644 --- a/src/main/java/appeng/core/worlddata/CompassData.java +++ b/src/main/java/appeng/core/worlddata/CompassData.java @@ -1,34 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.services.CompassService; -import com.google.common.base.Preconditions; import java.io.File; + import javax.annotation.Nonnull; +import appeng.services.CompassService; + +import com.google.common.base.Preconditions; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ final class CompassData implements IWorldCompassData, IOnWorldStoppable { + @Nonnull private final CompassService service; diff --git a/src/main/java/appeng/core/worlddata/DimensionData.java b/src/main/java/appeng/core/worlddata/DimensionData.java index d5158e9bf25..a9b9a724e19 100644 --- a/src/main/java/appeng/core/worlddata/DimensionData.java +++ b/src/main/java/appeng/core/worlddata/DimensionData.java @@ -1,44 +1,41 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.api.util.WorldCoord; -import appeng.core.AEConfig; -import appeng.core.sync.network.NetworkHandler; -import appeng.core.sync.packets.PacketNewStorageDimension; -import appeng.hooks.TickHandler; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; import java.util.List; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.network.NetworkManager; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import appeng.api.util.WorldCoord; +import appeng.core.AEConfig; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketNewStorageDimension; +import appeng.hooks.TickHandler; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ final class DimensionData implements IWorldDimensionData, IOnWorldStartable, IOnWorldStoppable { + private static final String CONFIG_CATEGORY = "DimensionManager"; private static final String CONFIG_KEY = "StorageCells"; private static final int[] STORAGE_CELLS_DEFAULT = new int[0]; @@ -135,14 +132,12 @@ public void setStoredSize(final int dim, final int targetX, final int targetY, f @Override public void sendToPlayer(@Nullable final NetworkManager manager) { if (manager != null) { - for (final int newDim : this.config - .get(PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY) + for (final int newDim : this.config.get(PACKAGE_DEST_CATEGORY, PACKAGE_KEY_CATEGORY, PACKAGE_DEF_CATEGORY) .getIntList()) { manager.scheduleOutboundPacket((new PacketNewStorageDimension(newDim)).getProxy()); } } else { - for (final TickHandler.PlayerColor pc : - TickHandler.INSTANCE.getPlayerColors().values()) { + for (final TickHandler.PlayerColor pc : TickHandler.INSTANCE.getPlayerColors().values()) { NetworkHandler.instance.sendToAll(pc.getPacket()); } } diff --git a/src/main/java/appeng/core/worlddata/IOnWorldStartable.java b/src/main/java/appeng/core/worlddata/IOnWorldStartable.java index 209076aedd4..f73810a3db7 100644 --- a/src/main/java/appeng/core/worlddata/IOnWorldStartable.java +++ b/src/main/java/appeng/core/worlddata/IOnWorldStartable.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; @@ -24,5 +16,6 @@ * @since rv3 30.05.2015 */ public interface IOnWorldStartable { + void onWorldStart(); } diff --git a/src/main/java/appeng/core/worlddata/IOnWorldStoppable.java b/src/main/java/appeng/core/worlddata/IOnWorldStoppable.java index c9e9d963c46..0930fe5f873 100644 --- a/src/main/java/appeng/core/worlddata/IOnWorldStoppable.java +++ b/src/main/java/appeng/core/worlddata/IOnWorldStoppable.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; @@ -24,5 +16,6 @@ * @since rv3 30.05.2015 */ public interface IOnWorldStoppable { + void onWorldStop(); } diff --git a/src/main/java/appeng/core/worlddata/IWorldCompassData.java b/src/main/java/appeng/core/worlddata/IWorldCompassData.java index e9c4f14faf9..a1cfeae87c8 100644 --- a/src/main/java/appeng/core/worlddata/IWorldCompassData.java +++ b/src/main/java/appeng/core/worlddata/IWorldCompassData.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; @@ -26,5 +18,6 @@ * @since rv3 30.05.2015 */ public interface IWorldCompassData { + CompassService service(); } diff --git a/src/main/java/appeng/core/worlddata/IWorldData.java b/src/main/java/appeng/core/worlddata/IWorldData.java index b68020f6e23..f6ae747f7fd 100644 --- a/src/main/java/appeng/core/worlddata/IWorldData.java +++ b/src/main/java/appeng/core/worlddata/IWorldData.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; @@ -26,6 +18,7 @@ * @since rv3 30.05.2015 */ public interface IWorldData { + void onServerStopping(); void onServerStoppped(); diff --git a/src/main/java/appeng/core/worlddata/IWorldDimensionData.java b/src/main/java/appeng/core/worlddata/IWorldDimensionData.java index 464c77657b7..db2f024e8a3 100644 --- a/src/main/java/appeng/core/worlddata/IWorldDimensionData.java +++ b/src/main/java/appeng/core/worlddata/IWorldDimensionData.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.api.util.WorldCoord; import javax.annotation.Nullable; + import net.minecraft.network.NetworkManager; +import appeng.api.util.WorldCoord; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ public interface IWorldDimensionData { + void addStorageCell(int newStorageCellID); WorldCoord getStoredSize(int dim); diff --git a/src/main/java/appeng/core/worlddata/IWorldGridStorageData.java b/src/main/java/appeng/core/worlddata/IWorldGridStorageData.java index 6ea3f2a4709..6416a8d9c1e 100644 --- a/src/main/java/appeng/core/worlddata/IWorldGridStorageData.java +++ b/src/main/java/appeng/core/worlddata/IWorldGridStorageData.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.me.GridStorage; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import appeng.me.GridStorage; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ public interface IWorldGridStorageData { + @Nullable GridStorage getGridStorage(long storageID); diff --git a/src/main/java/appeng/core/worlddata/IWorldPlayerData.java b/src/main/java/appeng/core/worlddata/IWorldPlayerData.java index 9f5201827d3..ac7126ca980 100644 --- a/src/main/java/appeng/core/worlddata/IWorldPlayerData.java +++ b/src/main/java/appeng/core/worlddata/IWorldPlayerData.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import com.mojang.authlib.GameProfile; import javax.annotation.Nullable; + import net.minecraft.entity.player.EntityPlayer; +import com.mojang.authlib.GameProfile; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ public interface IWorldPlayerData { + @Nullable EntityPlayer getPlayerFromID(int playerID); diff --git a/src/main/java/appeng/core/worlddata/IWorldPlayerMapping.java b/src/main/java/appeng/core/worlddata/IWorldPlayerMapping.java index fd564e4a0ed..de70ae001a5 100644 --- a/src/main/java/appeng/core/worlddata/IWorldPlayerMapping.java +++ b/src/main/java/appeng/core/worlddata/IWorldPlayerMapping.java @@ -1,37 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import com.google.common.base.Optional; import java.util.UUID; + import javax.annotation.Nonnull; +import com.google.common.base.Optional; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ public interface IWorldPlayerMapping { + /** - * Tries to retrieve the UUID of a player. - * Might not be stored inside of the map. - * Should not happen though. + * Tries to retrieve the UUID of a player. Might not be stored inside of the map. Should not happen though. * * @param id ID of the to be searched player * @return maybe the UUID of the searched player diff --git a/src/main/java/appeng/core/worlddata/IWorldSpawnData.java b/src/main/java/appeng/core/worlddata/IWorldSpawnData.java index ffec39bbb4d..8c0f577f315 100644 --- a/src/main/java/appeng/core/worlddata/IWorldSpawnData.java +++ b/src/main/java/appeng/core/worlddata/IWorldSpawnData.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; import java.util.Collection; + import net.minecraft.nbt.NBTTagCompound; /** @@ -27,6 +20,7 @@ * @since rv3 30.05.2015 */ public interface IWorldSpawnData { + void setGenerated(int dim, int chunkX, int chunkZ); boolean hasGenerated(int dim, int chunkX, int chunkZ); diff --git a/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java b/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java index 5a432dfde9a..f77c9cdca0f 100644 --- a/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java +++ b/src/main/java/appeng/core/worlddata/MeteorDataNameEncoder.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import com.google.common.base.Preconditions; import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; + /** * encodes data into a common name * @@ -29,6 +22,7 @@ * @since rv3 05.06.2015 */ public class MeteorDataNameEncoder { + private static final char DATA_SEPARATOR = '_'; private static final char BASE_EXTENSION_SEPARATOR = '.'; private static final String FILE_EXTENSION = "dat"; @@ -48,11 +42,8 @@ public MeteorDataNameEncoder(final int bitScale) { this(DATA_SEPARATOR, BASE_EXTENSION_SEPARATOR, FILE_EXTENSION, bitScale); } - private MeteorDataNameEncoder( - final char dataSeparator, - final char baseExtSeparator, - @Nonnull final String fileExtension, - final int bitScale) { + private MeteorDataNameEncoder(final char dataSeparator, final char baseExtSeparator, + @Nonnull final String fileExtension, final int bitScale) { Preconditions.checkNotNull(fileExtension); Preconditions.checkArgument(!fileExtension.isEmpty()); Preconditions.checkArgument(bitScale >= 0); @@ -68,7 +59,7 @@ private MeteorDataNameEncoder( * @param chunkX X coordinate of the chunk. Can be any integer * @param chunkZ Z coordinate of the chunk. Can be any integer * @return encoded file name suggestion in form of dim_x_y.dat where x and y will be - * shifted to stay conform with the vanilla chunk system + * shifted to stay conform with the vanilla chunk system * @since rv3 05.06.2015 */ public String encode(final int dimension, final int chunkX, final int chunkZ) { diff --git a/src/main/java/appeng/core/worlddata/PlayerData.java b/src/main/java/appeng/core/worlddata/PlayerData.java index 1d73c135926..de15c670d6c 100644 --- a/src/main/java/appeng/core/worlddata/PlayerData.java +++ b/src/main/java/appeng/core/worlddata/PlayerData.java @@ -1,45 +1,41 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.core.CommonHelper; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; -import com.mojang.authlib.GameProfile; import java.util.UUID; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import appeng.core.CommonHelper; + +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import com.mojang.authlib.GameProfile; + /** - * Handles the matching between UUIDs and internal IDs for security systems. - * This whole system could be replaced by storing directly the UUID, - * using a lot more traffic though + * Handles the matching between UUIDs and internal IDs for security systems. This whole system could be replaced by + * storing directly the UUID, using a lot more traffic though * * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ final class PlayerData implements IWorldPlayerData, IOnWorldStartable, IOnWorldStoppable { + private static final String LAST_PLAYER_CATEGORY = "Counters"; private static final String LAST_PLAYER_KEY = "lastPlayer"; private static final int LAST_PLAYER_DEFAULT = 0; @@ -101,16 +97,13 @@ public int getPlayerID(@Nonnull final GameProfile profile) { private int nextPlayer() { final int r = this.lastPlayerID; this.lastPlayerID++; - this.config - .get(LAST_PLAYER_CATEGORY, LAST_PLAYER_KEY, this.lastPlayerID) - .set(this.lastPlayerID); + this.config.get(LAST_PLAYER_CATEGORY, LAST_PLAYER_KEY, this.lastPlayerID).set(this.lastPlayerID); return r; } @Override public void onWorldStart() { - this.lastPlayerID = this.config - .get(LAST_PLAYER_CATEGORY, LAST_PLAYER_KEY, LAST_PLAYER_DEFAULT) + this.lastPlayerID = this.config.get(LAST_PLAYER_CATEGORY, LAST_PLAYER_KEY, LAST_PLAYER_DEFAULT) .getInt(LAST_PLAYER_DEFAULT); this.config.save(); diff --git a/src/main/java/appeng/core/worlddata/PlayerMapping.java b/src/main/java/appeng/core/worlddata/PlayerMapping.java index dd2c2521d7f..d69cd2b4d8c 100644 --- a/src/main/java/appeng/core/worlddata/PlayerMapping.java +++ b/src/main/java/appeng/core/worlddata/PlayerMapping.java @@ -1,40 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; import java.util.Map; import java.util.UUID; + import javax.annotation.Nonnull; + import net.minecraftforge.common.config.ConfigCategory; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; + /** - * Wrapper class for the player mappings. - * Will grant access to a pre initialized player map - * based on the "players" category in the settings.cfg + * Wrapper class for the player mappings. Will grant access to a pre initialized player map based on the "players" + * category in the settings.cfg */ final class PlayerMapping implements IWorldPlayerMapping { + /** - * View of player mappings, is not immutable, - * since it needs to be edited upon runtime, - * cause new players can join + * View of player mappings, is not immutable, since it needs to be edited upon runtime, cause new players can join */ private final Map mappings; diff --git a/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java b/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java index 6792a5c5579..1ad50819236 100644 --- a/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java +++ b/src/main/java/appeng/core/worlddata/PlayerMappingsInitializer.java @@ -1,47 +1,39 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.core.AELog; -import appeng.util.UUIDMatcher; import java.util.HashMap; import java.util.Map; import java.util.UUID; + import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Property; +import appeng.core.AELog; +import appeng.util.UUIDMatcher; + /** * Initializes a map of ID to UUID from the player list in the settings.cfg */ class PlayerMappingsInitializer { + /** * Internal immutable mapping */ private final Map playerMappings; /** - * Creates the initializer for the player mappings. - * The map will be filled upon construction - * and will only be filled with valid entries. - * If an invalid entry is found, an warning is printed, - * mostly due to migration problems from 1.7.2 to 1.7.10 - * where the UUIDs were introduced. + * Creates the initializer for the player mappings. The map will be filled upon construction and will only be filled + * with valid entries. If an invalid entry is found, an warning is printed, mostly due to migration problems from + * 1.7.2 to 1.7.10 where the UUIDs were introduced. * * @param playerList the category for the player list, generally extracted using the "players" tag * @param log the logger used to warn the server or user of faulty entries @@ -66,8 +58,12 @@ class PlayerMappingsInitializer { this.playerMappings.put(id, uuidString); } else { - AELog.warn("The configuration for players contained an outdated entry instead an expected UUID " - + maybeUUID + " for the player " + id + ". Please clean this up."); + AELog.warn( + "The configuration for players contained an outdated entry instead an expected UUID " + + maybeUUID + + " for the player " + + id + + ". Please clean this up."); } } } diff --git a/src/main/java/appeng/core/worlddata/SpawnData.java b/src/main/java/appeng/core/worlddata/SpawnData.java index 49c9d01fda8..bbf079a85f3 100644 --- a/src/main/java/appeng/core/worlddata/SpawnData.java +++ b/src/main/java/appeng/core/worlddata/SpawnData.java @@ -1,41 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.core.AELog; -import com.google.common.base.Preconditions; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Collection; import java.util.LinkedList; + import javax.annotation.Nonnull; + import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; +import appeng.core.AELog; + +import com.google.common.base.Preconditions; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ final class SpawnData implements IWorldSpawnData { + @Nonnull private final File spawnDirectory; @@ -70,8 +67,8 @@ public boolean hasGenerated(final int dim, final int chunkX, final int chunkZ) { } @Override - public boolean addNearByMeteorites( - final int dim, final int chunkX, final int chunkZ, final NBTTagCompound newData) { + public boolean addNearByMeteorites(final int dim, final int chunkX, final int chunkZ, + final NBTTagCompound newData) { synchronized (SpawnData.class) { final NBTTagCompound data = this.loadSpawnData(dim, chunkX, chunkZ); diff --git a/src/main/java/appeng/core/worlddata/StorageData.java b/src/main/java/appeng/core/worlddata/StorageData.java index 850874812e6..42fd8fe6889 100644 --- a/src/main/java/appeng/core/worlddata/StorageData.java +++ b/src/main/java/appeng/core/worlddata/StorageData.java @@ -1,49 +1,46 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.core.AELog; -import appeng.me.GridStorage; -import appeng.me.GridStorageSearch; -import com.google.common.base.Preconditions; import java.lang.ref.WeakReference; import java.util.Map; import java.util.WeakHashMap; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import appeng.core.AELog; +import appeng.me.GridStorage; +import appeng.me.GridStorageSearch; + +import com.google.common.base.Preconditions; + /** * @author thatsIch * @version rv3 - 30.05.2015 * @since rv3 30.05.2015 */ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOnWorldStoppable { + private static final String LAST_GRID_STORAGE_CATEGORY = "Counters"; private static final String LAST_GRID_STORAGE_KEY = "lastGridStorage"; private static final int LAST_GRID_STORAGE_DEFAULT = 0; private static final String GRID_STORAGE_CATEGORY = "gridstorage"; - private final Map> loadedStorage = - new WeakHashMap>(10); + private final Map> loadedStorage = new WeakHashMap>( + 10); private final Configuration config; private long lastGridStorage; @@ -118,8 +115,7 @@ public int getNextOrderedValue(final String name) { @Override public void onWorldStart() { final String lastString = this.config - .get(LAST_GRID_STORAGE_CATEGORY, LAST_GRID_STORAGE_KEY, LAST_GRID_STORAGE_DEFAULT) - .getString(); + .get(LAST_GRID_STORAGE_CATEGORY, LAST_GRID_STORAGE_KEY, LAST_GRID_STORAGE_DEFAULT).getString(); try { this.lastGridStorage = Long.parseLong(lastString); @@ -135,13 +131,9 @@ public void onWorldStop() { // populate new data for (final GridStorageSearch gs : this.loadedStorage.keySet()) { final GridStorage thisStorage = gs.getGridStorage().get(); - if (thisStorage != null - && thisStorage.getGrid() != null - && !thisStorage.getGrid().isEmpty()) { + if (thisStorage != null && thisStorage.getGrid() != null && !thisStorage.getGrid().isEmpty()) { final String value = thisStorage.getValue(); - this.config - .get(GRID_STORAGE_CATEGORY, String.valueOf(thisStorage.getID()), value) - .set(value); + this.config.get(GRID_STORAGE_CATEGORY, String.valueOf(thisStorage.getID()), value).set(value); } } diff --git a/src/main/java/appeng/core/worlddata/WorldData.java b/src/main/java/appeng/core/worlddata/WorldData.java index 39da7944c15..3fd2cec60e5 100644 --- a/src/main/java/appeng/core/worlddata/WorldData.java +++ b/src/main/java/appeng/core/worlddata/WorldData.java @@ -1,48 +1,44 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; -import appeng.core.AEConfig; -import appeng.services.CompassService; -import appeng.services.compass.CompassThreadFactory; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; import java.io.File; import java.util.List; import java.util.concurrent.ThreadFactory; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.config.Configuration; +import appeng.core.AEConfig; +import appeng.services.CompassService; +import appeng.services.compass.CompassThreadFactory; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; + /** * Singleton access to anything related to world-based data. *

* Data will change depending which world is loaded. Will probably not affect SMP at all since only one world is loaded, - * but SSP more, cause they play on - * different worlds. + * but SSP more, cause they play on different worlds. * * @author thatsIch * @version rv3 - 02.11.2015 * @since rv3 30.05.2015 */ public final class WorldData implements IWorldData { + private static final String AE2_DIRECTORY_NAME = "AE2"; private static final String SETTING_FILE_NAME = "settings.cfg"; private static final String SPAWNDATA_DIR_NAME = "spawndata"; diff --git a/src/main/java/appeng/crafting/CraftBranchFailure.java b/src/main/java/appeng/crafting/CraftBranchFailure.java index 7cfdb693f58..d71a7db1129 100644 --- a/src/main/java/appeng/crafting/CraftBranchFailure.java +++ b/src/main/java/appeng/crafting/CraftBranchFailure.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; diff --git a/src/main/java/appeng/crafting/CraftingCalculationFailure.java b/src/main/java/appeng/crafting/CraftingCalculationFailure.java index bf2313a3727..298380cbfb1 100644 --- a/src/main/java/appeng/crafting/CraftingCalculationFailure.java +++ b/src/main/java/appeng/crafting/CraftingCalculationFailure.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; diff --git a/src/main/java/appeng/crafting/CraftingJob.java b/src/main/java/appeng/crafting/CraftingJob.java index 8af46a8f7ca..267eb80ea32 100644 --- a/src/main/java/appeng/crafting/CraftingJob.java +++ b/src/main/java/appeng/crafting/CraftingJob.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; +import java.util.HashMap; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.networking.IGrid; @@ -36,17 +36,12 @@ import appeng.hooks.TickHandler; import appeng.me.cache.CraftingGridCache; import appeng.me.cluster.implementations.CraftingCPUCluster; + import com.google.common.base.Stopwatch; -import java.util.HashMap; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class CraftingJob implements ICraftingJob, Runnable { - private static final String LOG_CRAFTING_JOB = - "CraftingJob (%s) issued by %s requesting [%s] using %s bytes took %s ms"; + + private static final String LOG_CRAFTING_JOB = "CraftingJob (%s) issued by %s requesting [%s] using %s bytes took %s ms"; private static final String LOG_MACHINE_SOURCE_DETAILS = "Machine[object=%s, %s]"; private final MECraftingInventory original; @@ -72,11 +67,7 @@ private World wrapWorld(final World w) { return w; } - public CraftingJob( - final World w, - final IGrid grid, - final BaseActionSource actionSrc, - final IAEItemStack what, + public CraftingJob(final World w, final IGrid grid, final BaseActionSource actionSrc, final IAEItemStack what, final ICraftingCallback callback) { this.world = this.wrapWorld(w); this.output = what.copy(); @@ -152,8 +143,11 @@ public void run() { try { final Stopwatch timer = Stopwatch.createStarted(); - final MECraftingInventory craftingInventory = - new MECraftingInventory(this.original, true, false, true); + final MECraftingInventory craftingInventory = new MECraftingInventory( + this.original, + true, + false, + true); craftingInventory.ignore(this.output); this.availableCheck = new MECraftingInventory(this.original, false, false, false); @@ -286,8 +280,7 @@ public boolean simulateFor(final int milli) { while (this.running) { try { this.monitor.wait(); - } catch (final InterruptedException ignored) { - } + } catch (final InterruptedException ignored) {} } AELog.craftingDebug("main thread is now active"); @@ -346,6 +339,7 @@ public void startCrafting(MECraftingInventory storage, ICraftingCPU craftingCPUC } private static class TwoIntegers { + private final long perOp = 0; private final long times = 0; } diff --git a/src/main/java/appeng/crafting/CraftingLink.java b/src/main/java/appeng/crafting/CraftingLink.java index 895b562f979..19c08ca2d3d 100644 --- a/src/main/java/appeng/crafting/CraftingLink.java +++ b/src/main/java/appeng/crafting/CraftingLink.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.Actionable; import appeng.api.networking.crafting.ICraftingCPU; import appeng.api.networking.crafting.ICraftingLink; import appeng.api.networking.crafting.ICraftingRequester; import appeng.api.storage.data.IAEItemStack; -import net.minecraft.nbt.NBTTagCompound; public class CraftingLink implements ICraftingLink { @@ -150,9 +143,7 @@ public void setNexus(final CraftingLinkNexus n) { } public IAEItemStack injectItems(final IAEItemStack input, final Actionable mode) { - if (this.tie == null - || this.tie.getRequest() == null - || this.tie.getRequest().getRequester() == null) { + if (this.tie == null || this.tie.getRequest() == null || this.tie.getRequest().getRequester() == null) { return input; } diff --git a/src/main/java/appeng/crafting/CraftingLinkNexus.java b/src/main/java/appeng/crafting/CraftingLinkNexus.java index c72b99e6aa8..f352cea1fe8 100644 --- a/src/main/java/appeng/crafting/CraftingLinkNexus.java +++ b/src/main/java/appeng/crafting/CraftingLinkNexus.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; @@ -44,8 +36,7 @@ public boolean isDead(final IGrid g, final CraftingGridCache craftingGridCache) this.tickOfDeath++; } else { final boolean hasCpu = craftingGridCache.hasCpu(this.cpu.getCpu()); - final boolean hasMachine = - this.getRequest().getRequester().getActionableNode().getGrid() == g; + final boolean hasMachine = this.getRequest().getRequester().getActionableNode().getGrid() == g; if (hasCpu && hasMachine) { this.tickOfDeath = 0; diff --git a/src/main/java/appeng/crafting/CraftingTreeNode.java b/src/main/java/appeng/crafting/CraftingTreeNode.java index ce488ca6e3e..b68606dd53c 100644 --- a/src/main/java/appeng/crafting/CraftingTreeNode.java +++ b/src/main/java/appeng/crafting/CraftingTreeNode.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -27,11 +25,8 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.me.cluster.implementations.CraftingCPUCluster; + import com.google.common.collect.Lists; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.world.World; public class CraftingTreeNode { @@ -54,13 +49,8 @@ public class CraftingTreeNode { private boolean sim; - public CraftingTreeNode( - final ICraftingGrid cc, - final CraftingJob job, - final IAEItemStack wat, - final CraftingTreeProcess par, - final int slot, - final int depth) { + public CraftingTreeNode(final ICraftingGrid cc, final CraftingJob job, final IAEItemStack wat, + final CraftingTreeProcess par, final int slot, final int depth) { this.what = wat; this.parent = par; this.slot = slot; @@ -74,8 +64,8 @@ public CraftingTreeNode( return; // if you can emit for something, you can't make it with patterns. } - for (final ICraftingPatternDetails details : - cc.getCraftingFor(this.what, this.parent == null ? null : this.parent.details, slot, this.world)) // in + for (final ICraftingPatternDetails details : cc + .getCraftingFor(this.what, this.parent == null ? null : this.parent.details, slot, this.world)) // in // order. { if (this.parent == null || this.parent.notRecursive(details)) { @@ -237,7 +227,9 @@ IAEItemStack request(final MECraftingInventory inv, long l, final BaseActionSour pro.request(subInv, 1, src); final IAEItemStack available = subInv.extractItems( - pro.getAmountCrafted(this.what).setStackSize(l), Actionable.MODULATE, src); + pro.getAmountCrafted(this.what).setStackSize(l), + Actionable.MODULATE, + src); if (available != null) { if (!subInv.commit(src)) { @@ -308,9 +300,7 @@ void setSimulate() { } } - public void setJob( - final MECraftingInventory storage, - final CraftingCPUCluster craftingCPUCluster, + public void setJob(final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src) { for (final IAEItemStack i : this.used) { final IAEItemStack ex = storage.extractItems(i, Actionable.MODULATE, src); diff --git a/src/main/java/appeng/crafting/CraftingTreeProcess.java b/src/main/java/appeng/crafting/CraftingTreeProcess.java index 3fde4a96dcf..efa480113e6 100644 --- a/src/main/java/appeng/crafting/CraftingTreeProcess.java +++ b/src/main/java/appeng/crafting/CraftingTreeProcess.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.networking.crafting.ICraftingGrid; @@ -29,13 +30,6 @@ import appeng.me.cluster.implementations.CraftingCPUCluster; import appeng.util.Platform; import cpw.mods.fml.common.FMLCommonHandler; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; public class CraftingTreeProcess { @@ -52,12 +46,8 @@ public class CraftingTreeProcess { private boolean fullSimulation; private long bytes = 0; - public CraftingTreeProcess( - final ICraftingGrid cc, - final CraftingJob job, - final ICraftingPatternDetails details, - final CraftingTreeNode craftingTreeNode, - final int depth) { + public CraftingTreeProcess(final ICraftingGrid cc, final CraftingJob job, final ICraftingPatternDetails details, + final CraftingTreeNode craftingTreeNode, final int depth) { this.parent = craftingTreeNode; this.details = details; this.job = job; @@ -109,7 +99,8 @@ public CraftingTreeProcess( final IAEItemStack part = list[x]; if (part != null) { this.nodes.put( - new CraftingTreeNode(cc, job, part.copy(), this, x, depth + 1), part.getStackSize()); + new CraftingTreeNode(cc, job, part.copy(), this, x, depth + 1), + part.getStackSize()); } } } else { @@ -174,9 +165,10 @@ void request(final MECraftingInventory inv, final long i, final BaseActionSource ic.setInventorySlotContents(entry.getKey().getSlot(), stack.getItemStack()); } - FMLCommonHandler.instance() - .firePlayerCraftingEvent( - Platform.getPlayer((WorldServer) this.world), this.details.getOutput(ic, this.world), ic); + FMLCommonHandler.instance().firePlayerCraftingEvent( + Platform.getPlayer((WorldServer) this.world), + this.details.getOutput(ic, this.world), + ic); for (int x = 0; x < ic.getSizeInventory(); x++) { ItemStack is = ic.getStackInSlot(x); @@ -257,9 +249,8 @@ void setSimulate() { } } - void setJob( - final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src) - throws CraftBranchFailure { + void setJob(final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, + final BaseActionSource src) throws CraftBranchFailure { craftingCPUCluster.addCrafting(this.details, this.crafts); for (final CraftingTreeNode pro : this.nodes.keySet()) { diff --git a/src/main/java/appeng/crafting/CraftingWatcher.java b/src/main/java/appeng/crafting/CraftingWatcher.java index 1630bfccbe8..e99048b81ef 100644 --- a/src/main/java/appeng/crafting/CraftingWatcher.java +++ b/src/main/java/appeng/crafting/CraftingWatcher.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; -import appeng.api.networking.crafting.ICraftingWatcher; -import appeng.api.networking.crafting.ICraftingWatcherHost; -import appeng.api.storage.data.IAEStack; -import appeng.me.cache.CraftingGridCache; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; + import javax.annotation.Nonnull; +import appeng.api.networking.crafting.ICraftingWatcher; +import appeng.api.networking.crafting.ICraftingWatcherHost; +import appeng.api.storage.data.IAEStack; +import appeng.me.cache.CraftingGridCache; + /** * Maintain my interests, and a global watch list, they should always be fully synchronized. */ diff --git a/src/main/java/appeng/crafting/MECraftingInventory.java b/src/main/java/appeng/crafting/MECraftingInventory.java index 9e42fa9f1d3..182f43c662d 100644 --- a/src/main/java/appeng/crafting/MECraftingInventory.java +++ b/src/main/java/appeng/crafting/MECraftingInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.crafting; @@ -79,18 +71,13 @@ public MECraftingInventory(final MECraftingInventory parent) { this.injectedCache = null; } - this.localCache = - this.target.getAvailableItems(AEApi.instance().storage().createItemList()); + this.localCache = this.target.getAvailableItems(AEApi.instance().storage().createItemList()); this.par = parent; } - public MECraftingInventory( - final IMEMonitor target, - final BaseActionSource src, - final boolean logExtracted, - final boolean logInjections, - final boolean logMissing) { + public MECraftingInventory(final IMEMonitor target, final BaseActionSource src, + final boolean logExtracted, final boolean logInjections, final boolean logMissing) { this.target = target; this.logExtracted = logExtracted; this.logInjections = logInjections; @@ -122,11 +109,8 @@ public MECraftingInventory( this.par = null; } - public MECraftingInventory( - final IMEInventory target, - final boolean logExtracted, - final boolean logInjections, - final boolean logMissing) { + public MECraftingInventory(final IMEInventory target, final boolean logExtracted, + final boolean logInjections, final boolean logMissing) { this.target = target; this.logExtracted = logExtracted; this.logInjections = logInjections; diff --git a/src/main/java/appeng/crafting/v2/CraftingCalculations.java b/src/main/java/appeng/crafting/v2/CraftingCalculations.java index 78b0cf901ab..f73c592c5d6 100644 --- a/src/main/java/appeng/crafting/v2/CraftingCalculations.java +++ b/src/main/java/appeng/crafting/v2/CraftingCalculations.java @@ -1,32 +1,37 @@ package appeng.crafting.v2; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.ToLongBiFunction; + +import org.apache.logging.log4j.Level; + import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEStack; import appeng.core.AELog; import appeng.crafting.v2.resolvers.*; + import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.function.ToLongBiFunction; -import org.apache.logging.log4j.Level; /** * You can register additional crafting handlers here */ public class CraftingCalculations { - private static final ListMultimap>, CraftingRequestResolver> providers = - ArrayListMultimap.create(2, 8); - private static final ListMultimap>, ToLongBiFunction, Long>> - byteAmountAdjusters = ArrayListMultimap.create(2, 8); + + private static final ListMultimap>, CraftingRequestResolver> providers = ArrayListMultimap + .create(2, 8); + private static final ListMultimap>, ToLongBiFunction, Long>> byteAmountAdjusters = ArrayListMultimap + .create(2, 8); /** - * @param provider A custom resolver that can provide potential solutions ({@link CraftingTask}) to crafting requests ({@link CraftingRequest}) + * @param provider A custom resolver that can provide potential solutions ({@link CraftingTask}) to crafting + * requests ({@link CraftingRequest}) * @param stackTypeClass {@link IAEItemStack} or {@link IAEFluidStack} - * @param {@link IAEItemStack} or {@link IAEFluidStack} + * @param {@link IAEItemStack} or {@link IAEFluidStack} */ public static > void registerProvider( CraftingRequestResolver provider, Class stackTypeClass) { @@ -34,9 +39,10 @@ public static > void registerProvider( } /** - * @param adjuster A function that will be called when (re)-calculating the total byte cost of a request, takes in the request and the computed total bytes, and should return the new byte count + * @param adjuster A function that will be called when (re)-calculating the total byte cost of a request, + * takes in the request and the computed total bytes, and should return the new byte count * @param stackTypeClass {@link IAEItemStack} or {@link IAEFluidStack} - * @param {@link IAEItemStack} or {@link IAEFluidStack} + * @param {@link IAEItemStack} or {@link IAEFluidStack} */ public static > void registerByteAmountAdjuster( ToLongBiFunction, Long> adjuster, Class stackTypeClass) { @@ -47,9 +53,8 @@ public static > void registerByteAmountAdj public static > List tryResolveCraftingRequest( CraftingRequest request, CraftingContext context) { final ArrayList allTasks = new ArrayList<>(4); - for (final CraftingRequestResolver unsafeProvider : Multimaps.filterKeys( - providers, key -> key.isAssignableFrom(request.stackTypeClass)) - .values()) { + for (final CraftingRequestResolver unsafeProvider : Multimaps + .filterKeys(providers, key -> key.isAssignableFrom(request.stackTypeClass)).values()) { try { // Safety: Filtered by type using Multimaps.filterKeys final CraftingRequestResolver provider = (CraftingRequestResolver) unsafeProvider; @@ -67,13 +72,11 @@ public static > List tryReso return Collections.unmodifiableList(allTasks); } - public static > long adjustByteCost( - CraftingRequest request, long byteCost) { - for (final ToLongBiFunction, Long> unsafeAdjuster : Multimaps.filterKeys( - byteAmountAdjusters, key -> key.isAssignableFrom(request.stackTypeClass)) - .values()) { - final ToLongBiFunction, Long> adjuster = - (ToLongBiFunction, Long>) (Object) unsafeAdjuster; + public static > long adjustByteCost(CraftingRequest request, + long byteCost) { + for (final ToLongBiFunction, Long> unsafeAdjuster : Multimaps + .filterKeys(byteAmountAdjusters, key -> key.isAssignableFrom(request.stackTypeClass)).values()) { + final ToLongBiFunction, Long> adjuster = (ToLongBiFunction, Long>) (Object) unsafeAdjuster; byteCost = adjuster.applyAsLong(request, byteCost); } return byteCost; diff --git a/src/main/java/appeng/crafting/v2/CraftingContext.java b/src/main/java/appeng/crafting/v2/CraftingContext.java index d4b06cf79d2..e93a0090268 100644 --- a/src/main/java/appeng/crafting/v2/CraftingContext.java +++ b/src/main/java/appeng/crafting/v2/CraftingContext.java @@ -1,5 +1,16 @@ package appeng.crafting.v2; +import java.util.*; +import java.util.function.Supplier; + +import javax.annotation.Nonnull; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + import appeng.api.networking.IGrid; import appeng.api.networking.crafting.ICraftingGrid; import appeng.api.networking.crafting.ICraftingPatternDetails; @@ -15,24 +26,18 @@ import appeng.util.Platform; import appeng.util.item.AEItemStack; import appeng.util.item.OreListMultiMap; + import com.google.common.collect.ClassToInstanceMap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.MutableClassToInstanceMap; import cpw.mods.fml.common.FMLCommonHandler; -import java.util.*; -import java.util.function.Supplier; -import javax.annotation.Nonnull; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; /** * A bundle of state for the crafting operation like the ME grid, who requested crafting, etc. */ public final class CraftingContext { + public final World world; public final IGrid meGrid; public final ICraftingGrid craftingGrid; @@ -44,14 +49,17 @@ public final class CraftingContext { */ public final MECraftingInventory itemModel; /** - * An initially blank inventory for keeping all crafting byproduct outputs in. - * Extract from here before extracting from {@link CraftingContext#itemModel}.

- * It is separate from the item model, because at the end of the crafting calculation we must produce a list of items to extract from the system. - * When a crafting process puts those items back into the modelled inventory, and another process extract them the calculator would - * request withdrawing that byproduct directly from AE when setting up the crafting CPU. - * This would be wrong, it should assume that the item will be produced during crafting and does not need to be initially present in the system, which we achieve by separating byproducts. + * An initially blank inventory for keeping all crafting byproduct outputs in. Extract from here before extracting + * from {@link CraftingContext#itemModel}. + *

+ * It is separate from the item model, because at the end of the crafting calculation we must produce a list of + * items to extract from the system. When a crafting process puts those items back into the modelled inventory, and + * another process extract them the calculator would request withdrawing that byproduct directly from AE when + * setting up the crafting CPU. This would be wrong, it should assume that the item will be produced during crafting + * and does not need to be initially present in the system, which we achieve by separating byproducts. * - * @see appeng.crafting.v2.resolvers.ExtractItemResolver ExtractItemResolver - separates the items extracted from AE vs from byproducts for the crafting plan + * @see appeng.crafting.v2.resolvers.ExtractItemResolver ExtractItemResolver - separates the items extracted from AE + * vs from byproducts for the crafting plan */ public final MECraftingInventory byproductsInventory; /** @@ -62,6 +70,7 @@ public final class CraftingContext { public boolean wasSimulated = false; public static final class RequestInProcessing> { + public final CraftingRequest request; /** * Ordered by priority @@ -151,7 +160,8 @@ public List getFuzzyPatternsFor(@Nonnull IAEItemStack s } /** - * @return Whether the pattern has complex behavior leaving items in the crafting grid, requiring 1-by-1 simulation using a fake player + * @return Whether the pattern has complex behavior leaving items in the crafting grid, requiring 1-by-1 simulation + * using a fake player */ public boolean isPatternComplex(@Nonnull ICraftingPatternDetails pattern) { if (!pattern.isCraftable()) { @@ -172,6 +182,7 @@ public boolean isPatternComplex(@Nonnull ICraftingPatternDetails pattern) { /** * Simulates doing 1 craft with a crafting table. + * * @param inputSlots 3x3 crafting matrix contents * @return What remains in the 3x3 crafting matrix */ @@ -184,11 +195,10 @@ public IAEItemStack[] simulateComplexCrafting(IAEItemStack[] inputSlots, ICrafti simulatedWorkbench.setInventorySlotContents(i, inputSlots[i] == null ? null : inputSlots[i].getItemStack()); } if (world instanceof WorldServer) { - FMLCommonHandler.instance() - .firePlayerCraftingEvent( - Platform.getPlayer((WorldServer) world), - pattern.getOutput(simulatedWorkbench, world), - simulatedWorkbench); + FMLCommonHandler.instance().firePlayerCraftingEvent( + Platform.getPlayer((WorldServer) world), + pattern.getOutput(simulatedWorkbench, world), + simulatedWorkbench); } IAEItemStack[] output = new IAEItemStack[9]; for (int i = 0; i < output.length; i++) { @@ -258,7 +268,9 @@ public CraftingTask.State doWork() { } /** - * Gets the list of tasks that have finished executing, sorted topologically (dependencies before the tasks that require them) + * Gets the list of tasks that have finished executing, sorted topologically (dependencies before the tasks that + * require them) + * * @return An unmodifiable list of resolved tasks. */ public List getResolvedTasks() { @@ -267,6 +279,7 @@ public List getResolvedTasks() { /** * Gets all requests that have been added to the context. + * * @return An unmodifiable list of the requests. */ public List> getLiveRequests() { @@ -289,9 +302,11 @@ private boolean queueNextTaskOf(RequestInProcessing request, boolean addResol } /** - * A task to call queueNextTaskOf after a resolver gets computed to check if more resolving is needed for the same request-in-processing. + * A task to call queueNextTaskOf after a resolver gets computed to check if more resolving is needed for the same + * request-in-processing. */ private final class CheckOtherResolversTask> extends CraftingTask { + private final RequestInProcessing myRequest; public CheckOtherResolversTask(RequestInProcessing myRequest) { @@ -329,17 +344,20 @@ public void populatePlan(IItemList targetPlan) { } @Override - public void startOnCpu( - CraftingContext context, CraftingCPUCluster cpuCluster, MECraftingInventory craftingInv) { + public void startOnCpu(CraftingContext context, CraftingCPUCluster cpuCluster, + MECraftingInventory craftingInv) { // no-op } @Override public String toString() { return "CheckOtherResolversTask{" + "myRequest=" - + myRequest + ", priority=" - + priority + ", state=" - + state + '}'; + + myRequest + + ", priority=" + + priority + + ", state=" + + state + + '}'; } } } diff --git a/src/main/java/appeng/crafting/v2/CraftingJobV2.java b/src/main/java/appeng/crafting/v2/CraftingJobV2.java index 42146c23e4e..bd6803d2497 100644 --- a/src/main/java/appeng/crafting/v2/CraftingJobV2.java +++ b/src/main/java/appeng/crafting/v2/CraftingJobV2.java @@ -1,5 +1,13 @@ package appeng.crafting.v2; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import net.minecraft.world.World; + import appeng.api.networking.IGrid; import appeng.api.networking.crafting.ICraftingCPU; import appeng.api.networking.crafting.ICraftingCallback; @@ -13,16 +21,10 @@ import appeng.crafting.v2.resolvers.CraftingTask; import appeng.hooks.TickHandler; import appeng.me.cluster.implementations.CraftingCPUCluster; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import net.minecraft.world.World; /** - * A new, self-contained implementation of the crafting calculator. - * Does an iterative search on the crafting recipe tree. + * A new, self-contained implementation of the crafting calculator. Does an iterative search on the crafting recipe + * tree. */ public class CraftingJobV2 implements ICraftingJob, Future { @@ -40,12 +42,8 @@ protected enum State { protected State state = State.RUNNING; - public CraftingJobV2( - final World world, - final IGrid meGrid, - final BaseActionSource actionSource, - final IAEItemStack what, - final ICraftingCallback callback) { + public CraftingJobV2(final World world, final IGrid meGrid, final BaseActionSource actionSource, + final IAEItemStack what, final ICraftingCallback callback) { this.context = new CraftingContext(world, meGrid, actionSource); this.callback = callback; this.originalRequest = new CraftingRequest<>(what, SubstitutionMode.PRECISE_FRESH, IAEItemStack.class, true); diff --git a/src/main/java/appeng/crafting/v2/CraftingRequest.java b/src/main/java/appeng/crafting/v2/CraftingRequest.java index 03a121e033e..4a7ad458656 100644 --- a/src/main/java/appeng/crafting/v2/CraftingRequest.java +++ b/src/main/java/appeng/crafting/v2/CraftingRequest.java @@ -1,22 +1,24 @@ package appeng.crafting.v2; -import appeng.api.networking.crafting.ICraftingPatternDetails; -import appeng.api.storage.data.IAEFluidStack; -import appeng.api.storage.data.IAEItemStack; -import appeng.api.storage.data.IAEStack; -import appeng.crafting.v2.resolvers.CraftingTask; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.function.Predicate; +import appeng.api.networking.crafting.ICraftingPatternDetails; +import appeng.api.storage.data.IAEFluidStack; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.storage.data.IAEStack; +import appeng.crafting.v2.resolvers.CraftingTask; + /** * A single requested stack (item or fluid) to craft, e.g. 32x Torches * * @param Should be {@link IAEItemStack} or {@link appeng.api.storage.data.IAEFluidStack} */ public class CraftingRequest> { + public enum SubstitutionMode { /** * No substitution, do not use items from the AE system - used for user-started requests @@ -27,12 +29,14 @@ public enum SubstitutionMode { */ PRECISE, /** - * Allow fuzzy matching of ingredients, the request will have a {@link CraftingRequest#acceptableSubstituteFn} predicate to determine if the given fuzzy match item is valid + * Allow fuzzy matching of ingredients, the request will have a {@link CraftingRequest#acceptableSubstituteFn} + * predicate to determine if the given fuzzy match item is valid */ ACCEPT_FUZZY } public static class UsedResolverEntry { + public final CraftingTask task; public final IAEStack resolvedStack; @@ -64,7 +68,8 @@ public UsedResolverEntry(CraftingTask task, IAEStack resolvedStack) { private volatile long byteCost = 0; private volatile long untransformedByteCost = 0; /** - * If the item had to be simulated (there was not enough ingredients in the system to fulfill this request in any way) + * If the item had to be simulated (there was not enough ingredients in the system to fulfill this request in any + * way) */ public volatile boolean wasSimulated = false; @@ -79,12 +84,8 @@ public UsedResolverEntry(CraftingTask task, IAEStack resolvedStack) { * @param stackTypeClass Pass in {@code StackType.class}, needed for resolving types at runtime * @param acceptableSubstituteFn A predicate testing if a given item (in fuzzy mode) can fulfill the request */ - public CraftingRequest( - StackType stack, - SubstitutionMode substitutionMode, - Class stackTypeClass, - boolean allowSimulation, - Predicate acceptableSubstituteFn) { + public CraftingRequest(StackType stack, SubstitutionMode substitutionMode, Class stackTypeClass, + boolean allowSimulation, Predicate acceptableSubstituteFn) { this.stackTypeClass = stackTypeClass; this.stack = stack; this.substitutionMode = substitutionMode; @@ -102,10 +103,7 @@ public CraftingRequest( * @param substitutionMode Whether and how to allow substitutions when resolving this request * @param stackTypeClass Pass in {@code StackType.class}, needed for resolving types at runtime */ - public CraftingRequest( - StackType request, - SubstitutionMode substitutionMode, - Class stackTypeClass, + public CraftingRequest(StackType request, SubstitutionMode substitutionMode, Class stackTypeClass, boolean allowSimulation) { this(request, substitutionMode, stackTypeClass, allowSimulation, stack -> true); if (substitutionMode == SubstitutionMode.ACCEPT_FUZZY) { @@ -122,8 +120,16 @@ public long getByteCost() { @Override public String toString() { - return "CraftingRequest{request=" + stack + ", substitutionMode=" + substitutionMode + ", remainingToProcess=" - + remainingToProcess + ", byteCost=" + byteCost + ", wasSimulated=" + wasSimulated + '}'; + return "CraftingRequest{request=" + stack + + ", substitutionMode=" + + substitutionMode + + ", remainingToProcess=" + + remainingToProcess + + ", byteCost=" + + byteCost + + ", wasSimulated=" + + wasSimulated + + '}'; } /** @@ -148,7 +154,8 @@ public void fulfill(CraftingTask origin, StackType input, CraftingContext contex } /** - * Reduces the amount of items needed by {@code amount}, propagating any necessary refunds via the resolver crafting tasks. + * Reduces the amount of items needed by {@code amount}, propagating any necessary refunds via the resolver crafting + * tasks. */ public void partialRefund(CraftingContext context, long amount) { long remainingTaskAmount = amount; @@ -159,8 +166,8 @@ public void partialRefund(CraftingContext context, long amount) { if (resolver.resolvedStack.getStackSize() <= 0) { continue; } - final long taskRefunded = resolver.task.partialRefund( - context, Math.min(remainingTaskAmount, resolver.resolvedStack.getStackSize())); + final long taskRefunded = resolver.task + .partialRefund(context, Math.min(remainingTaskAmount, resolver.resolvedStack.getStackSize())); remainingTaskAmount -= taskRefunded; resolver.resolvedStack.setStackSize(resolver.resolvedStack.getStackSize() - taskRefunded); } @@ -193,6 +200,7 @@ public void fullRefund(CraftingContext context) { /** * Gets the resolved item stack. + * * @throws IllegalStateException if multiple item types were used to resolve the request */ public IAEStack getOneResolvedType() { diff --git a/src/main/java/appeng/crafting/v2/resolvers/CraftableItemResolver.java b/src/main/java/appeng/crafting/v2/resolvers/CraftableItemResolver.java index c60f4f67203..4cf16bb1a1e 100644 --- a/src/main/java/appeng/crafting/v2/resolvers/CraftableItemResolver.java +++ b/src/main/java/appeng/crafting/v2/resolvers/CraftableItemResolver.java @@ -1,5 +1,12 @@ package appeng.crafting.v2.resolvers; +import java.util.*; +import java.util.Map.Entry; + +import javax.annotation.Nonnull; + +import net.minecraft.world.World; + import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; import appeng.api.networking.crafting.ICraftingPatternDetails; @@ -12,14 +19,13 @@ import appeng.me.cluster.implementations.CraftingCPUCluster; import appeng.util.Platform; import appeng.util.item.HashBasedItemList; + import com.google.common.collect.ImmutableList; -import java.util.*; -import java.util.Map.Entry; -import javax.annotation.Nonnull; -import net.minecraft.world.World; public class CraftableItemResolver implements CraftingRequestResolver { + public static class RequestAndPerCraftAmount { + public final CraftingRequest request; public final long perCraftAmount; @@ -30,6 +36,7 @@ public RequestAndPerCraftAmount(CraftingRequest request, long perC } public static class CraftFromPatternTask extends CraftingTask { + public final ICraftingPatternDetails pattern; public final boolean allowSimulation; public final boolean isComplex; @@ -48,16 +55,13 @@ public static class CraftFromPatternTask extends CraftingTask { protected boolean requestedInputs = false; protected long totalCraftsDone = 0, fulfilledAmount = 0; /** - * If matchingOutput's stack size is greater than 1, this keeps track of how many remainder items were injected back into the context. + * If matchingOutput's stack size is greater than 1, this keeps track of how many remainder items were injected + * back into the context. */ protected long matchingOutputRemainderItems = 0; - public CraftFromPatternTask( - CraftingRequest request, - ICraftingPatternDetails pattern, - int priority, - boolean allowSimulation, - boolean isComplex) { + public CraftFromPatternTask(CraftingRequest request, ICraftingPatternDetails pattern, + int priority, boolean allowSimulation, boolean isComplex) { super(request, priority); this.pattern = pattern; this.allowSimulation = allowSimulation; @@ -137,10 +141,10 @@ public StepOutput calculateOneStep(CraftingContext context) { return new StepOutput(Collections.emptyList()); } final boolean canUseSubstitutes = pattern.canSubstitute(); - final SubstitutionMode childMode = - canUseSubstitutes ? SubstitutionMode.ACCEPT_FUZZY : SubstitutionMode.PRECISE; - final long toCraft = - Platform.ceilDiv(isComplex ? 1 : request.remainingToProcess, matchingOutput.getStackSize()); + final SubstitutionMode childMode = canUseSubstitutes ? SubstitutionMode.ACCEPT_FUZZY + : SubstitutionMode.PRECISE; + final long toCraft = Platform + .ceilDiv(isComplex ? 1 : request.remainingToProcess, matchingOutput.getStackSize()); if (requestedInputs) { // Calculate how many full recipes we could fulfill @@ -199,8 +203,8 @@ public StepOutput calculateOneStep(CraftingContext context) { for (IAEItemStack output : patternOutputs) { // add byproducts to the system if (output != matchingOutput) { - final IAEItemStack injected = - output.copy().setStackSize(Math.multiplyExact(maxCraftable, output.getStackSize())); + final IAEItemStack injected = output.copy() + .setStackSize(Math.multiplyExact(maxCraftable, output.getStackSize())); context.byproductsInventory.injectItems(injected, Actionable.MODULATE, context.actionSource); this.byproducts.put(injected.copy(), output.getStackSize()); } @@ -211,8 +215,8 @@ public StepOutput calculateOneStep(CraftingContext context) { for (RequestAndPerCraftAmount inputChildPair : childRequests.values()) { final CraftingRequest inputChild = inputChildPair.request; final long actuallyNeeded = Math.multiplyExact(inputChild.stack.getStackSize(), maxCraftable); - final long produced = - inputChild.stack.getStackSize() - Math.max(inputChild.remainingToProcess, 0); + final long produced = inputChild.stack.getStackSize() + - Math.max(inputChild.remainingToProcess, 0); if (produced > actuallyNeeded) { if (maxCraftable == 0) { inputChild.fullRefund(context); @@ -378,29 +382,37 @@ public void populatePlan(IItemList targetPlan) { } @Override - public void startOnCpu( - CraftingContext context, CraftingCPUCluster cpuCluster, MECraftingInventory craftingInv) { + public void startOnCpu(CraftingContext context, CraftingCPUCluster cpuCluster, + MECraftingInventory craftingInv) { cpuCluster.addCrafting(pattern, totalCraftsDone); } @Override public String toString() { return "CraftFromPatternTask{" + "request=" - + request + ", pattern=" - + pattern + ", allowSimulation=" - + allowSimulation + ", matchingOutput=" - + matchingOutput + ", requestedInputs=" - + requestedInputs + ", totalCraftsDone=" - + totalCraftsDone + ", priority=" - + priority + ", state=" - + state + '}'; + + request + + ", pattern=" + + pattern + + ", allowSimulation=" + + allowSimulation + + ", matchingOutput=" + + matchingOutput + + ", requestedInputs=" + + requestedInputs + + ", totalCraftsDone=" + + totalCraftsDone + + ", priority=" + + priority + + ", state=" + + state + + '}'; } } @Nonnull @Override - public List provideCraftingRequestResolvers( - @Nonnull CraftingRequest request, @Nonnull CraftingContext context) { + public List provideCraftingRequestResolvers(@Nonnull CraftingRequest request, + @Nonnull CraftingContext context) { final ImmutableList.Builder tasks = new ImmutableList.Builder<>(); final Set denyList = request.patternParents; final List patterns = new ArrayList<>(context.getPrecisePatternsFor(request.stack)); @@ -408,11 +420,10 @@ public List provideCraftingRequestResolvers( patterns.sort(Comparator.comparing(ICraftingPatternDetails::getPriority).reversed()); // If fuzzy patterns are allowed, if (request.substitutionMode == SubstitutionMode.ACCEPT_FUZZY) { - final List fuzzyPatterns = - new ArrayList<>(context.getFuzzyPatternsFor(request.stack)); + final List fuzzyPatterns = new ArrayList<>( + context.getFuzzyPatternsFor(request.stack)); fuzzyPatterns.removeAll(denyList); - fuzzyPatterns.sort( - Comparator.comparing(ICraftingPatternDetails::getPriority).reversed()); + fuzzyPatterns.sort(Comparator.comparing(ICraftingPatternDetails::getPriority).reversed()); patterns.addAll(fuzzyPatterns); } int priority = CraftingTask.PRIORITY_CRAFT_OFFSET + patterns.size() - 1; diff --git a/src/main/java/appeng/crafting/v2/resolvers/CraftingRequestResolver.java b/src/main/java/appeng/crafting/v2/resolvers/CraftingRequestResolver.java index 0b7fe2e2195..68c3c9eee91 100644 --- a/src/main/java/appeng/crafting/v2/resolvers/CraftingRequestResolver.java +++ b/src/main/java/appeng/crafting/v2/resolvers/CraftingRequestResolver.java @@ -1,28 +1,33 @@ package appeng.crafting.v2.resolvers; +import java.util.List; + +import javax.annotation.Nonnull; + import appeng.api.storage.data.IAEStack; import appeng.crafting.v2.CraftingContext; import appeng.crafting.v2.CraftingRequest; -import java.util.List; -import javax.annotation.Nonnull; /** * See {@link CraftingRequestResolver#provideCraftingRequestResolvers(CraftingRequest, CraftingContext)} */ @FunctionalInterface public interface CraftingRequestResolver> { + /** - * Provides a list of potential solutions for doing one crafting step, the calculator will try the solutions ordered by priority in turn. - * For example, given a plank item, it can give tasks for log->plank crafting - * Higher priority = will be used first, Integer.MAX_VALUE priority is used for items already in the system.

+ * Provides a list of potential solutions for doing one crafting step, the calculator will try the solutions ordered + * by priority in turn. For example, given a plank item, it can give tasks for log->plank crafting Higher priority = + * will be used first, Integer.MAX_VALUE priority is used for items already in the system. + *

*

- * It should reduce the {@link CraftingRequest#remainingToProcess} value by the number of items immediately available. + * It should reduce the {@link CraftingRequest#remainingToProcess} value by the number of items immediately + * available. * * @param request The request being resolved * @param context The ME system, job queue and pattern caches used to calculate potential resolutions * @return The list of potential solutions - return an empty list if none are available */ @Nonnull - List provideCraftingRequestResolvers( - @Nonnull CraftingRequest request, @Nonnull CraftingContext context); + List provideCraftingRequestResolvers(@Nonnull CraftingRequest request, + @Nonnull CraftingContext context); } diff --git a/src/main/java/appeng/crafting/v2/resolvers/CraftingTask.java b/src/main/java/appeng/crafting/v2/resolvers/CraftingTask.java index 939e68b49eb..dd051ad8891 100644 --- a/src/main/java/appeng/crafting/v2/resolvers/CraftingTask.java +++ b/src/main/java/appeng/crafting/v2/resolvers/CraftingTask.java @@ -1,5 +1,11 @@ package appeng.crafting.v2.resolvers; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import javax.annotation.Nonnull; + import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; @@ -7,23 +13,22 @@ import appeng.crafting.v2.CraftingContext; import appeng.crafting.v2.CraftingRequest; import appeng.me.cluster.implementations.CraftingCPUCluster; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import javax.annotation.Nonnull; /** - * A single action that can be performed to solve a {@link CraftingRequest}. - * Can have multiple inputs and outputs, resolved at runtime during crafting resolution (e.g. for handling substitutions). + * A single action that can be performed to solve a {@link CraftingRequest}. Can have multiple inputs and outputs, + * resolved at runtime during crafting resolution (e.g. for handling substitutions). */ public abstract class CraftingTask> { + public enum State { + NEEDS_MORE_WORK(true), SUCCESS(false), /** * This aborts the entire crafting operation, use only if absolutely necessary */ FAILURE(false); + public final boolean needsMoreWork; State(boolean needsMoreWork) { @@ -32,6 +37,7 @@ public enum State { } public static final class StepOutput { + @Nonnull public final List> extraInputsRequired; @@ -59,8 +65,8 @@ public StepOutput(@Nonnull List> extraInputsRequired) { /** * Called when it's this task's turn for computation. * - * @return A {@link StepOutput} instance describing progress made by the task in this call. - * If success or failure, the task should have cleaned up after itself - cancel won't be called. + * @return A {@link StepOutput} instance describing progress made by the task in this call. If success or failure, + * the task should have cleaned up after itself - cancel won't be called. */ public abstract StepOutput calculateOneStep(CraftingContext context); @@ -73,8 +79,8 @@ public StepOutput(@Nonnull List> extraInputsRequired) { public abstract void populatePlan(IItemList targetPlan); - public abstract void startOnCpu( - CraftingContext context, CraftingCPUCluster cpuCluster, MECraftingInventory craftingInv); + public abstract void startOnCpu(CraftingContext context, CraftingCPUCluster cpuCluster, + MECraftingInventory craftingInv); protected CraftingTask(CraftingRequest request, int priority) { this.request = request; diff --git a/src/main/java/appeng/crafting/v2/resolvers/EmitableItemResolver.java b/src/main/java/appeng/crafting/v2/resolvers/EmitableItemResolver.java index a13cd7d6d16..e8a9c4931ee 100644 --- a/src/main/java/appeng/crafting/v2/resolvers/EmitableItemResolver.java +++ b/src/main/java/appeng/crafting/v2/resolvers/EmitableItemResolver.java @@ -1,22 +1,24 @@ package appeng.crafting.v2.resolvers; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.crafting.MECraftingInventory; import appeng.crafting.v2.CraftingContext; import appeng.crafting.v2.CraftingRequest; import appeng.me.cluster.implementations.CraftingCPUCluster; -import java.util.Collections; -import java.util.List; -import javax.annotation.Nonnull; public class EmitableItemResolver implements CraftingRequestResolver { + public static class EmitItemTask extends CraftingTask { public EmitItemTask(CraftingRequest request) { - super( - request, - CraftingTask.PRIORITY_CRAFTING_EMITTER); // conjure items for calculations out of thin air as a last + super(request, CraftingTask.PRIORITY_CRAFTING_EMITTER); // conjure items for calculations out of thin air as + // a last } @Override @@ -48,8 +50,8 @@ public void populatePlan(IItemList targetPlan) { } @Override - public void startOnCpu( - CraftingContext context, CraftingCPUCluster cpuCluster, MECraftingInventory craftingInv) { + public void startOnCpu(CraftingContext context, CraftingCPUCluster cpuCluster, + MECraftingInventory craftingInv) { cpuCluster.addEmitable(this.request.stack.copy()); } @@ -61,8 +63,8 @@ public String toString() { @Nonnull @Override - public List provideCraftingRequestResolvers( - @Nonnull CraftingRequest request, @Nonnull CraftingContext context) { + public List provideCraftingRequestResolvers(@Nonnull CraftingRequest request, + @Nonnull CraftingContext context) { if (context.craftingGrid.canEmitFor(request.stack)) { return Collections.singletonList(new EmitItemTask(request)); } else { diff --git a/src/main/java/appeng/crafting/v2/resolvers/ExtractItemResolver.java b/src/main/java/appeng/crafting/v2/resolvers/ExtractItemResolver.java index cc4b78f91f5..6f9e2ed9a3e 100644 --- a/src/main/java/appeng/crafting/v2/resolvers/ExtractItemResolver.java +++ b/src/main/java/appeng/crafting/v2/resolvers/ExtractItemResolver.java @@ -1,5 +1,9 @@ package appeng.crafting.v2.resolvers; +import java.util.*; + +import javax.annotation.Nonnull; + import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; import appeng.api.storage.data.IAEItemStack; @@ -9,11 +13,11 @@ import appeng.crafting.v2.CraftingContext; import appeng.crafting.v2.CraftingRequest; import appeng.me.cluster.implementations.CraftingCPUCluster; -import java.util.*; -import javax.annotation.Nonnull; public class ExtractItemResolver implements CraftingRequestResolver { + public static class ExtractItemTask extends CraftingTask { + public final List removedFromSystem = new ArrayList<>(); public final List removedFromByproducts = new ArrayList<>(); @@ -46,7 +50,9 @@ private void extractExact(CraftingContext context, MECraftingInventory source, L if (exactMatching != null) { final long requestSize = Math.min(request.remainingToProcess, exactMatching.getStackSize()); final IAEItemStack extracted = source.extractItems( - exactMatching.copy().setStackSize(requestSize), Actionable.MODULATE, context.actionSource); + exactMatching.copy().setStackSize(requestSize), + Actionable.MODULATE, + context.actionSource); if (extracted != null && extracted.getStackSize() > 0) { request.fulfill(this, extracted, context); removedList.add(extracted.copy()); @@ -55,8 +61,8 @@ private void extractExact(CraftingContext context, MECraftingInventory source, L } private void extractFuzzy(CraftingContext context, MECraftingInventory source, List removedList) { - Collection fuzzyMatching = - source.getItemList().findFuzzy(request.stack, FuzzyMode.IGNORE_ALL); + Collection fuzzyMatching = source.getItemList() + .findFuzzy(request.stack, FuzzyMode.IGNORE_ALL); for (final IAEItemStack candidate : fuzzyMatching) { if (candidate == null) { continue; @@ -64,7 +70,9 @@ private void extractFuzzy(CraftingContext context, MECraftingInventory source, L if (request.acceptableSubstituteFn.test(candidate)) { final long requestSize = Math.min(request.remainingToProcess, candidate.getStackSize()); final IAEItemStack extracted = source.extractItems( - candidate.copy().setStackSize(requestSize), Actionable.MODULATE, context.actionSource); + candidate.copy().setStackSize(requestSize), + Actionable.MODULATE, + context.actionSource); if (extracted == null || extracted.getStackSize() <= 0) { continue; } @@ -87,15 +95,17 @@ public long partialRefund(CraftingContext context, long amount) { return originalAmount - amount; } - private long partialRefundFrom( - CraftingContext context, long amount, List source, MECraftingInventory target) { + private long partialRefundFrom(CraftingContext context, long amount, List source, + MECraftingInventory target) { final Iterator removedIt = source.iterator(); while (removedIt.hasNext() && amount > 0) { final IAEItemStack available = removedIt.next(); final long availAmount = available.getStackSize(); if (availAmount > amount) { target.injectItems( - available.copy().setStackSize(amount), Actionable.MODULATE, context.actionSource); + available.copy().setStackSize(amount), + Actionable.MODULATE, + context.actionSource); available.setStackSize(availAmount - amount); amount = 0; } else { @@ -126,8 +136,8 @@ public void populatePlan(IItemList targetPlan) { } @Override - public void startOnCpu( - CraftingContext context, CraftingCPUCluster cpuCluster, MECraftingInventory craftingInv) { + public void startOnCpu(CraftingContext context, CraftingCPUCluster cpuCluster, + MECraftingInventory craftingInv) { for (IAEItemStack stack : removedFromSystem) { if (stack.getStackSize() > 0) { IAEItemStack extracted = craftingInv.extractItems(stack, Actionable.MODULATE, context.actionSource); @@ -142,17 +152,21 @@ public void startOnCpu( @Override public String toString() { return "ExtractItemTask{" + "request=" - + request + ", removedFromSystem=" - + removedFromSystem + ", priority=" - + priority + ", state=" - + state + '}'; + + request + + ", removedFromSystem=" + + removedFromSystem + + ", priority=" + + priority + + ", state=" + + state + + '}'; } } @Nonnull @Override - public List provideCraftingRequestResolvers( - @Nonnull CraftingRequest request, @Nonnull CraftingContext context) { + public List provideCraftingRequestResolvers(@Nonnull CraftingRequest request, + @Nonnull CraftingContext context) { if (request.substitutionMode == CraftingRequest.SubstitutionMode.PRECISE_FRESH) { return Collections.emptyList(); } else { diff --git a/src/main/java/appeng/crafting/v2/resolvers/SimulateMissingItemResolver.java b/src/main/java/appeng/crafting/v2/resolvers/SimulateMissingItemResolver.java index 6e9ce6e5b58..6ab7c2ae3b2 100644 --- a/src/main/java/appeng/crafting/v2/resolvers/SimulateMissingItemResolver.java +++ b/src/main/java/appeng/crafting/v2/resolvers/SimulateMissingItemResolver.java @@ -1,5 +1,10 @@ package appeng.crafting.v2.resolvers; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; @@ -7,17 +12,15 @@ import appeng.crafting.v2.CraftingContext; import appeng.crafting.v2.CraftingRequest; import appeng.me.cluster.implementations.CraftingCPUCluster; -import java.util.Collections; -import java.util.List; -import javax.annotation.Nonnull; public class SimulateMissingItemResolver> implements CraftingRequestResolver { + public static class ConjureItemTask> extends CraftingTask { + public ConjureItemTask(CraftingRequest request) { - super( - request, - CraftingTask.PRIORITY_SIMULATE); // conjure items for calculations out of thin air as a last resort + super(request, CraftingTask.PRIORITY_SIMULATE); // conjure items for calculations out of thin air as a last + // resort } @Override @@ -52,8 +55,8 @@ public void populatePlan(IItemList targetPlan) { } @Override - public void startOnCpu( - CraftingContext context, CraftingCPUCluster cpuCluster, MECraftingInventory craftingInv) { + public void startOnCpu(CraftingContext context, CraftingCPUCluster cpuCluster, + MECraftingInventory craftingInv) { throw new IllegalStateException("Trying to start crafting a schedule with simulated items"); } @@ -65,8 +68,8 @@ public String toString() { @Nonnull @Override - public List provideCraftingRequestResolvers( - @Nonnull CraftingRequest request, @Nonnull CraftingContext context) { + public List provideCraftingRequestResolvers(@Nonnull CraftingRequest request, + @Nonnull CraftingContext context) { if (request.allowSimulation) { return Collections.singletonList(new ConjureItemTask<>(request)); } else { diff --git a/src/main/java/appeng/debug/BlockChunkloader.java b/src/main/java/appeng/debug/BlockChunkloader.java index 8ed835ac2df..1657cb57ecc 100644 --- a/src/main/java/appeng/debug/BlockChunkloader.java +++ b/src/main/java/appeng/debug/BlockChunkloader.java @@ -1,28 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.block.AEBaseTileBlock; -import appeng.core.AppEng; -import appeng.core.features.AEFeature; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.world.World; @@ -30,6 +20,10 @@ import net.minecraftforge.common.ForgeChunkManager.LoadingCallback; import net.minecraftforge.common.ForgeChunkManager.Ticket; +import appeng.block.AEBaseTileBlock; +import appeng.core.AppEng; +import appeng.core.features.AEFeature; + public class BlockChunkloader extends AEBaseTileBlock implements LoadingCallback { public BlockChunkloader() { diff --git a/src/main/java/appeng/debug/BlockCubeGenerator.java b/src/main/java/appeng/debug/BlockCubeGenerator.java index 1f2b7c993b3..24676b67640 100644 --- a/src/main/java/appeng/debug/BlockCubeGenerator.java +++ b/src/main/java/appeng/debug/BlockCubeGenerator.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; + public class BlockCubeGenerator extends AEBaseTileBlock { public BlockCubeGenerator() { @@ -35,16 +29,8 @@ public BlockCubeGenerator() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { final TileCubeGenerator tcg = this.getTileEntity(w, x, y, z); if (tcg != null) { tcg.click(player); diff --git a/src/main/java/appeng/debug/BlockItemGen.java b/src/main/java/appeng/debug/BlockItemGen.java index 9e929620872..58cc35c2ed7 100644 --- a/src/main/java/appeng/debug/BlockItemGen.java +++ b/src/main/java/appeng/debug/BlockItemGen.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; + public class BlockItemGen extends AEBaseTileBlock { public BlockItemGen() { diff --git a/src/main/java/appeng/debug/BlockPhantomNode.java b/src/main/java/appeng/debug/BlockPhantomNode.java index b12ce6df1ae..1fed3f84cd1 100644 --- a/src/main/java/appeng/debug/BlockPhantomNode.java +++ b/src/main/java/appeng/debug/BlockPhantomNode.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.block.AEBaseTileBlock; -import appeng.core.features.AEFeature; import java.util.EnumSet; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import appeng.block.AEBaseTileBlock; +import appeng.core.features.AEFeature; + public class BlockPhantomNode extends AEBaseTileBlock { public BlockPhantomNode() { @@ -35,16 +29,8 @@ public BlockPhantomNode() { } @Override - public boolean onActivated( - final World w, - final int x, - final int y, - final int z, - final EntityPlayer player, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onActivated(final World w, final int x, final int y, final int z, final EntityPlayer player, + final int side, final float hitX, final float hitY, final float hitZ) { final TilePhantomNode tpn = this.getTileEntity(w, x, y, z); tpn.triggerCrashMode(); return true; diff --git a/src/main/java/appeng/debug/TileChunkLoader.java b/src/main/java/appeng/debug/TileChunkLoader.java index 4dfd38b15b9..0b52628b593 100644 --- a/src/main/java/appeng/debug/TileChunkLoader.java +++ b/src/main/java/appeng/debug/TileChunkLoader.java @@ -1,31 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.core.AELog; -import appeng.core.AppEng; -import appeng.tile.AEBaseTile; -import appeng.tile.TileEvent; -import appeng.tile.events.TileEventType; -import appeng.util.Platform; -import cpw.mods.fml.common.FMLCommonHandler; import java.util.List; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; @@ -34,6 +20,14 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket; import net.minecraftforge.common.ForgeChunkManager.Type; +import appeng.core.AELog; +import appeng.core.AppEng; +import appeng.tile.AEBaseTile; +import appeng.tile.TileEvent; +import appeng.tile.events.TileEventType; +import appeng.util.Platform; +import cpw.mods.fml.common.FMLCommonHandler; + public class TileChunkLoader extends AEBaseTile { private boolean requestTicket = true; diff --git a/src/main/java/appeng/debug/TileCubeGenerator.java b/src/main/java/appeng/debug/TileCubeGenerator.java index bc866807f32..2fc779b1023 100644 --- a/src/main/java/appeng/debug/TileCubeGenerator.java +++ b/src/main/java/appeng/debug/TileCubeGenerator.java @@ -1,34 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.core.CommonHelper; -import appeng.tile.AEBaseTile; -import appeng.tile.TileEvent; -import appeng.tile.events.TileEventType; -import appeng.util.Platform; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraftforge.common.util.ForgeDirection; +import appeng.core.CommonHelper; +import appeng.tile.AEBaseTile; +import appeng.tile.TileEvent; +import appeng.tile.events.TileEventType; +import appeng.util.Platform; + public class TileCubeGenerator extends AEBaseTile { private int size = 3; diff --git a/src/main/java/appeng/debug/TileItemGen.java b/src/main/java/appeng/debug/TileItemGen.java index eff4ebf48be..e95800b2add 100644 --- a/src/main/java/appeng/debug/TileItemGen.java +++ b/src/main/java/appeng/debug/TileItemGen.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.tile.AEBaseTile; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import appeng.tile.AEBaseTile; + public class TileItemGen extends AEBaseTile implements IInventory { private static final Queue POSSIBLE_ITEMS = new LinkedList(); diff --git a/src/main/java/appeng/debug/TilePhantomNode.java b/src/main/java/appeng/debug/TilePhantomNode.java index aabf4c4925c..23f741d053e 100644 --- a/src/main/java/appeng/debug/TilePhantomNode.java +++ b/src/main/java/appeng/debug/TilePhantomNode.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; +import java.util.EnumSet; + +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridNode; import appeng.me.helpers.AENetworkProxy; import appeng.tile.grid.AENetworkTile; -import java.util.EnumSet; -import net.minecraftforge.common.util.ForgeDirection; public class TilePhantomNode extends AENetworkTile { diff --git a/src/main/java/appeng/debug/ToolDebugCard.java b/src/main/java/appeng/debug/ToolDebugCard.java index 36ca64eefbf..a7a83df196e 100644 --- a/src/main/java/appeng/debug/ToolDebugCard.java +++ b/src/main/java/appeng/debug/ToolDebugCard.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; + import appeng.api.networking.IGridConnection; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -37,35 +42,16 @@ import appeng.parts.p2p.PartP2PTunnel; import appeng.tile.networking.TileController; import appeng.util.Platform; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ForgeEventFactory; public class ToolDebugCard extends AEBaseItem { + public ToolDebugCard() { this.setFeature(EnumSet.of(AEFeature.UnsupportedDeveloperTools, AEFeature.Creative)); } @Override - public boolean onItemUseFirst( - final ItemStack stack, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true; if (Platform.isClient()) { @@ -103,8 +89,7 @@ public boolean onItemUseFirst( final int maxLength = 10000; int length = 0; - outer: - while (!next.isEmpty()) { + outer: while (!next.isEmpty()) { final Iterable current = next; next = new HashSet(); diff --git a/src/main/java/appeng/debug/ToolEraser.java b/src/main/java/appeng/debug/ToolEraser.java index 72774ec5be0..3151c0c996d 100644 --- a/src/main/java/appeng/debug/ToolEraser.java +++ b/src/main/java/appeng/debug/ToolEraser.java @@ -1,33 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.api.util.WorldCoord; -import appeng.client.texture.MissingIcon; -import appeng.core.AELog; -import appeng.core.features.AEFeature; -import appeng.items.AEBaseItem; -import appeng.util.Platform; import java.util.Collection; import java.util.EnumSet; import java.util.LinkedList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -36,6 +23,13 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import appeng.api.util.WorldCoord; +import appeng.client.texture.MissingIcon; +import appeng.core.AELog; +import appeng.core.features.AEFeature; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + public class ToolEraser extends AEBaseItem { private static final int BLOCK_ERASE_LIMIT = 90000; @@ -50,17 +44,8 @@ public void registerIcons(final IIconRegister par1IconRegister) { } @Override - public boolean onItemUseFirst( - final ItemStack stack, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true; if (Platform.isClient()) { @@ -70,10 +55,10 @@ public boolean onItemUseFirst( final Block blk = world.getBlock(x, y, z); final int meta = world.getBlockMetadata(x, y, z); - if (blk != null - && ForgeEventFactory.onPlayerInteract( - player, PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, x, y, z, side, world) - .isCanceled()) return true; + if (blk != null && ForgeEventFactory + .onPlayerInteract(player, PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, x, y, z, side, world) + .isCanceled()) + return true; List next = new LinkedList(); next.add(new WorldCoord(x, y, z)); @@ -106,8 +91,8 @@ public boolean onItemUseFirst( return true; } - private void wrappedAdd( - final World world, final int i, final int y, final int z, final Collection next) { + private void wrappedAdd(final World world, final int i, final int y, final int z, + final Collection next) { next.add(new WorldCoord(i, y, z)); } } diff --git a/src/main/java/appeng/debug/ToolMeteoritePlacer.java b/src/main/java/appeng/debug/ToolMeteoritePlacer.java index 5d8c9157a6f..04cd13571e6 100644 --- a/src/main/java/appeng/debug/ToolMeteoritePlacer.java +++ b/src/main/java/appeng/debug/ToolMeteoritePlacer.java @@ -1,30 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.client.texture.MissingIcon; -import appeng.core.features.AEFeature; -import appeng.items.AEBaseItem; -import appeng.util.Platform; -import appeng.worldgen.MeteoritePlacer; -import appeng.worldgen.meteorite.StandardWorld; import java.util.EnumSet; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -32,7 +19,15 @@ import net.minecraft.world.World; import net.minecraftforge.event.ForgeEventFactory; +import appeng.client.texture.MissingIcon; +import appeng.core.features.AEFeature; +import appeng.items.AEBaseItem; +import appeng.util.Platform; +import appeng.worldgen.MeteoritePlacer; +import appeng.worldgen.meteorite.StandardWorld; + public class ToolMeteoritePlacer extends AEBaseItem { + public ToolMeteoritePlacer() { this.setFeature(EnumSet.of(AEFeature.UnsupportedDeveloperTools, AEFeature.Creative)); } @@ -43,17 +38,8 @@ public void registerIcons(final IIconRegister par1IconRegister) { } @Override - public boolean onItemUseFirst( - final ItemStack stack, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true; if (Platform.isClient()) { diff --git a/src/main/java/appeng/debug/ToolReplicatorCard.java b/src/main/java/appeng/debug/ToolReplicatorCard.java index 36119da720a..6d9fb719a31 100644 --- a/src/main/java/appeng/debug/ToolReplicatorCard.java +++ b/src/main/java/appeng/debug/ToolReplicatorCard.java @@ -1,32 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.debug; -import appeng.api.networking.IGrid; -import appeng.api.networking.IGridHost; -import appeng.api.networking.IGridNode; -import appeng.api.networking.spatial.ISpatialCache; -import appeng.api.util.DimensionalCoord; -import appeng.core.features.AEFeature; -import appeng.items.AEBaseItem; -import appeng.util.Platform; import java.util.EnumSet; + import net.minecraft.block.Block; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; @@ -39,23 +24,24 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.ForgeEventFactory; +import appeng.api.networking.IGrid; +import appeng.api.networking.IGridHost; +import appeng.api.networking.IGridNode; +import appeng.api.networking.spatial.ISpatialCache; +import appeng.api.util.DimensionalCoord; +import appeng.core.features.AEFeature; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + public class ToolReplicatorCard extends AEBaseItem { + public ToolReplicatorCard() { this.setFeature(EnumSet.of(AEFeature.UnsupportedDeveloperTools, AEFeature.Creative)); } @Override - public boolean onItemUseFirst( - final ItemStack stack, - final EntityPlayer player, - final World world, - int x, - int y, - int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, int x, int y, + int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true; if (Platform.isClient()) { @@ -122,8 +108,8 @@ public boolean onItemUseFirst( world.setBlock(i + rel_x, j + rel_y, k + rel_z, blk, meta, 4); if (blk != null && blk.hasTileEntity(meta)) { - final TileEntity ote = - src_w.getTileEntity(min_x + i, min_y + j, min_z + k); + final TileEntity ote = src_w + .getTileEntity(min_x + i, min_y + j, min_z + k); final TileEntity nte = blk.createTileEntity(world, meta); final NBTTagCompound data = new NBTTagCompound(); ote.writeToNBT(data); diff --git a/src/main/java/appeng/entity/AEBaseEntityItem.java b/src/main/java/appeng/entity/AEBaseEntityItem.java index 227d558887f..e545c186c4b 100644 --- a/src/main/java/appeng/entity/AEBaseEntityItem.java +++ b/src/main/java/appeng/entity/AEBaseEntityItem.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; @@ -26,6 +19,7 @@ import net.minecraft.world.World; public abstract class AEBaseEntityItem extends EntityItem { + public AEBaseEntityItem(final World world) { super(world); } diff --git a/src/main/java/appeng/entity/EntityChargedQuartz.java b/src/main/java/appeng/entity/EntityChargedQuartz.java index c543fbc6375..530efa00a3f 100644 --- a/src/main/java/appeng/entity/EntityChargedQuartz.java +++ b/src/main/java/appeng/entity/EntityChargedQuartz.java @@ -1,32 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; -import appeng.api.AEApi; -import appeng.api.definitions.IMaterials; -import appeng.client.EffectType; -import appeng.core.AEConfig; -import appeng.core.CommonHelper; -import appeng.core.features.AEFeature; -import appeng.helpers.Reflected; -import appeng.util.Platform; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -36,6 +21,15 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.api.definitions.IMaterials; +import appeng.client.EffectType; +import appeng.core.AEConfig; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; +import appeng.helpers.Reflected; +import appeng.util.Platform; + public final class EntityChargedQuartz extends AEBaseEntityItem { private int delay = 0; @@ -87,7 +81,12 @@ private boolean transform() { if (materials.certusQuartzCrystalCharged().isSameAs(item)) { final AxisAlignedBB region = AxisAlignedBB.getBoundingBox( - this.posX - 1, this.posY - 1, this.posZ - 1, this.posX + 1, this.posY + 1, this.posZ + 1); + this.posX - 1, + this.posY - 1, + this.posZ - 1, + this.posX + 1, + this.posY + 1, + this.posZ + 1); final List l = this.getCheckedEntitiesWithinAABBExcludingEntity(region); EntityItem redstone = null; @@ -125,10 +124,13 @@ private boolean transform() { netherQuartz.setDead(); } - for (final ItemStack fluixCrystalStack : - materials.fluixCrystal().maybeStack(2).asSet()) { - final EntityItem entity = - new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, fluixCrystalStack); + for (final ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack(2).asSet()) { + final EntityItem entity = new EntityItem( + this.worldObj, + this.posX, + this.posY, + this.posZ, + fluixCrystalStack); this.worldObj.spawnEntityInWorld(entity); } diff --git a/src/main/java/appeng/entity/EntityFloatingItem.java b/src/main/java/appeng/entity/EntityFloatingItem.java index adc13243087..5561dae2753 100644 --- a/src/main/java/appeng/entity/EntityFloatingItem.java +++ b/src/main/java/appeng/entity/EntityFloatingItem.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; @@ -30,12 +22,7 @@ public final class EntityFloatingItem extends EntityItem { private int superDeath = 0; private float progress = 0; - public EntityFloatingItem( - final Entity parent, - final World world, - final double x, - final double y, - final double z, + public EntityFloatingItem(final Entity parent, final World world, final double x, final double y, final double z, final ItemStack stack) { super(world, x, y, z, stack); this.motionX = this.motionY = this.motionZ = 0.0d; diff --git a/src/main/java/appeng/entity/EntityGrowingCrystal.java b/src/main/java/appeng/entity/EntityGrowingCrystal.java index 39b387febbe..7e65be88e39 100644 --- a/src/main/java/appeng/entity/EntityGrowingCrystal.java +++ b/src/main/java/appeng/entity/EntityGrowingCrystal.java @@ -1,30 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; -import appeng.api.implementations.items.IGrowableCrystal; -import appeng.api.implementations.tiles.ICrystalGrowthAccelerator; -import appeng.client.EffectType; -import appeng.core.AEConfig; -import appeng.core.CommonHelper; -import appeng.core.features.AEFeature; -import appeng.util.Platform; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.item.EntityItem; @@ -34,6 +19,14 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import appeng.api.implementations.items.IGrowableCrystal; +import appeng.api.implementations.tiles.ICrystalGrowthAccelerator; +import appeng.client.EffectType; +import appeng.core.AEConfig; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; +import appeng.util.Platform; + public final class EntityGrowingCrystal extends EntityItem { private int progress_1000 = 0; @@ -116,7 +109,12 @@ public void onUpdate() { if (this.progress_1000 >= len) { this.progress_1000 = 0; CommonHelper.proxy.spawnEffect( - EffectType.Vibrant, this.worldObj, this.posX, this.posY + 0.2, this.posZ, null); + EffectType.Vibrant, + this.worldObj, + this.posX, + this.posY + 0.2, + this.posZ, + null); } } else { if (this.progress_1000 > 1000) { diff --git a/src/main/java/appeng/entity/EntityIds.java b/src/main/java/appeng/entity/EntityIds.java index d232a6066ca..557237a0f96 100644 --- a/src/main/java/appeng/entity/EntityIds.java +++ b/src/main/java/appeng/entity/EntityIds.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; @@ -21,6 +13,7 @@ import net.minecraft.entity.Entity; public final class EntityIds { + private static final int TINY_TNT = 10; private static final int SINGULARITY = 11; private static final int CHARGED_QUARTZ = 12; diff --git a/src/main/java/appeng/entity/EntitySingularity.java b/src/main/java/appeng/entity/EntitySingularity.java index 82f03f18230..b7307ce8d13 100644 --- a/src/main/java/appeng/entity/EntitySingularity.java +++ b/src/main/java/appeng/entity/EntitySingularity.java @@ -1,31 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; -import appeng.api.AEApi; -import appeng.api.definitions.IMaterials; -import appeng.core.AEConfig; -import appeng.core.features.AEFeature; -import appeng.helpers.Reflected; -import appeng.util.Platform; import java.util.Date; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; @@ -35,6 +22,13 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.AEApi; +import appeng.api.definitions.IMaterials; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; +import appeng.helpers.Reflected; +import appeng.util.Platform; + public final class EntitySingularity extends AEBaseEntityItem { private static int randTickSeed = 0; @@ -73,7 +67,12 @@ private void doExplosion() { if (materials.singularity().isSameAs(item)) { final AxisAlignedBB region = AxisAlignedBB.getBoundingBox( - this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4); + this.posX - 4, + this.posY - 4, + this.posZ - 4, + this.posX + 4, + this.posY + 4, + this.posZ + 4); final List l = this.getCheckedEntitiesWithinAABBExcludingEntity(region); for (final Entity e : l) { @@ -105,15 +104,19 @@ private void doExplosion() { e.setDead(); } - for (final ItemStack singularityStack : - materials.qESingularity().maybeStack(2).asSet()) { + for (final ItemStack singularityStack : materials.qESingularity().maybeStack(2) + .asSet()) { final NBTTagCompound cmp = Platform.openNbtData(singularityStack); cmp.setLong("freq", (new Date()).getTime() * 100 + (randTickSeed) % 100); randTickSeed++; item.stackSize--; final EntitySingularity entity = new EntitySingularity( - this.worldObj, this.posX, this.posY, this.posZ, singularityStack); + this.worldObj, + this.posX, + this.posY, + this.posZ, + singularityStack); this.worldObj.spawnEntityInWorld(entity); } } diff --git a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java index a6e2f1c0e1c..b7ffdb4a800 100644 --- a/src/main/java/appeng/entity/EntityTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/EntityTinyTNTPrimed.java @@ -1,32 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; -import appeng.api.AEApi; -import appeng.core.AEConfig; -import appeng.core.CommonHelper; -import appeng.core.features.AEFeature; -import appeng.core.sync.packets.PacketMockExplosion; -import appeng.helpers.Reflected; -import appeng.util.Platform; -import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -import io.netty.buffer.ByteBuf; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -39,15 +22,26 @@ import net.minecraft.world.Explosion; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.core.AEConfig; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; +import appeng.core.sync.packets.PacketMockExplosion; +import appeng.helpers.Reflected; +import appeng.util.Platform; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import io.netty.buffer.ByteBuf; + public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntityAdditionalSpawnData { + @Reflected public EntityTinyTNTPrimed(final World w) { super(w); this.setSize(0.35F, 0.35F); } - public EntityTinyTNTPrimed( - final World w, final double x, final double y, final double z, final EntityLivingBase igniter) { + public EntityTinyTNTPrimed(final World w, final double x, final double y, final double z, + final EntityLivingBase igniter) { super(w, x, y, z, igniter); this.setSize(0.55F, 0.55F); this.yOffset = this.height / 2.0F; @@ -77,12 +71,7 @@ public void onUpdate() { if (this.isInWater() && Platform.isServer()) // put out the fuse. { - for (final ItemStack tntStack : AEApi.instance() - .definitions() - .blocks() - .tinyTNT() - .maybeStack(1) - .asSet()) { + for (final ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack(1).asSet()) { final EntityItem item = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, tntStack); item.motionX = this.motionX; @@ -146,13 +135,19 @@ void explode() { for (int z = (int) (this.posZ - 2); z <= this.posZ + 2; z++) { final Block block = this.worldObj.getBlock(x, y, z); if (block != null && !block.isAir(this.worldObj, x, y, z)) { - float strength = (float) (2.3f - - (((x + 0.5f) - this.posX) * ((x + 0.5f) - this.posX) - + ((y + 0.5f) - this.posY) * ((y + 0.5f) - this.posY) - + ((z + 0.5f) - this.posZ) * ((z + 0.5f) - this.posZ))); + float strength = (float) (2.3f - (((x + 0.5f) - this.posX) * ((x + 0.5f) - this.posX) + + ((y + 0.5f) - this.posY) * ((y + 0.5f) - this.posY) + + ((z + 0.5f) - this.posZ) * ((z + 0.5f) - this.posZ))); final float resistance = block.getExplosionResistance( - this, this.worldObj, x, y, z, this.posX, this.posY, this.posZ); + this, + this.worldObj, + x, + y, + z, + this.posX, + this.posY, + this.posZ); strength -= (resistance + 0.3F) * 0.11f; if (strength > 0.01) { diff --git a/src/main/java/appeng/entity/RenderFloatingItem.java b/src/main/java/appeng/entity/RenderFloatingItem.java index 9bcf5760093..5890d8484ae 100644 --- a/src/main/java/appeng/entity/RenderFloatingItem.java +++ b/src/main/java/appeng/entity/RenderFloatingItem.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemBlock; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class RenderFloatingItem extends RenderItem { @@ -35,12 +29,7 @@ public RenderFloatingItem() { } @Override - public void doRender( - final EntityItem entityItem, - final double x, - final double y, - final double z, - final float yaw, + public void doRender(final EntityItem entityItem, final double x, final double y, final double z, final float yaw, final float partialTick) { if (entityItem instanceof EntityFloatingItem) { final EntityFloatingItem efi = (EntityFloatingItem) entityItem; diff --git a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java index 5a4becc854c..e40f863541e 100644 --- a/src/main/java/appeng/entity/RenderTinyTNTPrimed.java +++ b/src/main/java/appeng/entity/RenderTinyTNTPrimed.java @@ -1,25 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.entity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; @@ -27,8 +17,12 @@ import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class RenderTinyTNTPrimed extends Render { @@ -40,13 +34,13 @@ public RenderTinyTNTPrimed() { } @Override - public void doRender( - final Entity tnt, final double x, final double y, final double z, final float unused, final float life) { + public void doRender(final Entity tnt, final double x, final double y, final double z, final float unused, + final float life) { this.renderPrimedTNT((EntityTinyTNTPrimed) tnt, x, y, z, life); } - private void renderPrimedTNT( - final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, final float life) { + private void renderPrimedTNT(final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, + final float life) { GL11.glPushMatrix(); GL11.glTranslatef((float) x, (float) y - 0.25f, (float) z); float f2; diff --git a/src/main/java/appeng/facade/FacadeContainer.java b/src/main/java/appeng/facade/FacadeContainer.java index 513f142f8d7..a575fd62b46 100644 --- a/src/main/java/appeng/facade/FacadeContainer.java +++ b/src/main/java/appeng/facade/FacadeContainer.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.facade; +import java.io.IOException; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.parts.IFacadeContainer; import appeng.api.parts.IFacadePart; @@ -28,12 +28,6 @@ import appeng.items.parts.ItemFacade; import appeng.parts.CableBusStorage; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class FacadeContainer implements IFacadeContainer { @@ -116,20 +110,15 @@ public boolean readFromStream(final ByteBuf out) throws IOException { ids[0] = Math.abs(ids[0]); if (isBC && IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport bc = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); - final IFacadePart created = - bc.createFacadePart((Block) Block.blockRegistry.getObjectById(ids[0]), ids[1], side); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); + final IFacadePart created = bc + .createFacadePart((Block) Block.blockRegistry.getObjectById(ids[0]), ids[1], side); changed = changed || this.storage.getFacade(x) == null; this.storage.setFacade(x, created); } else if (!isBC) { - for (final Item facadeItem : AEApi.instance() - .definitions() - .items() - .facade() - .maybeItem() - .asSet()) { + for (final Item facadeItem : AEApi.instance().definitions().items().facade().maybeItem().asSet()) { final ItemFacade ifa = (ItemFacade) facadeItem; final ItemStack facade = ifa.createFromIDs(ids); if (facade != null) { @@ -159,11 +148,12 @@ public void readFromNBT(final NBTTagCompound c) { final Item i = is.getItem(); if (i instanceof IFacadeItem) { this.storage.setFacade( - x, ((IFacadeItem) i).createPartFromItemStack(is, ForgeDirection.getOrientation(x))); + x, + ((IFacadeItem) i).createPartFromItemStack(is, ForgeDirection.getOrientation(x))); } else { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport bc = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); if (bc.isFacade(is)) { this.storage.setFacade(x, bc.createFacadePart(is, ForgeDirection.getOrientation(x))); } diff --git a/src/main/java/appeng/facade/FacadePart.java b/src/main/java/appeng/facade/FacadePart.java index 969ab284e0f..4e365aa51a6 100644 --- a/src/main/java/appeng/facade/FacadePart.java +++ b/src/main/java/appeng/facade/FacadePart.java @@ -1,36 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.facade; -import appeng.api.AEApi; -import appeng.api.parts.*; -import appeng.client.render.BusRenderHelper; -import appeng.client.render.RenderBlocksWorkaround; -import appeng.core.AELog; -import appeng.integration.IntegrationRegistry; -import appeng.integration.IntegrationType; -import appeng.integration.abstraction.IBuildCraftTransport; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; + import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -44,8 +27,21 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import appeng.api.AEApi; +import appeng.api.parts.*; +import appeng.client.render.BusRenderHelper; +import appeng.client.render.RenderBlocksWorkaround; +import appeng.core.AELog; +import appeng.integration.IntegrationRegistry; +import appeng.integration.IntegrationType; +import appeng.integration.abstraction.IBuildCraftTransport; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class FacadePart implements IFacadePart, IBoxProvider { private final ItemStack facade; @@ -86,14 +82,8 @@ public void getBoxes(final IPartCollisionHelper ch, final Entity e) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, - final int y, - final int z, - final IPartRenderHelper instance2, - final RenderBlocks renderer, - final IFacadeContainer fc, - final AxisAlignedBB busBounds, + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper instance2, + final RenderBlocks renderer, final IFacadeContainer fc, final AxisAlignedBB busBounds, final boolean renderStilt) { if (this.facade != null) { final BusRenderHelper instance = (BusRenderHelper) instance2; @@ -115,8 +105,8 @@ public void renderStatic( IIcon myIcon = null; if (this.notAEFacade() && IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport bc = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); myIcon = bc.getCobbleStructurePipeTexture(); } @@ -156,11 +146,9 @@ public void renderStatic( try { color = ib.getColorFromItemStack(randomItem, 0); - } catch (final Throwable ignored) { - } + } catch (final Throwable ignored) {} - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = - renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; instance.setBounds(0, 0, 16 - this.thickness, 16, 16, 16); instance.prepareBounds(renderer); @@ -183,40 +171,45 @@ public void renderStatic( rbw.setCalculations(false); rbw.setFaces(this.calculateFaceOpenFaces(rbw.blockAccess, fc, x, y, z, this.side)); - ((RenderBlocksWorkaround) renderer) - .setTexture( - blk.getIcon( - ForgeDirection.DOWN.ordinal(), - ib.getMetadata(randomItem.getItemDamage())), - blk.getIcon( - ForgeDirection.UP.ordinal(), - ib.getMetadata(randomItem.getItemDamage())), - blk.getIcon( - ForgeDirection.NORTH.ordinal(), - ib.getMetadata(randomItem.getItemDamage())), - blk.getIcon( - ForgeDirection.SOUTH.ordinal(), - ib.getMetadata(randomItem.getItemDamage())), - blk.getIcon( - ForgeDirection.WEST.ordinal(), - ib.getMetadata(randomItem.getItemDamage())), - blk.getIcon( - ForgeDirection.EAST.ordinal(), - ib.getMetadata(randomItem.getItemDamage()))); + ((RenderBlocksWorkaround) renderer).setTexture( + blk.getIcon( + ForgeDirection.DOWN.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), + blk.getIcon( + ForgeDirection.UP.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), + blk.getIcon( + ForgeDirection.NORTH.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), + blk.getIcon( + ForgeDirection.SOUTH.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), + blk.getIcon( + ForgeDirection.WEST.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), + blk.getIcon( + ForgeDirection.EAST.ordinal(), + ib.getMetadata(randomItem.getItemDamage()))); } else { instance.setTexture( blk.getIcon( - ForgeDirection.DOWN.ordinal(), ib.getMetadata(randomItem.getItemDamage())), + ForgeDirection.DOWN.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), blk.getIcon( - ForgeDirection.UP.ordinal(), ib.getMetadata(randomItem.getItemDamage())), + ForgeDirection.UP.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), blk.getIcon( - ForgeDirection.NORTH.ordinal(), ib.getMetadata(randomItem.getItemDamage())), + ForgeDirection.NORTH.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), blk.getIcon( - ForgeDirection.SOUTH.ordinal(), ib.getMetadata(randomItem.getItemDamage())), + ForgeDirection.SOUTH.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), blk.getIcon( - ForgeDirection.WEST.ordinal(), ib.getMetadata(randomItem.getItemDamage())), + ForgeDirection.WEST.ordinal(), + ib.getMetadata(randomItem.getItemDamage())), blk.getIcon( - ForgeDirection.EAST.ordinal(), ib.getMetadata(randomItem.getItemDamage()))); + ForgeDirection.EAST.ordinal(), + ib.getMetadata(randomItem.getItemDamage()))); } if (busBounds == null) { @@ -254,9 +247,29 @@ public void renderStatic( } else { if (this.side == ForgeDirection.UP || this.side == ForgeDirection.DOWN) { this.renderSegmentBlockCurrentBounds( - instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0); + instance, + x, + y, + z, + renderer, + 0.0, + 0.0, + busBounds.maxZ, + 1.0, + 1.0, + 1.0); this.renderSegmentBlockCurrentBounds( - instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ); + instance, + x, + y, + z, + renderer, + 0.0, + 0.0, + 0.0, + 1.0, + 1.0, + busBounds.minZ); this.renderSegmentBlockCurrentBounds( instance, x, @@ -291,9 +304,29 @@ public void renderStatic( } this.renderSegmentBlockCurrentBounds( - instance, x, y, z, renderer, busBounds.maxX, 0.0, 0.0, 1.0, 1.0, 1.0); + instance, + x, + y, + z, + renderer, + busBounds.maxX, + 0.0, + 0.0, + 1.0, + 1.0, + 1.0); this.renderSegmentBlockCurrentBounds( - instance, x, y, z, renderer, 0.0, 0.0, 0.0, busBounds.minX, 1.0, 1.0); + instance, + x, + y, + z, + renderer, + 0.0, + 0.0, + 0.0, + busBounds.minX, + 1.0, + 1.0); this.renderSegmentBlockCurrentBounds( instance, x, @@ -336,9 +369,29 @@ public void renderStatic( } this.renderSegmentBlockCurrentBounds( - instance, x, y, z, renderer, 0.0, 0.0, busBounds.maxZ, 1.0, 1.0, 1.0); + instance, + x, + y, + z, + renderer, + 0.0, + 0.0, + busBounds.maxZ, + 1.0, + 1.0, + 1.0); this.renderSegmentBlockCurrentBounds( - instance, x, y, z, renderer, 0.0, 0.0, 0.0, 1.0, 1.0, busBounds.minZ); + instance, + x, + y, + z, + renderer, + 0.0, + 0.0, + 0.0, + 1.0, + 1.0, + busBounds.minZ); this.renderSegmentBlockCurrentBounds( instance, x, @@ -489,8 +542,8 @@ private ItemStack getTexture() { return facade.getTextureItem(this.facade); } else if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport bc = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); return bc.getTextureForFacade(this.facade); } @@ -498,20 +551,16 @@ private ItemStack getTexture() { return null; } - private EnumSet calculateFaceOpenFaces( - final IBlockAccess blockAccess, - final IFacadeContainer fc, - final int x, - final int y, - final int z, - final ForgeDirection side) { + private EnumSet calculateFaceOpenFaces(final IBlockAccess blockAccess, final IFacadeContainer fc, + final int x, final int y, final int z, final ForgeDirection side) { final EnumSet out = EnumSet.of(side, side.getOpposite()); final IFacadePart facade = fc.getFacade(side); for (final ForgeDirection it : ForgeDirection.VALID_DIRECTIONS) { - if (!out.contains(it) - && this.hasAlphaDiff( - blockAccess.getTileEntity(x + it.offsetX, y + it.offsetY, z + it.offsetZ), side, facade)) { + if (!out.contains(it) && this.hasAlphaDiff( + blockAccess.getTileEntity(x + it.offsetX, y + it.offsetY, z + it.offsetZ), + side, + facade)) { out.add(it); } } @@ -547,20 +596,16 @@ private EnumSet calculateFaceOpenFaces( /* * if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade( * ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( - * ForgeDirection.EAST ); } - * if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade( - * ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( - * ForgeDirection.WEST ); } - * if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( - * ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( - * ForgeDirection.NORTH ); } - * if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( - * ForgeDirection.SOUTH ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( - * ForgeDirection.SOUTH ); } - * if ( out.contains( ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( - * ForgeDirection.EAST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( - * ForgeDirection.EAST ); } - * if ( out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( + * ForgeDirection.EAST ); } if ( out.contains( ForgeDirection.WEST ) && (side.offsetZ != 0) ) { IFacadePart fp = + * fc.getFacade( ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) + * out.remove( ForgeDirection.WEST ); } if ( out.contains( ForgeDirection.NORTH ) && (side.offsetY != 0) ) { + * IFacadePart fp = fc.getFacade( ForgeDirection.NORTH ); if ( fp != null && (fp.isTransparent() == + * facade.isTransparent()) ) out.remove( ForgeDirection.NORTH ); } if ( out.contains( ForgeDirection.SOUTH ) && + * (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH ); if ( fp != null && + * (fp.isTransparent() == facade.isTransparent()) ) out.remove( ForgeDirection.SOUTH ); } if ( out.contains( + * ForgeDirection.EAST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( ForgeDirection.EAST ); if ( + * fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( ForgeDirection.EAST ); } if ( + * out.contains( ForgeDirection.WEST ) && (side.offsetY != 0) ) { IFacadePart fp = fc.getFacade( * ForgeDirection.WEST ); if ( fp != null && (fp.isTransparent() == facade.isTransparent()) ) out.remove( * ForgeDirection.WEST ); } */ @@ -568,18 +613,9 @@ private EnumSet calculateFaceOpenFaces( } @SideOnly(Side.CLIENT) - private void renderSegmentBlockCurrentBounds( - final IPartRenderHelper instance, - final int x, - final int y, - final int z, - final RenderBlocks renderer, - final double minX, - final double minY, - final double minZ, - final double maxX, - final double maxY, - final double maxZ) { + private void renderSegmentBlockCurrentBounds(final IPartRenderHelper instance, final int x, final int y, + final int z, final RenderBlocks renderer, final double minX, final double minY, final double minZ, + final double maxX, final double maxY, final double maxZ) { final double oldMinX = renderer.renderMinX; final double oldMinY = renderer.renderMinY; final double oldMinZ = renderer.renderMinZ; diff --git a/src/main/java/appeng/facade/IFacadeItem.java b/src/main/java/appeng/facade/IFacadeItem.java index 4fd42d3df72..e15632ef4c5 100644 --- a/src/main/java/appeng/facade/IFacadeItem.java +++ b/src/main/java/appeng/facade/IFacadeItem.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.facade; diff --git a/src/main/java/appeng/fmp/CableBusPart.java b/src/main/java/appeng/fmp/CableBusPart.java index 804dde1ca15..db97314991e 100644 --- a/src/main/java/appeng/fmp/CableBusPart.java +++ b/src/main/java/appeng/fmp/CableBusPart.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.fmp; +import java.io.IOException; +import java.util.*; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.parts.IPartCable; import appeng.api.networking.IGridNode; import appeng.api.parts.*; @@ -44,17 +49,6 @@ import codechicken.multipart.scalatraits.TIInventoryTile; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.io.IOException; -import java.util.*; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; /** * Implementing these might help improve visuals for hollow covers @@ -62,6 +56,7 @@ * TSlottedPart,ISidedHollowConnect */ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMaskedRedstonePart, AEMultiTile { + private static final ThreadLocal DISABLE_FACADE_OCCLUSION = new ThreadLocal(); private static final double SHORTER = 6.0 / 16.0; private static final double LONGER = 10.0 / 16.0; @@ -69,24 +64,23 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask private static final double MAX_DIRECTION = 1.0; private static final Cuboid6[] SIDE_TESTS = { - // DOWN(0, -1, 0), - new Cuboid6(SHORTER, MIN_DIRECTION, SHORTER, LONGER, SHORTER, LONGER), + // DOWN(0, -1, 0), + new Cuboid6(SHORTER, MIN_DIRECTION, SHORTER, LONGER, SHORTER, LONGER), - // UP(0, 1, 0), - new Cuboid6(SHORTER, LONGER, SHORTER, LONGER, MAX_DIRECTION, LONGER), + // UP(0, 1, 0), + new Cuboid6(SHORTER, LONGER, SHORTER, LONGER, MAX_DIRECTION, LONGER), - // NORTH(0, 0, -1), - new Cuboid6(SHORTER, SHORTER, MIN_DIRECTION, LONGER, LONGER, SHORTER), + // NORTH(0, 0, -1), + new Cuboid6(SHORTER, SHORTER, MIN_DIRECTION, LONGER, LONGER, SHORTER), - // SOUTH(0, 0, 1), - new Cuboid6(SHORTER, SHORTER, LONGER, LONGER, LONGER, MAX_DIRECTION), + // SOUTH(0, 0, 1), + new Cuboid6(SHORTER, SHORTER, LONGER, LONGER, LONGER, MAX_DIRECTION), - // WEST(-1, 0, 0), - new Cuboid6(MIN_DIRECTION, SHORTER, SHORTER, SHORTER, LONGER, LONGER), + // WEST(-1, 0, 0), + new Cuboid6(MIN_DIRECTION, SHORTER, SHORTER, SHORTER, LONGER, LONGER), - // EAST(1, 0, 0), - new Cuboid6(LONGER, SHORTER, SHORTER, MAX_DIRECTION, LONGER, LONGER), - }; + // EAST(1, 0, 0), + new Cuboid6(LONGER, SHORTER, SHORTER, MAX_DIRECTION, LONGER, LONGER), }; /** * Mask for {@link IMaskedRedstonePart#getConnectionMask(int)} @@ -320,7 +314,12 @@ public int getHollowSize(final int side) { final List boxes = new ArrayList(); final BusCollisionHelper bch = new BusCollisionHelper( - boxes, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH, null, true); + boxes, + ForgeDirection.EAST, + ForgeDirection.UP, + ForgeDirection.SOUTH, + null, + true); for (final ForgeDirection whichSide : ForgeDirection.values()) { final IPart fPart = this.getPart(whichSide); @@ -383,8 +382,7 @@ public int getSlotMask() { for (final ForgeDirection side : ForgeDirection.values()) { if (this.getPart(side) != null) { mask |= 1 << side.ordinal(); - } else if (side != ForgeDirection.UNKNOWN - && this.getFacadeContainer().getFacade(side) != null) { + } else if (side != ForgeDirection.UNKNOWN && this.getFacadeContainer().getFacade(side) != null) { mask |= 1 << side.ordinal(); } } @@ -542,8 +540,7 @@ public void notifyNeighbors() { ((TIInventoryTile) this.tile()).rebuildSlotMap(); } - if (this.world() != null - && this.world().blockExists(this.x(), this.y(), this.z()) + if (this.world() != null && this.world().blockExists(this.x(), this.y(), this.z()) && !CableBusContainer.isLoading()) { Platform.notifyBlocksOfNeighbors(this.world(), this.x(), this.y(), this.z()); } diff --git a/src/main/java/appeng/fmp/FMPEvent.java b/src/main/java/appeng/fmp/FMPEvent.java index 102b48ac97c..a7823173579 100644 --- a/src/main/java/appeng/fmp/FMPEvent.java +++ b/src/main/java/appeng/fmp/FMPEvent.java @@ -1,34 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.fmp; -import appeng.block.AEBaseItemBlock; -import appeng.core.sync.network.NetworkHandler; -import appeng.core.sync.packets.PacketMultiPart; -import appeng.integration.modules.helpers.FMPPacketEvent; -import codechicken.lib.packet.PacketCustom; -import codechicken.lib.raytracer.RayTracer; -import codechicken.lib.vec.BlockCoord; -import codechicken.lib.vec.Vector3; -import codechicken.multipart.TMultiPart; -import codechicken.multipart.TileMultipart; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.Block; import net.minecraft.block.BlockFence; import net.minecraft.entity.player.EntityPlayer; @@ -41,6 +22,18 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import appeng.block.AEBaseItemBlock; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketMultiPart; +import appeng.integration.modules.helpers.FMPPacketEvent; +import codechicken.lib.packet.PacketCustom; +import codechicken.lib.raytracer.RayTracer; +import codechicken.lib.vec.BlockCoord; +import codechicken.lib.vec.Vector3; +import codechicken.multipart.TMultiPart; +import codechicken.multipart.TileMultipart; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + /** * Basically a total rip of of the FMP version for vanilla, seemed to work well enough... */ @@ -83,8 +76,7 @@ private static boolean place(final EntityPlayer player, final World world) { { final Vector3 f = new Vector3(hit.hitVec).add(-hit.blockX, -hit.blockY, -hit.blockZ); final Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ); - if (block != null - && !ignoreActivate(block) + if (block != null && !ignoreActivate(block) && block.onBlockActivated( world, hit.blockX, @@ -96,15 +88,16 @@ private static boolean place(final EntityPlayer player, final World world) { (float) f.y, (float) f.z)) { player.swingItem(); - PacketCustom.sendToServer(new C08PacketPlayerBlockPlacement( - hit.blockX, - hit.blockY, - hit.blockZ, - hit.sideHit, - player.inventory.getCurrentItem(), - (float) f.x, - (float) f.y, - (float) f.z)); + PacketCustom.sendToServer( + new C08PacketPlayerBlockPlacement( + hit.blockX, + hit.blockY, + hit.blockZ, + hit.sideHit, + player.inventory.getCurrentItem(), + (float) f.x, + (float) f.y, + (float) f.z)); return true; } } diff --git a/src/main/java/appeng/fmp/FMPPlacementHelper.java b/src/main/java/appeng/fmp/FMPPlacementHelper.java index 9b20970f34f..5c267f3574c 100644 --- a/src/main/java/appeng/fmp/FMPPlacementHelper.java +++ b/src/main/java/appeng/fmp/FMPPlacementHelper.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.fmp; +import java.util.EnumSet; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.parts.*; import appeng.api.util.AEColor; import appeng.api.util.DimensionalCoord; @@ -27,13 +28,6 @@ import codechicken.lib.vec.BlockCoord; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; -import java.util.EnumSet; -import java.util.Set; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; public class FMPPlacementHelper implements IPartHost { diff --git a/src/main/java/appeng/fmp/PartRegistry.java b/src/main/java/appeng/fmp/PartRegistry.java index 5874e105972..ea2b7a6c874 100644 --- a/src/main/java/appeng/fmp/PartRegistry.java +++ b/src/main/java/appeng/fmp/PartRegistry.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.fmp; +import javax.annotation.Nullable; + +import net.minecraft.block.Block; + import appeng.block.AEBaseBlock; import appeng.block.misc.BlockQuartzTorch; import appeng.block.networking.BlockCableBus; import appeng.core.Api; import codechicken.multipart.TMultiPart; -import javax.annotation.Nullable; -import net.minecraft.block.Block; public enum PartRegistry { + QuartzTorchPart("ae2_torch", BlockQuartzTorch.class, QuartzTorchPart.class), CableBusPart("ae2_cablebus", BlockCableBus.class, CableBusPart.class); @@ -53,10 +48,7 @@ public static TMultiPart getPartByBlock(final Block block, final int meta) { public TMultiPart construct(final int meta) { try { if (this == CableBusPart) { - return (TMultiPart) Api.INSTANCE - .partHelper() - .getCombinedInstance(this.part.getName()) - .newInstance(); + return (TMultiPart) Api.INSTANCE.partHelper().getCombinedInstance(this.part.getName()).newInstance(); } else { return this.part.getConstructor(int.class).newInstance(meta); } diff --git a/src/main/java/appeng/fmp/QuartzTorchPart.java b/src/main/java/appeng/fmp/QuartzTorchPart.java index f1d00173c36..190323f0a01 100644 --- a/src/main/java/appeng/fmp/QuartzTorchPart.java +++ b/src/main/java/appeng/fmp/QuartzTorchPart.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.fmp; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.exceptions.MissingDefinition; import codechicken.lib.vec.BlockCoord; @@ -25,10 +23,6 @@ import codechicken.multipart.IRandomDisplayTick; import codechicken.multipart.minecraft.McBlockPart; import codechicken.multipart.minecraft.McSidedMetaPart; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTick { @@ -84,12 +78,7 @@ public void randomDisplayTick(final Random r) { @Override public Block getBlock() { - for (final Block torchBlock : AEApi.instance() - .definitions() - .blocks() - .quartzTorch() - .maybeBlock() - .asSet()) { + for (final Block torchBlock : AEApi.instance().definitions().blocks().quartzTorch().maybeBlock().asSet()) { return torchBlock; } diff --git a/src/main/java/appeng/helpers/AEGlassMaterial.java b/src/main/java/appeng/helpers/AEGlassMaterial.java index 43f8c5c9877..ffda0c3c46f 100644 --- a/src/main/java/appeng/helpers/AEGlassMaterial.java +++ b/src/main/java/appeng/helpers/AEGlassMaterial.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; diff --git a/src/main/java/appeng/helpers/AEMultiTile.java b/src/main/java/appeng/helpers/AEMultiTile.java index b27bbc42dbd..3629172b3b9 100644 --- a/src/main/java/appeng/helpers/AEMultiTile.java +++ b/src/main/java/appeng/helpers/AEMultiTile.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; @@ -22,4 +14,5 @@ import appeng.api.networking.IGridHost; import appeng.api.parts.IPartHost; -public interface AEMultiTile extends IGridHost, IPartHost, IColorableTile {} +public interface AEMultiTile extends IGridHost, IPartHost, IColorableTile { +} diff --git a/src/main/java/appeng/helpers/DualityInterface.java b/src/main/java/appeng/helpers/DualityInterface.java index e7e3220ffa2..ceba4e378d3 100644 --- a/src/main/java/appeng/helpers/DualityInterface.java +++ b/src/main/java/appeng/helpers/DualityInterface.java @@ -1,23 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.implementations.ICraftingPatternItem; @@ -72,39 +80,19 @@ import appeng.util.inv.WrapperInvSlot; import appeng.util.item.AEItemStack; import cofh.api.transport.IItemDuct; + import com.google.common.collect.ImmutableSet; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -public class DualityInterface - implements IGridTickable, - IStorageMonitorable, - IInventoryDestination, - IAEAppEngInventory, - IConfigManagerHost, - ICraftingProvider, - IUpgradeableHost, - IPriorityHost { +public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, + IConfigManagerHost, ICraftingProvider, IUpgradeableHost, IPriorityHost { public static final int NUMBER_OF_STORAGE_SLOTS = 9; public static final int NUMBER_OF_CONFIG_SLOTS = 9; public static final int NUMBER_OF_PATTERN_SLOTS = 9; private static final Collection BAD_BLOCKS = new HashSet(100); - private final int[] sides = {0, 1, 2, 3, 4, 5, 6, 7, 8}; - private final IAEItemStack[] requireWork = {null, null, null, null, null, null, null, null, null}; + private final int[] sides = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; + private final IAEItemStack[] requireWork = { null, null, null, null, null, null, null, null, null }; private final MultiCraftingTracker craftingTracker; protected final AENetworkProxy gridProxy; private final IInterfaceHost iHost; @@ -115,10 +103,12 @@ public class DualityInterface private final AppEngInternalInventory storage = new AppEngInternalInventory(this, NUMBER_OF_STORAGE_SLOTS); private final AppEngInternalInventory patterns = new AppEngInternalInventory(this, NUMBER_OF_PATTERN_SLOTS * 4); private final WrapperInvSlot slotInv = new WrapperInvSlot(this.storage); - private final MEMonitorPassThrough items = - new MEMonitorPassThrough(new NullInventory(), StorageChannel.ITEMS); - private final MEMonitorPassThrough fluids = - new MEMonitorPassThrough(new NullInventory(), StorageChannel.FLUIDS); + private final MEMonitorPassThrough items = new MEMonitorPassThrough( + new NullInventory(), + StorageChannel.ITEMS); + private final MEMonitorPassThrough fluids = new MEMonitorPassThrough( + new NullInventory(), + StorageChannel.FLUIDS); private final UpgradeInventory upgrades; private boolean hasConfig = false; private int priority; @@ -153,11 +143,7 @@ public void saveChanges() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (mc == InvOperation.markDirty) { TileEntity te = getHost().getTile(); @@ -405,8 +391,7 @@ protected void addToCraftingList(final ItemStack is) { if (is.getItem() instanceof ICraftingPatternItem) { final ICraftingPatternItem cpi = (ICraftingPatternItem) is.getItem(); - final ICraftingPatternDetails details = - cpi.getPatternForItem(is, this.iHost.getTileEntity().getWorldObj()); + final ICraftingPatternDetails details = cpi.getPatternForItem(is, this.iHost.getTileEntity().getWorldObj()); if (details != null) { if (this.craftingList == null) { @@ -424,8 +409,8 @@ private boolean hasItemsToSend() { @Override public boolean canInsert(final ItemStack stack) { - final IAEItemStack out = this.destination.injectItems( - AEApi.instance().storage().createItemStack(stack), Actionable.SIMULATE, null); + final IAEItemStack out = this.destination + .injectItems(AEApi.instance().storage().createItemStack(stack), Actionable.SIMULATE, null); if (out == null) { return true; } @@ -481,7 +466,10 @@ public int[] getAccessibleSlotsFromSide(final int side) { @Override public TickingRequest getTickingRequest(final IGridNode node) { return new TickingRequest( - TickRates.Interface.getMin(), TickRates.Interface.getMax(), !this.hasWorkToDo(), true); + TickRates.Interface.getMin(), + TickRates.Interface.getMax(), + !this.hasWorkToDo(), + true); } @Override @@ -491,7 +479,9 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi TileEntity te = iHost.getTileEntity(); AELog.debug( "Timing: interface at (%d %d %d) is ticking while the grid is booting", - te.xCoord, te.yCoord, te.zCoord); + te.xCoord, + te.yCoord, + te.zCoord); } return this.hasWorkToDo() ? TickRateModulation.SLOWER : TickRateModulation.SLEEP; } @@ -523,8 +513,8 @@ private boolean pushItemsOut(final EnumSet possibleDirections) { ItemStack whatToSend = i.next(); for (final ForgeDirection s : possibleDirections) { - final TileEntity te = - w.getTileEntity(tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ); + final TileEntity te = w + .getTileEntity(tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ); if (te == null) { continue; } @@ -620,8 +610,8 @@ private boolean usePlan(final int x, final IAEItemStack itemStack) { throw new GridAccessException(); } - final IAEItemStack acquired = - Platform.poweredExtraction(src, this.destination, itemStack, this.interfaceRequestSource); + final IAEItemStack acquired = Platform + .poweredExtraction(src, this.destination, itemStack, this.interfaceRequestSource); if (acquired != null) { changed = true; final ItemStack issue = adaptor.addItems(acquired.getItemStack()); @@ -747,8 +737,8 @@ private void cancelCrafting() { this.craftingTracker.cancel(); } - public IStorageMonitorable getMonitorable( - final ForgeDirection side, final BaseActionSource src, final IStorageMonitorable myInterface) { + public IStorageMonitorable getMonitorable(final ForgeDirection side, final BaseActionSource src, + final IStorageMonitorable myInterface) { if (Platform.canAccess(this.gridProxy, src)) { return myInterface; } @@ -794,8 +784,8 @@ public boolean pushPattern(final ICraftingPatternDetails patternDetails, final I final EnumSet possibleDirections = this.iHost.getTargets(); for (final ForgeDirection s : possibleDirections) { - final TileEntity te = - w.getTileEntity(tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ); + final TileEntity te = w + .getTileEntity(tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ); if (te instanceof IInterfaceHost) { try { if (((IInterfaceHost) te).getInterfaceDuality().sameGrid(this.gridProxy.getGrid())) { @@ -837,8 +827,10 @@ public boolean pushPattern(final ICraftingPatternDetails patternDetails, final I final ItemStack is = table.getStackInSlot(x); if (is != null) { final ItemStack rest = ((IItemDuct) te).insertItem(s.getOpposite(), is); - if (!hadAcceptedSome && rest != null && rest.stackSize == is.stackSize) - break; // conduit should accept all the pattern or nothing. + if (!hadAcceptedSome && rest != null && rest.stackSize == is.stackSize) break; // conduit should + // accept all the + // pattern or + // nothing. hadAcceptedSome = true; this.addToSendList(rest); } @@ -869,8 +861,8 @@ public boolean isBusy() { boolean allAreBusy = true; for (final ForgeDirection s : possibleDirections) { - final TileEntity te = - w.getTileEntity(tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ); + final TileEntity te = w + .getTileEntity(tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ); if (te != null && te.getClass().getName().equals("li.cil.oc.common.tileentity.Adapter")) continue; final InventoryAdaptor ad = InventoryAdaptor.getAdaptor(te, s.getOpposite()); if (ad != null) { @@ -899,8 +891,8 @@ private InsertionMode getInsertionMode() { return (InsertionMode) cm.getSetting(Settings.INSERTION_MODE); } - private static boolean acceptsItems( - final InventoryAdaptor ad, final InventoryCrafting table, final InsertionMode insertionMode) { + private static boolean acceptsItems(final InventoryAdaptor ad, final InventoryCrafting table, + final InsertionMode insertionMode) { for (int x = 0; x < table.getSizeInventory(); x++) { ItemStack is = table.getStackInSlot(x); if (is == null) { @@ -989,8 +981,8 @@ public ImmutableSet getRequestedJobs() { return this.craftingTracker.getRequestedJobs(); } - public IAEItemStack injectCraftedItems( - final ICraftingLink link, final IAEItemStack acquired, final Actionable mode) { + public IAEItemStack injectCraftedItems(final ICraftingLink link, final IAEItemStack acquired, + final Actionable mode) { final int slot = this.craftingTracker.getSlot(link); if (acquired != null && slot >= 0 && slot <= this.requireWork.length) { @@ -1057,18 +1049,19 @@ public String getTermName() { } final Block directedBlock = hostWorld.getBlock(xPos, yPos, zPos); - ItemStack what = - new ItemStack(directedBlock, 1, directedBlock.getDamageValue(hostWorld, xPos, yPos, zPos)); + ItemStack what = new ItemStack( + directedBlock, + 1, + directedBlock.getDamageValue(hostWorld, xPos, yPos, zPos)); try { - Vec3 from = Vec3.createVectorHelper( - hostTile.xCoord + 0.5, hostTile.yCoord + 0.5, hostTile.zCoord + 0.5); - from = from.addVector( - direction.offsetX * 0.501, direction.offsetY * 0.501, direction.offsetZ * 0.501); + Vec3 from = Vec3 + .createVectorHelper(hostTile.xCoord + 0.5, hostTile.yCoord + 0.5, hostTile.zCoord + 0.5); + from = from + .addVector(direction.offsetX * 0.501, direction.offsetY * 0.501, direction.offsetZ * 0.501); final Vec3 to = from.addVector(direction.offsetX, direction.offsetY, direction.offsetZ); final MovingObjectPosition mop = hostWorld.rayTraceBlocks(from, to, true); if (mop != null && !BAD_BLOCKS.contains(directedBlock)) { - if (mop.blockX == directedTile.xCoord - && mop.blockY == directedTile.yCoord + if (mop.blockX == directedTile.xCoord && mop.blockY == directedTile.yCoord && mop.blockZ == directedTile.zCoord) { final ItemStack g = directedBlock.getPickBlock( mop, @@ -1150,8 +1143,8 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, } @Override - public IAEItemStack extractItems( - final IAEItemStack request, final Actionable type, final BaseActionSource src) { + public IAEItemStack extractItems(final IAEItemStack request, final Actionable type, + final BaseActionSource src) { if (src instanceof InterfaceRequestSource) { return null; } diff --git a/src/main/java/appeng/helpers/HighlighterHandler.java b/src/main/java/appeng/helpers/HighlighterHandler.java index ce03f96cfe8..bcde176dd16 100644 --- a/src/main/java/appeng/helpers/HighlighterHandler.java +++ b/src/main/java/appeng/helpers/HighlighterHandler.java @@ -1,12 +1,14 @@ package appeng.helpers; -import appeng.api.util.DimensionalCoord; -import appeng.client.render.BlockPosHighlighter; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraftforge.client.event.RenderWorldLastEvent; + import org.lwjgl.opengl.GL11; +import appeng.api.util.DimensionalCoord; +import appeng.client.render.BlockPosHighlighter; + // inspired by McJtyLib public class HighlighterHandler { diff --git a/src/main/java/appeng/helpers/IContainerCraftingPacket.java b/src/main/java/appeng/helpers/IContainerCraftingPacket.java index cbc8623abe7..1a207b830a9 100644 --- a/src/main/java/appeng/helpers/IContainerCraftingPacket.java +++ b/src/main/java/appeng/helpers/IContainerCraftingPacket.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.networking.IGridNode; -import appeng.api.networking.security.BaseActionSource; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import appeng.api.networking.IGridNode; +import appeng.api.networking.security.BaseActionSource; + public interface IContainerCraftingPacket { /** diff --git a/src/main/java/appeng/helpers/ICustomCollision.java b/src/main/java/appeng/helpers/ICustomCollision.java index f1127ed6926..aa511620d61 100644 --- a/src/main/java/appeng/helpers/ICustomCollision.java +++ b/src/main/java/appeng/helpers/ICustomCollision.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; public interface ICustomCollision { + Iterable getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity thePlayer, boolean b); void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e); diff --git a/src/main/java/appeng/helpers/ICustomNameObject.java b/src/main/java/appeng/helpers/ICustomNameObject.java index a129b411f67..27c1d372030 100644 --- a/src/main/java/appeng/helpers/ICustomNameObject.java +++ b/src/main/java/appeng/helpers/ICustomNameObject.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; public interface ICustomNameObject { + String getCustomName(); boolean hasCustomName(); diff --git a/src/main/java/appeng/helpers/IInterfaceHost.java b/src/main/java/appeng/helpers/IInterfaceHost.java index 25bdaa7386a..86e8114a507 100644 --- a/src/main/java/appeng/helpers/IInterfaceHost.java +++ b/src/main/java/appeng/helpers/IInterfaceHost.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.implementations.IUpgradeableHost; -import appeng.api.networking.crafting.ICraftingProvider; -import appeng.api.networking.crafting.ICraftingRequester; import java.util.EnumSet; + import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.implementations.IUpgradeableHost; +import appeng.api.networking.crafting.ICraftingProvider; +import appeng.api.networking.crafting.ICraftingRequester; + public interface IInterfaceHost extends ICraftingProvider, IUpgradeableHost, ICraftingRequester { DualityInterface getInterfaceDuality(); diff --git a/src/main/java/appeng/helpers/IMouseWheelItem.java b/src/main/java/appeng/helpers/IMouseWheelItem.java index 16294b70e0f..119da91b667 100644 --- a/src/main/java/appeng/helpers/IMouseWheelItem.java +++ b/src/main/java/appeng/helpers/IMouseWheelItem.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; diff --git a/src/main/java/appeng/helpers/IOreFilterable.java b/src/main/java/appeng/helpers/IOreFilterable.java index 77a5e43be88..5242119a7b2 100644 --- a/src/main/java/appeng/helpers/IOreFilterable.java +++ b/src/main/java/appeng/helpers/IOreFilterable.java @@ -1,6 +1,7 @@ package appeng.helpers; public interface IOreFilterable { + /** * Get oredictionary filter */ diff --git a/src/main/java/appeng/helpers/IPriorityHost.java b/src/main/java/appeng/helpers/IPriorityHost.java index 4183abafc32..602b0701531 100644 --- a/src/main/java/appeng/helpers/IPriorityHost.java +++ b/src/main/java/appeng/helpers/IPriorityHost.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; diff --git a/src/main/java/appeng/helpers/InventoryAction.java b/src/main/java/appeng/helpers/InventoryAction.java index 11698a0c6be..1aad637b7d0 100644 --- a/src/main/java/appeng/helpers/InventoryAction.java +++ b/src/main/java/appeng/helpers/InventoryAction.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; diff --git a/src/main/java/appeng/helpers/LocationRotation.java b/src/main/java/appeng/helpers/LocationRotation.java index 5cb8c6d4f37..b274ad99bf1 100644 --- a/src/main/java/appeng/helpers/LocationRotation.java +++ b/src/main/java/appeng/helpers/LocationRotation.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.util.IOrientable; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; + public class LocationRotation implements IOrientable { private final IBlockAccess w; diff --git a/src/main/java/appeng/helpers/MetaRotation.java b/src/main/java/appeng/helpers/MetaRotation.java index 36ae0540dfd..472f37f67aa 100644 --- a/src/main/java/appeng/helpers/MetaRotation.java +++ b/src/main/java/appeng/helpers/MetaRotation.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.util.IOrientable; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; + public class MetaRotation implements IOrientable { private final IBlockAccess w; diff --git a/src/main/java/appeng/helpers/MultiCraftingTracker.java b/src/main/java/appeng/helpers/MultiCraftingTracker.java index 404b69149e1..2d595b4a408 100644 --- a/src/main/java/appeng/helpers/MultiCraftingTracker.java +++ b/src/main/java/appeng/helpers/MultiCraftingTracker.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.networking.IGrid; import appeng.api.networking.crafting.ICraftingGrid; @@ -27,11 +25,8 @@ import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.data.IAEItemStack; import appeng.util.InventoryAdaptor; + import com.google.common.collect.ImmutableSet; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class MultiCraftingTracker { @@ -68,15 +63,8 @@ public void writeToNBT(final NBTTagCompound extra) { } } - public boolean handleCrafting( - final int x, - final long itemToCraft, - final IAEItemStack ais, - final InventoryAdaptor d, - final World w, - final IGrid g, - final ICraftingGrid cg, - final BaseActionSource mySrc) { + public boolean handleCrafting(final int x, final long itemToCraft, final IAEItemStack ais, final InventoryAdaptor d, + final World w, final IGrid g, final ICraftingGrid cg, final BaseActionSource mySrc) { if (ais != null && d.simulateAdd(ais.getItemStack()) == null) { final Future craftingJob = this.getJob(x); diff --git a/src/main/java/appeng/helpers/NonNullArrayIterator.java b/src/main/java/appeng/helpers/NonNullArrayIterator.java index ab18a4f2a58..b5c83a738cd 100644 --- a/src/main/java/appeng/helpers/NonNullArrayIterator.java +++ b/src/main/java/appeng/helpers/NonNullArrayIterator.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; import java.util.Iterator; + import scala.NotImplementedError; public class NonNullArrayIterator implements Iterator { diff --git a/src/main/java/appeng/helpers/NullRotation.java b/src/main/java/appeng/helpers/NullRotation.java index effa43d4d54..11987afb62f 100644 --- a/src/main/java/appeng/helpers/NullRotation.java +++ b/src/main/java/appeng/helpers/NullRotation.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.util.IOrientable; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.IOrientable; + public class NullRotation implements IOrientable { public NullRotation() {} diff --git a/src/main/java/appeng/helpers/PatternHelper.java b/src/main/java/appeng/helpers/PatternHelper.java index 531960fa6c4..421e2c3cdb8 100644 --- a/src/main/java/appeng/helpers/PatternHelper.java +++ b/src/main/java/appeng/helpers/PatternHelper.java @@ -1,31 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.AEApi; -import appeng.api.networking.crafting.ICraftingPatternDetails; -import appeng.api.storage.data.IAEItemStack; -import appeng.container.ContainerNull; -import appeng.util.ItemSorters; -import appeng.util.Platform; -import appeng.util.item.AEItemStack; import java.util.*; + import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -35,6 +21,14 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.api.networking.crafting.ICraftingPatternDetails; +import appeng.api.storage.data.IAEItemStack; +import appeng.container.ContainerNull; +import appeng.util.ItemSorters; +import appeng.util.Platform; +import appeng.util.item.AEItemStack; + public class PatternHelper implements ICraftingPatternDetails, Comparable { private final ItemStack patternItem; @@ -351,8 +345,8 @@ public boolean equals(final Object obj) { } } - public static IAEItemStack[] loadIAEItemStackFromNBT( - final NBTTagList tags, boolean saveOrder, final ItemStack unknownItem) { + public static IAEItemStack[] loadIAEItemStackFromNBT(final NBTTagList tags, boolean saveOrder, + final ItemStack unknownItem) { final List items = new ArrayList(); for (int x = 0; x < tags.tagCount(); x++) { diff --git a/src/main/java/appeng/helpers/PlayerSecurityWrapper.java b/src/main/java/appeng/helpers/PlayerSecurityWrapper.java index 3a141404676..f898756386b 100644 --- a/src/main/java/appeng/helpers/PlayerSecurityWrapper.java +++ b/src/main/java/appeng/helpers/PlayerSecurityWrapper.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.config.SecurityPermissions; -import appeng.api.networking.security.ISecurityRegistry; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; +import appeng.api.config.SecurityPermissions; +import appeng.api.networking.security.ISecurityRegistry; + public class PlayerSecurityWrapper implements ISecurityRegistry { private final Map> target; diff --git a/src/main/java/appeng/helpers/Reflected.java b/src/main/java/appeng/helpers/Reflected.java index 0048a555c79..01055f0bb96 100644 --- a/src/main/java/appeng/helpers/Reflected.java +++ b/src/main/java/appeng/helpers/Reflected.java @@ -9,5 +9,5 @@ * Marker interface to help identify invocation of reflection */ @Retention(RetentionPolicy.SOURCE) -@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.TYPE, ElementType.METHOD}) +@Target({ ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.TYPE, ElementType.METHOD }) public @interface Reflected {} diff --git a/src/main/java/appeng/helpers/Splotch.java b/src/main/java/appeng/helpers/Splotch.java index 223d1af1340..2db6b56144d 100644 --- a/src/main/java/appeng/helpers/Splotch.java +++ b/src/main/java/appeng/helpers/Splotch.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; -import appeng.api.util.AEColor; -import io.netty.buffer.ByteBuf; import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.AEColor; +import io.netty.buffer.ByteBuf; + public class Splotch { private final ForgeDirection side; diff --git a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java index cf24faaf43c..c801c29d014 100644 --- a/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java +++ b/src/main/java/appeng/helpers/WirelessTerminalGuiObject.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.helpers; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; @@ -46,11 +44,6 @@ import appeng.container.interfaces.IInventorySlotAware; import appeng.items.contents.WirelessTerminalViewCells; import appeng.tile.networking.TileWireless; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, IInventorySlotAware, IViewCellStorage { @@ -67,14 +60,8 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II private final int inventorySlot; private final WirelessTerminalViewCells viewCells; - public WirelessTerminalGuiObject( - final IWirelessTermHandler wh, - final ItemStack is, - final EntityPlayer ep, - final World w, - final int x, - final int y, - final int z) { + public WirelessTerminalGuiObject(final IWirelessTermHandler wh, final ItemStack is, final EntityPlayer ep, + final World w, final int x, final int y, final int z) { this.encryptionKey = wh.getEncryptionKey(is); this.effectiveItem = is; this.myPlayer = ep; diff --git a/src/main/java/appeng/hooks/AETrading.java b/src/main/java/appeng/hooks/AETrading.java index 79616cb5f67..0d7d22fedba 100644 --- a/src/main/java/appeng/hooks/AETrading.java +++ b/src/main/java/appeng/hooks/AETrading.java @@ -1,40 +1,35 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; -import appeng.api.AEApi; -import appeng.api.definitions.IItemDefinition; -import appeng.api.definitions.IMaterials; -import com.google.common.base.Optional; -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; import java.util.Random; + import net.minecraft.entity.passive.EntityVillager; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; +import appeng.api.AEApi; +import appeng.api.definitions.IItemDefinition; +import appeng.api.definitions.IMaterials; + +import com.google.common.base.Optional; +import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; + public class AETrading implements IVillageTradeHandler { @Override - public void manipulateTradesForVillager( - final EntityVillager villager, final MerchantRecipeList recipeList, final Random random) { + public void manipulateTradesForVillager(final EntityVillager villager, final MerchantRecipeList recipeList, + final Random random) { final IMaterials materials = AEApi.instance().definitions().materials(); this.addMerchant(recipeList, materials.silicon(), 1, random, 2); @@ -44,12 +39,8 @@ public void manipulateTradesForVillager( this.addTrade(recipeList, materials.certusQuartzDust(), materials.certusQuartzCrystal(), random, 2); } - private void addMerchant( - final MerchantRecipeList list, - final IItemDefinition item, - final int emera, - final Random rand, - final int greed) { + private void addMerchant(final MerchantRecipeList list, final IItemDefinition item, final int emera, + final Random rand, final int greed) { for (final ItemStack itemStack : item.maybeStack(1).asSet()) { // Sell final ItemStack from = itemStack.copy(); @@ -79,12 +70,8 @@ private void addMerchant( } } - private void addTrade( - final MerchantRecipeList list, - final IItemDefinition inputDefinition, - final IItemDefinition outputDefinition, - final Random rand, - final int conversionVariance) { + private void addTrade(final MerchantRecipeList list, final IItemDefinition inputDefinition, + final IItemDefinition outputDefinition, final Random rand, final int conversionVariance) { final Optional maybeInputStack = inputDefinition.maybeStack(1); final Optional maybeOutputStack = outputDefinition.maybeStack(1); diff --git a/src/main/java/appeng/hooks/CompassManager.java b/src/main/java/appeng/hooks/CompassManager.java index 30d3514b791..35e20190d8a 100644 --- a/src/main/java/appeng/hooks/CompassManager.java +++ b/src/main/java/appeng/hooks/CompassManager.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; -import appeng.core.sync.network.NetworkHandler; -import appeng.core.sync.packets.PacketCompassRequest; import java.util.HashMap; import java.util.Iterator; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketCompassRequest; + public class CompassManager { public static final CompassManager INSTANCE = new CompassManager(); @@ -79,8 +72,7 @@ public CompassRequest(final long attunement, final int x, final int y, final int this.cx = x >> 4; this.cdy = y >> 5; this.cz = z >> 4; - this.hash = ((Integer) this.cx).hashCode() - ^ ((Integer) this.cdy).hashCode() + this.hash = ((Integer) this.cx).hashCode() ^ ((Integer) this.cdy).hashCode() ^ ((Integer) this.cz).hashCode() ^ ((Long) attunement).hashCode(); } @@ -99,8 +91,7 @@ public boolean equals(final Object obj) { return false; } final CompassRequest other = (CompassRequest) obj; - return this.attunement == other.attunement - && this.cx == other.cx + return this.attunement == other.attunement && this.cx == other.cx && this.cdy == other.cdy && this.cz == other.cz; } diff --git a/src/main/java/appeng/hooks/CompassResult.java b/src/main/java/appeng/hooks/CompassResult.java index a4bce671c71..3862aa33372 100644 --- a/src/main/java/appeng/hooks/CompassResult.java +++ b/src/main/java/appeng/hooks/CompassResult.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; diff --git a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java index 594baf8a88c..4ccae234b86 100644 --- a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java +++ b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java @@ -1,24 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; -import appeng.entity.EntityTinyTNTPrimed; import net.minecraft.block.BlockDispenser; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; @@ -26,6 +17,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import appeng.entity.EntityTinyTNTPrimed; + public final class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem { @Override @@ -35,8 +28,12 @@ protected ItemStack dispenseStack(final IBlockSource dispenser, final ItemStack final int i = dispenser.getXInt() + enumfacing.getFrontOffsetX(); final int j = dispenser.getYInt() + enumfacing.getFrontOffsetY(); final int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); - final EntityTinyTNTPrimed primedTinyTNTEntity = - new EntityTinyTNTPrimed(world, i + 0.5F, j + 0.5F, k + 0.5F, null); + final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( + world, + i + 0.5F, + j + 0.5F, + k + 0.5F, + null); world.spawnEntityInWorld(primedTinyTNTEntity); --dispensedItem.stackSize; return dispensedItem; diff --git a/src/main/java/appeng/hooks/DispenserBlockTool.java b/src/main/java/appeng/hooks/DispenserBlockTool.java index 71ada39973b..8117c87e47a 100644 --- a/src/main/java/appeng/hooks/DispenserBlockTool.java +++ b/src/main/java/appeng/hooks/DispenserBlockTool.java @@ -1,24 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; -import appeng.util.Platform; import net.minecraft.block.BlockDispenser; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; @@ -28,6 +19,8 @@ import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import appeng.util.Platform; + public final class DispenserBlockTool extends BehaviorDefaultDispenseItem { @Override diff --git a/src/main/java/appeng/hooks/DispenserMatterCannon.java b/src/main/java/appeng/hooks/DispenserMatterCannon.java index dd325a4abd9..2e200b02ead 100644 --- a/src/main/java/appeng/hooks/DispenserMatterCannon.java +++ b/src/main/java/appeng/hooks/DispenserMatterCannon.java @@ -1,25 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; -import appeng.items.tools.powered.ToolMassCannon; -import appeng.util.Platform; import net.minecraft.block.BlockDispenser; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; @@ -31,6 +21,9 @@ import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.ForgeDirection; +import appeng.items.tools.powered.ToolMassCannon; +import appeng.util.Platform; + public final class DispenserMatterCannon extends BehaviorDefaultDispenseItem { @Override @@ -40,8 +33,7 @@ protected ItemStack dispenseStack(final IBlockSource dispenser, ItemStack dispen final EnumFacing enumfacing = BlockDispenser.func_149937_b(dispenser.getBlockMetadata()); ForgeDirection dir = ForgeDirection.UNKNOWN; for (final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { - if (enumfacing.getFrontOffsetX() == d.offsetX - && enumfacing.getFrontOffsetY() == d.offsetY + if (enumfacing.getFrontOffsetX() == d.offsetX && enumfacing.getFrontOffsetY() == d.offsetY && enumfacing.getFrontOffsetZ() == d.offsetZ) { dir = d; } diff --git a/src/main/java/appeng/hooks/IBlockTool.java b/src/main/java/appeng/hooks/IBlockTool.java index 0b9ef03b47b..475d5b01dc5 100644 --- a/src/main/java/appeng/hooks/IBlockTool.java +++ b/src/main/java/appeng/hooks/IBlockTool.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; @@ -24,15 +16,6 @@ public interface IBlockTool { - boolean onItemUse( - ItemStack dispensedItem, - EntityPlayer player, - World w, - int x, - int y, - int z, - int ordinal, - float hitX, - float hitY, - float hitZ); + boolean onItemUse(ItemStack dispensedItem, EntityPlayer player, World w, int x, int y, int z, int ordinal, + float hitX, float hitY, float hitZ); } diff --git a/src/main/java/appeng/hooks/TickHandler.java b/src/main/java/appeng/hooks/TickHandler.java index a9ea56f93cd..49029a675fb 100644 --- a/src/main/java/appeng/hooks/TickHandler.java +++ b/src/main/java/appeng/hooks/TickHandler.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.hooks; +import java.util.*; +import java.util.concurrent.TimeUnit; + +import net.minecraft.world.World; +import net.minecraftforge.event.world.ChunkEvent; +import net.minecraftforge.event.world.WorldEvent; + import appeng.api.AEApi; import appeng.api.networking.IGridNode; import appeng.api.networking.crafting.ICraftingJob; @@ -33,27 +32,23 @@ import appeng.tile.AEBaseTile; import appeng.util.IWorldCallable; import appeng.util.Platform; + import com.google.common.base.Stopwatch; import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.Multimap; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.gameevent.TickEvent.Phase; import cpw.mods.fml.common.gameevent.TickEvent.Type; import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; -import java.util.*; -import java.util.concurrent.TimeUnit; -import net.minecraft.world.World; -import net.minecraftforge.event.world.ChunkEvent; -import net.minecraftforge.event.world.WorldEvent; public class TickHandler { public static final TickHandler INSTANCE = new TickHandler(); private final Queue> serverQueue = new LinkedList>(); private final Multimap craftingJobs = LinkedListMultimap.create(); - private final WeakHashMap>> callQueue = - new WeakHashMap>>(); + private final WeakHashMap>> callQueue = new WeakHashMap>>(); private final HandlerRep server = new HandlerRep(); private final HandlerRep client = new HandlerRep(); private final HashMap cliPlayerColors = new HashMap(); diff --git a/src/main/java/appeng/integration/IIntegrationModule.java b/src/main/java/appeng/integration/IIntegrationModule.java index 37a554c88ed..336e473245f 100644 --- a/src/main/java/appeng/integration/IIntegrationModule.java +++ b/src/main/java/appeng/integration/IIntegrationModule.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; public interface IIntegrationModule { + void init() throws Throwable; void postInit(); diff --git a/src/main/java/appeng/integration/IntegrationHelper.java b/src/main/java/appeng/integration/IntegrationHelper.java index 125bfb83b64..1d8ee7545e4 100644 --- a/src/main/java/appeng/integration/IntegrationHelper.java +++ b/src/main/java/appeng/integration/IntegrationHelper.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; diff --git a/src/main/java/appeng/integration/IntegrationNode.java b/src/main/java/appeng/integration/IntegrationNode.java index 002f4ebdb6e..ea07e6ef4bc 100644 --- a/src/main/java/appeng/integration/IntegrationNode.java +++ b/src/main/java/appeng/integration/IntegrationNode.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; +import java.lang.reflect.Field; + import appeng.api.exceptions.ModNotInstalled; import appeng.core.AEConfig; import appeng.core.AELog; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModAPIManager; -import java.lang.reflect.Field; public final class IntegrationNode { @@ -38,8 +31,8 @@ public final class IntegrationNode { private Object instance; private IIntegrationModule mod = null; - public IntegrationNode( - final String displayName, final String modID, final IntegrationType shortName, final String name) { + public IntegrationNode(final String displayName, final String modID, final IntegrationType shortName, + final String name) { this.displayName = displayName; this.shortName = shortName; this.modID = modID; @@ -69,15 +62,14 @@ void call(final IntegrationStage stage) { switch (stage) { case PRE_INIT: final ModAPIManager apiManager = ModAPIManager.INSTANCE; - boolean enabled = - this.modID == null || Loader.isModLoaded(this.modID) || apiManager.hasAPI(this.modID); + boolean enabled = this.modID == null || Loader.isModLoaded(this.modID) + || apiManager.hasAPI(this.modID); AEConfig.instance.addCustomCategoryComment( "ModIntegration", "Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason."); final String mode = AEConfig.instance - .get("ModIntegration", this.displayName.replace(" ", ""), "AUTO") - .getString(); + .get("ModIntegration", this.displayName.replace(" ", ""), "AUTO").getString(); if (mode.toUpperCase().equals("ON")) { enabled = true; @@ -88,8 +80,7 @@ void call(final IntegrationStage stage) { if (enabled) { this.classValue = this.getClass().getClassLoader().loadClass(this.name); - this.mod = (IIntegrationModule) - this.classValue.getConstructor().newInstance(); + this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance(); final Field f = this.classValue.getField("instance"); f.set(this.classValue, this.setInstance(this.mod)); } else { diff --git a/src/main/java/appeng/integration/IntegrationRegistry.java b/src/main/java/appeng/integration/IntegrationRegistry.java index 00d12afa6dc..40f2dcc82cd 100644 --- a/src/main/java/appeng/integration/IntegrationRegistry.java +++ b/src/main/java/appeng/integration/IntegrationRegistry.java @@ -1,30 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; -import cpw.mods.fml.relauncher.FMLLaunchHandler; -import cpw.mods.fml.relauncher.Side; import java.util.Collection; import java.util.LinkedList; + import javax.annotation.Nonnull; +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.Side; + public enum IntegrationRegistry { + INSTANCE; private static final String PACKAGE_PREFIX = "appeng.integration.modules."; @@ -67,8 +62,8 @@ public String getStatus() { builder.append(", "); } - final String integrationState = - node.getShortName() + ":" + (node.getState() == IntegrationStage.FAILED ? "OFF" : "ON"); + final String integrationState = node.getShortName() + ":" + + (node.getState() == IntegrationStage.FAILED ? "OFF" : "ON"); builder.append(integrationState); } diff --git a/src/main/java/appeng/integration/IntegrationSide.java b/src/main/java/appeng/integration/IntegrationSide.java index 88d5580abe5..88b744f7dbb 100644 --- a/src/main/java/appeng/integration/IntegrationSide.java +++ b/src/main/java/appeng/integration/IntegrationSide.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; diff --git a/src/main/java/appeng/integration/IntegrationStage.java b/src/main/java/appeng/integration/IntegrationStage.java index c589d3e8590..ead21763b9a 100644 --- a/src/main/java/appeng/integration/IntegrationStage.java +++ b/src/main/java/appeng/integration/IntegrationStage.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; diff --git a/src/main/java/appeng/integration/IntegrationType.java b/src/main/java/appeng/integration/IntegrationType.java index 53ff1007dfd..69455ea8d5f 100644 --- a/src/main/java/appeng/integration/IntegrationType.java +++ b/src/main/java/appeng/integration/IntegrationType.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration; public enum IntegrationType { + IC2(IntegrationSide.BOTH, "Industrial Craft 2", "IC2"), RotaryCraft(IntegrationSide.BOTH, "Rotary Craft", "RotaryCraft"), diff --git a/src/main/java/appeng/integration/abstraction/IBetterStorage.java b/src/main/java/appeng/integration/abstraction/IBetterStorage.java index f8a04f23d6f..2d3ff9fcb27 100644 --- a/src/main/java/appeng/integration/abstraction/IBetterStorage.java +++ b/src/main/java/appeng/integration/abstraction/IBetterStorage.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.util.InventoryAdaptor; import net.minecraftforge.common.util.ForgeDirection; +import appeng.util.InventoryAdaptor; + public interface IBetterStorage { boolean isStorageCrate(Object te); diff --git a/src/main/java/appeng/integration/abstraction/IBuildCraftCore.java b/src/main/java/appeng/integration/abstraction/IBuildCraftCore.java index 61be6447b4a..2caef41eeb8 100644 --- a/src/main/java/appeng/integration/abstraction/IBuildCraftCore.java +++ b/src/main/java/appeng/integration/abstraction/IBuildCraftCore.java @@ -1,41 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; /** * Contains wrench behaviour *

- * and registers the engines as P2P attunements for RF tunnels - * (since BC 7, they are part of BC Core) - * The attunement is currently not public anymore, - * because it was only used internally + * and registers the engines as P2P attunements for RF tunnels (since BC 7, they are part of BC Core) The attunement is + * currently not public anymore, because it was only used internally * * @author AlgorithmX2 * @version rv3 * @since rv0 */ public interface IBuildCraftCore { + /** * @param eq to be checked item, can be {@code null} * @return {@code true} if it is an {@link buildcraft.api.tools.IToolWrench} diff --git a/src/main/java/appeng/integration/abstraction/IBuildCraftTransport.java b/src/main/java/appeng/integration/abstraction/IBuildCraftTransport.java index 06e34d9bd24..3878c4ab45d 100644 --- a/src/main/java/appeng/integration/abstraction/IBuildCraftTransport.java +++ b/src/main/java/appeng/integration/abstraction/IBuildCraftTransport.java @@ -1,46 +1,39 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.api.parts.IFacadePart; import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IFacadePart; + /** * Contains facade logic to interchange BC facades with AE facades, *

* pipe logic to interact between storage buses and pipes *

- * and using pipes for attunements - * The attunement is currently not public anymore, - * because it was only used internally + * and using pipes for attunements The attunement is currently not public anymore, because it was only used internally * * @author thatsIch * @version rv3 - 12.06.2015 * @since rv3 12.06.2015 */ public interface IBuildCraftTransport { + /** * @param is to be checked item * @return {@code true} if the checked item is a {@link buildcraft.api.facades.IFacadeItem} diff --git a/src/main/java/appeng/integration/abstraction/ICLApi.java b/src/main/java/appeng/integration/abstraction/ICLApi.java index faa7c085d79..d67567330df 100644 --- a/src/main/java/appeng/integration/abstraction/ICLApi.java +++ b/src/main/java/appeng/integration/abstraction/ICLApi.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/IDSU.java b/src/main/java/appeng/integration/abstraction/IDSU.java index ffa3f267eaf..2f97d0ad9bf 100644 --- a/src/main/java/appeng/integration/abstraction/IDSU.java +++ b/src/main/java/appeng/integration/abstraction/IDSU.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.api.storage.IMEInventory; import net.minecraft.tileentity.TileEntity; +import appeng.api.storage.IMEInventory; + public interface IDSU { IMEInventory getDSU(TileEntity te); diff --git a/src/main/java/appeng/integration/abstraction/IFMP.java b/src/main/java/appeng/integration/abstraction/IFMP.java index f9ab99d67ff..a9ef6f1dd89 100644 --- a/src/main/java/appeng/integration/abstraction/IFMP.java +++ b/src/main/java/appeng/integration/abstraction/IFMP.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; + import appeng.api.parts.IPartHost; import appeng.parts.CableBusContainer; import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; public interface IFMP { diff --git a/src/main/java/appeng/integration/abstraction/IFZ.java b/src/main/java/appeng/integration/abstraction/IFZ.java index d21ac85ca10..071becd0ab7 100644 --- a/src/main/java/appeng/integration/abstraction/IFZ.java +++ b/src/main/java/appeng/integration/abstraction/IFZ.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.api.storage.IMEInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import appeng.api.storage.IMEInventory; + public interface IFZ { ItemStack barrelGetItem(TileEntity te); diff --git a/src/main/java/appeng/integration/abstraction/IForestry.java b/src/main/java/appeng/integration/abstraction/IForestry.java index b1d1184eb10..aa35a6dd783 100644 --- a/src/main/java/appeng/integration/abstraction/IForestry.java +++ b/src/main/java/appeng/integration/abstraction/IForestry.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/IGT.java b/src/main/java/appeng/integration/abstraction/IGT.java index e377606f11f..ce807c4a686 100644 --- a/src/main/java/appeng/integration/abstraction/IGT.java +++ b/src/main/java/appeng/integration/abstraction/IGT.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.api.storage.IMEInventory; import net.minecraft.tileentity.TileEntity; +import appeng.api.storage.IMEInventory; + public interface IGT { boolean isQuantumChest(TileEntity te); diff --git a/src/main/java/appeng/integration/abstraction/IIC2.java b/src/main/java/appeng/integration/abstraction/IIC2.java index bde96dd2c19..743e7293e18 100644 --- a/src/main/java/appeng/integration/abstraction/IIC2.java +++ b/src/main/java/appeng/integration/abstraction/IIC2.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/IImmibisMicroblocks.java b/src/main/java/appeng/integration/abstraction/IImmibisMicroblocks.java index 1d65e7f33d6..02f4702cb88 100644 --- a/src/main/java/appeng/integration/abstraction/IImmibisMicroblocks.java +++ b/src/main/java/appeng/integration/abstraction/IImmibisMicroblocks.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.api.parts.IPartHost; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; +import appeng.api.parts.IPartHost; + public interface IImmibisMicroblocks { IPartHost getOrCreateHost(EntityPlayer player, int side, TileEntity te); diff --git a/src/main/java/appeng/integration/abstraction/IInvTweaks.java b/src/main/java/appeng/integration/abstraction/IInvTweaks.java index 9d6bd36bc8b..8a10b30dbea 100644 --- a/src/main/java/appeng/integration/abstraction/IInvTweaks.java +++ b/src/main/java/appeng/integration/abstraction/IInvTweaks.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/ILP.java b/src/main/java/appeng/integration/abstraction/ILP.java index c2d1d9704eb..1665eb44393 100644 --- a/src/main/java/appeng/integration/abstraction/ILP.java +++ b/src/main/java/appeng/integration/abstraction/ILP.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; -import appeng.api.storage.IMEInventory; import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import appeng.api.storage.IMEInventory; + public interface ILP { List getCraftedItems(TileEntity te); diff --git a/src/main/java/appeng/integration/abstraction/IMekanism.java b/src/main/java/appeng/integration/abstraction/IMekanism.java index 7116e5df1bc..c0b49714807 100644 --- a/src/main/java/appeng/integration/abstraction/IMekanism.java +++ b/src/main/java/appeng/integration/abstraction/IMekanism.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/INEI.java b/src/main/java/appeng/integration/abstraction/INEI.java index 6860022f947..b2bdc225d40 100644 --- a/src/main/java/appeng/integration/abstraction/INEI.java +++ b/src/main/java/appeng/integration/abstraction/INEI.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/IRC.java b/src/main/java/appeng/integration/abstraction/IRC.java index b60be4a4796..614d4f6bf3d 100644 --- a/src/main/java/appeng/integration/abstraction/IRC.java +++ b/src/main/java/appeng/integration/abstraction/IRC.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/abstraction/ITE.java b/src/main/java/appeng/integration/abstraction/ITE.java index 1bebd51abf0..67344e169f7 100644 --- a/src/main/java/appeng/integration/abstraction/ITE.java +++ b/src/main/java/appeng/integration/abstraction/ITE.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.abstraction; diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java index 696ccc8a931..dabcbc99a50 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AECableSchematicTile.java @@ -1,29 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.BCHelpers; -import appeng.api.parts.*; -import appeng.api.util.AEColor; -import appeng.api.util.DimensionalCoord; -import appeng.parts.CableBusContainer; -import buildcraft.api.blueprints.IBuilderContext; import java.util.Set; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -31,6 +19,12 @@ import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.*; +import appeng.api.util.AEColor; +import appeng.api.util.DimensionalCoord; +import appeng.parts.CableBusContainer; +import buildcraft.api.blueprints.IBuilderContext; + public class AECableSchematicTile extends AEGenericSchematicTile implements IPartHost { @Override diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java index 57ff403b650..ce5e4227102 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AEGenericSchematicTile.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.BCHelpers; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.util.ICommonTile; import appeng.tile.AEBaseTile; import appeng.util.Platform; import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.SchematicTile; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class AEGenericSchematicTile extends SchematicTile { diff --git a/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java b/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java index 2fb436c46ed..df86ff28b1a 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/AERotatableBlockSchematic.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.BCHelpers; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.util.Platform; import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.SchematicBlock; -import net.minecraftforge.common.util.ForgeDirection; public class AERotatableBlockSchematic extends SchematicBlock { diff --git a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java index 0dccf44a3e3..a4562872c56 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeHandler.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.BCHelpers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IMEInventory; @@ -25,17 +20,15 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IBuildCraftTransport; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class BCPipeHandler implements IExternalStorageHandler { @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource mySrc) { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport bc = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); return chan == StorageChannel.ITEMS && bc.isPipe(te, d); } @@ -44,8 +37,8 @@ public boolean canHandle( } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource src) { if (chan == StorageChannel.ITEMS) { return new BCPipeInventory(te, d); } diff --git a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java index 0570ec97c6e..dd2911b1db2 100644 --- a/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java +++ b/src/main/java/appeng/integration/modules/BCHelpers/BCPipeInventory.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.BCHelpers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IMEInventory; @@ -27,8 +22,6 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IBuildCraftTransport; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class BCPipeInventory implements IMEInventory { @@ -43,8 +36,8 @@ public BCPipeInventory(final TileEntity te, final ForgeDirection direction) { @Override public IAEItemStack injectItems(final IAEItemStack input, final Actionable mode, final BaseActionSource src) { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport registry = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport registry = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); if (mode == Actionable.SIMULATE) { if (registry.canAddItemsToPipe(this.te, input.getItemStack(), this.direction)) { diff --git a/src/main/java/appeng/integration/modules/BetterStorage.java b/src/main/java/appeng/integration/modules/BetterStorage.java index 28184462500..af50a74ab78 100644 --- a/src/main/java/appeng/integration/modules/BetterStorage.java +++ b/src/main/java/appeng/integration/modules/BetterStorage.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.mcft.copy.betterstorage.api.crate.ICrateStorage; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.helpers.Reflected; import appeng.integration.IIntegrationModule; @@ -26,10 +21,9 @@ import appeng.integration.modules.helpers.BSCrateHandler; import appeng.integration.modules.helpers.BSCrateStorageAdaptor; import appeng.util.InventoryAdaptor; -import net.mcft.copy.betterstorage.api.crate.ICrateStorage; -import net.minecraftforge.common.util.ForgeDirection; public class BetterStorage implements IIntegrationModule, IBetterStorage { + @Reflected public static BetterStorage instance; diff --git a/src/main/java/appeng/integration/modules/BuildCraftBuilder.java b/src/main/java/appeng/integration/modules/BuildCraftBuilder.java index 6287d5eeac0..1ffb21e3a83 100644 --- a/src/main/java/appeng/integration/modules/BuildCraftBuilder.java +++ b/src/main/java/appeng/integration/modules/BuildCraftBuilder.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlocks; @@ -32,11 +30,8 @@ import appeng.integration.modules.BCHelpers.AERotatableBlockSchematic; import buildcraft.api.blueprints.BuilderAPI; import buildcraft.api.blueprints.ISchematicRegistry; + import com.google.common.base.Optional; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; /** * The builder has no interface, because it provides no functionality @@ -47,6 +42,7 @@ */ @Reflected public class BuildCraftBuilder implements IIntegrationModule { + @Reflected public static BuildCraftBuilder instance; @@ -86,8 +82,7 @@ private void initBuilderSupport() { } final Block block = maybeBlock.get(); - if (block instanceof IOrientableBlock - && ((IOrientableBlock) block).usesMetadata() + if (block instanceof IOrientableBlock && ((IOrientableBlock) block).usesMetadata() && !(def instanceof ITileDefinition)) { schematicRegistry.registerSchematicBlock(block, AERotatableBlockSchematic.class); } else if (maybeMultiPart.isSameAs(new ItemStack(block))) { diff --git a/src/main/java/appeng/integration/modules/BuildCraftCore.java b/src/main/java/appeng/integration/modules/BuildCraftCore.java index 45839dc888b..60ee401ff7d 100644 --- a/src/main/java/appeng/integration/modules/BuildCraftCore.java +++ b/src/main/java/appeng/integration/modules/BuildCraftCore.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import javax.annotation.Nonnull; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.TunnelType; import appeng.api.features.IP2PTunnelRegistry; @@ -26,13 +24,10 @@ import appeng.integration.IntegrationHelper; import appeng.integration.abstraction.IBuildCraftCore; import buildcraft.api.tools.IToolWrench; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; @Reflected public final class BuildCraftCore implements IBuildCraftCore, IIntegrationModule { + @Reflected public static BuildCraftCore instance; @@ -49,14 +44,14 @@ public boolean isWrench(final Item eq) { } @Override - public boolean canWrench( - @Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, final int z) { + public boolean canWrench(@Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, + final int z) { return ((IToolWrench) wrench).canWrench(wrencher, x, y, z); } @Override - public void wrenchUsed( - @Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, final int z) { + public void wrenchUsed(@Nonnull final Item wrench, final EntityPlayer wrencher, final int x, final int y, + final int z) { ((IToolWrench) wrench).wrenchUsed(wrencher, x, y, z); } diff --git a/src/main/java/appeng/integration/modules/BuildCraftTransport.java b/src/main/java/appeng/integration/modules/BuildCraftTransport.java index 0448c7153d7..2da4f8f6b66 100644 --- a/src/main/java/appeng/integration/modules/BuildCraftTransport.java +++ b/src/main/java/appeng/integration/modules/BuildCraftTransport.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.IAppEngApi; import appeng.api.config.TunnelType; @@ -37,14 +39,6 @@ import buildcraft.transport.ItemFacade; import buildcraft.transport.PipeIconProvider; import cpw.mods.fml.common.event.FMLInterModComms; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; /** * @author thatsIch @@ -53,6 +47,7 @@ */ @Reflected public class BuildCraftTransport implements IBuildCraftTransport, IIntegrationModule { + @Reflected public static BuildCraftTransport instance; @@ -120,10 +115,9 @@ public ItemStack getTextureForFacade(@Nonnull final ItemStack facade) { @Override public IIcon getCobbleStructurePipeTexture() { try { - return buildcraft.BuildCraftTransport.instance.pipeIconProvider.getIcon( - PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure - } catch (final Exception ignored) { - } + return buildcraft.BuildCraftTransport.instance.pipeIconProvider + .getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure + } catch (final Exception ignored) {} return null; // Pipe } @@ -154,8 +148,8 @@ public boolean canAddItemsToPipe(final TileEntity te, final ItemStack is, final } @Override - public boolean addItemsToPipe( - @Nullable final TileEntity te, @Nullable final ItemStack is, @Nonnull final ForgeDirection dir) { + public boolean addItemsToPipe(@Nullable final TileEntity te, @Nullable final ItemStack is, + @Nonnull final ForgeDirection dir) { if (is != null && te != null && te instanceof IInjectable) { final IInjectable pt = (IInjectable) te; if (pt.canInjectItems(dir)) { @@ -180,7 +174,8 @@ private void registerPowerP2P() { final IP2PTunnelRegistry registry = AEApi.instance().registries().p2pTunnel(); registry.addNewAttunement( - new ItemStack(buildcraft.BuildCraftTransport.pipePowerCobblestone), TunnelType.RF_POWER); + new ItemStack(buildcraft.BuildCraftTransport.pipePowerCobblestone), + TunnelType.RF_POWER); registry.addNewAttunement(new ItemStack(buildcraft.BuildCraftTransport.pipePowerDiamond), TunnelType.RF_POWER); registry.addNewAttunement(new ItemStack(buildcraft.BuildCraftTransport.pipePowerGold), TunnelType.RF_POWER); registry.addNewAttunement(new ItemStack(buildcraft.BuildCraftTransport.pipePowerQuartz), TunnelType.RF_POWER); @@ -232,9 +227,9 @@ public void postInit() { private void initPipeConnection() { final IAppEngApi api = AEApi.instance(); - api.partHelper() - .registerNewLayer( - "appeng.parts.layers.LayerIPipeConnection", "buildcraft.api.transport.IPipeConnection"); + api.partHelper().registerNewLayer( + "appeng.parts.layers.LayerIPipeConnection", + "buildcraft.api.transport.IPipeConnection"); api.registries().externalStorage().addExternalStorageInterface(new BCPipeHandler()); } diff --git a/src/main/java/appeng/integration/modules/CLApi.java b/src/main/java/appeng/integration/modules/CLApi.java index 9441fc8b563..dd61a4913a2 100644 --- a/src/main/java/appeng/integration/modules/CLApi.java +++ b/src/main/java/appeng/integration/modules/CLApi.java @@ -9,11 +9,11 @@ // * // * Applied Energistics 2 is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU Lesser General Public License for more details. // * // * You should have received a copy of the GNU Lesser General Public License -// * along with Applied Energistics 2. If not, see . +// * along with Applied Energistics 2. If not, see . // */ // // package appeng.integration.modules; @@ -28,35 +28,35 @@ // // public class CLApi implements ICLApi, IIntegrationModule // { -// @Reflected -// public static CLApi instance; -// -// @Reflected -// public CLApi() -// { -// IntegrationHelper.testClassExistence( this, coloredlightscore.src.api.CLApi.class ); -// } -// -// @Override -// public void init() throws Throwable -// { -// } -// -// @Override -// public void postInit() -// { -// // :P -// } -// -// @Override -// public int colorLight( final AEColor color, final int light ) -// { -// final int mv = color.mediumVariant; -// -// final float r = ( mv >> 16 ) & 0xff; -// final float g = ( mv >> 8 ) & 0xff; -// final float b = ( mv ) & 0xff; -// -// return coloredlightscore.src.api.CLApi.makeRGBLightValue( r / 255.0f, g / 255.0f, b / 255.0f, light / 15.0f ); -// } +// @Reflected +// public static CLApi instance; +// +// @Reflected +// public CLApi() +// { +// IntegrationHelper.testClassExistence( this, coloredlightscore.src.api.CLApi.class ); +// } +// +// @Override +// public void init() throws Throwable +// { +// } +// +// @Override +// public void postInit() +// { +// // :P +// } +// +// @Override +// public int colorLight( final AEColor color, final int light ) +// { +// final int mv = color.mediumVariant; +// +// final float r = ( mv >> 16 ) & 0xff; +// final float g = ( mv >> 8 ) & 0xff; +// final float b = ( mv ) & 0xff; +// +// return coloredlightscore.src.api.CLApi.makeRGBLightValue( r / 255.0f, g / 255.0f, b / 255.0f, light / 15.0f ); +// } // } diff --git a/src/main/java/appeng/integration/modules/Chisel.java b/src/main/java/appeng/integration/modules/Chisel.java index 09edac2fc50..82442f7608e 100644 --- a/src/main/java/appeng/integration/modules/Chisel.java +++ b/src/main/java/appeng/integration/modules/Chisel.java @@ -1,12 +1,13 @@ package appeng.integration.modules; +import net.minecraft.block.Block; + import appeng.api.AEApi; import appeng.api.definitions.IBlocks; import appeng.helpers.Reflected; import appeng.integration.IIntegrationModule; import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.Block; public class Chisel implements IIntegrationModule { diff --git a/src/main/java/appeng/integration/modules/CraftGuide.java b/src/main/java/appeng/integration/modules/CraftGuide.java index 58580e87d19..54204ffd22c 100644 --- a/src/main/java/appeng/integration/modules/CraftGuide.java +++ b/src/main/java/appeng/integration/modules/CraftGuide.java @@ -9,11 +9,11 @@ // * // * Applied Energistics 2 is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU Lesser General Public License for more details. // * // * You should have received a copy of the GNU Lesser General Public License -// * along with Applied Energistics 2. If not, see . +// * along with Applied Energistics 2. If not, see . // */ // // package appeng.integration.modules; @@ -51,414 +51,414 @@ // // public final class CraftGuide extends CraftGuideAPIObject implements IIntegrationModule, RecipeProvider // { -// private static final int SLOT_SIZE = 16; -// private static final int TEXTURE_WIDTH = 79; -// private static final int TEXTURE_HEIGHT = 58; -// private static final int GRINDER_RATIO = 10000; -// -// private static final Slot[] GRINDER_SLOTS = { -// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 41, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ), -// new ChanceSlot( 59, 12, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% +// private static final int SLOT_SIZE = 16; +// private static final int TEXTURE_WIDTH = 79; +// private static final int TEXTURE_HEIGHT = 58; +// private static final int GRINDER_RATIO = 10000; +// +// private static final Slot[] GRINDER_SLOTS = { +// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 41, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ), +// new ChanceSlot( 59, 12, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% // chance)" ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ), -// new ChanceSlot( 59, 30, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% +// new ChanceSlot( 59, 30, SLOT_SIZE, SLOT_SIZE, true ).setRatio( GRINDER_RATIO ).setFormatString( " (%1$.2f%% // chance)" ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ), -// new ItemSlot( 22, 12, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ), -// new ItemSlot( 22, 30, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ) -// }; -// private static final Slot[] INSCRIBER_SLOTS = { -// new ItemSlot( 12, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 50, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ), -// new ItemSlot( 31, 21, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ) -// }; -// private static final Slot[] SHAPELESS_CRAFTING_SLOTS = { -// new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ), -// }; -// private static final Slot[] CRAFTING_SLOTS_OWN_BG = { -// new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(), -// }; -// private static final Slot[] SMALL_CRAFTING_SLOTS_OWN_BG = { -// new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), -// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(), -// }; -// private static final Slot[] CRTAFTING_SLOTS = { -// new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ), -// }; -// private static final Slot[] SMALL_CRAFTING_SLOTS = { -// new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ), -// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ), -// }; -// -// @Reflected -// public static CraftGuide instance; -// -// public CraftGuide() -// { -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.CraftGuideLog.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.DefaultRecipeTemplate.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.RecipeGeneratorImplementation.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ChanceSlot.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.CraftGuideAPIObject.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ItemSlot.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeGenerator.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeProvider.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeTemplate.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.Slot.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.SlotType.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.DynamicTexture.class ); -// IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.TextureClip.class ); -// } -// -// @Override -// public void init() throws Throwable -// { -// } -// -// @Override -// public void postInit() -// { -// } -// -// @Override -// public void generateRecipes( final RecipeGenerator generator ) -// { -// final RecipeTemplate craftingTemplate; -// final RecipeTemplate smallTemplate; -// -// if( uristqwerty.CraftGuide.CraftGuide.newerBackgroundStyle ) -// { -// craftingTemplate = generator.createRecipeTemplate( CRAFTING_SLOTS_OWN_BG, null ); -// smallTemplate = generator.createRecipeTemplate( SMALL_CRAFTING_SLOTS_OWN_BG, null ); -// } -// else -// { -// final TextureClip craftingBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 1, +// new ItemSlot( 22, 12, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ), +// new ItemSlot( 22, 30, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ) +// }; +// private static final Slot[] INSCRIBER_SLOTS = { +// new ItemSlot( 12, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 50, 21, SLOT_SIZE, SLOT_SIZE, true ).drawOwnBackground().setSlotType( SlotType.OUTPUT_SLOT ), +// new ItemSlot( 31, 21, SLOT_SIZE, SLOT_SIZE ).setSlotType( SlotType.MACHINE_SLOT ) +// }; +// private static final Slot[] SHAPELESS_CRAFTING_SLOTS = { +// new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ), +// }; +// private static final Slot[] CRAFTING_SLOTS_OWN_BG = { +// new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(), +// }; +// private static final Slot[] SMALL_CRAFTING_SLOTS_OWN_BG = { +// new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ).drawOwnBackground(), +// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ).drawOwnBackground(), +// }; +// private static final Slot[] CRTAFTING_SLOTS = { +// new ItemSlot( 3, 3, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 21, 3, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 39, 3, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 3, 21, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 21, 21, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 39, 21, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 3, 39, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 21, 39, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 39, 39, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ), +// }; +// private static final Slot[] SMALL_CRAFTING_SLOTS = { +// new ItemSlot( 12, 12, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 30, 12, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 12, 30, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 30, 30, SLOT_SIZE, SLOT_SIZE ), +// new ItemSlot( 59, 21, SLOT_SIZE, SLOT_SIZE, true ).setSlotType( SlotType.OUTPUT_SLOT ), +// }; +// +// @Reflected +// public static CraftGuide instance; +// +// public CraftGuide() +// { +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.CraftGuideLog.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.DefaultRecipeTemplate.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.RecipeGeneratorImplementation.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ChanceSlot.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.CraftGuideAPIObject.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.ItemSlot.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeGenerator.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeProvider.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.RecipeTemplate.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.Slot.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.CraftGuide.api.SlotType.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.DynamicTexture.class ); +// IntegrationHelper.testClassExistence( this, uristqwerty.gui_craftguide.texture.TextureClip.class ); +// } +// +// @Override +// public void init() throws Throwable +// { +// } +// +// @Override +// public void postInit() +// { +// } +// +// @Override +// public void generateRecipes( final RecipeGenerator generator ) +// { +// final RecipeTemplate craftingTemplate; +// final RecipeTemplate smallTemplate; +// +// if( uristqwerty.CraftGuide.CraftGuide.newerBackgroundStyle ) +// { +// craftingTemplate = generator.createRecipeTemplate( CRAFTING_SLOTS_OWN_BG, null ); +// smallTemplate = generator.createRecipeTemplate( SMALL_CRAFTING_SLOTS_OWN_BG, null ); +// } +// else +// { +// final TextureClip craftingBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 1, // TEXTURE_WIDTH, TEXTURE_HEIGHT ); -// final TextureClip craftingSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 1, +// final TextureClip craftingSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 1, // TEXTURE_WIDTH, TEXTURE_HEIGHT ); -// craftingTemplate = new DefaultRecipeTemplate( CRTAFTING_SLOTS, RecipeGeneratorImplementation.workbench, craftingBG, +// craftingTemplate = new DefaultRecipeTemplate( CRTAFTING_SLOTS, RecipeGeneratorImplementation.workbench, craftingBG, // craftingSelected ); // -// final TextureClip smallBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, TEXTURE_WIDTH, +// final TextureClip smallBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 61, TEXTURE_WIDTH, // TEXTURE_HEIGHT ); -// final TextureClip smallSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, +// final TextureClip smallSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 61, // TEXTURE_WIDTH, TEXTURE_HEIGHT ); -// smallTemplate = new DefaultRecipeTemplate( SMALL_CRAFTING_SLOTS, RecipeGeneratorImplementation.workbench, smallBG, +// smallTemplate = new DefaultRecipeTemplate( SMALL_CRAFTING_SLOTS, RecipeGeneratorImplementation.workbench, smallBG, // smallSelected ); -// } +// } // -// final TextureClip shapelessBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 121, +// final TextureClip shapelessBG = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 1, 121, // TEXTURE_WIDTH, TEXTURE_HEIGHT ); -// final TextureClip shapelessSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 121, +// final TextureClip shapelessSelected = new TextureClip( DynamicTexture.instance( "recipe_backgrounds" ), 82, 121, // TEXTURE_WIDTH, TEXTURE_HEIGHT ); -// final RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( SHAPELESS_CRAFTING_SLOTS, +// final RecipeTemplate shapelessTemplate = new DefaultRecipeTemplate( SHAPELESS_CRAFTING_SLOTS, // RecipeGeneratorImplementation.workbench, shapelessBG, shapelessSelected ); // -// this.addCraftingRecipes( craftingTemplate, smallTemplate, shapelessTemplate, generator ); +// this.addCraftingRecipes( craftingTemplate, smallTemplate, shapelessTemplate, generator ); // -// final IAppEngApi api = AEApi.instance(); -// final IBlocks aeBlocks = api.definitions().blocks(); -// final Optional grindstone = aeBlocks.grindStone().maybeStack( 1 ); -// final Optional inscriber = aeBlocks.inscriber().maybeStack( 1 ); +// final IAppEngApi api = AEApi.instance(); +// final IBlocks aeBlocks = api.definitions().blocks(); +// final Optional grindstone = aeBlocks.grindStone().maybeStack( 1 ); +// final Optional inscriber = aeBlocks.inscriber().maybeStack( 1 ); // -// if( grindstone.isPresent() ) -// { -// this.addGrinderRecipes( api, grindstone.get(), generator ); -// } +// if( grindstone.isPresent() ) +// { +// this.addGrinderRecipes( api, grindstone.get(), generator ); +// } // -// if( inscriber.isPresent() ) -// { -// this.addInscriberRecipes( api, inscriber.get(), generator ); -// } -// } +// if( inscriber.isPresent() ) +// { +// this.addInscriberRecipes( api, inscriber.get(), generator ); +// } +// } // -// @SuppressWarnings( "unchecked" ) -// private List getUncheckedRecipes() -// { -// return (List) CraftingManager.getInstance().getRecipeList(); -// } +// @SuppressWarnings( "unchecked" ) +// private List getUncheckedRecipes() +// { +// return (List) CraftingManager.getInstance().getRecipeList(); +// } // -// private void addCraftingRecipes( final RecipeTemplate template, final RecipeTemplate templateSmall, final +// private void addCraftingRecipes( final RecipeTemplate template, final RecipeTemplate templateSmall, final // RecipeTemplate templateShapeless, final RecipeGenerator generator ) -// { -// final List recipes = this.getUncheckedRecipes(); -// -// int errCount = 0; -// -// for( final IRecipe recipe : recipes ) -// { -// try -// { -// final Object[] items = this.getCraftingRecipe( recipe, true ); -// -// if( items == null ) -// { -// continue; -// } -// if( items.length == 5 ) -// { -// generator.addRecipe( templateSmall, items ); -// } -// else if( recipe instanceof ShapelessRecipe ) -// { -// generator.addRecipe( templateShapeless, items ); -// } -// else -// { -// generator.addRecipe( template, items ); -// } -// } -// catch( final Exception e ) -// { -// if( errCount >= 5 ) -// { -// CraftGuideLog.log( "AppEng CraftGuide integration: Stack trace limit reached, further stack traces from this +// { +// final List recipes = this.getUncheckedRecipes(); +// +// int errCount = 0; +// +// for( final IRecipe recipe : recipes ) +// { +// try +// { +// final Object[] items = this.getCraftingRecipe( recipe, true ); +// +// if( items == null ) +// { +// continue; +// } +// if( items.length == 5 ) +// { +// generator.addRecipe( templateSmall, items ); +// } +// else if( recipe instanceof ShapelessRecipe ) +// { +// generator.addRecipe( templateShapeless, items ); +// } +// else +// { +// generator.addRecipe( template, items ); +// } +// } +// catch( final Exception e ) +// { +// if( errCount >= 5 ) +// { +// CraftGuideLog.log( "AppEng CraftGuide integration: Stack trace limit reached, further stack traces from this // invocation will not be logged to the console. They will still be logged to // (.minecraft)/config/CraftGuide/CraftGuide.log", true ); -// } -// else -// { -// e.printStackTrace(); -// } -// errCount++; -// -// CraftGuideLog.log( e ); -// } -// } -// } -// -// private void addGrinderRecipes( final IAppEngApi api, final ItemStack grindstone, final RecipeGenerator generator ) -// { -// final ItemStack handle = api.definitions().blocks().crankHandle().maybeStack( 1 ).orNull(); -// final RecipeTemplate grinderTemplate = generator.createRecipeTemplate( GRINDER_SLOTS, grindstone ); -// -// for( final IGrinderEntry recipe : api.registries().grinder().getRecipes() ) -// { -// generator.addRecipe( grinderTemplate, new Object[] { -// recipe.getInput(), -// recipe.getOutput(), -// new Object[] { -// recipe.getOptionalOutput(), -// (int) ( recipe.getOptionalChance() * GRINDER_RATIO ) -// }, -// new Object[] { -// recipe.getSecondOptionalOutput(), -// (int) ( recipe.getOptionalChance() * GRINDER_RATIO ) -// }, -// handle, -// grindstone -// } ); -// } -// } -// -// private void addInscriberRecipes( final IAppEngApi api, final ItemStack inscriber, final RecipeGenerator generator ) -// { -// final RecipeTemplate inscriberTemplate = generator.createRecipeTemplate( INSCRIBER_SLOTS, inscriber ); -// -// for( final IInscriberRecipe recipe : api.registries().inscriber().getRecipes() ) -// { -// generator.addRecipe( inscriberTemplate, new Object[] { -// recipe.getInputs(), -// recipe.getTopOptional().orNull(), -// recipe.getBottomOptional().orNull(), -// recipe.getOutput(), -// inscriber -// } ); -// } -// } -// -// private Object[] getCraftingShapelessRecipe( final List items, final ItemStack recipeOutput ) -// { -// final Object[] output = new Object[10]; -// -// for( int i = 0; i < items.size(); i++ ) -// { -// output[i] = items.get( i ); -// -// if( output[i] instanceof ItemStack[] ) -// { -// output[i] = Arrays.asList( (ItemStack[]) output[i] ); -// } -// -// if( output[i] instanceof IIngredient ) -// { -// try -// { -// output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); -// } -// catch( final RegistrationError ignored ) -// { -// -// } -// catch( final MissingIngredientError ignored ) -// { -// -// } -// } -// } -// -// output[9] = recipeOutput; -// -// return output; -// } -// -// private Object[] getSmallShapedRecipe( final int width, final int height, final Object[] items, final ItemStack +// } +// else +// { +// e.printStackTrace(); +// } +// errCount++; +// +// CraftGuideLog.log( e ); +// } +// } +// } +// +// private void addGrinderRecipes( final IAppEngApi api, final ItemStack grindstone, final RecipeGenerator generator ) +// { +// final ItemStack handle = api.definitions().blocks().crankHandle().maybeStack( 1 ).orNull(); +// final RecipeTemplate grinderTemplate = generator.createRecipeTemplate( GRINDER_SLOTS, grindstone ); +// +// for( final IGrinderEntry recipe : api.registries().grinder().getRecipes() ) +// { +// generator.addRecipe( grinderTemplate, new Object[] { +// recipe.getInput(), +// recipe.getOutput(), +// new Object[] { +// recipe.getOptionalOutput(), +// (int) ( recipe.getOptionalChance() * GRINDER_RATIO ) +// }, +// new Object[] { +// recipe.getSecondOptionalOutput(), +// (int) ( recipe.getOptionalChance() * GRINDER_RATIO ) +// }, +// handle, +// grindstone +// } ); +// } +// } +// +// private void addInscriberRecipes( final IAppEngApi api, final ItemStack inscriber, final RecipeGenerator generator ) +// { +// final RecipeTemplate inscriberTemplate = generator.createRecipeTemplate( INSCRIBER_SLOTS, inscriber ); +// +// for( final IInscriberRecipe recipe : api.registries().inscriber().getRecipes() ) +// { +// generator.addRecipe( inscriberTemplate, new Object[] { +// recipe.getInputs(), +// recipe.getTopOptional().orNull(), +// recipe.getBottomOptional().orNull(), +// recipe.getOutput(), +// inscriber +// } ); +// } +// } +// +// private Object[] getCraftingShapelessRecipe( final List items, final ItemStack recipeOutput ) +// { +// final Object[] output = new Object[10]; +// +// for( int i = 0; i < items.size(); i++ ) +// { +// output[i] = items.get( i ); +// +// if( output[i] instanceof ItemStack[] ) +// { +// output[i] = Arrays.asList( (ItemStack[]) output[i] ); +// } +// +// if( output[i] instanceof IIngredient ) +// { +// try +// { +// output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); +// } +// catch( final RegistrationError ignored ) +// { +// +// } +// catch( final MissingIngredientError ignored ) +// { +// +// } +// } +// } +// +// output[9] = recipeOutput; +// +// return output; +// } +// +// private Object[] getSmallShapedRecipe( final int width, final int height, final Object[] items, final ItemStack // recipeOutput ) -// { -// final Object[] output = new Object[5]; -// -// for( int y = 0; y < height; y++ ) -// { -// for( int x = 0; x < width; x++ ) -// { -// final int i = y * 2 + x; -// output[i] = items[y * width + x]; -// -// if( output[i] instanceof ItemStack[] ) -// { -// output[i] = Arrays.asList( (ItemStack[]) output[i] ); -// } -// -// if( output[i] instanceof IIngredient ) -// { -// try -// { -// output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); -// } -// catch( final RegistrationError ignored ) -// { -// -// } -// catch( final MissingIngredientError ignored ) -// { -// -// } -// } -// } -// } -// -// output[4] = recipeOutput; -// -// return output; -// } -// -// private Object[] getCraftingShapedRecipe( final int width, final int height, final Object[] items, final ItemStack +// { +// final Object[] output = new Object[5]; +// +// for( int y = 0; y < height; y++ ) +// { +// for( int x = 0; x < width; x++ ) +// { +// final int i = y * 2 + x; +// output[i] = items[y * width + x]; +// +// if( output[i] instanceof ItemStack[] ) +// { +// output[i] = Arrays.asList( (ItemStack[]) output[i] ); +// } +// +// if( output[i] instanceof IIngredient ) +// { +// try +// { +// output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); +// } +// catch( final RegistrationError ignored ) +// { +// +// } +// catch( final MissingIngredientError ignored ) +// { +// +// } +// } +// } +// } +// +// output[4] = recipeOutput; +// +// return output; +// } +// +// private Object[] getCraftingShapedRecipe( final int width, final int height, final Object[] items, final ItemStack // recipeOutput ) -// { -// final Object[] output = new Object[10]; -// -// for( int y = 0; y < height; y++ ) -// { -// for( int x = 0; x < width; x++ ) -// { -// final int i = y * 3 + x; -// output[i] = items[y * width + x]; -// -// if( output[i] instanceof ItemStack[] ) -// { -// output[i] = Arrays.asList( (ItemStack[]) output[i] ); -// } -// -// if( output[i] instanceof IIngredient ) -// { -// try -// { -// output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); -// } -// catch( final RegistrationError ignored ) -// { -// -// } -// catch( final MissingIngredientError ignored ) -// { -// -// } -// } -// } -// } -// -// output[9] = recipeOutput; -// -// return output; -// } -// -// private Object toCG( final ItemStack[] itemStackSet ) -// { -// final List list = Arrays.asList( itemStackSet ); -// -// for( int x = 0; x < list.size(); x++ ) -// { -// list.set( x, list.get( x ).copy() ); -// if( list.get( x ).stackSize == 0 ) -// { -// list.get( x ).stackSize = 1; -// } -// } -// -// return list; -// } -// -// @Nullable -// private Object[] getCraftingRecipe( final IRecipe recipe, final boolean allowSmallGrid ) -// { -// if( recipe instanceof ShapelessRecipe ) -// { -// final List items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, +// { +// final Object[] output = new Object[10]; +// +// for( int y = 0; y < height; y++ ) +// { +// for( int x = 0; x < width; x++ ) +// { +// final int i = y * 3 + x; +// output[i] = items[y * width + x]; +// +// if( output[i] instanceof ItemStack[] ) +// { +// output[i] = Arrays.asList( (ItemStack[]) output[i] ); +// } +// +// if( output[i] instanceof IIngredient ) +// { +// try +// { +// output[i] = this.toCG( ( (IIngredient) output[i] ).getItemStackSet() ); +// } +// catch( final RegistrationError ignored ) +// { +// +// } +// catch( final MissingIngredientError ignored ) +// { +// +// } +// } +// } +// } +// +// output[9] = recipeOutput; +// +// return output; +// } +// +// private Object toCG( final ItemStack[] itemStackSet ) +// { +// final List list = Arrays.asList( itemStackSet ); +// +// for( int x = 0; x < list.size(); x++ ) +// { +// list.set( x, list.get( x ).copy() ); +// if( list.get( x ).stackSize == 0 ) +// { +// list.get( x ).stackSize = 1; +// } +// } +// +// return list; +// } +// +// @Nullable +// private Object[] getCraftingRecipe( final IRecipe recipe, final boolean allowSmallGrid ) +// { +// if( recipe instanceof ShapelessRecipe ) +// { +// final List items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, // "input" ); // -// return this.getCraftingShapelessRecipe( items, recipe.getRecipeOutput() ); -// } -// else if( recipe instanceof ShapedRecipe ) -// { -// final int width = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" ); -// final int height = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" ); -// final Object[] items = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" ); -// -// if( allowSmallGrid && width < 3 && height < 3 ) -// { -// return this.getSmallShapedRecipe( width, height, items, recipe.getRecipeOutput() ); -// } -// else -// { -// return this.getCraftingShapedRecipe( width, height, items, recipe.getRecipeOutput() ); -// } -// } -// -// return null; -// } +// return this.getCraftingShapelessRecipe( items, recipe.getRecipeOutput() ); +// } +// else if( recipe instanceof ShapedRecipe ) +// { +// final int width = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" ); +// final int height = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" ); +// final Object[] items = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" ); +// +// if( allowSmallGrid && width < 3 && height < 3 ) +// { +// return this.getSmallShapedRecipe( width, height, items, recipe.getRecipeOutput() ); +// } +// else +// { +// return this.getCraftingShapedRecipe( width, height, items, recipe.getRecipeOutput() ); +// } +// } +// +// return null; +// } // } diff --git a/src/main/java/appeng/integration/modules/DSU.java b/src/main/java/appeng/integration/modules/DSU.java index 5296673f212..d6912d44e68 100644 --- a/src/main/java/appeng/integration/modules/DSU.java +++ b/src/main/java/appeng/integration/modules/DSU.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.minecraft.tileentity.TileEntity; + +import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; import appeng.api.AEApi; import appeng.api.storage.IMEInventory; import appeng.helpers.Reflected; @@ -26,10 +21,9 @@ import appeng.integration.abstraction.IDSU; import appeng.integration.modules.helpers.MFRDSUHandler; import appeng.integration.modules.helpers.MinefactoryReloadedDeepStorageUnit; -import net.minecraft.tileentity.TileEntity; -import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; public class DSU implements IDSU, IIntegrationModule { + @Reflected public static DSU instance; diff --git a/src/main/java/appeng/integration/modules/FMP.java b/src/main/java/appeng/integration/modules/FMP.java index 1777989b66a..4a914b39b36 100644 --- a/src/main/java/appeng/integration/modules/FMP.java +++ b/src/main/java/appeng/integration/modules/FMP.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import java.util.Collection; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlocks; @@ -40,17 +41,12 @@ import codechicken.multipart.MultipartGenerator; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; + import com.google.common.collect.Lists; import cpw.mods.fml.common.eventhandler.Event; -import java.util.Collection; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IFMP { + @Reflected public static FMP instance; @@ -175,8 +171,9 @@ public void registerPassThrough(final Class layerInterface) { try { MultipartGenerator.registerPassThroughInterface(layerInterface.getName()); } catch (final Throwable t) { - AELog.error("Failed to register " + layerInterface.getName() - + " with FMP, some features may not work with MultiParts."); + AELog.error( + "Failed to register " + layerInterface.getName() + + " with FMP, some features may not work with MultiParts."); AELog.debug(t); } } diff --git a/src/main/java/appeng/integration/modules/FZ.java b/src/main/java/appeng/integration/modules/FZ.java index 3744c01a0e9..cc9fa767d6f 100644 --- a/src/main/java/appeng/integration/modules/FZ.java +++ b/src/main/java/appeng/integration/modules/FZ.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import appeng.api.AEApi; import appeng.api.storage.IMEInventory; import appeng.helpers.Reflected; @@ -26,16 +25,12 @@ import appeng.integration.modules.helpers.FactorizationBarrel; import appeng.integration.modules.helpers.FactorizationHandler; import appeng.util.Platform; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; /** * 100% Hacks. */ public class FZ implements IFZ, IIntegrationModule { + @Reflected public static FZ instance; @@ -59,9 +54,7 @@ public ItemStack barrelGetItem(final TileEntity te) { } return i; - } catch (final IllegalArgumentException ignored) { - } catch (final IllegalAccessException ignored) { - } + } catch (final IllegalArgumentException ignored) {} catch (final IllegalAccessException ignored) {} return null; } @@ -71,10 +64,7 @@ public int barrelGetMaxItemCount(final TileEntity te) { if (day_BarrelClass.isInstance(te)) { return (Integer) day_getMaxSize.invoke(te); } - } catch (final IllegalAccessException ignored) { - } catch (final IllegalArgumentException ignored) { - } catch (final InvocationTargetException ignored) { - } + } catch (final IllegalAccessException ignored) {} catch (final IllegalArgumentException ignored) {} catch (final InvocationTargetException ignored) {} return 0; } @@ -84,10 +74,7 @@ public int barrelGetItemCount(final TileEntity te) { if (day_BarrelClass.isInstance(te)) { return (Integer) day_getItemCount.invoke(te); } - } catch (final IllegalAccessException ignored) { - } catch (final IllegalArgumentException ignored) { - } catch (final InvocationTargetException ignored) { - } + } catch (final IllegalAccessException ignored) {} catch (final IllegalArgumentException ignored) {} catch (final InvocationTargetException ignored) {} return 0; } @@ -97,9 +84,7 @@ public void setItemType(final TileEntity te, final ItemStack input) { if (day_BarrelClass.isInstance(te)) { day_item.set(te, input == null ? null : input.copy()); } - } catch (final IllegalArgumentException ignored) { - } catch (final IllegalAccessException ignored) { - } + } catch (final IllegalArgumentException ignored) {} catch (final IllegalAccessException ignored) {} } @Override @@ -110,10 +95,7 @@ public void barrelSetCount(final TileEntity te, final int max) { } te.markDirty(); - } catch (final IllegalAccessException ignored) { - } catch (final IllegalArgumentException ignored) { - } catch (final InvocationTargetException ignored) { - } + } catch (final IllegalAccessException ignored) {} catch (final IllegalArgumentException ignored) {} catch (final InvocationTargetException ignored) {} } @Override diff --git a/src/main/java/appeng/integration/modules/GT.java b/src/main/java/appeng/integration/modules/GT.java index 8111f418e58..989a373542a 100644 --- a/src/main/java/appeng/integration/modules/GT.java +++ b/src/main/java/appeng/integration/modules/GT.java @@ -24,11 +24,9 @@ public GT() throws Throwable { @Override public void init() throws Throwable { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.GT)) { - AEApi.instance() - .partHelper() - .registerNewLayer( - "appeng.parts.layers.LayerIEnergyConnected", - "gregtech.api.interfaces.tileentity.IEnergyConnected"); + AEApi.instance().partHelper().registerNewLayer( + "appeng.parts.layers.LayerIEnergyConnected", + "gregtech.api.interfaces.tileentity.IEnergyConnected"); } } diff --git a/src/main/java/appeng/integration/modules/IC2.java b/src/main/java/appeng/integration/modules/IC2.java index 976b2b7fd1b..89ad804a7ea 100644 --- a/src/main/java/appeng/integration/modules/IC2.java +++ b/src/main/java/appeng/integration/modules/IC2.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; + import appeng.api.AEApi; import appeng.api.IAppEngApi; import appeng.api.config.TunnelType; @@ -31,11 +27,9 @@ import appeng.integration.abstraction.IIC2; import ic2.api.energy.tile.IEnergyTile; import ic2.api.recipe.RecipeInputItemStack; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.MinecraftForge; public class IC2 implements IIC2, IIntegrationModule { + @Reflected public static IC2 instance; @@ -72,10 +66,9 @@ public void postInit() { reg.addNewAttunement(this.getItem("splitterCableItem"), TunnelType.IC2_POWER); try { - AEApi.instance().registries().movable().whiteListTileEntity((Class) - Class.forName("ic2.core.crop.TileEntityCrop")); - } catch (ClassNotFoundException ignored) { - } + AEApi.instance().registries().movable() + .whiteListTileEntity((Class) Class.forName("ic2.core.crop.TileEntityCrop")); + } catch (ClassNotFoundException ignored) {} // this is gone? // AEApi.INSTANCE().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 ); } diff --git a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java index cf69f6664e0..a5d4628511f 100644 --- a/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java +++ b/src/main/java/appeng/integration/modules/ImmibisMicroblocks.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import java.lang.reflect.Method; + +import mods.immibis.core.api.multipart.ICoverSystem; +import mods.immibis.core.api.multipart.IMultipartTile; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.parts.IPartHost; @@ -27,17 +30,11 @@ import appeng.integration.IIntegrationModule; import appeng.integration.IntegrationHelper; import appeng.integration.abstraction.IImmibisMicroblocks; + import com.google.common.base.Optional; -import java.lang.reflect.Method; -import mods.immibis.core.api.multipart.ICoverSystem; -import mods.immibis.core.api.multipart.IMultipartTile; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class ImmibisMicroblocks implements IImmibisMicroblocks, IIntegrationModule { + @Reflected public static ImmibisMicroblocks instance; @@ -83,13 +80,11 @@ public IPartHost getOrCreateHost(final EntityPlayer player, final int side, fina final int x = te.xCoord; final int y = te.yCoord; final int z = te.zCoord; - final boolean isPartItem = player != null - && player.getHeldItem() != null + final boolean isPartItem = player != null && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IPartItem; if (te instanceof IMultipartTile && this.canConvertTiles && isPartItem) { - final IBlockDefinition multiPart = - AEApi.instance().definitions().blocks().multiPart(); + final IBlockDefinition multiPart = AEApi.instance().definitions().blocks().multiPart(); final Optional maybeMultiPartBlock = multiPart.maybeBlock(); final Optional maybeMultiPartStack = multiPart.maybeStack(1); @@ -102,8 +97,8 @@ public IPartHost getOrCreateHost(final EntityPlayer player, final int side, fina try { // ItemStack.class, EntityPlayer.class, World.class, // int.class, int.class, int.class, int.class, Block.class, int.class ); - this.mergeIntoMicroblockContainer.invoke( - null, multiPartStack, player, w, x, y, z, side, multiPartBlock, 0); + this.mergeIntoMicroblockContainer + .invoke(null, multiPartStack, player, w, x, y, z, side, multiPartBlock, 0); } catch (final Throwable e) { this.canConvertTiles = false; return null; diff --git a/src/main/java/appeng/integration/modules/InvTweaks.java b/src/main/java/appeng/integration/modules/InvTweaks.java index 27ea59d8b08..fcd484662eb 100644 --- a/src/main/java/appeng/integration/modules/InvTweaks.java +++ b/src/main/java/appeng/integration/modules/InvTweaks.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.minecraft.item.ItemStack; + import appeng.helpers.Reflected; import appeng.integration.IIntegrationModule; import appeng.integration.IntegrationHelper; import appeng.integration.abstraction.IInvTweaks; import cpw.mods.fml.common.Loader; import invtweaks.api.InvTweaksAPI; -import net.minecraft.item.ItemStack; public class InvTweaks implements IInvTweaks, IIntegrationModule { + @Reflected public static InvTweaks instance; @@ -39,8 +33,7 @@ public InvTweaks() { @Override public void init() { - api = (InvTweaksAPI) - Loader.instance().getIndexedModList().get("inventorytweaks").getMod(); + api = (InvTweaksAPI) Loader.instance().getIndexedModList().get("inventorytweaks").getMod(); } @Override diff --git a/src/main/java/appeng/integration/modules/Jabba.java b/src/main/java/appeng/integration/modules/Jabba.java index 0cf654800cf..7e56d783abb 100644 --- a/src/main/java/appeng/integration/modules/Jabba.java +++ b/src/main/java/appeng/integration/modules/Jabba.java @@ -1,5 +1,9 @@ package appeng.integration.modules; +import mcp.mobius.betterbarrels.common.blocks.TileEntityBarrel; + +import net.minecraft.tileentity.TileEntity; + import appeng.api.AEApi; import appeng.api.storage.IMEInventory; import appeng.api.storage.data.IAEItemStack; @@ -8,10 +12,9 @@ import appeng.integration.IntegrationHelper; import appeng.integration.modules.helpers.JabbaBarrel; import appeng.integration.modules.helpers.JabbaStorageHandler; -import mcp.mobius.betterbarrels.common.blocks.TileEntityBarrel; -import net.minecraft.tileentity.TileEntity; public class Jabba implements IIntegrationModule { + @Reflected public static Jabba instance; diff --git a/src/main/java/appeng/integration/modules/MFR.java b/src/main/java/appeng/integration/modules/MFR.java index 397dc7a869d..a28f90b29f3 100644 --- a/src/main/java/appeng/integration/modules/MFR.java +++ b/src/main/java/appeng/integration/modules/MFR.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; @@ -23,13 +15,15 @@ import appeng.integration.IntegrationHelper; public class MFR implements IIntegrationModule { + @Reflected public static MFR instance; @Reflected public MFR() { IntegrationHelper.testClassExistence( - this, powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection.class); + this, + powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection.class); } @Override diff --git a/src/main/java/appeng/integration/modules/Mekanism.java b/src/main/java/appeng/integration/modules/Mekanism.java index 13a570e3129..010ad83be2b 100644 --- a/src/main/java/appeng/integration/modules/Mekanism.java +++ b/src/main/java/appeng/integration/modules/Mekanism.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.helpers.Reflected; import appeng.integration.IIntegrationModule; import appeng.integration.abstraction.IMekanism; import cpw.mods.fml.common.event.FMLInterModComms; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public final class Mekanism implements IMekanism, IIntegrationModule { + @Reflected public static Mekanism instance; diff --git a/src/main/java/appeng/integration/modules/NEI.java b/src/main/java/appeng/integration/modules/NEI.java index bf53ff06ab2..4ec84433ff9 100644 --- a/src/main/java/appeng/integration/modules/NEI.java +++ b/src/main/java/appeng/integration/modules/NEI.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import appeng.client.gui.AEBaseMEGui; import appeng.client.gui.implementations.GuiCraftConfirm; import appeng.client.gui.implementations.GuiCraftingCPU; @@ -37,18 +41,9 @@ import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.guihook.IContainerObjectHandler; import codechicken.nei.guihook.IContainerTooltipHandler; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule, IContainerObjectHandler { + @Reflected public static NEI instance; @@ -73,10 +68,10 @@ public NEI() throws ClassNotFoundException { @Override public void init() throws Throwable { - this.registerRecipeHandler = - this.apiClass.getDeclaredMethod("registerRecipeHandler", codechicken.nei.recipe.ICraftingHandler.class); - this.registerUsageHandler = - this.apiClass.getDeclaredMethod("registerUsageHandler", codechicken.nei.recipe.IUsageHandler.class); + this.registerRecipeHandler = this.apiClass + .getDeclaredMethod("registerRecipeHandler", codechicken.nei.recipe.ICraftingHandler.class); + this.registerUsageHandler = this.apiClass + .getDeclaredMethod("registerUsageHandler", codechicken.nei.recipe.IUsageHandler.class); this.registerNEIGuiHandler = this.apiClass.getDeclaredMethod("registerNEIGuiHandler", INEIGuiHandler.class); registerNEIGuiHandler.invoke(apiClass, new NEIGuiHandler()); @@ -97,12 +92,12 @@ public void init() throws Throwable { GuiContainerManager.addObjectHandler(this); // crafting terminal... - final Method registerGuiOverlay = this.apiClass.getDeclaredMethod( - "registerGuiOverlay", Class.class, String.class, IStackPositioner.class); + final Method registerGuiOverlay = this.apiClass + .getDeclaredMethod("registerGuiOverlay", Class.class, String.class, IStackPositioner.class); final Class overlayHandler = Class.forName("codechicken.nei.api.IOverlayHandler"); - final Method registrar = - this.apiClass.getDeclaredMethod("registerGuiOverlayHandler", Class.class, overlayHandler, String.class); + final Method registrar = this.apiClass + .getDeclaredMethod("registerGuiOverlayHandler", Class.class, overlayHandler, String.class); registerGuiOverlay.invoke(this.apiClass, GuiCraftingTerm.class, "crafting", new TerminalCraftingSlotFinder()); registerGuiOverlay.invoke(this.apiClass, GuiPatternTerm.class, "crafting", new TerminalCraftingSlotFinder()); @@ -140,7 +135,12 @@ public void drawSlot(final Slot s) { GuiContainerManager.drawItems.renderItemAndEffectIntoGUI(fontRenderer, mc.getTextureManager(), stack, x, y); GuiContainerManager.drawItems.renderItemOverlayIntoGUI( - fontRenderer, mc.getTextureManager(), stack, x, y, String.valueOf(stack.stackSize)); + fontRenderer, + mc.getTextureManager(), + stack, + x, + y, + String.valueOf(stack.stackSize)); } @Override @@ -155,24 +155,20 @@ public RenderItem setItemRender(final RenderItem renderItem) { } @Override - public List handleTooltip( - final GuiContainer arg0, final int arg1, final int arg2, final List current) { + public List handleTooltip(final GuiContainer arg0, final int arg1, final int arg2, + final List current) { return current; } @Override - public List handleItemDisplayName( - final GuiContainer arg0, final ItemStack arg1, final List current) { + public List handleItemDisplayName(final GuiContainer arg0, final ItemStack arg1, + final List current) { return current; } @Override - public List handleItemTooltip( - final GuiContainer guiScreen, - final ItemStack stack, - final int mouseX, - final int mouseY, - final List currentToolTip) { + public List handleItemTooltip(final GuiContainer guiScreen, final ItemStack stack, final int mouseX, + final int mouseY, final List currentToolTip) { if (guiScreen instanceof AEBaseMEGui) { return ((AEBaseMEGui) guiScreen).handleItemTooltip(stack, mouseX, mouseY, currentToolTip); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java index e8e163d7f3a..62361a3403d 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapedRecipeHandler.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; import appeng.api.recipes.IIngredient; @@ -33,15 +36,6 @@ import codechicken.nei.api.IStackPositioner; import codechicken.nei.recipe.RecipeInfo; import codechicken.nei.recipe.TemplateRecipeHandler; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiCrafting; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler { @@ -183,7 +177,10 @@ private void setIngredients(final int width, final int height, final Object[] it try { final ItemStack[] is = ing.getItemStackSet(); final PositionedStack stack = new PositionedStack( - useSingleItems ? Platform.findPreferred(is) : is, 25 + x * 18, 6 + y * 18, false); + useSingleItems ? Platform.findPreferred(is) : is, + 25 + x * 18, + 6 + y * 18, + false); stack.setMaxSize(1); this.ingredients.add(stack); } catch (final RegistrationError ignored) { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java index 27cd5850c80..2ef8d613b3e 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIAEShapelessRecipeHandler.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; import appeng.api.recipes.IIngredient; @@ -33,15 +36,6 @@ import codechicken.nei.api.IStackPositioner; import codechicken.nei.recipe.RecipeInfo; import codechicken.nei.recipe.TemplateRecipeHandler; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiCrafting; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java index 4620f4a4fb6..7c3db999c65 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEICraftingHandler.java @@ -1,39 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; -import appeng.client.gui.implementations.GuiCraftingTerm; -import appeng.client.gui.implementations.GuiPatternTerm; -import appeng.container.slot.SlotCraftingMatrix; -import appeng.container.slot.SlotFakeCraftingMatrix; -import appeng.core.AELog; -import appeng.core.sync.network.NetworkHandler; -import appeng.core.sync.packets.PacketNEIRecipe; -import appeng.util.Platform; -import codechicken.nei.PositionedStack; -import codechicken.nei.api.IOverlayHandler; -import codechicken.nei.recipe.IRecipeHandler; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.LinkedList; import java.util.List; + import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -41,27 +23,38 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import appeng.client.gui.implementations.GuiCraftingTerm; +import appeng.client.gui.implementations.GuiPatternTerm; +import appeng.container.slot.SlotCraftingMatrix; +import appeng.container.slot.SlotFakeCraftingMatrix; +import appeng.core.AELog; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketNEIRecipe; +import appeng.util.Platform; +import codechicken.nei.PositionedStack; +import codechicken.nei.api.IOverlayHandler; +import codechicken.nei.recipe.IRecipeHandler; + public class NEICraftingHandler implements IOverlayHandler { public NEICraftingHandler(final int x, final int y) {} @Override - public void overlayRecipe( - final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex, final boolean shift) { + public void overlayRecipe(final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex, + final boolean shift) { try { final List ingredients = recipe.getIngredientStacks(recipeIndex); if (gui instanceof GuiCraftingTerm || gui instanceof GuiPatternTerm) { PacketNEIRecipe packet = new PacketNEIRecipe(packIngredients(gui, ingredients, false)); if (packet.size() >= 32 * 1024) { - AELog.warn("Recipe for " + recipe.getRecipeName() - + " has too many variants, reduced version will be used"); + AELog.warn( + "Recipe for " + recipe.getRecipeName() + + " has too many variants, reduced version will be used"); packet = new PacketNEIRecipe(packIngredients(gui, ingredients, true)); } NetworkHandler.instance.sendToServer(packet); } - } catch (final Exception ignored) { - } catch (final Error ignored) { - } + } catch (final Exception ignored) {} catch (final Error ignored) {} } // if the packet becomes too large, limit each slot contents to 3k diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java index 88236410514..c925d2e8498 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIFacadeRecipeHandler.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IItemDefinition; @@ -31,15 +32,9 @@ import codechicken.nei.api.IStackPositioner; import codechicken.nei.recipe.RecipeInfo; import codechicken.nei.recipe.TemplateRecipeHandler; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiCrafting; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; public class NEIFacadeRecipeHandler extends TemplateRecipeHandler { + private final ItemFacade facade; private final IItemDefinition anchorDefinition; @@ -59,8 +54,7 @@ public void loadTransferRects() { public void loadCraftingRecipes(final String outputId, final Object... results) { if ((outputId.equals("crafting")) && (this.getClass() == NEIFacadeRecipeHandler.class)) { final List facades = this.facade.getFacades(); - for (final ItemStack anchorStack : - this.anchorDefinition.maybeStack(1).asSet()) { + for (final ItemStack anchorStack : this.anchorDefinition.maybeStack(1).asSet()) { for (final ItemStack is : facades) { final CachedShapedRecipe recipe = new CachedShapedRecipe(this.facade, anchorStack, is); recipe.computeVisuals(); @@ -75,8 +69,7 @@ public void loadCraftingRecipes(final String outputId, final Object... results) @Override public void loadCraftingRecipes(final ItemStack result) { if (result.getItem() == this.facade) { - for (final ItemStack anchorStack : - this.anchorDefinition.maybeStack(1).asSet()) { + for (final ItemStack anchorStack : this.anchorDefinition.maybeStack(1).asSet()) { final CachedShapedRecipe recipe = new CachedShapedRecipe(this.facade, anchorStack, result); recipe.computeVisuals(); this.arecipes.add(recipe); @@ -163,6 +156,7 @@ public String getRecipeName() { } private final class CachedShapedRecipe extends TemplateRecipeHandler.CachedRecipe { + public final List ingredients; public final PositionedStack result; @@ -171,7 +165,7 @@ public CachedShapedRecipe(final IFacadeItem facade, final ItemStack anchor, fina this.result = new PositionedStack(output, 119, 24); this.ingredients = new ArrayList(); final ItemStack in = facade.getTextureItem(output); - this.setIngredients(3, 3, new Object[] {null, anchor, null, anchor, in, anchor, null, anchor, null}); + this.setIngredients(3, 3, new Object[] { null, anchor, null, anchor, in, anchor, null, anchor, null }); } public void setIngredients(final int width, final int height, final Object[] items) { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java index 519bb959eec..4fa34c07956 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGrinderRecipeHandler.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.features.IGrinderEntry; import appeng.client.gui.implementations.GuiGrinder; @@ -29,30 +34,19 @@ import codechicken.nei.api.IOverlayHandler; import codechicken.nei.api.IRecipeOverlayRenderer; import codechicken.nei.recipe.TemplateRecipeHandler; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; public class NEIGrinderRecipeHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - this.transferRects.add( - new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(84, 23, 24, 18), "grindstone")); + this.transferRects + .add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(84, 23, 24, 18), "grindstone")); } @Override public void loadCraftingRecipes(final String outputId, final Object... results) { if ((outputId.equals("grindstone")) && (this.getClass() == NEIGrinderRecipeHandler.class)) { - for (final IGrinderEntry recipe : - AEApi.instance().registries().grinder().getRecipes()) { + for (final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe(recipe); cachedRecipe.computeVisuals(); this.arecipes.add(cachedRecipe); @@ -64,8 +58,7 @@ public void loadCraftingRecipes(final String outputId, final Object... results) @Override public void loadCraftingRecipes(final ItemStack result) { - for (final IGrinderEntry recipe : - AEApi.instance().registries().grinder().getRecipes()) { + for (final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { if (NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result)) { final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe(recipe); cachedRecipe.computeVisuals(); @@ -76,8 +69,7 @@ public void loadCraftingRecipes(final ItemStack result) { @Override public void loadUsageRecipes(final ItemStack ingredient) { - for (final IGrinderEntry recipe : - AEApi.instance().registries().grinder().getRecipes()) { + for (final IGrinderEntry recipe : AEApi.instance().registries().grinder().getRecipes()) { final CachedGrindStoneRecipe cachedRecipe = new CachedGrindStoneRecipe(recipe); if ((cachedRecipe.contains(cachedRecipe.ingredients, ingredient.getItem()))) { @@ -163,6 +155,7 @@ public String getRecipeName() { } private class CachedGrindStoneRecipe extends TemplateRecipeHandler.CachedRecipe { + private final List ingredients; private final PositionedStack result; private String displayChance; @@ -184,8 +177,8 @@ public CachedGrindStoneRecipe(final IGrinderEntry recipe) { final int secondOptionalChancePercent = (int) (recipe.getSecondOptionalChance() * 100); if (secondOptionalOutput != null) { this.hasOptional = true; - this.displayChance = String.format( - GuiText.MultipleOutputs.getLocal(), optionalChancePercent, secondOptionalChancePercent); + this.displayChance = String + .format(GuiText.MultipleOutputs.getLocal(), optionalChancePercent, secondOptionalChancePercent); this.ingredients.add(new PositionedStack(secondOptionalOutput, -30 + 107 + 18 + 18, 47)); } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGuiHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGuiHandler.java index a32cd7bfced..73af85995fa 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIGuiHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIGuiHandler.java @@ -1,14 +1,16 @@ package appeng.integration.modules.NEIHelpers; +import java.util.regex.Pattern; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + import appeng.client.gui.implementations.GuiCraftConfirm; import appeng.client.gui.implementations.GuiCraftingStatus; import appeng.client.gui.implementations.GuiMEMonitorable; import appeng.client.gui.widgets.IDropToFillTextField; import codechicken.nei.api.INEIGuiAdapter; -import java.util.regex.Pattern; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; public class NEIGuiHandler extends INEIGuiAdapter { @@ -22,7 +24,10 @@ public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemSta if (gmm.isOverTextField(mousex, mousey)) { gmm.setTextFieldValue( - formattingText(draggedStack.getDisplayName()), mousex, mousey, draggedStack.copy()); + formattingText(draggedStack.getDisplayName()), + mousex, + mousey, + draggedStack.copy()); return true; } } @@ -44,8 +49,7 @@ public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { } protected String formattingText(final String displayName) { - return SPECIAL_REGEX_CHARS - .matcher(EnumChatFormatting.getTextWithoutFormattingCodes(displayName)) + return SPECIAL_REGEX_CHARS.matcher(EnumChatFormatting.getTextWithoutFormattingCodes(displayName)) .replaceAll("\\\\$0"); } } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java index 41f40805471..a4c5c05e67a 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIInscriberRecipeHandler.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.features.IInscriberRecipe; import appeng.client.gui.implementations.GuiInscriber; @@ -28,14 +31,6 @@ import codechicken.nei.api.IOverlayHandler; import codechicken.nei.api.IRecipeOverlayRenderer; import codechicken.nei.recipe.TemplateRecipeHandler; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; /** * @author AlgorithmX2 @@ -47,15 +42,14 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - this.transferRects.add( - new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(84, 23, 24, 18), "inscriber")); + this.transferRects + .add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(84, 23, 24, 18), "inscriber")); } @Override public void loadCraftingRecipes(final String outputId, final Object... results) { if ((outputId.equals("inscriber")) && (this.getClass() == NEIInscriberRecipeHandler.class)) { - for (final IInscriberRecipe recipe : - AEApi.instance().registries().inscriber().getRecipes()) { + for (final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) { final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe(recipe); cachedRecipe.computeVisuals(); this.arecipes.add(cachedRecipe); @@ -67,8 +61,7 @@ public void loadCraftingRecipes(final String outputId, final Object... results) @Override public void loadCraftingRecipes(final ItemStack result) { - for (final IInscriberRecipe recipe : - AEApi.instance().registries().inscriber().getRecipes()) { + for (final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) { if (NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result)) { final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe(recipe); cachedRecipe.computeVisuals(); @@ -79,8 +72,7 @@ public void loadCraftingRecipes(final ItemStack result) { @Override public void loadUsageRecipes(final ItemStack ingredient) { - for (final IInscriberRecipe recipe : - AEApi.instance().registries().inscriber().getRecipes()) { + for (final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) { final CachedInscriberRecipe cachedRecipe = new CachedInscriberRecipe(recipe); if ((cachedRecipe.contains(cachedRecipe.ingredients, ingredient.getItem()))) { diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java index 2f0e74be125..ee7ec2af157 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/NEIWorldCraftingHandler.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.util.*; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IItemDefinition; @@ -32,13 +34,6 @@ import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.ICraftingHandler; import codechicken.nei.recipe.IUsageHandler; -import java.util.*; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; public class NEIWorldCraftingHandler implements ICraftingHandler, IUsageHandler { @@ -118,8 +113,8 @@ public List handleTooltip(final GuiRecipe gui, final List cur } @Override - public List handleItemTooltip( - final GuiRecipe gui, final ItemStack stack, final List currentToolTip, final int recipe) { + public List handleItemTooltip(final GuiRecipe gui, final ItemStack stack, + final List currentToolTip, final int recipe) { return currentToolTip; } diff --git a/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java b/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java index 4598fc2a601..4cb3f0971d8 100644 --- a/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java +++ b/src/main/java/appeng/integration/modules/NEIHelpers/TerminalCraftingSlotFinder.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.NEIHelpers; +import java.util.ArrayList; + import appeng.client.gui.implementations.GuiMEMonitorable; import codechicken.nei.PositionedStack; import codechicken.nei.api.IStackPositioner; -import java.util.ArrayList; public class TerminalCraftingSlotFinder implements IStackPositioner { diff --git a/src/main/java/appeng/integration/modules/OpenComputers.java b/src/main/java/appeng/integration/modules/OpenComputers.java index faa273e2bc5..217a1b7bb3b 100644 --- a/src/main/java/appeng/integration/modules/OpenComputers.java +++ b/src/main/java/appeng/integration/modules/OpenComputers.java @@ -1,23 +1,16 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import li.cil.oc.api.Items; import appeng.api.AEApi; import appeng.api.IAppEngApi; import appeng.api.config.TunnelType; @@ -28,9 +21,9 @@ import appeng.integration.IntegrationHelper; import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; -import li.cil.oc.api.Items; public class OpenComputers implements IIntegrationModule { + @Reflected public static OpenComputers instance; @@ -51,7 +44,8 @@ public void init() { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.OpenComputers)) { partHelper.registerNewLayer( - "appeng.parts.layers.LayerSidedEnvironment", "li.cil.oc.api.network.SidedEnvironment"); + "appeng.parts.layers.LayerSidedEnvironment", + "li.cil.oc.api.network.SidedEnvironment"); } } diff --git a/src/main/java/appeng/integration/modules/PneumaticCraft.java b/src/main/java/appeng/integration/modules/PneumaticCraft.java index d81a6244049..dd7c25aaa28 100644 --- a/src/main/java/appeng/integration/modules/PneumaticCraft.java +++ b/src/main/java/appeng/integration/modules/PneumaticCraft.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.IAppEngApi; import appeng.api.config.TunnelType; @@ -29,10 +24,9 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class PneumaticCraft implements IIntegrationModule { + @Reflected public static PneumaticCraft instance; diff --git a/src/main/java/appeng/integration/modules/RC.java b/src/main/java/appeng/integration/modules/RC.java index 79bd12fcd1d..c00b0c744b9 100644 --- a/src/main/java/appeng/integration/modules/RC.java +++ b/src/main/java/appeng/integration/modules/RC.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import mods.railcraft.api.crafting.IRockCrusherRecipe; +import mods.railcraft.api.crafting.RailcraftCraftingManager; + +import net.minecraft.item.ItemStack; + import appeng.helpers.Reflected; import appeng.integration.IIntegrationModule; import appeng.integration.IntegrationHelper; import appeng.integration.abstraction.IRC; -import mods.railcraft.api.crafting.IRockCrusherRecipe; -import mods.railcraft.api.crafting.RailcraftCraftingManager; -import net.minecraft.item.ItemStack; public class RC implements IRC, IIntegrationModule { + @Reflected public static RC instance; diff --git a/src/main/java/appeng/integration/modules/RF.java b/src/main/java/appeng/integration/modules/RF.java index 5ca23d8e6ef..863d84ad533 100644 --- a/src/main/java/appeng/integration/modules/RF.java +++ b/src/main/java/appeng/integration/modules/RF.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.IAppEngApi; import appeng.api.config.TunnelType; @@ -28,10 +23,9 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public final class RF implements IIntegrationModule { + @Reflected public static RF instance; diff --git a/src/main/java/appeng/integration/modules/RFItem.java b/src/main/java/appeng/integration/modules/RFItem.java index d5c5bfe8876..a8290501167 100644 --- a/src/main/java/appeng/integration/modules/RFItem.java +++ b/src/main/java/appeng/integration/modules/RFItem.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; @@ -23,6 +15,7 @@ import appeng.integration.IntegrationHelper; public class RFItem implements IIntegrationModule { + @Reflected public static RFItem instance; diff --git a/src/main/java/appeng/integration/modules/Waila.java b/src/main/java/appeng/integration/modules/Waila.java index 8473667412e..5b8b0e5743e 100644 --- a/src/main/java/appeng/integration/modules/Waila.java +++ b/src/main/java/appeng/integration/modules/Waila.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules; +import mcp.mobius.waila.api.IWailaDataProvider; +import mcp.mobius.waila.api.IWailaRegistrar; import appeng.helpers.Reflected; import appeng.integration.IIntegrationModule; import appeng.integration.IntegrationHelper; @@ -25,10 +19,9 @@ import appeng.integration.modules.waila.TileWailaDataProvider; import appeng.tile.AEBaseTile; import cpw.mods.fml.common.event.FMLInterModComms; -import mcp.mobius.waila.api.IWailaDataProvider; -import mcp.mobius.waila.api.IWailaRegistrar; public class Waila implements IIntegrationModule { + @Reflected public static Waila instance; diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrate.java b/src/main/java/appeng/integration/modules/helpers/BSCrate.java index e50386b52f4..0ecbb64dbd4 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrate.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrate.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import net.mcft.copy.betterstorage.api.crate.ICrateStorage; +import net.minecraft.item.ItemStack; + import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IMEInventory; @@ -25,10 +20,9 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.util.item.AEItemStack; -import net.mcft.copy.betterstorage.api.crate.ICrateStorage; -import net.minecraft.item.ItemStack; public class BSCrate implements IMEInventory { + private final ICrateStorage crateStorage; public BSCrate(final Object object) { diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java b/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java index 1ca28df35d4..20358fc1213 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrateHandler.java @@ -1,42 +1,35 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import net.mcft.copy.betterstorage.api.crate.ICrateStorage; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IMEInventory; import appeng.api.storage.StorageChannel; -import net.mcft.copy.betterstorage.api.crate.ICrateStorage; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class BSCrateHandler implements IExternalStorageHandler { @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel channel, + final BaseActionSource mySrc) { return channel == StorageChannel.ITEMS && te instanceof ICrateStorage; } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, final StorageChannel channel, + final BaseActionSource src) { if (channel == StorageChannel.ITEMS) { return new BSCrate(te); } diff --git a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java index bf99bd8aaa6..e6b9c05cfea 100644 --- a/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java +++ b/src/main/java/appeng/integration/modules/helpers/BSCrateStorageAdaptor.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import java.util.Iterator; + +import net.mcft.copy.betterstorage.api.crate.ICrateStorage; +import net.minecraft.item.ItemStack; + import appeng.api.config.FuzzyMode; import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.inv.IInventoryDestination; import appeng.util.inv.ItemSlot; import appeng.util.iterators.StackToSlotIterator; -import java.util.Iterator; -import net.mcft.copy.betterstorage.api.crate.ICrateStorage; -import net.minecraft.item.ItemStack; public class BSCrateStorageAdaptor extends InventoryAdaptor { @@ -92,10 +86,7 @@ public ItemStack simulateRemove(final int amount, final ItemStack filter, final } @Override - public ItemStack removeSimilarItems( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack removeSimilarItems(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { ItemStack target = null; @@ -120,10 +111,7 @@ public ItemStack removeSimilarItems( } @Override - public ItemStack simulateSimilarRemove( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack simulateSimilarRemove(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { ItemStack target = null; diff --git a/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java b/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java index cc9afce7a45..225c91e9d76 100644 --- a/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java +++ b/src/main/java/appeng/integration/modules/helpers/FMPPacketEvent.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; -import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.player.EntityPlayerMP; +import cpw.mods.fml.common.eventhandler.Event; + public class FMPPacketEvent extends Event { private final EntityPlayerMP sender; diff --git a/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java b/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java index b088a118c6a..1b07ea50bcb 100644 --- a/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java +++ b/src/main/java/appeng/integration/modules/helpers/FactorizationBarrel.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IMEInventory; @@ -26,8 +21,6 @@ import appeng.api.storage.data.IItemList; import appeng.integration.abstraction.IFZ; import appeng.util.item.AEItemStack; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class FactorizationBarrel implements IMEInventory { diff --git a/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java b/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java index 41ee8123731..bae002af438 100644 --- a/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/FactorizationHandler.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IMEInventory; @@ -25,20 +20,18 @@ import appeng.integration.modules.FZ; import appeng.me.storage.MEMonitorIInventory; import appeng.util.inv.IMEAdaptor; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class FactorizationHandler implements IExternalStorageHandler { @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource mySrc) { return chan == StorageChannel.ITEMS && FZ.instance.isBarrel(te); } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource src) { if (chan == StorageChannel.ITEMS) { return new MEMonitorIInventory(new IMEAdaptor(FZ.instance.getFactorizationBarrel(te), src)); } diff --git a/src/main/java/appeng/integration/modules/helpers/JabbaBarrel.java b/src/main/java/appeng/integration/modules/helpers/JabbaBarrel.java index b4aedd3a92a..63d4b571d84 100644 --- a/src/main/java/appeng/integration/modules/helpers/JabbaBarrel.java +++ b/src/main/java/appeng/integration/modules/helpers/JabbaBarrel.java @@ -1,5 +1,10 @@ package appeng.integration.modules.helpers; +import mcp.mobius.betterbarrels.common.blocks.TileEntityBarrel; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IMEInventory; @@ -7,11 +12,9 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.util.item.AEItemStack; -import mcp.mobius.betterbarrels.common.blocks.TileEntityBarrel; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class JabbaBarrel implements IMEInventory { + private final TileEntityBarrel barrel; public JabbaBarrel(final TileEntity te) { @@ -48,8 +51,7 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable mode, if (input.getTagCompound() != null) { return input; } - long max = ((long) this.barrel.getStorage().getMaxStacks()) - * input.getItemStack().getMaxStackSize(); + long max = ((long) this.barrel.getStorage().getMaxStacks()) * input.getItemStack().getMaxStackSize(); if (input.getStackSize() <= max || barrel.getStorage().isVoid()) { if (mode == Actionable.MODULATE) { this.barrel.setStoredItemType(input.getItemStack(), (int) input.getStackSize()); diff --git a/src/main/java/appeng/integration/modules/helpers/JabbaStorageHandler.java b/src/main/java/appeng/integration/modules/helpers/JabbaStorageHandler.java index 6ead9791dad..36ed664eea0 100644 --- a/src/main/java/appeng/integration/modules/helpers/JabbaStorageHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/JabbaStorageHandler.java @@ -1,5 +1,8 @@ package appeng.integration.modules.helpers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IMEInventory; @@ -8,19 +11,18 @@ import appeng.integration.modules.Jabba; import appeng.me.storage.MEMonitorIInventory; import appeng.util.inv.IMEAdaptor; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class JabbaStorageHandler implements IExternalStorageHandler { + @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource mySrc) { return chan == StorageChannel.ITEMS && Jabba.instance.isBarrel(te); } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, + final StorageChannel chan, final BaseActionSource src) { if (chan == StorageChannel.ITEMS) { return new MEMonitorIInventory(new IMEAdaptor(Jabba.instance.getBarrel(te), src)); } diff --git a/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java b/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java index 66545b81e3f..941b2fc9e70 100644 --- a/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/MFRDSUHandler.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; import appeng.api.storage.IMEInventory; @@ -25,20 +20,18 @@ import appeng.integration.modules.DSU; import appeng.me.storage.MEMonitorIInventory; import appeng.util.inv.IMEAdaptor; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class MFRDSUHandler implements IExternalStorageHandler { @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource mySrc) { return chan == StorageChannel.ITEMS && DSU.instance.isDSU(te); } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel chan, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, final StorageChannel chan, + final BaseActionSource src) { if (chan == StorageChannel.ITEMS) { return new MEMonitorIInventory(new IMEAdaptor(DSU.instance.getDSU(te), src)); } diff --git a/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java index 611977e3fc9..a0853ac95ad 100644 --- a/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java +++ b/src/main/java/appeng/integration/modules/helpers/MinefactoryReloadedDeepStorageUnit.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IMEInventory; @@ -25,9 +21,6 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; import appeng.util.item.AEItemStack; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; public class MinefactoryReloadedDeepStorageUnit implements IMEInventory { diff --git a/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java b/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java index 4dd77525e6d..f35f412bd5c 100644 --- a/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java +++ b/src/main/java/appeng/integration/modules/helpers/NullRFHandler.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.helpers; -import cofh.api.energy.IEnergyReceiver; import net.minecraftforge.common.util.ForgeDirection; +import cofh.api.energy.IEnergyReceiver; + public class NullRFHandler implements IEnergyReceiver { @Override diff --git a/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java index 92899a9f891..8a4ca4cc8f1 100644 --- a/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/BaseWailaDataProvider.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -36,47 +30,33 @@ * @since rv2 */ public abstract class BaseWailaDataProvider implements IWailaDataProvider { + @Override public ItemStack getWailaStack(final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return null; } @Override - public List getWailaHead( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaHead(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return currentToolTip; } @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return currentToolTip; } @Override - public List getWailaTail( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaTail(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return currentToolTip; } @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, + final World world, final int x, final int y, final int z) { return tag; } } diff --git a/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java index 39803adabbc..ba582012eb7 100644 --- a/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/PartWailaDataProvider.java @@ -1,31 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila; -import appeng.api.parts.IPart; -import appeng.integration.modules.waila.part.*; -import com.google.common.base.Optional; -import com.google.common.collect.Lists; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -33,6 +23,12 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import appeng.api.parts.IPart; +import appeng.integration.modules.waila.part.*; + +import com.google.common.base.Optional; +import com.google.common.collect.Lists; + /** * Delegation provider for parts through {@link IPartWailaDataProvider} * @@ -41,6 +37,7 @@ * @since rv2 */ public final class PartWailaDataProvider implements IWailaDataProvider { + /** * Contains all providers */ @@ -92,11 +89,8 @@ public ItemStack getWailaStack(final IWailaDataAccessor accessor, final IWailaCo } @Override - public List getWailaHead( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaHead(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -114,11 +108,8 @@ public List getWailaHead( } @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -136,11 +127,8 @@ public List getWailaBody( } @Override - public List getWailaTail( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaTail(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { final TileEntity te = accessor.getTileEntity(); final MovingObjectPosition mop = accessor.getPosition(); @@ -158,14 +146,8 @@ public List getWailaTail( } @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, + final World world, final int x, final int y, final int z) { final MovingObjectPosition mop = this.tracer.retraceBlock(world, player, x, y, z); if (mop != null) { diff --git a/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java index bd474867794..04a6092e694 100644 --- a/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/TileWailaDataProvider.java @@ -1,38 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila; -import appeng.integration.modules.waila.tile.ChargerWailaDataProvider; -import appeng.integration.modules.waila.tile.CraftingMonitorWailaDataProvider; -import appeng.integration.modules.waila.tile.PowerStateWailaDataProvider; -import appeng.integration.modules.waila.tile.PowerStorageWailaDataProvider; -import com.google.common.collect.Lists; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.integration.modules.waila.tile.ChargerWailaDataProvider; +import appeng.integration.modules.waila.tile.CraftingMonitorWailaDataProvider; +import appeng.integration.modules.waila.tile.PowerStateWailaDataProvider; +import appeng.integration.modules.waila.tile.PowerStorageWailaDataProvider; + +import com.google.common.collect.Lists; + /** * Delegation provider for tiles through {@link mcp.mobius.waila.api.IWailaDataProvider} * @@ -41,6 +37,7 @@ * @since rv2 */ public final class TileWailaDataProvider implements IWailaDataProvider { + /** * Contains all providers */ @@ -64,11 +61,8 @@ public ItemStack getWailaStack(final IWailaDataAccessor accessor, final IWailaCo } @Override - public List getWailaHead( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaHead(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { for (final IWailaDataProvider provider : this.providers) { provider.getWailaHead(itemStack, currentToolTip, accessor, config); } @@ -77,11 +71,8 @@ public List getWailaHead( } @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { for (final IWailaDataProvider provider : this.providers) { provider.getWailaBody(itemStack, currentToolTip, accessor, config); } @@ -90,11 +81,8 @@ public List getWailaBody( } @Override - public List getWailaTail( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaTail(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { for (final IWailaDataProvider provider : this.providers) { provider.getWailaTail(itemStack, currentToolTip, accessor, config); } @@ -103,14 +91,8 @@ public List getWailaTail( } @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, + final World world, final int x, final int y, final int z) { for (final IWailaDataProvider provider : this.providers) { provider.getNBTData(player, te, tag, world, x, y, z); } diff --git a/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java index 587bf943d76..6e536cce9e5 100644 --- a/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/BasePartWailaDataProvider.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; -import appeng.api.parts.IPart; -import appeng.api.parts.PartItemStack; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.api.parts.IPart; +import appeng.api.parts.PartItemStack; + /** * Default implementation of {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} * @@ -37,48 +32,33 @@ * @since rv2 */ public class BasePartWailaDataProvider implements IPartWailaDataProvider { + @Override public ItemStack getWailaStack(final IPart part, final IWailaConfigHandler config, final ItemStack partStack) { return part.getItemStack(PartItemStack.World); } @Override - public List getWailaHead( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaHead(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return currentToolTip; } @Override - public List getWailaBody( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return currentToolTip; } @Override - public List getWailaTail( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaTail(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { return currentToolTip; } @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final IPart part, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final IPart part, final TileEntity te, + final NBTTagCompound tag, final World world, final int x, final int y, final int z) { return tag; } } diff --git a/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java index 5c310087101..97c68f7c5c3 100644 --- a/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/ChannelWailaDataProvider.java @@ -1,38 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; -import appeng.api.parts.IPart; -import appeng.core.localization.WailaText; -import appeng.parts.networking.PartCableSmart; -import appeng.parts.networking.PartDenseCable; -import appeng.parts.networking.PartUltraDenseCableSmart; -import gnu.trove.map.TObjectShortMap; -import gnu.trove.map.hash.TObjectShortHashMap; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.api.parts.IPart; +import appeng.core.localization.WailaText; +import appeng.parts.networking.PartCableSmart; +import appeng.parts.networking.PartDenseCable; +import appeng.parts.networking.PartUltraDenseCableSmart; +import gnu.trove.map.TObjectShortMap; +import gnu.trove.map.hash.TObjectShortHashMap; + /** * Channel-information provider for WAILA * @@ -41,6 +36,7 @@ * @since rv2 */ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider { + /** * Channel key used for the transferred {@link net.minecraft.nbt.NBTTagCompound} */ @@ -66,15 +62,12 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider { * @return modified tool tip */ @Override - public List getWailaBody( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { if (part instanceof PartCableSmart || part instanceof PartDenseCable) { final short usedChannels = this.getUsedChannels(part, accessor.getNBTData()); - final int maxChannels = - ((part instanceof PartUltraDenseCableSmart) ? 128 : ((part instanceof PartDenseCable) ? 32 : 8)); + final int maxChannels = ((part instanceof PartUltraDenseCableSmart) ? 128 + : ((part instanceof PartDenseCable) ? 32 : 8)); final String formattedToolTip = String.format(WailaText.Channels.getLocal(), usedChannels, maxChannels); currentToolTip.add(formattedToolTip); @@ -89,8 +82,8 @@ public List getWailaBody( * If the client received information of the channels on the server, they are used, else if the cache contains a * previous stored value, this will be used. Default value is 0. * - * @param part part to be looked at - * @param tag tag maybe containing the channel information + * @param part part to be looked at + * @param tag tag maybe containing the channel information * @return used channels on the cable */ private short getUsedChannels(final IPart part, final NBTTagCompound tag) { @@ -125,15 +118,8 @@ private short getUsedChannels(final IPart part, final NBTTagCompound tag) { * @return tag send to the client */ @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final IPart part, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final IPart part, final TileEntity te, + final NBTTagCompound tag, final World world, final int x, final int y, final int z) { if (part instanceof PartCableSmart || part instanceof PartDenseCable) { final NBTTagCompound tempTag = new NBTTagCompound(); diff --git a/src/main/java/appeng/integration/modules/waila/part/IPartWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/IPartWailaDataProvider.java index f9f945735c8..58d8d3aa89d 100644 --- a/src/main/java/appeng/integration/modules/waila/part/IPartWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/IPartWailaDataProvider.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; -import appeng.api.parts.IPart; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.api.parts.IPart; + /** * An abstraction layer of the {@link appeng.integration.modules.waila.part.IPartWailaDataProvider} for * {@link appeng.api.parts.IPart}. @@ -37,17 +32,18 @@ * @since rv2 */ public interface IPartWailaDataProvider { + ItemStack getWailaStack(IPart part, IWailaConfigHandler config, ItemStack partStack); - List getWailaHead( - IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config); + List getWailaHead(IPart part, List currentToolTip, IWailaDataAccessor accessor, + IWailaConfigHandler config); - List getWailaBody( - IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config); + List getWailaBody(IPart part, List currentToolTip, IWailaDataAccessor accessor, + IWailaConfigHandler config); - List getWailaTail( - IPart part, List currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config); + List getWailaTail(IPart part, List currentToolTip, IWailaDataAccessor accessor, + IWailaConfigHandler config); - NBTTagCompound getNBTData( - EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z); + NBTTagCompound getNBTData(EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, + int y, int z); } diff --git a/src/main/java/appeng/integration/modules/waila/part/P2PStateWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/P2PStateWailaDataProvider.java index f2ecbc17554..49ee5b31d20 100644 --- a/src/main/java/appeng/integration/modules/waila/part/P2PStateWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/P2PStateWailaDataProvider.java @@ -1,37 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; -import appeng.api.parts.IPart; -import appeng.core.localization.ButtonToolTips; -import appeng.core.localization.WailaText; -import appeng.me.GridAccessException; -import appeng.parts.p2p.PartP2PTunnel; -import com.google.common.collect.Iterators; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.api.parts.IPart; +import appeng.core.localization.ButtonToolTips; +import appeng.core.localization.WailaText; +import appeng.me.GridAccessException; +import appeng.parts.p2p.PartP2PTunnel; + +import com.google.common.collect.Iterators; + /** * Provides information about a P2P tunnel to WAILA. */ @@ -47,19 +43,16 @@ public final class P2PStateWailaDataProvider extends BasePartWailaDataProvider { /** * Adds state to the tooltip * - * @param part part with state + * @param part part with state * @param currentToolTip to be added to tooltip - * @param accessor wrapper for various information - * @param config config settings + * @param accessor wrapper for various information + * @param config config settings * * @return modified tooltip */ @Override - public List getWailaBody( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { if (part instanceof PartP2PTunnel) { NBTTagCompound nbtData = accessor.getNBTData(); if (nbtData.hasKey(TAG_P2P_STATE)) { @@ -82,8 +75,7 @@ public List getWailaBody( } final long freq = nbtData.getLong(TAG_P2P_FREQUENCY); - final String freqTooltip = - String.format("%X", freq).replaceAll("(.{4})", "$0 ").trim(); + final String freqTooltip = String.format("%X", freq).replaceAll("(.{4})", "$0 ").trim(); final String local = ButtonToolTips.P2PFrequency.getLocal(); @@ -96,15 +88,8 @@ public List getWailaBody( } @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final IPart part, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final IPart part, final TileEntity te, + final NBTTagCompound tag, final World world, final int x, final int y, final int z) { if (part instanceof PartP2PTunnel) { final PartP2PTunnel tunnel = (PartP2PTunnel) part; @@ -133,7 +118,7 @@ public NBTTagCompound getNBTData( } } - tag.setIntArray(TAG_P2P_STATE, new int[] {state, outputCount}); + tag.setIntArray(TAG_P2P_STATE, new int[] { state, outputCount }); } return tag; diff --git a/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java b/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java index 621ea8ae7ca..45894525f83 100644 --- a/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java +++ b/src/main/java/appeng/integration/modules/waila/part/PartAccessor.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; + import appeng.api.parts.IPart; import appeng.api.parts.IPartHost; import appeng.api.parts.SelectedPart; + import com.google.common.base.Optional; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; /** * Accessor to access specific parts for WAILA @@ -34,6 +28,7 @@ * @since rv2 */ public final class PartAccessor { + /** * Hits a {@link appeng.api.parts.IPartHost} with {@link net.minecraft.util.MovingObjectPosition}. *

diff --git a/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java index 8131278b1fc..4727a8b2eb6 100644 --- a/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/PartStackWailaDataProvider.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; -import appeng.api.parts.IPart; -import appeng.api.parts.PartItemStack; import mcp.mobius.waila.api.IWailaConfigHandler; + import net.minecraft.item.ItemStack; +import appeng.api.parts.IPart; +import appeng.api.parts.PartItemStack; + /** * Part ItemStack provider for WAILA * diff --git a/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java index 683bddb56ff..bc83bf640e6 100644 --- a/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/PowerStateWailaDataProvider.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; -import appeng.api.implementations.IPowerChannelState; -import appeng.api.parts.IPart; -import appeng.core.localization.WailaText; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; +import appeng.api.implementations.IPowerChannelState; +import appeng.api.parts.IPart; +import appeng.core.localization.WailaText; /** * Power state provider for WAILA @@ -33,6 +26,7 @@ * @since rv2 */ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider { + /** * Adds state to the tooltip * @@ -43,11 +37,8 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider * @return modified tooltip */ @Override - public List getWailaBody( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { if (part instanceof IPowerChannelState) { final IPowerChannelState state = (IPowerChannelState) part; diff --git a/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java index 86682ec8e5d..e7d9af42897 100644 --- a/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/part/StorageMonitorWailaDataProvider.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; +import java.util.List; + +import mcp.mobius.waila.api.IWailaConfigHandler; +import mcp.mobius.waila.api.IWailaDataAccessor; import appeng.api.implementations.parts.IPartStorageMonitor; import appeng.api.parts.IPart; import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEStack; import appeng.core.localization.WailaText; -import java.util.List; -import mcp.mobius.waila.api.IWailaConfigHandler; -import mcp.mobius.waila.api.IWailaDataAccessor; /** * Storage monitor provider for WAILA @@ -36,9 +29,9 @@ * @since rv2 */ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProvider { + /** - * Displays the stack if present and if the monitor is locked. - * Can handle fluids and items. + * Displays the stack if present and if the monitor is locked. Can handle fluids and items. * * @param part maybe storage monitor * @param currentToolTip to be written to tooltip @@ -47,11 +40,8 @@ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProv * @return modified tooltip */ @Override - public List getWailaBody( - final IPart part, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final IPart part, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { if (part instanceof IPartStorageMonitor) { final IPartStorageMonitor monitor = (IPartStorageMonitor) part; @@ -60,8 +50,7 @@ public List getWailaBody( if (displayed instanceof IAEItemStack) { final IAEItemStack ais = (IAEItemStack) displayed; - currentToolTip.add( - WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName()); + currentToolTip.add(WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName()); } else if (displayed instanceof IAEFluidStack) { final IAEFluidStack ais = (IAEFluidStack) displayed; currentToolTip.add( diff --git a/src/main/java/appeng/integration/modules/waila/part/Tracer.java b/src/main/java/appeng/integration/modules/waila/part/Tracer.java index e26b0e99c7e..5dde7dddb97 100644 --- a/src/main/java/appeng/integration/modules/waila/part/Tracer.java +++ b/src/main/java/appeng/integration/modules/waila/part/Tracer.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.part; @@ -33,9 +25,9 @@ * @since rv2 */ public final class Tracer { + /** - * Trace view of players to blocks. - * Ignore all which are out of reach. + * Trace view of players to blocks. Ignore all which are out of reach. * * @param world word of block * @param player player viewing block @@ -44,8 +36,8 @@ public final class Tracer { * @param z z pos of block * @return trace movement. Can be null */ - public MovingObjectPosition retraceBlock( - final World world, final EntityPlayerMP player, final int x, final int y, final int z) { + public MovingObjectPosition retraceBlock(final World world, final EntityPlayerMP player, final int x, final int y, + final int z) { final Block block = world.getBlock(x, y, z); final Vec3 headVec = this.getCorrectedHeadVec(player); diff --git a/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java index 62ec8578af8..2939676b96b 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/ChargerWailaDataProvider.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.tile; -import appeng.core.localization.WailaText; -import appeng.integration.modules.waila.BaseWailaDataProvider; -import appeng.tile.misc.TileCharger; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import appeng.core.localization.WailaText; +import appeng.integration.modules.waila.BaseWailaDataProvider; +import appeng.tile.misc.TileCharger; + /** * Charger provider for WAILA * @@ -37,6 +32,7 @@ * @since rv2 */ public final class ChargerWailaDataProvider extends BaseWailaDataProvider { + /** * Displays the holding item and its tooltip * @@ -47,11 +43,8 @@ public final class ChargerWailaDataProvider extends BaseWailaDataProvider { * @return modified tooltip */ @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { final TileEntity te = accessor.getTileEntity(); if (te instanceof TileCharger) { final TileCharger charger = (TileCharger) te; diff --git a/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java index 487f351b8ff..b7d1c428b74 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/CraftingMonitorWailaDataProvider.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.tile; -import appeng.api.storage.data.IAEItemStack; -import appeng.core.localization.WailaText; -import appeng.integration.modules.waila.BaseWailaDataProvider; -import appeng.tile.crafting.TileCraftingMonitorTile; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import appeng.api.storage.data.IAEItemStack; +import appeng.core.localization.WailaText; +import appeng.integration.modules.waila.BaseWailaDataProvider; +import appeng.tile.crafting.TileCraftingMonitorTile; + /** * Crafting-monitor provider for WAILA * @@ -36,6 +31,7 @@ * @since rv2 */ public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvider { + /** * Displays the item currently crafted by the CPU cluster * @@ -46,11 +42,8 @@ public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvide * @return modified tooltip */ @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { final TileEntity te = accessor.getTileEntity(); if (te instanceof TileCraftingMonitorTile) { final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) te; diff --git a/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java index e3d31ae9802..39b85822891 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/PowerStateWailaDataProvider.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.tile; -import appeng.api.implementations.IPowerChannelState; -import appeng.core.localization.WailaText; -import appeng.integration.modules.waila.BaseWailaDataProvider; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import appeng.api.implementations.IPowerChannelState; +import appeng.core.localization.WailaText; +import appeng.integration.modules.waila.BaseWailaDataProvider; + /** * Power state provider for WAILA * @@ -35,6 +30,7 @@ * @since rv2 */ public final class PowerStateWailaDataProvider extends BaseWailaDataProvider { + /** * Adds state to the tooltip * @@ -45,11 +41,8 @@ public final class PowerStateWailaDataProvider extends BaseWailaDataProvider { * @return modified tooltip */ @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { final TileEntity te = accessor.getTileEntity(); if (te instanceof IPowerChannelState) { diff --git a/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java b/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java index b2b69940089..c117b596a39 100644 --- a/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java +++ b/src/main/java/appeng/integration/modules/waila/tile/PowerStorageWailaDataProvider.java @@ -1,39 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.integration.modules.waila.tile; -import appeng.api.networking.energy.IAEPowerStorage; -import appeng.core.localization.WailaText; -import appeng.integration.modules.waila.BaseWailaDataProvider; -import appeng.util.Platform; -import gnu.trove.map.TObjectLongMap; -import gnu.trove.map.hash.TObjectLongHashMap; import java.util.List; + import mcp.mobius.waila.api.ITaggedList; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.api.networking.energy.IAEPowerStorage; +import appeng.core.localization.WailaText; +import appeng.integration.modules.waila.BaseWailaDataProvider; +import appeng.util.Platform; +import gnu.trove.map.TObjectLongMap; +import gnu.trove.map.hash.TObjectLongHashMap; + /** * Power storage provider for WAILA * @@ -42,6 +37,7 @@ * @since rv2 */ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider { + /** * Power key used for the transferred {@link net.minecraft.nbt.NBTTagCompound} */ @@ -58,8 +54,7 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider { private final TObjectLongMap cache = new TObjectLongHashMap(); /** - * Adds the current and max power to the tool tip - * Will ignore if the tile has an energy buffer ( > 0 ) + * Adds the current and max power to the tool tip Will ignore if the tile has an energy buffer ( > 0 ) * * @param itemStack stack of power storage * @param currentToolTip current tool tip @@ -68,11 +63,8 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider { * @return modified tool tip */ @Override - public List getWailaBody( - final ItemStack itemStack, - final List currentToolTip, - final IWailaDataAccessor accessor, - final IWailaConfigHandler config) { + public List getWailaBody(final ItemStack itemStack, final List currentToolTip, + final IWailaDataAccessor accessor, final IWailaConfigHandler config) { // Removes RF tooltip on WAILA 1.5.9+ ((ITaggedList) currentToolTip).removeEntries("RFEnergyStorage"); @@ -113,14 +105,8 @@ public List getWailaBody( * @return tag send to the client */ @Override - public NBTTagCompound getNBTData( - final EntityPlayerMP player, - final TileEntity te, - final NBTTagCompound tag, - final World world, - final int x, - final int y, - final int z) { + public NBTTagCompound getNBTData(final EntityPlayerMP player, final TileEntity te, final NBTTagCompound tag, + final World world, final int x, final int y, final int z) { if (te instanceof IAEPowerStorage) { final IAEPowerStorage storage = (IAEPowerStorage) te; diff --git a/src/main/java/appeng/items/AEBaseItem.java b/src/main/java/appeng/items/AEBaseItem.java index e1d3da429da..3ccf17fe63b 100644 --- a/src/main/java/appeng/items/AEBaseItem.java +++ b/src/main/java/appeng/items/AEBaseItem.java @@ -1,35 +1,32 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items; -import appeng.core.features.*; -import com.google.common.base.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import appeng.core.features.*; + +import com.google.common.base.Optional; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public abstract class AEBaseItem extends Item implements IAEFeature { + private final String fullName; private final Optional subName; private IFeatureHandler feature; @@ -66,8 +63,8 @@ public void setFeature(final EnumSet f) { @SideOnly(Side.CLIENT) @Override @SuppressWarnings("unchecked") - public final void addInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public final void addInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { this.addCheckedInformation(stack, player, lines, displayMoreInfo); } @@ -83,13 +80,13 @@ public boolean isBookEnchantable(final ItemStack itemstack1, final ItemStack ite } @SideOnly(Side.CLIENT) - protected void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + protected void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { super.addInformation(stack, player, lines, displayMoreInfo); } - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { super.getSubItems(sameItem, creativeTab, itemStacks); } } diff --git a/src/main/java/appeng/items/contents/CellConfig.java b/src/main/java/appeng/items/contents/CellConfig.java index 5982f9ed2de..d34d319c2f7 100644 --- a/src/main/java/appeng/items/contents/CellConfig.java +++ b/src/main/java/appeng/items/contents/CellConfig.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.contents; +import net.minecraft.item.ItemStack; + import appeng.tile.inventory.AppEngInternalInventory; import appeng.util.Platform; -import net.minecraft.item.ItemStack; public class CellConfig extends AppEngInternalInventory { diff --git a/src/main/java/appeng/items/contents/CellUpgrades.java b/src/main/java/appeng/items/contents/CellUpgrades.java index fae9cd76fe8..350863337a7 100644 --- a/src/main/java/appeng/items/contents/CellUpgrades.java +++ b/src/main/java/appeng/items/contents/CellUpgrades.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.contents; +import net.minecraft.item.ItemStack; + import appeng.parts.automation.StackUpgradeInventory; import appeng.util.Platform; -import net.minecraft.item.ItemStack; public final class CellUpgrades extends StackUpgradeInventory { + private final ItemStack is; public CellUpgrades(final ItemStack is, final int upgrades) { diff --git a/src/main/java/appeng/items/contents/NetworkToolViewer.java b/src/main/java/appeng/items/contents/NetworkToolViewer.java index 85c5c737306..e696dedf1d1 100644 --- a/src/main/java/appeng/items/contents/NetworkToolViewer.java +++ b/src/main/java/appeng/items/contents/NetworkToolViewer.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.contents; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import appeng.api.implementations.guiobjects.INetworkTool; import appeng.api.implementations.items.IUpgradeModule; import appeng.api.networking.IGridHost; import appeng.tile.inventory.AppEngInternalInventory; import appeng.util.Platform; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class NetworkToolViewer implements INetworkTool { @@ -105,8 +98,7 @@ public void closeInventory() { @Override public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { - return this.inv.isItemValidForSlot(i, itemstack) - && itemstack.getItem() instanceof IUpgradeModule + return this.inv.isItemValidForSlot(i, itemstack) && itemstack.getItem() instanceof IUpgradeModule && ((IUpgradeModule) itemstack.getItem()).getType(itemstack) != null; } diff --git a/src/main/java/appeng/items/contents/PortableCellViewer.java b/src/main/java/appeng/items/contents/PortableCellViewer.java index 07495949043..fec1ccfbfd7 100644 --- a/src/main/java/appeng/items/contents/PortableCellViewer.java +++ b/src/main/java/appeng/items/contents/PortableCellViewer.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.contents; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.*; import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.items.IAEItemPowerStorage; @@ -31,8 +26,6 @@ import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; import appeng.util.Platform; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class PortableCellViewer extends MEMonitorHandler implements IPortableCell, IInventorySlotAware { diff --git a/src/main/java/appeng/items/contents/QuartzKnifeObj.java b/src/main/java/appeng/items/contents/QuartzKnifeObj.java index 1a2b9e71a76..3c43e119010 100644 --- a/src/main/java/appeng/items/contents/QuartzKnifeObj.java +++ b/src/main/java/appeng/items/contents/QuartzKnifeObj.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.contents; -import appeng.api.implementations.guiobjects.IGuiItemObject; import net.minecraft.item.ItemStack; +import appeng.api.implementations.guiobjects.IGuiItemObject; + public class QuartzKnifeObj implements IGuiItemObject { private final ItemStack is; diff --git a/src/main/java/appeng/items/contents/WirelessTerminalViewCells.java b/src/main/java/appeng/items/contents/WirelessTerminalViewCells.java index 3799325832e..8f0668720b8 100644 --- a/src/main/java/appeng/items/contents/WirelessTerminalViewCells.java +++ b/src/main/java/appeng/items/contents/WirelessTerminalViewCells.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.contents; +import net.minecraft.item.ItemStack; + import appeng.tile.inventory.AppEngInternalInventory; import appeng.util.Platform; -import net.minecraft.item.ItemStack; public class WirelessTerminalViewCells extends AppEngInternalInventory { diff --git a/src/main/java/appeng/items/materials/ItemMultiMaterial.java b/src/main/java/appeng/items/materials/ItemMultiMaterial.java index 04f99bc427b..f38a24263b4 100644 --- a/src/main/java/appeng/items/materials/ItemMultiMaterial.java +++ b/src/main/java/appeng/items/materials/ItemMultiMaterial.java @@ -1,46 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.materials; -import appeng.api.config.Upgrades; -import appeng.api.implementations.IUpgradeableHost; -import appeng.api.implementations.items.IItemGroup; -import appeng.api.implementations.items.IStorageComponent; -import appeng.api.implementations.items.IUpgradeModule; -import appeng.api.implementations.tiles.ISegmentedInventory; -import appeng.api.parts.IPartHost; -import appeng.api.parts.SelectedPart; -import appeng.client.texture.MissingIcon; -import appeng.core.AEConfig; -import appeng.core.features.AEFeature; -import appeng.core.features.IStackSrc; -import appeng.core.features.MaterialStackSrc; -import appeng.core.features.NameResolver; -import appeng.items.AEBaseItem; -import appeng.util.InventoryAdaptor; -import appeng.util.Platform; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableSet; import java.util.*; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -58,7 +32,29 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.config.Upgrades; +import appeng.api.implementations.IUpgradeableHost; +import appeng.api.implementations.items.IItemGroup; +import appeng.api.implementations.items.IStorageComponent; +import appeng.api.implementations.items.IUpgradeModule; +import appeng.api.implementations.tiles.ISegmentedInventory; +import appeng.api.parts.IPartHost; +import appeng.api.parts.SelectedPart; +import appeng.client.texture.MissingIcon; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; +import appeng.core.features.IStackSrc; +import appeng.core.features.MaterialStackSrc; +import appeng.core.features.NameResolver; +import appeng.items.AEBaseItem; +import appeng.util.InventoryAdaptor; +import appeng.util.Platform; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; + public final class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, IUpgradeModule { + public static ItemMultiMaterial instance; private static final int KILO_SCALAR = 1024; @@ -74,8 +70,8 @@ public ItemMultiMaterial() { } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { super.addCheckedInformation(stack, player, lines, displayMoreInfo); final MaterialType mt = this.getTypeByStack(stack); @@ -98,8 +94,7 @@ public void addCheckedInformation( if (j.getKey().getItem() instanceof IItemGroup) { final IItemGroup ig = (IItemGroup) j.getKey().getItem(); - final String str = - ig.getUnlocalizedGroupName(u.getSupported().keySet(), j.getKey()); + final String str = ig.getUnlocalizedGroupName(u.getSupported().keySet(), j.getKey()); if (str != null) { name = Platform.gui_localize(str) + (limit > 1 ? " (" + limit + ')' : ""); } @@ -247,8 +242,8 @@ private String nameOf(final ItemStack is) { } @Override - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { final List types = Arrays.asList(MaterialType.values()); Collections.sort(types, new Comparator() { @@ -279,17 +274,8 @@ public void registerIcons(final IIconRegister icoRegister) { } @Override - public boolean onItemUseFirst( - final ItemStack is, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack is, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, is, 1) <= 0) return true; if (player.isSneaking()) { @@ -333,13 +319,11 @@ public boolean hasCustomEntity(final ItemStack is) { @Override public Entity createEntity(final World w, final Entity location, final ItemStack itemstack) { - final Class droppedEntity = - this.getTypeByStack(itemstack).getCustomEntityClass(); + final Class droppedEntity = this.getTypeByStack(itemstack).getCustomEntityClass(); final Entity eqi; try { - eqi = droppedEntity - .getConstructor(World.class, double.class, double.class, double.class, ItemStack.class) + eqi = droppedEntity.getConstructor(World.class, double.class, double.class, double.class, ItemStack.class) .newInstance(w, location.posX, location.posY, location.posZ, itemstack); } catch (final Throwable t) { throw new IllegalStateException(t); @@ -386,6 +370,7 @@ public boolean isStorageComponent(final ItemStack is) { } private static class SlightlyBetterSort implements Comparator { + private final Pattern pattern; public SlightlyBetterSort(final Pattern pattern) { diff --git a/src/main/java/appeng/items/materials/MaterialType.java b/src/main/java/appeng/items/materials/MaterialType.java index fb37aa706bd..bbce88806ff 100644 --- a/src/main/java/appeng/items/materials/MaterialType.java +++ b/src/main/java/appeng/items/materials/MaterialType.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.materials; +import java.util.EnumSet; + +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import appeng.core.AppEng; import appeng.core.features.AEFeature; import appeng.core.features.MaterialStackSrc; @@ -27,13 +26,9 @@ import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public enum MaterialType { + InvalidType(-1, AEFeature.Core), CertusQuartzCrystal(0, AEFeature.Core, "crystalCertusQuartz"), @@ -158,8 +153,8 @@ public enum MaterialType { true); } - MaterialType( - final int metaValue, final AEFeature part, final String oreDictionary, final Class c) { + MaterialType(final int metaValue, final AEFeature part, final String oreDictionary, + final Class c) { this.features = EnumSet.of(part); this.setDamageValue(metaValue); this.oreName = oreDictionary; diff --git a/src/main/java/appeng/items/misc/ItemCrystalSeed.java b/src/main/java/appeng/items/misc/ItemCrystalSeed.java index f73de91c113..3c587363164 100644 --- a/src/main/java/appeng/items/misc/ItemCrystalSeed.java +++ b/src/main/java/appeng/items/misc/ItemCrystalSeed.java @@ -1,40 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.misc; -import appeng.api.AEApi; -import appeng.api.definitions.IMaterials; -import appeng.api.implementations.items.IGrowableCrystal; -import appeng.api.recipes.ResolverResult; -import appeng.core.AppEng; -import appeng.core.features.AEFeature; -import appeng.core.localization.ButtonToolTips; -import appeng.entity.EntityGrowingCrystal; -import appeng.entity.EntityIds; -import appeng.items.AEBaseItem; -import appeng.util.Platform; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.List; + import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -49,6 +29,21 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.api.definitions.IMaterials; +import appeng.api.implementations.items.IGrowableCrystal; +import appeng.api.recipes.ResolverResult; +import appeng.core.AppEng; +import appeng.core.features.AEFeature; +import appeng.core.localization.ButtonToolTips; +import appeng.entity.EntityGrowingCrystal; +import appeng.entity.EntityIds; +import appeng.items.AEBaseItem; +import appeng.util.Platform; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal { private static final int LEVEL_OFFSET = 200; @@ -81,16 +76,13 @@ public ItemCrystalSeed() { public static ResolverResult getResolver(final int certus2) { ResolverResult resolver = null; - for (ItemStack crystalSeedStack : AEApi.instance() - .definitions() - .items() - .crystalSeed() - .maybeStack(1) - .asSet()) { + for (ItemStack crystalSeedStack : AEApi.instance().definitions().items().crystalSeed().maybeStack(1).asSet()) { crystalSeedStack.setItemDamage(certus2); crystalSeedStack = newStyle(crystalSeedStack); resolver = new ResolverResult( - "ItemCrystalSeed", crystalSeedStack.getItemDamage(), crystalSeedStack.getTagCompound()); + "ItemCrystalSeed", + crystalSeedStack.getItemDamage(), + crystalSeedStack.getTagCompound()); } return resolver; @@ -121,20 +113,17 @@ public ItemStack triggerGrowth(final ItemStack is) { final int size = is.stackSize; if (newDamage == CERTUS + SINGLE_OFFSET) { - for (final ItemStack quartzStack : - materials.purifiedCertusQuartzCrystal().maybeStack(size).asSet()) { + for (final ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack(size).asSet()) { return quartzStack; } } if (newDamage == NETHER + SINGLE_OFFSET) { - for (final ItemStack quartzStack : - materials.purifiedNetherQuartzCrystal().maybeStack(size).asSet()) { + for (final ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack(size).asSet()) { return quartzStack; } } if (newDamage == FLUIX + SINGLE_OFFSET) { - for (final ItemStack quartzStack : - materials.purifiedFluixCrystal().maybeStack(size).asSet()) { + for (final ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack(size).asSet()) { return quartzStack; } } @@ -159,8 +148,8 @@ public float getMultiplier(final Block blk, final Material mat) { @SideOnly(Side.CLIENT) @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { lines.add(ButtonToolTips.DoesntDespawn.getLocal()); final int progress = this.getProgress(stack) % SINGLE_OFFSET; lines.add(Math.floor((float) progress / (float) (SINGLE_OFFSET / 100)) + "%"); @@ -265,8 +254,12 @@ public boolean hasCustomEntity(final ItemStack stack) { @Override public Entity createEntity(final World world, final Entity location, final ItemStack itemstack) { - final EntityGrowingCrystal egc = - new EntityGrowingCrystal(world, location.posX, location.posY, location.posZ, itemstack); + final EntityGrowingCrystal egc = new EntityGrowingCrystal( + world, + location.posX, + location.posY, + location.posZ, + itemstack); egc.motionX = location.motionX; egc.motionY = location.motionY; @@ -280,8 +273,8 @@ public Entity createEntity(final World world, final Entity location, final ItemS } @Override - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { // lvl 0 itemStacks.add(newStyle(new ItemStack(this, 1, CERTUS))); itemStacks.add(newStyle(new ItemStack(this, 1, NETHER))); diff --git a/src/main/java/appeng/items/misc/ItemEncodedPattern.java b/src/main/java/appeng/items/misc/ItemEncodedPattern.java index 99eeb5a3df4..b56b1dd518f 100644 --- a/src/main/java/appeng/items/misc/ItemEncodedPattern.java +++ b/src/main/java/appeng/items/misc/ItemEncodedPattern.java @@ -1,39 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.misc; -import appeng.api.AEApi; -import appeng.api.implementations.ICraftingPatternItem; -import appeng.api.networking.crafting.ICraftingPatternDetails; -import appeng.api.storage.data.IAEItemStack; -import appeng.client.render.items.ItemEncodedPatternRenderer; -import appeng.core.CommonHelper; -import appeng.core.features.AEFeature; -import appeng.core.localization.GuiText; -import appeng.helpers.PatternHelper; -import appeng.items.AEBaseItem; -import appeng.util.Platform; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.WeakHashMap; + import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -45,7 +27,20 @@ import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.event.ForgeEventFactory; +import appeng.api.AEApi; +import appeng.api.implementations.ICraftingPatternItem; +import appeng.api.networking.crafting.ICraftingPatternDetails; +import appeng.api.storage.data.IAEItemStack; +import appeng.client.render.items.ItemEncodedPatternRenderer; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; +import appeng.core.localization.GuiText; +import appeng.helpers.PatternHelper; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternItem { + // rather simple client side caching. private static final Map SIMPLE_CACHE = new WeakHashMap(); @@ -65,17 +60,8 @@ public ItemStack onItemRightClick(final ItemStack stack, final World w, final En } @Override - public boolean onItemUseFirst( - final ItemStack stack, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true; return this.clearPattern(stack, player); @@ -91,12 +77,8 @@ private boolean clearPattern(final ItemStack stack, final EntityPlayer player) { for (int s = 0; s < player.inventory.getSizeInventory(); s++) { if (inv.getStackInSlot(s) == stack) { - for (final ItemStack blankPattern : AEApi.instance() - .definitions() - .materials() - .blankPattern() - .maybeStack(stack.stackSize) - .asSet()) { + for (final ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern() + .maybeStack(stack.stackSize).asSet()) { inv.setInventorySlotContents(s, blankPattern); } @@ -109,8 +91,8 @@ private boolean clearPattern(final ItemStack stack, final EntityPlayer player) { } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { final NBTTagCompound encodedValue = stack.getTagCompound(); if (encodedValue == null) { @@ -196,13 +178,8 @@ public ItemStack getOutput(final ItemStack item) { return out; } - private boolean addInformation( - final EntityPlayer player, - final IAEItemStack[] items, - final List lines, - final String label, - final String and, - final boolean displayMoreInfo) { + private boolean addInformation(final EntityPlayer player, final IAEItemStack[] items, final List lines, + final String label, final String and, final boolean displayMoreInfo) { final ItemStack unknownItem = new ItemStack(Blocks.fire); boolean recipeIsBroken = false; boolean first = true; diff --git a/src/main/java/appeng/items/misc/ItemPaintBall.java b/src/main/java/appeng/items/misc/ItemPaintBall.java index 9977928eac0..dcffbf537a4 100644 --- a/src/main/java/appeng/items/misc/ItemPaintBall.java +++ b/src/main/java/appeng/items/misc/ItemPaintBall.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.misc; -import appeng.api.util.AEColor; -import appeng.client.render.items.PaintBallRender; -import appeng.core.features.AEFeature; -import appeng.core.localization.GuiText; -import appeng.items.AEBaseItem; -import appeng.util.Platform; import java.util.EnumSet; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.client.MinecraftForgeClient; +import appeng.api.util.AEColor; +import appeng.client.render.items.PaintBallRender; +import appeng.core.features.AEFeature; +import appeng.core.localization.GuiText; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + public class ItemPaintBall extends AEBaseItem { private static final int DAMAGE_THRESHOLD = 20; @@ -67,8 +61,8 @@ public AEColor getColor(final ItemStack is) { } @Override - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { for (final AEColor c : AEColor.values()) { if (c != AEColor.Transparent) { itemStacks.add(new ItemStack(this, 1, c.ordinal())); diff --git a/src/main/java/appeng/items/parts/ItemFacade.java b/src/main/java/appeng/items/parts/ItemFacade.java index 7506054190a..a9a904c0f9a 100644 --- a/src/main/java/appeng/items/parts/ItemFacade.java +++ b/src/main/java/appeng/items/parts/ItemFacade.java @@ -1,41 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.parts; -import appeng.api.AEApi; -import appeng.api.exceptions.MissingDefinition; -import appeng.api.parts.IAlphaPassItem; -import appeng.block.solids.OreQuartz; -import appeng.client.render.BusRenderer; -import appeng.core.FacadeConfig; -import appeng.core.features.AEFeature; -import appeng.facade.FacadePart; -import appeng.facade.IFacadeItem; -import appeng.items.AEBaseItem; -import appeng.util.Platform; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockGlass; import net.minecraft.block.BlockStainedGlass; @@ -50,6 +28,22 @@ import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; +import appeng.api.exceptions.MissingDefinition; +import appeng.api.parts.IAlphaPassItem; +import appeng.block.solids.OreQuartz; +import appeng.client.render.BusRenderer; +import appeng.core.FacadeConfig; +import appeng.core.features.AEFeature; +import appeng.facade.FacadePart; +import appeng.facade.IFacadeItem; +import appeng.items.AEBaseItem; +import appeng.util.Platform; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassItem { private List subTypes = null; @@ -69,17 +63,8 @@ public int getSpriteNumber() { } @Override - public boolean onItemUse( - final ItemStack is, - final EntityPlayer player, - final World w, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, + final int z, final int side, final float hitX, final float hitY, final float hitZ) { return AEApi.instance().partHelper().placeBus(is, x, y, z, side, player, w); } @@ -98,8 +83,8 @@ public String getItemStackDisplayName(final ItemStack is) { } @Override - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { this.calculateSubTypes(); itemStacks.addAll(this.subTypes); } @@ -147,8 +132,8 @@ public ItemStack createFacadeForItem(final ItemStack l, final boolean returnItem final boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass; final boolean disableOre = b instanceof OreQuartz; - final boolean defaultValue = - (b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre) || enableGlass; + final boolean defaultValue = (b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre) + || enableGlass; if (FacadeConfig.instance.checkEnabled(b, metadata, defaultValue)) { if (returnItem) { return l; @@ -229,8 +214,7 @@ public ItemStack getCreativeTabIcon() { } public ItemStack createFromIDs(final int[] ids) { - for (final ItemStack facadeStack : - AEApi.instance().definitions().items().facade().maybeStack(1).asSet()) { + for (final ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack(1).asSet()) { final NBTTagCompound facadeTag = new NBTTagCompound(); facadeTag.setIntArray("x", ids.clone()); facadeStack.setTagCompound(facadeTag); diff --git a/src/main/java/appeng/items/parts/ItemMultiPart.java b/src/main/java/appeng/items/parts/ItemMultiPart.java index 893eea0418b..ec83280ee4c 100644 --- a/src/main/java/appeng/items/parts/ItemMultiPart.java +++ b/src/main/java/appeng/items/parts/ItemMultiPart.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.parts; +import java.lang.reflect.InvocationTargetException; +import java.util.*; +import java.util.Map.Entry; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.exceptions.MissingDefinition; import appeng.api.implementations.items.IItemGroup; @@ -34,26 +41,16 @@ import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.items.AEBaseItem; + import com.google.common.base.Preconditions; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import java.util.Map.Entry; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup { + private static final int INITIAL_REGISTERED_CAPACITY = PartType.values().length; - private static final Comparator> REGISTERED_COMPARATOR = - new RegisteredComparator(); + private static final Comparator> REGISTERED_COMPARATOR = new RegisteredComparator(); public static ItemMultiPart instance; private final NameResolver nameResolver; @@ -121,16 +118,21 @@ private ItemStackSrc createPart(final PartType mat, final int varID) { return output; } - private void processMetaOverlap( - final boolean enabled, final int partDamage, final PartType mat, final PartTypeWithVariant pti) { + private void processMetaOverlap(final boolean enabled, final int partDamage, final PartType mat, + final PartTypeWithVariant pti) { assert partDamage >= 0; assert mat != null; assert pti != null; final PartTypeWithVariant registeredPartType = this.registered.get(partDamage); if (registeredPartType != null) { - throw new IllegalStateException("Meta Overlap detected with type " + mat + " and damage " + partDamage - + ". Found " + registeredPartType + " there already."); + throw new IllegalStateException( + "Meta Overlap detected with type " + mat + + " and damage " + + partDamage + + ". Found " + + registeredPartType + + " there already."); } if (enabled) { @@ -162,24 +164,17 @@ public IIcon getIconFromDamage(final int dmg) { return registeredType.ico; } - final String formattedRegistered = - Arrays.toString(this.registered.keySet().toArray()); - throw new MissingDefinition("Tried to get the icon from a non-existent part with damage value " + dmg - + ". There were registered: " + formattedRegistered + '.'); + final String formattedRegistered = Arrays.toString(this.registered.keySet().toArray()); + throw new MissingDefinition( + "Tried to get the icon from a non-existent part with damage value " + dmg + + ". There were registered: " + + formattedRegistered + + '.'); } @Override - public boolean onItemUse( - final ItemStack is, - final EntityPlayer player, - final World w, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, + final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (this.getTypeByStack(is) == PartType.InvalidType) { return false; } @@ -222,10 +217,10 @@ public void registerIcons(final IIconRegister iconRegister) { } @Override - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { - final List> types = - new ArrayList>(this.registered.entrySet()); + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { + final List> types = new ArrayList>( + this.registered.entrySet()); Collections.sort(types, REGISTERED_COMPARATOR); for (final Entry part : types) { @@ -339,6 +334,7 @@ public String getUnlocalizedGroupName(final Set others, final ItemSta } private static final class PartTypeWithVariant { + private final PartType part; private final int variant; @@ -356,13 +352,17 @@ private PartTypeWithVariant(final PartType part, final int variant) { @Override public String toString() { return "PartTypeWithVariant{" + "part=" - + this.part + ", variant=" - + this.variant + ", ico=" - + this.ico + '}'; + + this.part + + ", variant=" + + this.variant + + ", ico=" + + this.ico + + '}'; } } private static final class RegisteredComparator implements Comparator> { + @Override public int compare(final Entry o1, final Entry o2) { return o1.getValue().part.name().compareTo(o2.getValue().part.name()); diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 251a4ef742d..244cc088411 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.parts; +import java.lang.reflect.Constructor; +import java.util.Collections; +import java.util.EnumSet; +import java.util.Set; + import appeng.api.parts.IPart; import appeng.core.features.AEFeature; import appeng.core.localization.GuiText; @@ -27,15 +24,13 @@ import appeng.parts.networking.*; import appeng.parts.p2p.*; import appeng.parts.reporting.*; -import java.lang.reflect.Constructor; -import java.util.Collections; -import java.util.EnumSet; -import java.util.Set; public enum PartType { + InvalidType(-1, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), null), CableGlass(0, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartCableGlass.class) { + @Override public boolean isCable() { return true; @@ -43,6 +38,7 @@ public boolean isCable() { }, CableCovered(20, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartCableCovered.class) { + @Override public boolean isCable() { return true; @@ -50,6 +46,7 @@ public boolean isCable() { }, CableSmart(40, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartCableSmart.class) { + @Override public boolean isCable() { return true; @@ -57,29 +54,33 @@ public boolean isCable() { }, CableDense(60, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartDenseCable.class) { + @Override public boolean isCable() { return true; } }, - CableDenseCovered( - 520, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartDenseCableCovered.class) { + CableDenseCovered(520, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), + PartDenseCableCovered.class) { + @Override public boolean isCable() { return true; } }, - CableUltraDenseCovered( - 540, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartUltraDenseCableCovered.class) { + CableUltraDenseCovered(540, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), + PartUltraDenseCableCovered.class) { + @Override public boolean isCable() { return true; } }, - CableUltraDenseSmart( - 560, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartUltraDenseCableSmart.class) { + CableUltraDenseSmart(560, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), + PartUltraDenseCableSmart.class) { + @Override public boolean isCable() { return true; @@ -88,8 +89,8 @@ public boolean isCable() { ToggleBus(80, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartToggleBus.class), - InvertedToggleBus( - 100, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartInvertedToggleBus.class), + InvertedToggleBus(100, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), + PartInvertedToggleBus.class), CableAnchor(120, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartCableAnchor.class), @@ -107,131 +108,72 @@ public boolean isCable() { ExportBus(260, EnumSet.of(AEFeature.ExportBus), EnumSet.noneOf(IntegrationType.class), PartExportBus.class), - LevelEmitter( - 280, EnumSet.of(AEFeature.LevelEmitter), EnumSet.noneOf(IntegrationType.class), PartLevelEmitter.class), + LevelEmitter(280, EnumSet.of(AEFeature.LevelEmitter), EnumSet.noneOf(IntegrationType.class), + PartLevelEmitter.class), - AnnihilationPlane( - 300, - EnumSet.of(AEFeature.AnnihilationPlane), - EnumSet.noneOf(IntegrationType.class), + AnnihilationPlane(300, EnumSet.of(AEFeature.AnnihilationPlane), EnumSet.noneOf(IntegrationType.class), PartAnnihilationPlane.class), - IdentityAnnihilationPlane( - 301, - EnumSet.of(AEFeature.AnnihilationPlane, AEFeature.IdentityAnnihilationPlane), - EnumSet.noneOf(IntegrationType.class), - PartIdentityAnnihilationPlane.class), + IdentityAnnihilationPlane(301, EnumSet.of(AEFeature.AnnihilationPlane, AEFeature.IdentityAnnihilationPlane), + EnumSet.noneOf(IntegrationType.class), PartIdentityAnnihilationPlane.class), - FormationPlane( - 320, EnumSet.of(AEFeature.FormationPlane), EnumSet.noneOf(IntegrationType.class), PartFormationPlane.class), + FormationPlane(320, EnumSet.of(AEFeature.FormationPlane), EnumSet.noneOf(IntegrationType.class), + PartFormationPlane.class), - PatternTerminal( - 340, EnumSet.of(AEFeature.Patterns), EnumSet.noneOf(IntegrationType.class), PartPatternTerminal.class), + PatternTerminal(340, EnumSet.of(AEFeature.Patterns), EnumSet.noneOf(IntegrationType.class), + PartPatternTerminal.class), - CraftingTerminal( - 360, - EnumSet.of(AEFeature.CraftingTerminal), - EnumSet.noneOf(IntegrationType.class), + CraftingTerminal(360, EnumSet.of(AEFeature.CraftingTerminal), EnumSet.noneOf(IntegrationType.class), PartCraftingTerminal.class), Terminal(380, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartTerminal.class), - StorageMonitor( - 400, EnumSet.of(AEFeature.StorageMonitor), EnumSet.noneOf(IntegrationType.class), PartStorageMonitor.class), + StorageMonitor(400, EnumSet.of(AEFeature.StorageMonitor), EnumSet.noneOf(IntegrationType.class), + PartStorageMonitor.class), - ConversionMonitor( - 420, - EnumSet.of(AEFeature.PartConversionMonitor), - EnumSet.noneOf(IntegrationType.class), + ConversionMonitor(420, EnumSet.of(AEFeature.PartConversionMonitor), EnumSet.noneOf(IntegrationType.class), PartConversionMonitor.class), Interface(440, EnumSet.of(AEFeature.Core), EnumSet.noneOf(IntegrationType.class), PartInterface.class), - P2PTunnelME( - 460, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelME), - EnumSet.noneOf(IntegrationType.class), - PartP2PTunnelME.class, - GuiText.METunnel), - - P2PTunnelRedstone( - 461, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone), - EnumSet.noneOf(IntegrationType.class), - PartP2PRedstone.class, - GuiText.RedstoneTunnel), - - P2PTunnelItems( - 462, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelItems), - EnumSet.noneOf(IntegrationType.class), - PartP2PItems.class, - GuiText.ItemTunnel), - - P2PTunnelLiquids( - 463, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids), - EnumSet.noneOf(IntegrationType.class), - PartP2PLiquids.class, - GuiText.FluidTunnel), - - P2PTunnelEU( - 465, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelEU), - EnumSet.of(IntegrationType.IC2), - PartP2PIC2Power.class, - GuiText.EUTunnel), - - P2PTunnelRF( - 466, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelRF), - EnumSet.of(IntegrationType.RF), - PartP2PRFPower.class, - GuiText.RFTunnel), - - P2PTunnelLight( - 467, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelLight), - EnumSet.noneOf(IntegrationType.class), - PartP2PLight.class, - GuiText.LightTunnel), - - P2PTunnelOpenComputers( - 468, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers), - EnumSet.of(IntegrationType.OpenComputers), - PartP2POpenComputers.class, - GuiText.OCTunnel), - - P2PTunnelPressure( - 469, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelPressure), - EnumSet.of(IntegrationType.PneumaticCraft), - PartP2PPressure.class, - GuiText.PressureTunnel), - - P2PTunnelGT( - 470, - EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelGregtech), - EnumSet.of(IntegrationType.GT), - PartP2PGT5Power.class, - GuiText.GTTunnel), - - P2PTunnelInterface( - 471, - EnumSet.of(AEFeature.P2PTunnel), - EnumSet.noneOf(IntegrationType.class), - PartP2PInterface.class, - GuiText.IFACETunnel), - - InterfaceTerminal( - 480, - EnumSet.of(AEFeature.InterfaceTerminal), - EnumSet.noneOf(IntegrationType.class), + P2PTunnelME(460, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelME), EnumSet.noneOf(IntegrationType.class), + PartP2PTunnelME.class, GuiText.METunnel), + + P2PTunnelRedstone(461, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone), + EnumSet.noneOf(IntegrationType.class), PartP2PRedstone.class, GuiText.RedstoneTunnel), + + P2PTunnelItems(462, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelItems), + EnumSet.noneOf(IntegrationType.class), PartP2PItems.class, GuiText.ItemTunnel), + + P2PTunnelLiquids(463, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids), + EnumSet.noneOf(IntegrationType.class), PartP2PLiquids.class, GuiText.FluidTunnel), + + P2PTunnelEU(465, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelEU), EnumSet.of(IntegrationType.IC2), + PartP2PIC2Power.class, GuiText.EUTunnel), + + P2PTunnelRF(466, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelRF), EnumSet.of(IntegrationType.RF), + PartP2PRFPower.class, GuiText.RFTunnel), + + P2PTunnelLight(467, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelLight), + EnumSet.noneOf(IntegrationType.class), PartP2PLight.class, GuiText.LightTunnel), + + P2PTunnelOpenComputers(468, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers), + EnumSet.of(IntegrationType.OpenComputers), PartP2POpenComputers.class, GuiText.OCTunnel), + + P2PTunnelPressure(469, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelPressure), + EnumSet.of(IntegrationType.PneumaticCraft), PartP2PPressure.class, GuiText.PressureTunnel), + + P2PTunnelGT(470, EnumSet.of(AEFeature.P2PTunnel, AEFeature.P2PTunnelGregtech), EnumSet.of(IntegrationType.GT), + PartP2PGT5Power.class, GuiText.GTTunnel), + + P2PTunnelInterface(471, EnumSet.of(AEFeature.P2PTunnel), EnumSet.noneOf(IntegrationType.class), + PartP2PInterface.class, GuiText.IFACETunnel), + + InterfaceTerminal(480, EnumSet.of(AEFeature.InterfaceTerminal), EnumSet.noneOf(IntegrationType.class), PartInterfaceTerminal.class), - PatternTerminalEx( - 500, EnumSet.of(AEFeature.Patterns), EnumSet.noneOf(IntegrationType.class), PartPatternTerminalEx.class); + PatternTerminalEx(500, EnumSet.of(AEFeature.Patterns), EnumSet.noneOf(IntegrationType.class), + PartPatternTerminalEx.class); private final int baseDamage; private final Set features; @@ -240,20 +182,13 @@ public boolean isCable() { private final GuiText extraName; private Constructor constructor; - PartType( - final int baseMetaValue, - final Set features, - final Set integrations, + PartType(final int baseMetaValue, final Set features, final Set integrations, final Class c) { this(baseMetaValue, features, integrations, c, null); } - PartType( - final int baseMetaValue, - final Set features, - final Set integrations, - final Class c, - final GuiText en) { + PartType(final int baseMetaValue, final Set features, final Set integrations, + final Class c, final GuiText en) { this.features = Collections.unmodifiableSet(features); this.integrations = Collections.unmodifiableSet(integrations); this.myPart = c; diff --git a/src/main/java/appeng/items/storage/ItemAdvancedStorageCell.java b/src/main/java/appeng/items/storage/ItemAdvancedStorageCell.java index d2a59db320d..7f894a85460 100644 --- a/src/main/java/appeng/items/storage/ItemAdvancedStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemAdvancedStorageCell.java @@ -1,13 +1,16 @@ package appeng.items.storage; +import java.util.EnumSet; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IItemDefinition; import appeng.api.exceptions.MissingDefinition; import appeng.core.features.AEFeature; import appeng.items.materials.MaterialType; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.item.ItemStack; public class ItemAdvancedStorageCell extends ItemBasicStorageCell { @@ -50,11 +53,7 @@ protected IItemDefinition getStorageCellCase() { @Override public ItemStack getContainerItem(final ItemStack itemStack) { - for (final ItemStack stack : AEApi.instance() - .definitions() - .materials() - .emptyAdvancedStorageCell() - .maybeStack(1) + for (final ItemStack stack : AEApi.instance().definitions().materials().emptyAdvancedStorageCell().maybeStack(1) .asSet()) { return stack; } diff --git a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java index 8d8f03564cb..43a1513c5ad 100644 --- a/src/main/java/appeng/items/storage/ItemBasicStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemBasicStorageCell.java @@ -1,23 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.storage; +import java.text.NumberFormat; +import java.util.EnumSet; +import java.util.List; +import java.util.Set; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; + import appeng.api.AEApi; import appeng.api.config.FuzzyMode; import appeng.api.config.IncludeExclude; @@ -41,23 +47,14 @@ import appeng.items.materials.MaterialType; import appeng.util.InventoryAdaptor; import appeng.util.Platform; + import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.text.NumberFormat; -import java.util.EnumSet; -import java.util.List; -import java.util.Set; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ForgeEventFactory; public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, IItemGroup { + protected MaterialType component; protected int totalBytes; protected int perType; @@ -102,33 +99,39 @@ public ItemBasicStorageCell(final Optional subName) { @SideOnly(Side.CLIENT) @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { - final IMEInventoryHandler inventory = - AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.ITEMS); + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { + final IMEInventoryHandler inventory = AEApi.instance().registries().cell() + .getCellInventory(stack, null, StorageChannel.ITEMS); if (inventory instanceof ICellInventoryHandler) { final ICellInventoryHandler handler = (ICellInventoryHandler) inventory; final ICellInventory cellInventory = handler.getCellInv(); if (cellInventory != null) { - lines.add(NumberFormat.getInstance().format(cellInventory.getUsedBytes()) + " " + GuiText.Of.getLocal() - + ' ' + NumberFormat.getInstance().format(cellInventory.getTotalBytes()) + ' ' - + GuiText.BytesUsed.getLocal()); - - lines.add(NumberFormat.getInstance().format(cellInventory.getStoredItemTypes()) + " " - + GuiText.Of.getLocal() + ' ' - + NumberFormat.getInstance().format(cellInventory.getTotalItemTypes()) + ' ' - + GuiText.Types.getLocal()); + lines.add( + NumberFormat.getInstance().format(cellInventory.getUsedBytes()) + " " + + GuiText.Of.getLocal() + + ' ' + + NumberFormat.getInstance().format(cellInventory.getTotalBytes()) + + ' ' + + GuiText.BytesUsed.getLocal()); + + lines.add( + NumberFormat.getInstance().format(cellInventory.getStoredItemTypes()) + " " + + GuiText.Of.getLocal() + + ' ' + + NumberFormat.getInstance().format(cellInventory.getTotalItemTypes()) + + ' ' + + GuiText.Types.getLocal()); if (handler.isPreformatted()) { String filter = cellInventory.getOreFilter(); if (filter.isEmpty()) { final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST - ? GuiText.Included - : GuiText.Excluded) - .getLocal(); + ? GuiText.Included + : GuiText.Excluded).getLocal(); if (handler.isFuzzy()) { lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); @@ -137,9 +140,7 @@ public void addCheckedInformation( } if (GuiScreen.isShiftKeyDown()) { lines.add(GuiText.Filter.getLocal() + ": "); - for (int i = 0; - i < cellInventory.getConfigInventory().getSizeInventory(); - ++i) { + for (int i = 0; i < cellInventory.getConfigInventory().getSizeInventory(); ++i) { ItemStack s = cellInventory.getConfigInventory().getStackInSlot(i); if (s != null) lines.add(s.getDisplayName()); } @@ -243,15 +244,15 @@ public ItemStack onItemRightClick(final ItemStack stack, final World world, fina return stack; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) private boolean disassembleDrive(final ItemStack stack, final World world, final EntityPlayer player) { if (player.isSneaking()) { if (Platform.isClient()) { return false; } final InventoryPlayer playerInventory = player.inventory; - final IMEInventoryHandler inv = - AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.ITEMS); + final IMEInventoryHandler inv = AEApi.instance().registries().cell() + .getCellInventory(stack, null, StorageChannel.ITEMS); if (inv != null && playerInventory.getCurrentItem() == stack) { final InventoryAdaptor ia = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN); final IItemList list = inv.getAvailableItems(StorageChannel.ITEMS.createList()); @@ -275,8 +276,7 @@ private boolean disassembleDrive(final ItemStack stack, final World world, final } // drop empty storage cell case - for (final ItemStack storageCellStack : - getStorageCellCase().maybeStack(1).asSet()) { + for (final ItemStack storageCellStack : getStorageCellCase().maybeStack(1).asSet()) { final ItemStack extraA = ia.addItems(storageCellStack); if (extraA != null) { player.dropPlayerItemWithRandomChoice(extraA, false); @@ -299,17 +299,8 @@ protected IItemDefinition getStorageCellCase() { } @Override - public boolean onItemUseFirst( - final ItemStack stack, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack stack, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, stack, 1) <= 0) return true; return this.disassembleDrive(stack, world, player); @@ -317,11 +308,7 @@ public boolean onItemUseFirst( @Override public ItemStack getContainerItem(final ItemStack itemStack) { - for (final ItemStack stack : AEApi.instance() - .definitions() - .materials() - .emptyStorageCell() - .maybeStack(1) + for (final ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack(1) .asSet()) { return stack; } diff --git a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java index a1e98cc214b..6b0b4380bd7 100644 --- a/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemCreativeStorageCell.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.storage; +import java.util.EnumSet; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.config.FuzzyMode; import appeng.api.storage.ICellWorkbenchItem; import appeng.core.features.AEFeature; import appeng.items.AEBaseItem; import appeng.items.contents.CellConfig; -import java.util.EnumSet; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenchItem { diff --git a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java index 1f299885139..c1267322da0 100644 --- a/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java +++ b/src/main/java/appeng/items/storage/ItemSpatialStorageCell.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.storage; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + import appeng.api.implementations.TransitionResult; import appeng.api.implementations.items.ISpatialStorageCell; import appeng.api.util.WorldCoord; @@ -28,16 +29,11 @@ import appeng.spatial.StorageHelper; import appeng.spatial.StorageWorldProvider; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorageCell { + private final int maxRegion; public ItemSpatialStorageCell(final int spatialScale) { @@ -48,8 +44,8 @@ public ItemSpatialStorageCell(final int spatialScale) { } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { final WorldCoord wc = this.getStoredSize(stack); if (wc.x > 0) { lines.add(GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z); @@ -125,8 +121,8 @@ public WorldCoord getMax(final ItemStack is) { } @Override - public TransitionResult doSpatialTransition( - final ItemStack is, final World w, final WorldCoord min, final WorldCoord max, final boolean doTransition) { + public TransitionResult doSpatialTransition(final ItemStack is, final World w, final WorldCoord min, + final WorldCoord max, final boolean doTransition) { final WorldCoord scale = this.getStoredSize(is); final int targetX = max.x - min.x - 1; @@ -144,19 +140,18 @@ public TransitionResult doSpatialTransition( } final int floorBuffer = 64; - StorageHelper.getInstance() - .swapRegions( - w, - destination, - min.x + 1, - min.y + 1, - min.z + 1, - 1, - floorBuffer + 1, - 1, - targetX - 1, - targetY - 1, - targetZ - 1); + StorageHelper.getInstance().swapRegions( + w, + destination, + min.x + 1, + min.y + 1, + min.z + 1, + 1, + floorBuffer + 1, + 1, + targetX - 1, + targetY - 1, + targetZ - 1); this.setStoredSize(is, targetX, targetY, targetZ); return new TransitionResult(true, 0); diff --git a/src/main/java/appeng/items/storage/ItemViewCell.java b/src/main/java/appeng/items/storage/ItemViewCell.java index 6738859a296..ef377ea8b55 100644 --- a/src/main/java/appeng/items/storage/ItemViewCell.java +++ b/src/main/java/appeng/items/storage/ItemViewCell.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.storage; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.FuzzyMode; import appeng.api.config.Upgrades; @@ -33,13 +32,9 @@ import appeng.util.Platform; import appeng.util.item.AEItemStack; import appeng.util.prioitylist.*; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem { + public ItemViewCell() { this.setFeature(EnumSet.of(AEFeature.Core)); this.setMaxStackSize(1); @@ -89,8 +84,7 @@ public static IPartitionList createFilter(final ItemStack[] list) if (hasOreFilter && !filter.isEmpty()) { myMergedList.addNewList(new OreFilteredList(filter), !hasInverter); } else { - final IItemList priorityList = - AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); for (int x = 0; x < config.getSizeInventory(); x++) { final ItemStack is = config.getStackInSlot(x); @@ -102,7 +96,8 @@ public static IPartitionList createFilter(final ItemStack[] list) if (!priorityList.isEmpty()) { if (hasFuzzy) { myMergedList.addNewList( - new FuzzyPriorityList(priorityList, fzMode), !hasInverter); + new FuzzyPriorityList(priorityList, fzMode), + !hasInverter); } else { myMergedList.addNewList(new PrecisePriorityList(priorityList), !hasInverter); } @@ -156,8 +151,8 @@ public void setOreFilter(ItemStack is, String filter) { } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { String filter = getOreFilter(stack); if (!filter.isEmpty()) lines.add(GuiText.PartitionedOre.getLocal() + " : " + filter); } diff --git a/src/main/java/appeng/items/tools/ToolBiometricCard.java b/src/main/java/appeng/items/tools/ToolBiometricCard.java index 026192e05b8..5b1f929b91f 100644 --- a/src/main/java/appeng/items/tools/ToolBiometricCard.java +++ b/src/main/java/appeng/items/tools/ToolBiometricCard.java @@ -1,35 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools; -import appeng.api.config.SecurityPermissions; -import appeng.api.features.IPlayerRegistry; -import appeng.api.implementations.items.IBiometricCard; -import appeng.api.networking.security.ISecurityRegistry; -import appeng.client.render.items.ToolBiometricCardRender; -import appeng.core.features.AEFeature; -import appeng.core.localization.GuiText; -import appeng.items.AEBaseItem; -import appeng.util.Platform; -import com.mojang.authlib.GameProfile; import java.util.EnumSet; import java.util.List; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -39,7 +22,20 @@ import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.event.ForgeEventFactory; +import appeng.api.config.SecurityPermissions; +import appeng.api.features.IPlayerRegistry; +import appeng.api.implementations.items.IBiometricCard; +import appeng.api.networking.security.ISecurityRegistry; +import appeng.client.render.items.ToolBiometricCardRender; +import appeng.core.features.AEFeature; +import appeng.core.localization.GuiText; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + +import com.mojang.authlib.GameProfile; + public class ToolBiometricCard extends AEBaseItem implements IBiometricCard { + public ToolBiometricCard() { this.setFeature(EnumSet.of(AEFeature.Security)); this.setMaxStackSize(1); @@ -61,8 +57,8 @@ public ItemStack onItemRightClick(final ItemStack is, final World w, final Entit } @Override - public boolean itemInteractionForEntity( - ItemStack is, final EntityPlayer par2EntityPlayer, final EntityLivingBase target) { + public boolean itemInteractionForEntity(ItemStack is, final EntityPlayer par2EntityPlayer, + final EntityLivingBase target) { if (target instanceof EntityPlayer && !par2EntityPlayer.isSneaking()) { if (par2EntityPlayer.capabilities.isCreativeMode) { is = par2EntityPlayer.getCurrentEquippedItem(); @@ -77,8 +73,7 @@ public boolean itemInteractionForEntity( @Override public String getItemStackDisplayName(final ItemStack is) { final GameProfile username = this.getProfile(is); - return username != null - ? super.getItemStackDisplayName(is) + " - " + username.getName() + return username != null ? super.getItemStackDisplayName(is) + " - " + username.getName() : super.getItemStackDisplayName(is); } @@ -154,8 +149,8 @@ public void registerPermissions(final ISecurityRegistry register, final IPlayerR } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { final EnumSet perms = this.getPermissions(stack); if (perms.isEmpty()) { lines.add(GuiText.NoPermissions.getLocal()); diff --git a/src/main/java/appeng/items/tools/ToolMemoryCard.java b/src/main/java/appeng/items/tools/ToolMemoryCard.java index ef1fa115711..b727921138c 100644 --- a/src/main/java/appeng/items/tools/ToolMemoryCard.java +++ b/src/main/java/appeng/items/tools/ToolMemoryCard.java @@ -1,33 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools; -import appeng.api.implementations.items.IMemoryCard; -import appeng.api.implementations.items.MemoryCardMessages; -import appeng.core.features.AEFeature; -import appeng.core.localization.ButtonToolTips; -import appeng.core.localization.GuiText; -import appeng.core.localization.PlayerMessages; -import appeng.items.AEBaseItem; -import appeng.util.Platform; import java.util.EnumSet; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -35,6 +20,15 @@ import net.minecraft.world.World; import net.minecraftforge.event.ForgeEventFactory; +import appeng.api.implementations.items.IMemoryCard; +import appeng.api.implementations.items.MemoryCardMessages; +import appeng.core.features.AEFeature; +import appeng.core.localization.ButtonToolTips; +import appeng.core.localization.GuiText; +import appeng.core.localization.PlayerMessages; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + public class ToolMemoryCard extends AEBaseItem implements IMemoryCard { public ToolMemoryCard() { @@ -43,20 +37,20 @@ public ToolMemoryCard() { } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { lines.add(this.getLocalizedName(this.getSettingsName(stack) + ".name", this.getSettingsName(stack))); final NBTTagCompound data = this.getData(stack); if (data.hasKey("tooltip")) { - lines.add(StatCollector.translateToLocal( - this.getLocalizedName(data.getString("tooltip") + ".name", data.getString("tooltip")))); + lines.add( + StatCollector.translateToLocal( + this.getLocalizedName(data.getString("tooltip") + ".name", data.getString("tooltip")))); } if (data.hasKey("freq")) { final long freq = data.getLong("freq"); - final String freqTooltip = - String.format("%X", freq).replaceAll("(.{4})", "$0 ").trim(); + final String freqTooltip = String.format("%X", freq).replaceAll("(.{4})", "$0 ").trim(); final String local = ButtonToolTips.P2PFrequency.getLocal(); @@ -134,17 +128,8 @@ public void notifyUser(final EntityPlayer player, final MemoryCardMessages msg) } @Override - public boolean onItemUse( - final ItemStack is, - final EntityPlayer player, - final World w, - final int x, - final int y, - final int z, - final int side, - final float hx, - final float hy, - final float hz) { + public boolean onItemUse(final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, + final int z, final int side, final float hx, final float hy, final float hz) { if (player.isSneaking() && !w.isRemote) { if (ForgeEventFactory.onItemUseStart(player, is, 1) <= 0) return false; final IMemoryCard mem = (IMemoryCard) is.getItem(); @@ -157,8 +142,8 @@ public boolean onItemUse( } @Override - public boolean doesSneakBypassUse( - final World world, final int x, final int y, final int z, final EntityPlayer player) { + public boolean doesSneakBypassUse(final World world, final int x, final int y, final int z, + final EntityPlayer player) { return true; } } diff --git a/src/main/java/appeng/items/tools/ToolNetworkTool.java b/src/main/java/appeng/items/tools/ToolNetworkTool.java index ac9f16aff51..f878a33040c 100644 --- a/src/main/java/appeng/items/tools/ToolNetworkTool.java +++ b/src/main/java/appeng/items/tools/ToolNetworkTool.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import appeng.api.implementations.guiobjects.IGuiItem; import appeng.api.implementations.guiobjects.IGuiItemObject; import appeng.api.implementations.items.IAEWrench; @@ -38,18 +43,8 @@ import appeng.transformer.annotations.Integration.Interface; import appeng.util.Platform; import buildcraft.api.tools.IToolWrench; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; @Interface(iface = "buildcraft.api.tools.IToolWrench", iname = IntegrationType.BuildCraftCore) public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench, IToolWrench { @@ -90,35 +85,28 @@ public ItemStack onItemRightClick(final ItemStack it, final World w, final Entit } @Override - public boolean onItemUseFirst( - final ItemStack is, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack is, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, is, 1) <= 0) return true; Block blk = world.getBlock(x, y, z); - if (blk != null) - if (ForgeEventFactory.onPlayerInteract( - player, - blk.isAir(world, x, y, z) - ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR - : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, - x, - y, - z, - side, - world) - .isCanceled()) return true; - - final MovingObjectPosition mop = - new MovingObjectPosition(x, y, z, side, Vec3.createVectorHelper(hitX, hitY, hitZ)); + if (blk != null) if (ForgeEventFactory.onPlayerInteract( + player, + blk.isAir(world, x, y, z) ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR + : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, + x, + y, + z, + side, + world).isCanceled()) + return true; + + final MovingObjectPosition mop = new MovingObjectPosition( + x, + y, + z, + side, + Vec3.createVectorHelper(hitX, hitY, hitZ)); final TileEntity te = world.getTileEntity(x, y, z); if (te instanceof IPartHost) { final SelectedPart part = ((IPartHost) te).selectPart(mop.hitVec); @@ -139,22 +127,13 @@ public boolean onItemUseFirst( } @Override - public boolean doesSneakBypassUse( - final World world, final int x, final int y, final int z, final EntityPlayer player) { + public boolean doesSneakBypassUse(final World world, final int x, final int y, final int z, + final EntityPlayer player) { return true; } - public boolean serverSideToolLogic( - final ItemStack is, - final EntityPlayer p, - final World w, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean serverSideToolLogic(final ItemStack is, final EntityPlayer p, final World w, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (side >= 0) { if (!Platform.hasPermissions(new DimensionalCoord(w, x, y, z), p)) { return false; @@ -162,18 +141,16 @@ public boolean serverSideToolLogic( final Block b = w.getBlock(x, y, z); - if (b != null) - if (ForgeEventFactory.onPlayerInteract( - p, - b.isAir(w, x, y, z) - ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR - : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, - x, - y, - z, - side, - w) - .isCanceled()) return false; + if (b != null) if (ForgeEventFactory.onPlayerInteract( + p, + b.isAir(w, x, y, z) ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR + : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, + x, + y, + z, + side, + w).isCanceled()) + return false; if (b != null && !p.isSneaking()) { final TileEntity te = w.getTileEntity(x, y, z); diff --git a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java index 4ea830fec64..4fc4a6acc71 100644 --- a/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java +++ b/src/main/java/appeng/items/tools/powered/ToolChargedStaff.java @@ -1,36 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered; +import java.util.EnumSet; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraftforge.event.ForgeEventFactory; + import appeng.core.AEConfig; import appeng.core.features.AEFeature; import appeng.core.sync.packets.PacketLightning; import appeng.items.tools.powered.powersink.AEBasePoweredItem; import appeng.server.ServerHelper; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.ForgeEventFactory; public class ToolChargedStaff extends AEBasePoweredItem { @@ -52,7 +47,13 @@ public boolean hitEntity(final ItemStack item, final EntityLivingBase target, fi final float dy = (float) (Platform.getRandomFloat() * target.height + target.boundingBox.minY); final float dz = (float) (Platform.getRandomFloat() * target.width + target.boundingBox.minZ); ServerHelper.proxy.sendToAllNearExcept( - null, dx, dy, dz, 32.0, target.worldObj, new PacketLightning(dx, dy, dz)); + null, + dx, + dy, + dz, + 32.0, + target.worldObj, + new PacketLightning(dx, dy, dz)); } } target.attackEntityFrom(DamageSource.magic, 6); diff --git a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java index 7f9ddc2b047..690e2f72b5c 100644 --- a/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java +++ b/src/main/java/appeng/items/tools/powered/ToolColorApplicator.java @@ -1,23 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemSnowball; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -51,23 +59,11 @@ import appeng.util.ItemSorters; import appeng.util.Platform; import appeng.util.item.AEItemStack; + import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.block.BlockDispenser; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemSnowball; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCell, IItemGroup, IBlockTool, IMouseWheelItem { @@ -99,26 +95,17 @@ public void postInit() { } @Override - public boolean onItemUse( - final ItemStack is, - final EntityPlayer p, - final World w, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, + final int z, final int side, final float hitX, final float hitY, final float hitZ) { final Block blk = w.getBlock(x, y, z); ItemStack paintBall = this.getColor(is); - final IMEInventory inv = - AEApi.instance().registries().cell().getCellInventory(is, null, StorageChannel.ITEMS); + final IMEInventory inv = AEApi.instance().registries().cell() + .getCellInventory(is, null, StorageChannel.ITEMS); if (inv != null) { - final IAEItemStack option = - inv.extractItems(AEItemStack.create(paintBall), Actionable.SIMULATE, new BaseActionSource()); + final IAEItemStack option = inv + .extractItems(AEItemStack.create(paintBall), Actionable.SIMULATE, new BaseActionSource()); if (option != null) { paintBall = option.getItemStack(); @@ -141,7 +128,9 @@ public boolean onItemUse( && ((IColorableTile) te).getColor() != AEColor.Transparent) { if (((IColorableTile) te).recolourBlock(orientation, AEColor.Transparent, p)) { inv.extractItems( - AEItemStack.create(paintBall), Actionable.MODULATE, new BaseActionSource()); + AEItemStack.create(paintBall), + Actionable.MODULATE, + new BaseActionSource()); this.extractAEPower(is, powerPerUse); return true; } @@ -149,12 +138,11 @@ public boolean onItemUse( } // clean paint balls.. - final Block testBlk = - w.getBlock(x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ); - final TileEntity painted = - w.getTileEntity(x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ); - if (this.getAECurrentPower(is) > powerPerUse - && testBlk instanceof BlockPaint + final Block testBlk = w + .getBlock(x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ); + final TileEntity painted = w + .getTileEntity(x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ); + if (this.getAECurrentPower(is) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint) { inv.extractItems(AEItemStack.create(paintBall), Actionable.MODULATE, new BaseActionSource()); this.extractAEPower(is, powerPerUse); @@ -165,17 +153,16 @@ public boolean onItemUse( final AEColor color = this.getColorFromItem(paintBall); if (color != null && this.getAECurrentPower(is) > powerPerUse) { - if (color != AEColor.Transparent - && this.recolourBlock( - blk, - ForgeDirection.getOrientation(side), - w, - x, - y, - z, - ForgeDirection.getOrientation(side), - color, - p)) { + if (color != AEColor.Transparent && this.recolourBlock( + blk, + ForgeDirection.getOrientation(side), + w, + x, + y, + z, + ForgeDirection.getOrientation(side), + color, + p)) { inv.extractItems(AEItemStack.create(paintBall), Actionable.MODULATE, new BaseActionSource()); this.extractAEPower(is, powerPerUse); return true; @@ -249,11 +236,10 @@ public ItemStack getColor(final ItemStack is) { private ItemStack findNextColor(final ItemStack is, final ItemStack anchor, final int scrollOffset) { ItemStack newColor = null; - final IMEInventory inv = - AEApi.instance().registries().cell().getCellInventory(is, null, StorageChannel.ITEMS); + final IMEInventory inv = AEApi.instance().registries().cell() + .getCellInventory(is, null, StorageChannel.ITEMS); if (inv != null) { - final IItemList itemList = - inv.getAvailableItems(AEApi.instance().storage().createItemList()); + final IItemList itemList = inv.getAvailableItems(AEApi.instance().storage().createItemList()); if (anchor == null) { final IAEItemStack firstItem = itemList.getFirstItem(); if (firstItem != null) { @@ -317,16 +303,8 @@ private void setColor(final ItemStack is, final ItemStack newColor) { } } - private boolean recolourBlock( - final Block blk, - final ForgeDirection side, - final World w, - final int x, - final int y, - final int z, - final ForgeDirection orientation, - final AEColor newColor, - final EntityPlayer p) { + private boolean recolourBlock(final Block blk, final ForgeDirection side, final World w, final int x, final int y, + final int z, final ForgeDirection orientation, final AEColor newColor, final EntityPlayer p) { if (blk == Blocks.carpet) { final int meta = w.getBlockMetadata(x, y, z); if (newColor.ordinal() == meta) { @@ -388,20 +366,30 @@ public void cycleColors(final ItemStack is, final ItemStack paintBall, final int @SideOnly(Side.CLIENT) @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { super.addCheckedInformation(stack, player, lines, displayMoreInfo); - final IMEInventory cdi = - AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.ITEMS); + final IMEInventory cdi = AEApi.instance().registries().cell() + .getCellInventory(stack, null, StorageChannel.ITEMS); if (cdi instanceof CellInventoryHandler) { final ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv(); if (cd != null) { - lines.add(cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' - + GuiText.BytesUsed.getLocal()); - lines.add(cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalItemTypes() + ' ' - + GuiText.Types.getLocal()); + lines.add( + cd.getUsedBytes() + " " + + GuiText.Of.getLocal() + + ' ' + + cd.getTotalBytes() + + ' ' + + GuiText.BytesUsed.getLocal()); + lines.add( + cd.getStoredItemTypes() + " " + + GuiText.Of.getLocal() + + ' ' + + cd.getTotalItemTypes() + + ' ' + + GuiText.Types.getLocal()); } } } diff --git a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java index 6e8fa4ee6c2..73ac0dcc7d7 100644 --- a/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java +++ b/src/main/java/appeng/items/tools/powered/ToolEntropyManipulator.java @@ -1,34 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered; -import appeng.api.util.DimensionalCoord; -import appeng.block.misc.BlockTinyTNT; -import appeng.core.AEConfig; -import appeng.core.features.AEFeature; -import appeng.hooks.DispenserBlockTool; -import appeng.hooks.IBlockTool; -import appeng.items.tools.powered.powersink.AEBasePoweredItem; -import appeng.util.InWorldToolOperationResult; -import appeng.util.Platform; -import com.google.common.base.Optional; import java.util.*; + import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockTNT; @@ -50,7 +33,20 @@ import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.util.DimensionalCoord; +import appeng.block.misc.BlockTinyTNT; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; +import appeng.hooks.DispenserBlockTool; +import appeng.hooks.IBlockTool; +import appeng.items.tools.powered.powersink.AEBasePoweredItem; +import appeng.util.InWorldToolOperationResult; +import appeng.util.Platform; + +import com.google.common.base.Optional; + public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockTool { + private final Map heatUp; private final Map coolDown; @@ -101,10 +97,16 @@ public ToolEntropyManipulator() { new InWorldToolOperationResult(new ItemStack(Blocks.flowing_water))); } - private static final boolean breakBlockWithCheck( - final World w, final EntityPlayer p, final int x, final int y, final int z) { - BlockEvent.BreakEvent event = - new BlockEvent.BreakEvent(x, y, z, w, w.getBlock(x, y, z), w.getBlockMetadata(x, y, z), p); + private static final boolean breakBlockWithCheck(final World w, final EntityPlayer p, final int x, final int y, + final int z) { + BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( + x, + y, + z, + w, + w.getBlock(x, y, z), + w.getBlockMetadata(x, y, z), + p); MinecraftForge.EVENT_BUS.post(event); return !event.isCanceled() && w.setBlockToAir(x, y, z); } @@ -115,14 +117,8 @@ public void postInit() { BlockDispenser.dispenseBehaviorRegistry.putObject(this, new DispenserBlockTool()); } - private boolean heat( - final Block blockID, - final EntityPlayer p, - final int metadata, - final World w, - final int x, - final int y, - final int z) { + private boolean heat(final Block blockID, final EntityPlayer p, final int metadata, final World w, final int x, + final int y, final int z) { if (!breakBlockWithCheck(w, p, x, y, z)) return false; InWorldToolOperationResult r = this.heatUp.get(new InWorldToolOperationIngredient(blockID, metadata)); @@ -158,14 +154,8 @@ private boolean canHeat(final Block blockID, final int metadata) { return r != null; } - private boolean cool( - final Block blockID, - final EntityPlayer p, - final int metadata, - final World w, - final int x, - final int y, - final int z) { + private boolean cool(final Block blockID, final EntityPlayer p, final int metadata, final World w, final int x, + final int y, final int z) { if (!breakBlockWithCheck(w, p, x, y, z)) return false; InWorldToolOperationResult r = this.coolDown.get(new InWorldToolOperationIngredient(blockID, metadata)); @@ -236,17 +226,8 @@ public ItemStack onItemRightClick(final ItemStack item, final World w, final Ent } @Override - public boolean onItemUse( - final ItemStack item, - final EntityPlayer p, - final World w, - int x, - int y, - int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final ItemStack item, final EntityPlayer p, final World w, int x, int y, int z, + final int side, final float hitX, final float hitY, final float hitZ) { if (this.getAECurrentPower(item) > 1600) { if (!p.canPlayerEdit(x, y, z, side, item)) { return false; @@ -255,18 +236,16 @@ public boolean onItemUse( final Block blockID = w.getBlock(x, y, z); final int metadata = w.getBlockMetadata(x, y, z); - if (blockID == null - || ForgeEventFactory.onPlayerInteract( - p, - blockID.isAir(w, x, y, z) - ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR - : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, - x, - y, - z, - side, - w) - .isCanceled()) return false; + if (blockID == null || ForgeEventFactory.onPlayerInteract( + p, + blockID.isAir(w, x, y, z) ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR + : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, + x, + y, + z, + side, + w).isCanceled()) + return false; if (p.isSneaking()) { if (this.canCool(blockID, metadata)) { @@ -324,10 +303,15 @@ public boolean onItemUse( if (!breakBlockWithCheck(w, p, x, y, z)) return false; this.extractAEPower(item, 1600); - final InWorldToolOperationResult or = - InWorldToolOperationResult.getBlockOperationResult(out.toArray(new ItemStack[out.size()])); + final InWorldToolOperationResult or = InWorldToolOperationResult + .getBlockOperationResult(out.toArray(new ItemStack[out.size()])); w.playSoundEffect( - x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + x + 0.5D, + y + 0.5D, + z + 0.5D, + "fire.ignite", + 1.0F, + itemRand.nextFloat() * 0.4F + 0.8F); if (or.getBlockItem() != null) { w.setBlock( @@ -357,7 +341,12 @@ public boolean onItemUse( if (w.isAirBlock(x, y, z)) { this.extractAEPower(item, 1600); w.playSoundEffect( - x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + x + 0.5D, + y + 0.5D, + z + 0.5D, + "fire.ignite", + 1.0F, + itemRand.nextFloat() * 0.4F + 0.8F); w.setBlock(x, y, z, Blocks.fire); } @@ -370,6 +359,7 @@ public boolean onItemUse( } private static class InWorldToolOperationIngredient { + private final Block blockID; private final int metadata; diff --git a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java index b443bb69c76..a874469adc9 100644 --- a/src/main/java/appeng/items/tools/powered/ToolMassCannon.java +++ b/src/main/java/appeng/items/tools/powered/ToolMassCannon.java @@ -1,23 +1,35 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered; +import java.text.NumberFormat; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.*; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -51,27 +63,11 @@ import appeng.me.storage.CellInventoryHandler; import appeng.tile.misc.TilePaint; import appeng.util.Platform; + import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.text.NumberFormat; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.BlockDispenser; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.passive.EntitySheep; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.util.MovingObjectPosition.MovingObjectType; -import net.minecraft.world.World; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.common.util.ForgeDirection; public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell { @@ -88,20 +84,30 @@ public void postInit() { @SideOnly(Side.CLIENT) @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { super.addCheckedInformation(stack, player, lines, displayMoreInfo); - final IMEInventory cdi = - AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.ITEMS); + final IMEInventory cdi = AEApi.instance().registries().cell() + .getCellInventory(stack, null, StorageChannel.ITEMS); if (cdi instanceof CellInventoryHandler) { final ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv(); if (cd != null) { - lines.add(cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' - + NumberFormat.getInstance().format(cd.getTotalBytes()) + ' ' + GuiText.BytesUsed.getLocal()); - lines.add(cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' - + NumberFormat.getInstance().format(cd.getTotalItemTypes()) + ' ' + GuiText.Types.getLocal()); + lines.add( + cd.getUsedBytes() + " " + + GuiText.Of.getLocal() + + ' ' + + NumberFormat.getInstance().format(cd.getTotalBytes()) + + ' ' + + GuiText.BytesUsed.getLocal()); + lines.add( + cd.getStoredItemTypes() + " " + + GuiText.Of.getLocal() + + ' ' + + NumberFormat.getInstance().format(cd.getTotalItemTypes()) + + ' ' + + GuiText.Types.getLocal()); } } } @@ -116,11 +122,10 @@ public ItemStack onItemRightClick(final ItemStack item, final World w, final Ent shots += cu.getInstalledUpgrades(Upgrades.SPEED); } - final IMEInventory inv = - AEApi.instance().registries().cell().getCellInventory(item, null, StorageChannel.ITEMS); + final IMEInventory inv = AEApi.instance().registries().cell() + .getCellInventory(item, null, StorageChannel.ITEMS); if (inv != null) { - final IItemList itemList = - inv.getAvailableItems(AEApi.instance().storage().createItemList()); + final IItemList itemList = inv.getAvailableItems(AEApi.instance().storage().createItemList()); IAEStack aeAmmo = itemList.getFirstItem(); if (aeAmmo instanceof IAEItemStack) { shots = Math.min(shots, (int) aeAmmo.getStackSize()); @@ -162,8 +167,7 @@ public ItemStack onItemRightClick(final ItemStack item, final World w, final Ent final Vec3 direction = Vec3.createVectorHelper(f7 * d3, f6 * d3, f8 * d3); direction.normalize(); - final float penetration = - AEApi.instance().registries().matterCannon().getPenetration(ammo); // 196.96655f; + final float penetration = AEApi.instance().registries().matterCannon().getPenetration(ammo); // 196.96655f; if (penetration <= 0) { final ItemStack type = ((IAEItemStack) aeAmmo).getItemStack(); if (type.getItem() instanceof ItemPaintBall) { @@ -185,24 +189,15 @@ public ItemStack onItemRightClick(final ItemStack item, final World w, final Ent return item; } - private void shootPaintBalls( - final ItemStack type, - final World w, - final EntityPlayer p, - final Vec3 vec3, - final Vec3 vec31, - final Vec3 direction, - final double d0, - final double d1, - final double d2) { + private void shootPaintBalls(final ItemStack type, final World w, final EntityPlayer p, final Vec3 vec3, + final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2) { final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( - Math.min(vec3.xCoord, vec31.xCoord), - Math.min(vec3.yCoord, vec31.yCoord), - Math.min(vec3.zCoord, vec31.zCoord), - Math.max(vec3.xCoord, vec31.xCoord), - Math.max(vec3.yCoord, vec31.yCoord), - Math.max(vec3.zCoord, vec31.zCoord)) - .expand(16, 16, 16); + Math.min(vec3.xCoord, vec31.xCoord), + Math.min(vec3.yCoord, vec31.yCoord), + Math.min(vec3.zCoord, vec31.zCoord), + Math.max(vec3.xCoord, vec31.xCoord), + Math.max(vec3.yCoord, vec31.yCoord), + Math.max(vec3.zCoord, vec31.zCoord)).expand(16, 16, 16); Entity entity = null; final List list = w.getEntitiesWithinAABBExcludingEntity(p, bb); @@ -295,11 +290,7 @@ private void shootPaintBalls( final Block whatsThere = w.getBlock(x, y, z); if (whatsThere.isReplaceable(w, x, y, z) && w.isAirBlock(x, y, z)) { - for (final Block paintBlock : AEApi.instance() - .definitions() - .blocks() - .paint() - .maybeBlock() + for (final Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock() .asSet()) { w.setBlock(x, y, z, paintBlock, 0, 3); } @@ -316,28 +307,19 @@ private void shootPaintBalls( } } - private void standardAmmo( - float penetration, - final World w, - final EntityPlayer p, - final Vec3 vec3, - final Vec3 vec31, - final Vec3 direction, - final double d0, - final double d1, - final double d2) { + private void standardAmmo(float penetration, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, + final Vec3 direction, final double d0, final double d1, final double d2) { boolean hasDestroyed = true; while (penetration > 0 && hasDestroyed) { hasDestroyed = false; final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( - Math.min(vec3.xCoord, vec31.xCoord), - Math.min(vec3.yCoord, vec31.yCoord), - Math.min(vec3.zCoord, vec31.zCoord), - Math.max(vec3.xCoord, vec31.xCoord), - Math.max(vec3.yCoord, vec31.yCoord), - Math.max(vec3.zCoord, vec31.zCoord)) - .expand(16, 16, 16); + Math.min(vec3.xCoord, vec31.xCoord), + Math.min(vec3.yCoord, vec31.yCoord), + Math.min(vec3.zCoord, vec31.zCoord), + Math.max(vec3.xCoord, vec31.xCoord), + Math.max(vec3.yCoord, vec31.yCoord), + Math.max(vec3.zCoord, vec31.zCoord)).expand(16, 16, 16); Entity entity = null; final List list = w.getEntitiesWithinAABBExcludingEntity(p, bb); @@ -430,9 +412,8 @@ private void standardAmmo( final float hardness = b.getBlockHardness(w, pos.blockX, pos.blockY, pos.blockZ) * 9.0f; if (hardness >= 0.0) { - if (penetration > hardness - && Platform.hasPermissions( - new DimensionalCoord(w, pos.blockX, pos.blockY, pos.blockZ), p)) { + if (penetration > hardness && Platform + .hasPermissions(new DimensionalCoord(w, pos.blockX, pos.blockY, pos.blockZ), p)) { hasDestroyed = true; penetration -= hardness; penetration *= 0.60; diff --git a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java index fd84f54f706..80acb9e4141 100644 --- a/src/main/java/appeng/items/tools/powered/ToolPortableCell.java +++ b/src/main/java/appeng/items/tools/powered/ToolPortableCell.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered; +import java.util.EnumSet; +import java.util.List; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.FuzzyMode; import appeng.api.implementations.guiobjects.IGuiItem; @@ -39,19 +41,14 @@ import appeng.items.tools.powered.powersink.AEBasePoweredItem; import appeng.me.storage.CellInventoryHandler; import appeng.util.Platform; + import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.List; -import java.util.Set; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell, IGuiItem, IItemGroup { + public ToolPortableCell() { super(AEConfig.instance.portableCellBattery, Optional.absent()); this.setFeature(EnumSet.of(AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools)); @@ -71,20 +68,30 @@ public boolean isFull3D() { @SideOnly(Side.CLIENT) @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { super.addCheckedInformation(stack, player, lines, displayMoreInfo); - final IMEInventory cdi = - AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.ITEMS); + final IMEInventory cdi = AEApi.instance().registries().cell() + .getCellInventory(stack, null, StorageChannel.ITEMS); if (cdi instanceof CellInventoryHandler) { final ICellInventory cd = ((ICellInventoryHandler) cdi).getCellInv(); if (cd != null) { - lines.add(cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' - + GuiText.BytesUsed.getLocal()); - lines.add(cd.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalItemTypes() + ' ' - + GuiText.Types.getLocal()); + lines.add( + cd.getUsedBytes() + " " + + GuiText.Of.getLocal() + + ' ' + + cd.getTotalBytes() + + ' ' + + GuiText.BytesUsed.getLocal()); + lines.add( + cd.getStoredItemTypes() + " " + + GuiText.Of.getLocal() + + ' ' + + cd.getTotalItemTypes() + + ' ' + + GuiText.Types.getLocal()); } } } diff --git a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java index f0371bed9b4..c3e2f9acd17 100644 --- a/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java +++ b/src/main/java/appeng/items/tools/powered/ToolWirelessTerminal.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.event.ForgeEventFactory; + import appeng.api.AEApi; import appeng.api.config.Settings; import appeng.api.config.SortDir; @@ -32,17 +34,11 @@ import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; import appeng.util.Platform; + import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.event.ForgeEventFactory; public class ToolWirelessTerminal extends AEBasePoweredItem implements IWirelessTermHandler { @@ -66,8 +62,8 @@ public boolean isFull3D() { @SideOnly(Side.CLIENT) @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { super.addCheckedInformation(stack, player, lines, displayMoreInfo); if (stack.hasTagCompound()) { diff --git a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java index a1add405587..cd7b11607fd 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AEBasePoweredItem.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered.powersink; @@ -21,6 +13,7 @@ import com.google.common.base.Optional; public abstract class AEBasePoweredItem extends RedstoneFlux { + public AEBasePoweredItem(final double powerCapacity, final Optional subName) { super(powerCapacity, subName); diff --git a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java index e35eda5fea1..09916cf3de8 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java +++ b/src/main/java/appeng/items/tools/powered/powersink/AERootPoweredItem.java @@ -1,39 +1,35 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered.powersink; -import appeng.api.config.AccessRestriction; -import appeng.api.config.PowerUnits; -import appeng.api.implementations.items.IAEItemPowerStorage; -import appeng.core.localization.GuiText; -import appeng.items.AEBaseItem; -import appeng.util.Platform; -import com.google.common.base.Optional; import java.text.MessageFormat; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import appeng.api.config.AccessRestriction; +import appeng.api.config.PowerUnits; +import appeng.api.implementations.items.IAEItemPowerStorage; +import appeng.core.localization.GuiText; +import appeng.items.AEBaseItem; +import appeng.util.Platform; + +import com.google.common.base.Optional; + public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage { + private static final String POWER_NBT_KEY = "internalCurrentPower"; private final double powerCapacity; @@ -47,8 +43,8 @@ public AERootPoweredItem(final double powerCapacity, final Optional subN } @Override - public void addCheckedInformation( - final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo) { + public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List lines, + final boolean displayMoreInfo) { final NBTTagCompound tag = stack.getTagCompound(); double internalCurrentPower = 0; final double internalMaxPower = this.getAEMaxPower(stack); @@ -59,9 +55,12 @@ public void addCheckedInformation( final double percent = internalCurrentPower / internalMaxPower; - lines.add(GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower) - + Platform.gui_localize(PowerUnits.AE.unlocalizedName) + " - " - + MessageFormat.format(" {0,number,#.##%} ", percent)); + lines.add( + GuiText.StoredEnergy.getLocal() + ':' + + MessageFormat.format(" {0,number,#} ", internalCurrentPower) + + Platform.gui_localize(PowerUnits.AE.unlocalizedName) + + " - " + + MessageFormat.format(" {0,number,#.##%} ", percent)); } @Override @@ -70,8 +69,8 @@ public boolean isDamageable() { } @Override - protected void getCheckedSubItems( - final Item sameItem, final CreativeTabs creativeTab, final List itemStacks) { + protected void getCheckedSubItems(final Item sameItem, final CreativeTabs creativeTab, + final List itemStacks) { super.getCheckedSubItems(sameItem, creativeTab, itemStacks); final ItemStack charged = new ItemStack(this, 1); @@ -134,11 +133,11 @@ private double getInternalBattery(final ItemStack is, final batteryOperation op, /** * inject external */ - double injectExternalPower( - final PowerUnits input, final ItemStack is, final double amount, final boolean simulate) { + double injectExternalPower(final PowerUnits input, final ItemStack is, final double amount, + final boolean simulate) { if (simulate) { - final int requiredEU = - (int) PowerUnits.AE.convertTo(PowerUnits.EU, this.getAEMaxPower(is) - this.getAECurrentPower(is)); + final int requiredEU = (int) PowerUnits.AE + .convertTo(PowerUnits.EU, this.getAEMaxPower(is) - this.getAECurrentPower(is)); if (amount < requiredEU) { return 0; } diff --git a/src/main/java/appeng/items/tools/powered/powersink/IC2.java b/src/main/java/appeng/items/tools/powered/powersink/IC2.java index b75a585e4d1..8e960b011db 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/IC2.java +++ b/src/main/java/appeng/items/tools/powered/powersink/IC2.java @@ -1,51 +1,41 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered.powersink; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import appeng.api.config.PowerUnits; import appeng.integration.IntegrationType; import appeng.transformer.annotations.Integration.Interface; import appeng.transformer.annotations.Integration.InterfaceList; import appeng.transformer.annotations.Integration.Method; + import com.google.common.base.Optional; + import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; @InterfaceList( - value = { - @Interface(iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2), - @Interface(iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2) - }) + value = { @Interface(iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2), + @Interface(iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2) }) public abstract class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem { + public IC2(final double powerCapacity, final Optional subName) { super(powerCapacity, subName); } @Override - public double charge( - final ItemStack is, - final double amount, - final int tier, - final boolean ignoreTransferLimit, + public double charge(final ItemStack is, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean simulate) { double addedAmt = amount; final double limit = this.getTransferLimit(is); @@ -58,13 +48,8 @@ public double charge( } @Override - public double discharge( - final ItemStack itemStack, - final double amount, - final int tier, - final boolean ignoreTransferLimit, - final boolean externally, - final boolean simulate) { + public double discharge(final ItemStack itemStack, final double amount, final int tier, + final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) { return 0; } diff --git a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java index 85ead77bab1..6605bc55e63 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/items/tools/powered/powersink/RedstoneFlux.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered.powersink; +import net.minecraft.item.ItemStack; + import appeng.api.config.PowerUnits; import appeng.integration.IntegrationType; import appeng.transformer.annotations.Integration.Interface; import cofh.api.energy.IEnergyContainerItem; + import com.google.common.base.Optional; -import net.minecraft.item.ItemStack; @Interface(iface = "cofh.api.energy.IEnergyContainerItem", iname = IntegrationType.RFItem) public abstract class RedstoneFlux extends IC2 implements IEnergyContainerItem { + public RedstoneFlux(final double powerCapacity, final Optional subName) { super(powerCapacity, subName); } diff --git a/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java b/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java index 4c5c625f9ed..7236606d203 100644 --- a/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java +++ b/src/main/java/appeng/items/tools/powered/powersink/UniversalElectricity.java @@ -1,54 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.powered.powersink; /* -@Interface(iface = "universalelectricity.core.item.IItemElectric", modid = "IC2") -public class UniversalElectricity extends ThermalExpansion implements IItemElectric -{ -* -* public UniversalElectricity(Class c, String subName) { super( c, subName ); } -* -* @Override public float recharge(ItemStack is, float energy, boolean -* doRecharge) { return (float) (energy - injectExternalPower( PowerUnits.KJ, -* is, energy, !doRecharge )); } -* -* @Override public float discharge(ItemStack is, float energy, boolean -* doDischarge) { return 0; } -* -* @Override public float getElectricityStored(ItemStack is) { return (int) -* PowerUnits.AE.convertTo( PowerUnits.KJ, getAECurrentPower( is ) ); } -* -* @Override public float getMaxElectricityStored(ItemStack is) { return (int) -* PowerUnits.AE.convertTo( PowerUnits.KJ, getAEMaxPower( is ) ); } -* -* @Override public void setElectricity(ItemStack is, float joules) { double -* currentPower = getAECurrentPower( is ); double targetPower = -* PowerUnits.KJ.convertTo( PowerUnits.AE, joules ); if ( targetPower > -* currentPower ) injectAEPower( is, targetPower - currentPower ); else -* extractAEPower( is, currentPower - targetPower ); } -* -* @Override public float getTransfer(ItemStack is) { return (float) -* PowerUnits.AE.convertTo( PowerUnits.KJ, getAEMaxPower( is ) - -* getAECurrentPower( is ) ); } -* -* @Override public float getVoltage(ItemStack itemStack) { return 120; } - -} -*/ + * @Interface(iface = "universalelectricity.core.item.IItemElectric", modid = "IC2") public class UniversalElectricity + * extends ThermalExpansion implements IItemElectric { public UniversalElectricity(Class c, String subName) { super( c, + * subName ); } + * @Override public float recharge(ItemStack is, float energy, boolean doRecharge) { return (float) (energy - + * injectExternalPower( PowerUnits.KJ, is, energy, !doRecharge )); } + * @Override public float discharge(ItemStack is, float energy, boolean doDischarge) { return 0; } + * @Override public float getElectricityStored(ItemStack is) { return (int) PowerUnits.AE.convertTo( PowerUnits.KJ, + * getAECurrentPower( is ) ); } + * @Override public float getMaxElectricityStored(ItemStack is) { return (int) PowerUnits.AE.convertTo( PowerUnits.KJ, + * getAEMaxPower( is ) ); } + * @Override public void setElectricity(ItemStack is, float joules) { double currentPower = getAECurrentPower( is ); + * double targetPower = PowerUnits.KJ.convertTo( PowerUnits.AE, joules ); if ( targetPower > currentPower ) + * injectAEPower( is, targetPower - currentPower ); else extractAEPower( is, currentPower - targetPower ); } + * @Override public float getTransfer(ItemStack is) { return (float) PowerUnits.AE.convertTo( PowerUnits.KJ, + * getAEMaxPower( is ) - getAECurrentPower( is ) ); } + * @Override public float getVoltage(ItemStack itemStack) { return 120; } } + */ diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java index fd5c79c5d3b..886b97ca5cb 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzAxe.java @@ -1,41 +1,40 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; + import appeng.core.features.AEFeature; import appeng.core.features.IAEFeature; import appeng.core.features.IFeatureHandler; import appeng.core.features.ItemFeatureHandler; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemStack; public class ToolQuartzAxe extends ItemAxe implements IAEFeature { + private final AEFeature type; private final IFeatureHandler feature; public ToolQuartzAxe(final AEFeature type) { super(ToolMaterial.IRON); this.feature = new ItemFeatureHandler( - EnumSet.of(this.type = type, AEFeature.QuartzAxe), this, this, Optional.of(type.name())); + EnumSet.of(this.type = type, AEFeature.QuartzAxe), + this, + this, + Optional.of(type.name())); } @Override diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java index 12b93e3fb1a..dedfea377aa 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzCuttingKnife.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.guiobjects.IGuiItem; import appeng.api.implementations.guiobjects.IGuiItemObject; import appeng.core.features.AEFeature; @@ -27,15 +27,11 @@ import appeng.tile.AEBaseTile; import appeng.tile.networking.TileCableBus; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem { + private final AEFeature type; public ToolQuartzCuttingKnife(final AEFeature type) { @@ -48,17 +44,8 @@ public ToolQuartzCuttingKnife(final AEFeature type) { } @Override - public boolean onItemUse( - final ItemStack is, - final EntityPlayer p, - final World w, - final int x, - final int y, - final int z, - final int s, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, + final int z, final int s, final float hitX, final float hitY, final float hitZ) { if (Platform.isServer()) { TileEntity te = w.getTileEntity(x, y, z); if (te instanceof AEBaseTile && !(te instanceof TileCableBus)) diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java index 01abfe1a0bd..78b67f5e65d 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzHoe.java @@ -1,34 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemStack; + import appeng.core.features.AEFeature; import appeng.core.features.IAEFeature; import appeng.core.features.IFeatureHandler; import appeng.core.features.ItemFeatureHandler; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.item.ItemHoe; -import net.minecraft.item.ItemStack; public class ToolQuartzHoe extends ItemHoe implements IAEFeature { + private final AEFeature feature; private final IFeatureHandler handler; @@ -37,7 +33,10 @@ public ToolQuartzHoe(final AEFeature feature) { this.feature = feature; this.handler = new ItemFeatureHandler( - EnumSet.of(feature, AEFeature.QuartzHoe), this, this, Optional.of(feature.name())); + EnumSet.of(feature, AEFeature.QuartzHoe), + this, + this, + Optional.of(feature.name())); } @Override diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java index 9bcccee70b4..94e4cc230e6 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzPickaxe.java @@ -1,34 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; + import appeng.core.features.AEFeature; import appeng.core.features.IAEFeature; import appeng.core.features.IFeatureHandler; import appeng.core.features.ItemFeatureHandler; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.item.ItemPickaxe; -import net.minecraft.item.ItemStack; public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature { + private final AEFeature type; private final IFeatureHandler feature; @@ -36,8 +32,11 @@ public ToolQuartzPickaxe(final AEFeature type) { super(ToolMaterial.IRON); this.type = type; - this.feature = - new ItemFeatureHandler(EnumSet.of(type, AEFeature.QuartzPickaxe), this, this, Optional.of(type.name())); + this.feature = new ItemFeatureHandler( + EnumSet.of(type, AEFeature.QuartzPickaxe), + this, + this, + Optional.of(type.name())); } @Override diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java index 03067d6f7cb..5afea9ef3d2 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSpade.java @@ -1,34 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; + import appeng.core.features.AEFeature; import appeng.core.features.IAEFeature; import appeng.core.features.IFeatureHandler; import appeng.core.features.ItemFeatureHandler; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.item.ItemSpade; -import net.minecraft.item.ItemStack; public class ToolQuartzSpade extends ItemSpade implements IAEFeature { + private final AEFeature type; private final IFeatureHandler handler; @@ -36,7 +32,10 @@ public ToolQuartzSpade(final AEFeature type) { super(ToolMaterial.IRON); this.handler = new ItemFeatureHandler( - EnumSet.of(this.type = type, AEFeature.QuartzSpade), this, this, Optional.of(type.name())); + EnumSet.of(this.type = type, AEFeature.QuartzSpade), + this, + this, + Optional.of(type.name())); } @Override diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java index dde30cbdaf8..4ec734526cf 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzSword.java @@ -1,41 +1,40 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; + import appeng.core.features.AEFeature; import appeng.core.features.IAEFeature; import appeng.core.features.IFeatureHandler; import appeng.core.features.ItemFeatureHandler; import appeng.util.Platform; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; public class ToolQuartzSword extends ItemSword implements IAEFeature { + private final AEFeature type; private final IFeatureHandler feature; public ToolQuartzSword(final AEFeature type) { super(ToolMaterial.IRON); this.feature = new ItemFeatureHandler( - EnumSet.of(this.type = type, AEFeature.QuartzSword), this, this, Optional.of(type.name())); + EnumSet.of(this.type = type, AEFeature.QuartzSword), + this, + this, + Optional.of(type.name())); } @Override diff --git a/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java b/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java index dacba524ea8..c9b41f3e2a2 100644 --- a/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java +++ b/src/main/java/appeng/items/tools/quartz/ToolQuartzWrench.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.items.tools.quartz; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import appeng.api.implementations.items.IAEWrench; import appeng.api.util.DimensionalCoord; import appeng.core.features.AEFeature; @@ -26,15 +28,8 @@ import appeng.transformer.annotations.Integration.Interface; import appeng.util.Platform; import buildcraft.api.tools.IToolWrench; + import com.google.common.base.Optional; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; @Interface(iface = "buildcraft.api.tools.IToolWrench", iname = IntegrationType.BuildCraftCore) public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWrench { @@ -48,36 +43,24 @@ public ToolQuartzWrench(final AEFeature type) { } @Override - public boolean onItemUseFirst( - final ItemStack is, - final EntityPlayer player, - final World world, - final int x, - final int y, - final int z, - final int side, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack is, final EntityPlayer player, final World world, final int x, + final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) { if (ForgeEventFactory.onItemUseStart(player, is, 1) <= 0) return true; final Block b = world.getBlock(x, y, z); - if (b != null - && ForgeEventFactory.onPlayerInteract( - player, - b.isAir(world, x, y, z) - ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR - : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, - x, - y, - z, - side, - world) - .isCanceled()) return true; - - if (b != null - && !player.isSneaking() + if (b != null && ForgeEventFactory.onPlayerInteract( + player, + b.isAir(world, x, y, z) ? PlayerInteractEvent.Action.RIGHT_CLICK_AIR + : PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, + x, + y, + z, + side, + world).isCanceled()) + return true; + + if (b != null && !player.isSneaking() && Platform.hasPermissions(new DimensionalCoord(world, x, y, z), player)) { if (Platform.isClient()) { return !world.isRemote; @@ -95,8 +78,8 @@ public boolean onItemUseFirst( @Override // public boolean shouldPassSneakingClickToBlock(World w, int x, int y, int z) - public boolean doesSneakBypassUse( - final World world, final int x, final int y, final int z, final EntityPlayer player) { + public boolean doesSneakBypassUse(final World world, final int x, final int y, final int z, + final EntityPlayer player) { return true; } diff --git a/src/main/java/appeng/me/Grid.java b/src/main/java/appeng/me/Grid.java index c3db1f90d37..3ff63339529 100644 --- a/src/main/java/appeng/me/Grid.java +++ b/src/main/java/appeng/me/Grid.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; +import java.util.*; +import java.util.Map.Entry; + import appeng.api.AEApi; import appeng.api.networking.*; import appeng.api.networking.events.MENetworkEvent; @@ -27,15 +22,12 @@ import appeng.hooks.TickHandler; import appeng.me.cache.CraftingGridCache; import appeng.util.ReadOnlyCollection; -import java.util.*; -import java.util.Map.Entry; public class Grid implements IGrid { + private final NetworkEventBus eventBus = new NetworkEventBus(); - private final Map, MachineSet> machines = - new HashMap, MachineSet>(); - private final Map, GridCacheWrapper> caches = - new HashMap, GridCacheWrapper>(); + private final Map, MachineSet> machines = new HashMap, MachineSet>(); + private final Map, GridCacheWrapper> caches = new HashMap, GridCacheWrapper>(); private GridNode pivot; private int priority; // how import is this network? private GridStorage myStorage; @@ -47,8 +39,8 @@ public class Grid implements IGrid { public Grid(final GridNode center) { this.pivot = center; - final Map, IGridCache> myCaches = - AEApi.instance().registries().gridCache().createCacheInstance(this); + final Map, IGridCache> myCaches = AEApi.instance().registries().gridCache() + .createCacheInstance(this); for (final Entry, IGridCache> c : myCaches.entrySet()) { final Class key = c.getKey(); final IGridCache value = c.getValue(); diff --git a/src/main/java/appeng/me/GridAccessException.java b/src/main/java/appeng/me/GridAccessException.java index 1442d9202c3..3e6cd96211c 100644 --- a/src/main/java/appeng/me/GridAccessException.java +++ b/src/main/java/appeng/me/GridAccessException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; diff --git a/src/main/java/appeng/me/GridCacheWrapper.java b/src/main/java/appeng/me/GridCacheWrapper.java index d3bf5cd07e9..929d003381c 100644 --- a/src/main/java/appeng/me/GridCacheWrapper.java +++ b/src/main/java/appeng/me/GridCacheWrapper.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; diff --git a/src/main/java/appeng/me/GridConnection.java b/src/main/java/appeng/me/GridConnection.java index ff650ba84b4..2c5f798f92c 100644 --- a/src/main/java/appeng/me/GridConnection.java +++ b/src/main/java/appeng/me/GridConnection.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; +import java.util.Arrays; +import java.util.EnumSet; + +import net.minecraftforge.common.util.ForgeDirection; + +import org.apache.logging.log4j.Level; + import appeng.api.exceptions.ExistingConnectionException; import appeng.api.exceptions.FailedConnection; import appeng.api.exceptions.NullNodeConnectionException; @@ -35,15 +34,10 @@ import appeng.me.pathfinding.IPathItem; import appeng.util.Platform; import appeng.util.ReadOnlyCollection; -import java.util.Arrays; -import java.util.EnumSet; -import net.minecraftforge.common.util.ForgeDirection; -import org.apache.logging.log4j.Level; public class GridConnection implements IGridConnection, IPathItem { - private static final String EXISTING_CONNECTION_MESSAGE = - "Connection between node [machine=%s, %s] and [machine=%s, %s] on [%s] already exists."; + private static final String EXISTING_CONNECTION_MESSAGE = "Connection between node [machine=%s, %s] and [machine=%s, %s] on [%s] already exists."; private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged(); private int channelData = 0; @@ -65,10 +59,12 @@ public GridConnection(final IGridNode aNode, final IGridNode bNode, final ForgeD AELog.info( "Security audit 1 failed at [%s] belonging to player [id=%d]", - aCoordinates.toString(), a.getPlayerID()); + aCoordinates.toString(), + a.getPlayerID()); AELog.info( "Security audit 2 failed at [%s] belonging to player [id=%d]", - bCoordinates.toString(), b.getPlayerID()); + bCoordinates.toString(), + b.getPlayerID()); } throw new SecurityConnectionException(); @@ -79,15 +75,19 @@ public GridConnection(final IGridNode aNode, final IGridNode bNode, final ForgeD } if (a.hasConnection(b) || b.hasConnection(a)) { - final String aMachineClass = - a.getGridBlock().getMachine().getClass().getSimpleName(); - final String bMachineClass = - b.getGridBlock().getMachine().getClass().getSimpleName(); + final String aMachineClass = a.getGridBlock().getMachine().getClass().getSimpleName(); + final String bMachineClass = b.getGridBlock().getMachine().getClass().getSimpleName(); final String aCoordinates = a.getGridBlock().getLocation().toString(); final String bCoordinates = b.getGridBlock().getLocation().toString(); - throw new ExistingConnectionException(String.format( - EXISTING_CONNECTION_MESSAGE, aMachineClass, aCoordinates, bMachineClass, bCoordinates, fromAtoB)); + throw new ExistingConnectionException( + String.format( + EXISTING_CONNECTION_MESSAGE, + aMachineClass, + aCoordinates, + bMachineClass, + bCoordinates, + fromAtoB)); } this.sideA = a; @@ -127,8 +127,7 @@ public GridConnection(final IGridNode aNode, final IGridNode bNode, final ForgeD } private boolean isNetworkABetter(final GridNode a, final GridNode b) { - return a.getMyGrid().getPriority() > b.getMyGrid().getPriority() - || a.getMyGrid().size() > b.getMyGrid().size(); + return a.getMyGrid().getPriority() > b.getMyGrid().getPriority() || a.getMyGrid().size() > b.getMyGrid().size(); } @Override diff --git a/src/main/java/appeng/me/GridException.java b/src/main/java/appeng/me/GridException.java index 590868b0e0b..6884cd231e0 100644 --- a/src/main/java/appeng/me/GridException.java +++ b/src/main/java/appeng/me/GridException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; diff --git a/src/main/java/appeng/me/GridNode.java b/src/main/java/appeng/me/GridNode.java index 7e13dc8d83a..bc9be6241b8 100644 --- a/src/main/java/appeng/me/GridNode.java +++ b/src/main/java/appeng/me/GridNode.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; +import java.util.*; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.exceptions.FailedConnection; import appeng.api.networking.*; import appeng.api.networking.energy.IEnergyGrid; @@ -34,15 +33,11 @@ import appeng.me.pathfinding.IPathItem; import appeng.util.IWorldCallable; import appeng.util.ReadOnlyCollection; -import java.util.*; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class GridNode implements IGridNode, IPathItem { + private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged(); - private static final int[] CHANNEL_COUNT = {0, 8, 32, 128}; + private static final int[] CHANNEL_COUNT = { 0, 8, 32, 128 }; private final List connections = new LinkedList<>(); private final IGridBlock gridProxy; @@ -106,8 +101,7 @@ boolean hasConnection(final IGridNode otherSide) { } void validateGrid() { - final GridSplitDetector gsd = - new GridSplitDetector(this.getInternalGrid().getPivot()); + final GridSplitDetector gsd = new GridSplitDetector(this.getInternalGrid().getPivot()); this.beginVisit(gsd); if (!gsd.isPivotFound()) { final IGridVisitor gp = new GridPropagator(new Grid(this)); @@ -422,8 +416,7 @@ private boolean canConnect(final GridNode from, final ForgeDirection dir) { } // only connect ultra dense cable to dense cables - if (hasFlag(GridFlags.ULTRA_DENSE_CAPACITY) - && !hasFlag(GridFlags.DENSE_CAPACITY) + if (hasFlag(GridFlags.ULTRA_DENSE_CAPACITY) && !hasFlag(GridFlags.DENSE_CAPACITY) && !(from.hasFlag(GridFlags.ULTRA_DENSE_CAPACITY) || (from.hasFlag(GridFlags.DENSE_CAPACITY) && !from.hasFlag(GridFlags.CANNOT_CARRY)))) return false; @@ -439,10 +432,7 @@ private AEColor getColor() { return AEColor.values()[(this.compressedData >> 3) & 0x1F]; } - private void visitorConnection( - final Object tracker, - final IGridVisitor g, - final Deque nextRun, + private void visitorConnection(final Object tracker, final IGridVisitor g, final Deque nextRun, final Deque nextConnections) { if (g.visitNode(this)) { for (final IGridConnection gc : this.getConnections()) { @@ -573,6 +563,7 @@ public void setPreviousDraw(final double previousDraw) { } private static class MachineSecurityBreak implements IWorldCallable { + private final GridNode node; public MachineSecurityBreak(final GridNode node) { @@ -588,6 +579,7 @@ public Void call(final World world) throws Exception { } private static class ConnectionComparator implements Comparator { + private final IGridNode gn; public ConnectionComparator(final IGridNode gn) { diff --git a/src/main/java/appeng/me/GridNodeCollection.java b/src/main/java/appeng/me/GridNodeCollection.java index 12ffa5497c7..2d8dbf3a32c 100644 --- a/src/main/java/appeng/me/GridNodeCollection.java +++ b/src/main/java/appeng/me/GridNodeCollection.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; -import appeng.api.networking.IGridHost; -import appeng.api.networking.IGridNode; -import appeng.api.util.IReadOnlyCollection; import java.util.Iterator; import java.util.Map; import java.util.Set; +import appeng.api.networking.IGridHost; +import appeng.api.networking.IGridNode; +import appeng.api.util.IReadOnlyCollection; + public class GridNodeCollection implements IReadOnlyCollection { + private final Map, MachineSet> machines; public GridNodeCollection(final Map, MachineSet> machines) { diff --git a/src/main/java/appeng/me/GridNodeIterator.java b/src/main/java/appeng/me/GridNodeIterator.java index 9d3828c827f..3e54d079431 100644 --- a/src/main/java/appeng/me/GridNodeIterator.java +++ b/src/main/java/appeng/me/GridNodeIterator.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; -import appeng.api.networking.IGridHost; -import appeng.api.networking.IGridNode; import java.util.Iterator; import java.util.Map; +import appeng.api.networking.IGridHost; +import appeng.api.networking.IGridNode; + /** * Nested iterator for {@link appeng.me.MachineSet} *

@@ -30,6 +23,7 @@ * {@link appeng.api.networking.IGridNode} */ public class GridNodeIterator implements Iterator { + private final Iterator outerIterator; private Iterator innerIterator; diff --git a/src/main/java/appeng/me/GridPropagator.java b/src/main/java/appeng/me/GridPropagator.java index 2e12292e8cd..c79def47360 100644 --- a/src/main/java/appeng/me/GridPropagator.java +++ b/src/main/java/appeng/me/GridPropagator.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; @@ -22,6 +14,7 @@ import appeng.api.networking.IGridVisitor; public class GridPropagator implements IGridVisitor { + private final Grid g; public GridPropagator(final Grid g) { diff --git a/src/main/java/appeng/me/GridSplitDetector.java b/src/main/java/appeng/me/GridSplitDetector.java index 6bc747b8c26..2ee2179333e 100644 --- a/src/main/java/appeng/me/GridSplitDetector.java +++ b/src/main/java/appeng/me/GridSplitDetector.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; diff --git a/src/main/java/appeng/me/GridStorage.java b/src/main/java/appeng/me/GridStorage.java index 29fe72dcd6b..43aa550be00 100644 --- a/src/main/java/appeng/me/GridStorage.java +++ b/src/main/java/appeng/me/GridStorage.java @@ -1,35 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; -import appeng.api.networking.IGrid; -import appeng.api.networking.IGridStorage; -import appeng.core.AELog; -import appeng.core.worlddata.WorldData; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.ref.WeakReference; import java.util.WeakHashMap; + import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; +import appeng.api.networking.IGrid; +import appeng.api.networking.IGridStorage; +import appeng.core.AELog; +import appeng.core.worlddata.WorldData; + public class GridStorage implements IGridStorage { private final long myID; diff --git a/src/main/java/appeng/me/GridStorageSearch.java b/src/main/java/appeng/me/GridStorageSearch.java index 153efc77752..a37b2acb6bb 100644 --- a/src/main/java/appeng/me/GridStorageSearch.java +++ b/src/main/java/appeng/me/GridStorageSearch.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; diff --git a/src/main/java/appeng/me/MachineSet.java b/src/main/java/appeng/me/MachineSet.java index 018409473d1..f65f1cd730e 100644 --- a/src/main/java/appeng/me/MachineSet.java +++ b/src/main/java/appeng/me/MachineSet.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; +import java.util.HashSet; + import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; import appeng.api.networking.IMachineSet; -import java.util.HashSet; public class MachineSet extends HashSet implements IMachineSet { diff --git a/src/main/java/appeng/me/NetworkEventBus.java b/src/main/java/appeng/me/NetworkEventBus.java index 61ee43d2e27..8f5d3bf9599 100644 --- a/src/main/java/appeng/me/NetworkEventBus.java +++ b/src/main/java/appeng/me/NetworkEventBus.java @@ -1,35 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; +import java.lang.reflect.Method; +import java.util.*; +import java.util.Map.Entry; + import appeng.api.networking.IGridNode; import appeng.api.networking.events.MENetworkEvent; import appeng.api.networking.events.MENetworkEventSubscribe; import appeng.core.AELog; -import java.lang.reflect.Method; -import java.util.*; -import java.util.Map.Entry; public class NetworkEventBus { + private static final Collection READ_CLASSES = new HashSet(); - private static final Map, Map> EVENTS = - new HashMap, Map>(); + private static final Map, Map> EVENTS = new HashMap, Map>(); void readClass(final Class listAs, final Class c) { if (READ_CLASSES.contains(c)) { @@ -59,12 +52,14 @@ void readClass(final Class listAs, final Class c) { classEvents.put(listAs, thisEvent); } else { - throw new IllegalStateException("Invalid ME Network Event Subscriber, " + m.getName() - + "s Parameter must extend MENetworkEvent."); + throw new IllegalStateException( + "Invalid ME Network Event Subscriber, " + m.getName() + + "s Parameter must extend MENetworkEvent."); } } else { - throw new IllegalStateException("Invalid ME Network Event Subscriber, " + m.getName() - + " must have exactly 1 parameter."); + throw new IllegalStateException( + "Invalid ME Network Event Subscriber, " + m.getName() + + " must have exactly 1 parameter."); } } } diff --git a/src/main/java/appeng/me/NetworkList.java b/src/main/java/appeng/me/NetworkList.java index 16118a51a0e..cc8c45c96ec 100644 --- a/src/main/java/appeng/me/NetworkList.java +++ b/src/main/java/appeng/me/NetworkList.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me; diff --git a/src/main/java/appeng/me/cache/CraftingGridCache.java b/src/main/java/appeng/me/cache/CraftingGridCache.java index 5be8469baac..c1003389262 100644 --- a/src/main/java/appeng/me/cache/CraftingGridCache.java +++ b/src/main/java/appeng/me/cache/CraftingGridCache.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.ThreadFactory; +import java.util.stream.StreamSupport; + +import net.minecraft.world.World; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.networking.IGrid; @@ -50,21 +52,15 @@ import appeng.tile.crafting.TileCraftingTile; import appeng.util.ItemSorters; import appeng.util.item.OreListMultiMap; + import com.google.common.collect.*; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.ThreadFactory; -import java.util.stream.StreamSupport; -import net.minecraft.world.World; public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper, ICellProvider, IMEInventoryHandler { private static final ExecutorService CRAFTING_POOL; private static final Comparator COMPARATOR = new Comparator() { + @Override public int compare(final ICraftingPatternDetails firstDetail, final ICraftingPatternDetails nextDetail) { return nextDetail.getPriority() - firstDetail.getPriority(); @@ -94,8 +90,8 @@ public Thread newThread(final Runnable ar) { private final Set emitableItems = new HashSet(); private final Map craftingLinks = new HashMap(); private final Multimap interests = HashMultimap.create(); - private final GenericInterestManager interestManager = - new GenericInterestManager(this.interests); + private final GenericInterestManager interestManager = new GenericInterestManager( + this.interests); private IStorageGrid storageGrid; private IEnergyGrid energyGrid; private boolean updateList = false; @@ -121,8 +117,7 @@ public void onUpdateTick() { this.updateCPUClusters(); } - final Iterator craftingLinkIterator = - this.craftingLinks.values().iterator(); + final Iterator craftingLinkIterator = this.craftingLinks.values().iterator(); while (craftingLinkIterator.hasNext()) { if (craftingLinkIterator.next().isDead(this.grid, this)) { craftingLinkIterator.remove(); @@ -244,7 +239,9 @@ private void updatePatterns() { setPatternsFromCraftingMethods(); this.storageGrid.postAlterationOfStoredItems( - StorageChannel.ITEMS, this.craftableItems.keySet(), new BaseActionSource()); + StorageChannel.ITEMS, + this.craftableItems.keySet(), + new BaseActionSource()); } /** Only for unit test usage */ @@ -287,8 +284,7 @@ private void updateCPUClusters() { this.craftingCPUClusters.clear(); for (Object cls : StreamSupport.stream(grid.getMachinesClasses().spliterator(), false) - .filter(c -> TileCraftingStorageTile.class.isAssignableFrom(c)) - .toArray()) { + .filter(c -> TileCraftingStorageTile.class.isAssignableFrom(c)).toArray()) { for (final IGridNode cst : this.grid.getMachines((Class) cls)) { final TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine(); final CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster(); @@ -429,19 +425,15 @@ public ImmutableMap> getCra } @Override - public ImmutableCollection getCraftingFor( - final IAEItemStack whatToCraft, - final ICraftingPatternDetails details, - final int slotIndex, - final World world) { + public ImmutableCollection getCraftingFor(final IAEItemStack whatToCraft, + final ICraftingPatternDetails details, final int slotIndex, final World world) { final ImmutableList res = this.craftableItems.get(whatToCraft); if (res == null) { if (details != null && details.isCraftable()) { for (final IAEItemStack ais : this.craftableItems.keySet()) { - if (ais.getItem() == whatToCraft.getItem() - && (!ais.getItem().getHasSubtypes() - || ais.getItemDamage() == whatToCraft.getItemDamage())) { + if (ais.getItem() == whatToCraft.getItem() && (!ais.getItem().getHasSubtypes() + || ais.getItemDamage() == whatToCraft.getItemDamage())) { if (details.isValidItemForSlot(slotIndex, ais.getItemStack(), world)) { return this.craftableItems.get(ais); } @@ -463,12 +455,8 @@ public static ExecutorService getCraftingPool() { } @Override - public Future beginCraftingJob( - final World world, - final IGrid grid, - final BaseActionSource actionSrc, - final IAEItemStack slotItem, - final ICraftingCallback cb) { + public Future beginCraftingJob(final World world, final IGrid grid, final BaseActionSource actionSrc, + final IAEItemStack slotItem, final ICraftingCallback cb) { if (world == null || grid == null || actionSrc == null || slotItem == null) { throw new IllegalArgumentException("Invalid Crafting Job Request"); } @@ -489,12 +477,8 @@ public Future beginCraftingJob( } @Override - public ICraftingLink submitJob( - final ICraftingJob job, - final ICraftingRequester requestingMachine, - final ICraftingCPU target, - final boolean prioritizePower, - final BaseActionSource src) { + public ICraftingLink submitJob(final ICraftingJob job, final ICraftingRequester requestingMachine, + final ICraftingCPU target, final boolean prioritizePower, final BaseActionSource src) { if (job.isSimulation()) { return null; } @@ -514,12 +498,12 @@ public ICraftingLink submitJob( } Collections.sort(validCpusClusters, new Comparator() { + private int compareInternal(CraftingCPUCluster firstCluster, CraftingCPUCluster nextCluster) { - int comparison = - ItemSorters.compareLong(nextCluster.getCoProcessors(), firstCluster.getCoProcessors()); - if (comparison == 0) - comparison = ItemSorters.compareLong( - nextCluster.getAvailableStorage(), firstCluster.getAvailableStorage()); + int comparison = ItemSorters + .compareLong(nextCluster.getCoProcessors(), firstCluster.getCoProcessors()); + if (comparison == 0) comparison = ItemSorters + .compareLong(nextCluster.getAvailableStorage(), firstCluster.getAvailableStorage()); if (comparison == 0) return nextCluster.getName().compareTo(firstCluster.getName()); else return comparison; } diff --git a/src/main/java/appeng/me/cache/EnergyGridCache.java b/src/main/java/appeng/me/cache/EnergyGridCache.java index e9ace01ffa5..c7158a5773e 100644 --- a/src/main/java/appeng/me/cache/EnergyGridCache.java +++ b/src/main/java/appeng/me/cache/EnergyGridCache.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.*; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -30,9 +24,9 @@ import appeng.me.GridNode; import appeng.me.energy.EnergyThreshold; import appeng.me.energy.EnergyWatcher; + import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; -import java.util.*; public class EnergyGridCache implements IEnergyGrid { @@ -146,8 +140,8 @@ public void onUpdateTick() { boolean currentlyHasPower = false; if (this.drainPerTick > 0.0001) { - final double drained = - this.extractAEPower(this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG); + final double drained = this + .extractAEPower(this.getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG); currentlyHasPower = drained >= this.drainPerTick - 0.001; } else { currentlyHasPower = this.extractAEPower(0.1, Actionable.SIMULATE, PowerMultiplier.CONFIG) > 0; diff --git a/src/main/java/appeng/me/cache/GridStorageCache.java b/src/main/java/appeng/me/cache/GridStorageCache.java index 4ef5866d812..4f72563fb95 100644 --- a/src/main/java/appeng/me/cache/GridStorageCache.java +++ b/src/main/java/appeng/me/cache/GridStorageCache.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; + import appeng.api.AEApi; import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; @@ -40,12 +37,9 @@ import appeng.me.helpers.GenericInterestManager; import appeng.me.storage.ItemWatcher; import appeng.me.storage.NetworkInventoryHandler; + import com.google.common.collect.HashMultimap; import com.google.common.collect.SetMultimap; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; public class GridStorageCache implements IStorageGrid { @@ -53,12 +47,14 @@ public class GridStorageCache implements IStorageGrid { private final HashSet activeCellProviders = new HashSet(); private final HashSet inactiveCellProviders = new HashSet(); private final SetMultimap interests = HashMultimap.create(); - private final GenericInterestManager interestManager = - new GenericInterestManager(this.interests); - private final NetworkMonitor itemMonitor = - new NetworkMonitor(this, StorageChannel.ITEMS); - private final NetworkMonitor fluidMonitor = - new NetworkMonitor(this, StorageChannel.FLUIDS); + private final GenericInterestManager interestManager = new GenericInterestManager( + this.interests); + private final NetworkMonitor itemMonitor = new NetworkMonitor( + this, + StorageChannel.ITEMS); + private final NetworkMonitor fluidMonitor = new NetworkMonitor( + this, + StorageChannel.FLUIDS); private final HashMap watchers = new HashMap(); private NetworkInventoryHandler myItemNetwork; private NetworkInventoryHandler myFluidNetwork; @@ -206,8 +202,8 @@ public void cellUpdate(final MENetworkCellArrayUpdate ev) { tracker.applyChanges(); } - private void postChangesToNetwork( - final StorageChannel chan, final int upOrDown, final IItemList availableItems, final BaseActionSource src) { + private void postChangesToNetwork(final StorageChannel chan, final int upOrDown, final IItemList availableItems, + final BaseActionSource src) { switch (chan) { case FLUIDS: this.fluidMonitor.postChange(upOrDown > 0, availableItems, src); @@ -258,8 +254,8 @@ IMEInventoryHandler getFluidInventoryHandler() { } @Override - public void postAlterationOfStoredItems( - final StorageChannel chan, final Iterable input, final BaseActionSource src) { + public void postAlterationOfStoredItems(final StorageChannel chan, final Iterable input, + final BaseActionSource src) { if (chan == StorageChannel.ITEMS) { this.itemMonitor.postChange(true, (Iterable) input, src); } else if (chan == StorageChannel.FLUIDS) { @@ -304,11 +300,8 @@ private class CellChangeTrackerRecord { final IItemList list; final BaseActionSource src; - public CellChangeTrackerRecord( - final StorageChannel channel, - final int i, - final IMEInventoryHandler h, - final BaseActionSource actionSrc) { + public CellChangeTrackerRecord(final StorageChannel channel, final int i, + final IMEInventoryHandler h, final BaseActionSource actionSrc) { this.channel = channel; this.up_or_down = i; this.src = actionSrc; @@ -333,11 +326,8 @@ private class CellChangeTracker { final List data = new LinkedList(); - public void postChanges( - final StorageChannel channel, - final int i, - final IMEInventoryHandler h, - final BaseActionSource actionSrc) { + public void postChanges(final StorageChannel channel, final int i, + final IMEInventoryHandler h, final BaseActionSource actionSrc) { this.data.add(new CellChangeTrackerRecord(channel, i, h, actionSrc)); } diff --git a/src/main/java/appeng/me/cache/NetworkMonitor.java b/src/main/java/appeng/me/cache/NetworkMonitor.java index 080844cd16c..51d5d673079 100644 --- a/src/main/java/appeng/me/cache/NetworkMonitor.java +++ b/src/main/java/appeng/me/cache/NetworkMonitor.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.*; +import java.util.Map.Entry; + +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.networking.events.MENetworkStorageEvent; @@ -29,15 +28,12 @@ import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; import appeng.me.storage.ItemWatcher; + import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import java.util.*; -import java.util.Map.Entry; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class NetworkMonitor> implements IMEMonitor { + @Nonnull private static final Deque> GLOBAL_DEPTH = Lists.newLinkedList(); @@ -179,8 +175,8 @@ private Iterator, Object>> getListeners() { return this.listeners.entrySet().iterator(); } - private T monitorDifference( - final IAEStack original, final T leftOvers, final boolean extraction, final BaseActionSource src) { + private T monitorDifference(final IAEStack original, final T leftOvers, final boolean extraction, + final BaseActionSource src) { final T diff = (T) original.copy(); if (extraction) { @@ -236,8 +232,7 @@ protected void postChange(final boolean add, final Iterable changes, final Ba } if (this.myGridCache.getInterestManager().containsKey(changedItem)) { - final Collection list = - this.myGridCache.getInterestManager().get(changedItem); + final Collection list = this.myGridCache.getInterestManager().get(changedItem); if (!list.isEmpty()) { IAEStack fullStack = this.getStorageList().findPrecise(changedItem); diff --git a/src/main/java/appeng/me/cache/P2PCache.java b/src/main/java/appeng/me/cache/P2PCache.java index 89d172d9aa0..f33aa83cbc8 100644 --- a/src/main/java/appeng/me/cache/P2PCache.java +++ b/src/main/java/appeng/me/cache/P2PCache.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.HashMap; + import appeng.api.networking.*; import appeng.api.networking.events.MENetworkBootingStatusChange; import appeng.api.networking.events.MENetworkEventSubscribe; @@ -26,9 +20,9 @@ import appeng.me.cache.helpers.TunnelCollection; import appeng.parts.p2p.PartP2PTunnel; import appeng.parts.p2p.PartP2PTunnelME; + import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; -import java.util.HashMap; public class P2PCache implements IGridCache { diff --git a/src/main/java/appeng/me/cache/PathGridCache.java b/src/main/java/appeng/me/cache/PathGridCache.java index 0a5aa633781..9f1d9818177 100644 --- a/src/main/java/appeng/me/cache/PathGridCache.java +++ b/src/main/java/appeng/me/cache/PathGridCache.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.*; + +import net.minecraftforge.common.util.ForgeDirection; + +import org.apache.logging.log4j.Level; + import appeng.api.networking.*; import appeng.api.networking.events.MENetworkBootingStatusChange; import appeng.api.networking.events.MENetworkChannelChanged; @@ -35,9 +33,6 @@ import appeng.me.pathfinding.*; import appeng.tile.networking.TileController; import appeng.util.Platform; -import java.util.*; -import net.minecraftforge.common.util.ForgeDirection; -import org.apache.logging.log4j.Level; public class PathGridCache implements IPathingGrid { @@ -133,15 +128,14 @@ public void onUpdateTick() { if (firstStage) { for (BackbonePathSegment ps : backbone.values()) { BackbonePathSegment.reset(backbone); - //noinspection StatementWithEmptyBody - while (!ps.step( - backbone, TopologyStage.BACKBONE)) {} // just establish backbone topology, that is fast + // noinspection StatementWithEmptyBody + while (!ps.step(backbone, TopologyStage.BACKBONE)) {} // just establish backbone topology, that + // is fast ps.selectControllerRoute(); } BackbonePathSegment.reset(backbone); } else { - final Iterator bsi = - this.backbone.values().iterator(); + final Iterator bsi = this.backbone.values().iterator(); boolean hasAliveSegments = false; while (bsi.hasNext()) { final PathSegment pat = bsi.next(); diff --git a/src/main/java/appeng/me/cache/SecurityCache.java b/src/main/java/appeng/me/cache/SecurityCache.java index f29f11cb59b..9da9c64b26b 100644 --- a/src/main/java/appeng/me/cache/SecurityCache.java +++ b/src/main/java/appeng/me/cache/SecurityCache.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.*; + +import net.minecraft.entity.player.EntityPlayer; + import appeng.api.config.SecurityPermissions; import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; @@ -29,12 +25,12 @@ import appeng.api.networking.security.ISecurityProvider; import appeng.core.worlddata.WorldData; import appeng.me.GridNode; + import com.google.common.base.Preconditions; import com.mojang.authlib.GameProfile; -import java.util.*; -import net.minecraft.entity.player.EntityPlayer; public class SecurityCache implements ISecurityGrid { + private final IGrid myGrid; private final List securityProvider = new ArrayList<>(); private final HashMap> playerPerms = new HashMap<>(); @@ -112,8 +108,7 @@ public void populateGridStorage(final IGridStorage destinationStorage) {} @Override public boolean isAvailable() { - return startupTicks >= STARTUP_DELAY - && this.securityProvider.size() == 1 + return startupTicks >= STARTUP_DELAY && this.securityProvider.size() == 1 && this.securityProvider.get(0).isSecurityEnabled(); } diff --git a/src/main/java/appeng/me/cache/SpatialPylonCache.java b/src/main/java/appeng/me/cache/SpatialPylonCache.java index c7270d580b7..a90e89ced40 100644 --- a/src/main/java/appeng/me/cache/SpatialPylonCache.java +++ b/src/main/java/appeng/me/cache/SpatialPylonCache.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; + import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -31,9 +27,6 @@ import appeng.me.cluster.implementations.SpatialPylonCluster; import appeng.tile.spatial.TileSpatialIOPort; import appeng.tile.spatial.TileSpatialPylon; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; public class SpatialPylonCache implements ISpatialCache { @@ -44,8 +37,7 @@ public class SpatialPylonCache implements ISpatialCache { private DimensionalCoord captureMax; private boolean isValid = false; private List ioPorts = new LinkedList(); - private HashMap clusters = - new HashMap(); + private HashMap clusters = new HashMap(); public SpatialPylonCache(final IGrid g) { this.myGrid = g; @@ -102,8 +94,7 @@ private void reset(final IGrid grid) { double maxPower = 0; double minPower = 0; if (this.hasRegion()) { - this.isValid = this.captureMax.x - this.captureMin.x > 1 - && this.captureMax.y - this.captureMin.y > 1 + this.isValid = this.captureMax.x - this.captureMin.x > 1 && this.captureMax.y - this.captureMin.y > 1 && this.captureMax.z - this.captureMin.z > 1; for (final SpatialPylonCluster cl : this.clusters.values()) { diff --git a/src/main/java/appeng/me/cache/TickManagerCache.java b/src/main/java/appeng/me/cache/TickManagerCache.java index 6a3038f3cf4..703b88f5849 100644 --- a/src/main/java/appeng/me/cache/TickManagerCache.java +++ b/src/main/java/appeng/me/cache/TickManagerCache.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache; +import java.util.HashMap; +import java.util.PriorityQueue; + +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; + import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -30,11 +29,6 @@ import appeng.core.AEConfig; import appeng.core.AELog; import appeng.me.cache.helpers.TickTracker; -import java.util.HashMap; -import java.util.PriorityQueue; -import net.minecraft.crash.CrashReport; -import net.minecraft.crash.CrashReportCategory; -import net.minecraft.util.ReportedException; public class TickManagerCache implements ITickManager { @@ -85,7 +79,11 @@ public void onUpdateTick() { DimensionalCoord c = tt.getNode().getGridBlock().getLocation(); AELog.debug( "Timing: machine tick at (%d %d %d) took %d ns, new state is %s", - c.x, c.y, c.z, System.nanoTime() - tickStartTime, mod.toString()); + c.x, + c.y, + c.z, + System.nanoTime() - tickStartTime, + mod.toString()); } switch (mod) { case FASTER: @@ -118,8 +116,8 @@ public void onUpdateTick() { } } catch (final Throwable t) { final CrashReport crashreport = CrashReport.makeCrashReport(t, "Ticking GridNode"); - final CrashReportCategory crashreportcategory = - crashreport.makeCategory(tt.getGridTickable().getClass().getSimpleName() + " being ticked."); + final CrashReportCategory crashreportcategory = crashreport + .makeCategory(tt.getGridTickable().getClass().getSimpleName() + " being ticked."); tt.addEntityCrashInfo(crashreportcategory); throw new ReportedException(crashreport); } diff --git a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java index d80d1b74621..0e9131119b2 100644 --- a/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java +++ b/src/main/java/appeng/me/cache/helpers/ConnectionWrapper.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache.helpers; diff --git a/src/main/java/appeng/me/cache/helpers/Connections.java b/src/main/java/appeng/me/cache/helpers/Connections.java index 89ac1179633..90709bc49d7 100644 --- a/src/main/java/appeng/me/cache/helpers/Connections.java +++ b/src/main/java/appeng/me/cache/helpers/Connections.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache.helpers; +import java.util.HashMap; + +import net.minecraft.world.World; + import appeng.api.networking.IGridNode; import appeng.parts.p2p.PartP2PTunnelME; import appeng.util.IWorldCallable; -import java.util.HashMap; -import net.minecraft.world.World; public class Connections implements IWorldCallable { diff --git a/src/main/java/appeng/me/cache/helpers/TickTracker.java b/src/main/java/appeng/me/cache/helpers/TickTracker.java index dfb0466dbed..04a7ed4cffd 100644 --- a/src/main/java/appeng/me/cache/helpers/TickTracker.java +++ b/src/main/java/appeng/me/cache/helpers/TickTracker.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache.helpers; +import javax.annotation.Nonnull; + +import net.minecraft.crash.CrashReportCategory; + import appeng.api.networking.IGridNode; import appeng.api.networking.ticking.IGridTickable; import appeng.api.networking.ticking.TickingRequest; import appeng.api.util.DimensionalCoord; import appeng.me.cache.TickManagerCache; import appeng.parts.AEBasePart; -import javax.annotation.Nonnull; -import net.minecraft.crash.CrashReportCategory; public class TickTracker implements Comparable { @@ -39,11 +33,7 @@ public class TickTracker implements Comparable { private long lastTick; private int currentRate; - public TickTracker( - final TickingRequest req, - final IGridNode node, - final IGridTickable gt, - final long currentTick, + public TickTracker(final TickingRequest req, final IGridNode node, final IGridTickable gt, final long currentTick, final TickManagerCache tickManagerCache) { this.request = req; this.gt = gt; @@ -85,10 +75,8 @@ public void addEntityCrashInfo(final CrashReportCategory crashreportcategory) { crashreportcategory.addCrashSection("CurrentTickRate", this.getCurrentRate()); crashreportcategory.addCrashSection("MinTickRate", this.getRequest().minTickRate); crashreportcategory.addCrashSection("MaxTickRate", this.getRequest().maxTickRate); - crashreportcategory.addCrashSection( - "MachineType", this.getGridTickable().getClass().getName()); - crashreportcategory.addCrashSection( - "GridBlockType", this.getNode().getGridBlock().getClass().getName()); + crashreportcategory.addCrashSection("MachineType", this.getGridTickable().getClass().getName()); + crashreportcategory.addCrashSection("GridBlockType", this.getNode().getGridBlock().getClass().getName()); crashreportcategory.addCrashSection("ConnectedSides", this.getNode().getConnectedSides()); final DimensionalCoord dc = this.getNode().getGridBlock().getLocation(); diff --git a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java index f8b3bc2da45..6eb5d0d224d 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelCollection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelCollection.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache.helpers; -import appeng.parts.p2p.PartP2PTunnel; -import appeng.util.iterators.NullIterator; import java.util.Collection; import java.util.Iterator; +import appeng.parts.p2p.PartP2PTunnel; +import appeng.util.iterators.NullIterator; + public class TunnelCollection implements Iterable { private final Class clz; diff --git a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java index 66b191e0468..3d92565da0f 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelConnection.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelConnection.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache.helpers; diff --git a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java index bffa50dc3c0..7b0b73edbab 100644 --- a/src/main/java/appeng/me/cache/helpers/TunnelIterator.java +++ b/src/main/java/appeng/me/cache/helpers/TunnelIterator.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cache.helpers; -import appeng.parts.p2p.PartP2PTunnel; import java.util.Collection; import java.util.Iterator; +import appeng.parts.p2p.PartP2PTunnel; + public class TunnelIterator implements Iterator { private final Iterator wrapped; diff --git a/src/main/java/appeng/me/cluster/IAECluster.java b/src/main/java/appeng/me/cluster/IAECluster.java index 81775078326..aa40e3ea028 100644 --- a/src/main/java/appeng/me/cluster/IAECluster.java +++ b/src/main/java/appeng/me/cluster/IAECluster.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster; -import appeng.api.networking.IGridHost; import java.util.Iterator; +import appeng.api.networking.IGridHost; + public interface IAECluster { void updateStatus(boolean updateGrid); diff --git a/src/main/java/appeng/me/cluster/IAEMultiBlock.java b/src/main/java/appeng/me/cluster/IAEMultiBlock.java index a7889885574..97a5cd573b3 100644 --- a/src/main/java/appeng/me/cluster/IAEMultiBlock.java +++ b/src/main/java/appeng/me/cluster/IAEMultiBlock.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster; diff --git a/src/main/java/appeng/me/cluster/MBCalculator.java b/src/main/java/appeng/me/cluster/MBCalculator.java index b5fa4fbdf32..84197035995 100644 --- a/src/main/java/appeng/me/cluster/MBCalculator.java +++ b/src/main/java/appeng/me/cluster/MBCalculator.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster; -import appeng.api.util.WorldCoord; -import appeng.core.AELog; -import appeng.util.Platform; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.WorldCoord; +import appeng.core.AELog; +import appeng.util.Platform; + public abstract class MBCalculator { private final IAEMultiBlock target; @@ -155,8 +148,8 @@ private boolean verifyUnownedRegion(final World w, final WorldCoord min, final W */ public abstract boolean isValidTile(TileEntity te); - private boolean verifyUnownedRegionInner( - final World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, final ForgeDirection side) { + private boolean verifyUnownedRegionInner(final World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, + final ForgeDirection side) { switch (side) { case WEST: minX -= 1; diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java index 6a8d9d78fd3..9e8646e8ea7 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCalculator.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster.implementations; +import java.util.Iterator; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -27,10 +25,6 @@ import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.MBCalculator; import appeng.tile.crafting.TileCraftingTile; -import java.util.Iterator; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class CraftingCPUCalculator extends MBCalculator { diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index da0a0316920..7fa968bcd1e 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster.implementations; +import java.util.*; +import java.util.Map.Entry; +import java.util.stream.IntStream; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -49,18 +52,10 @@ import appeng.tile.crafting.TileCraftingTile; import appeng.util.Platform; import appeng.util.item.AEItemStack; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import cpw.mods.fml.common.FMLCommonHandler; -import java.util.*; -import java.util.Map.Entry; -import java.util.stream.IntStream; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; public final class CraftingCPUCluster implements IAECluster, ICraftingCPU { @@ -69,14 +64,12 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU { private final WorldCoord min; private final WorldCoord max; private final int[] usedOps = new int[3]; - private final Map tasks = - new HashMap(); + private final Map tasks = new HashMap(); // INSTANCE sate private final LinkedList tiles = new LinkedList(); private final LinkedList storage = new LinkedList(); private final LinkedList status = new LinkedList(); - private final HashMap, Object> listeners = - new HashMap, Object>(); + private final HashMap, Object> listeners = new HashMap, Object>(); private ICraftingLink myLastLink; private String myName = ""; private boolean isDestroyed = false; @@ -415,12 +408,11 @@ private ArrayList getExtractItems(IAEItemStack ingredient, ICrafti if (!patternDetails.isCraftable() && fuzz.getStackSize() <= 0) continue; if (patternDetails.isCraftable()) { final IAEItemStack[] inputSlots = patternDetails.getInputs(); - final IAEItemStack finalIngredient = - ingredient; // have to copy because of Java lambda capture rules here + final IAEItemStack finalIngredient = ingredient; // have to copy because of Java lambda capture + // rules here final int matchingSlot = IntStream.range(0, inputSlots.length) .filter(idx -> inputSlots[idx] != null && inputSlots[idx].equals(finalIngredient)) - .findFirst() - .orElse(-1); + .findFirst().orElse(-1); if (matchingSlot < 0) { continue; } @@ -444,8 +436,8 @@ private ArrayList getExtractItems(IAEItemStack ingredient, ICrafti } } } else { - final IAEItemStack extractItems = - this.inventory.extractItems(ingredient, Actionable.SIMULATE, this.machineSrc); + final IAEItemStack extractItems = this.inventory + .extractItems(ingredient, Actionable.SIMULATE, this.machineSrc); final ItemStack is = extractItems == null ? null : extractItems.getItemStack(); if (is != null && is.stackSize == ingredient.getStackSize()) { list.add(extractItems); @@ -539,8 +531,7 @@ public void updateCraftingLogic(final IGrid grid, final IEnergyGrid eg, final Cr } private void executeCrafting(final IEnergyGrid eg, final CraftingGridCache cc) { - final Iterator> i = - this.tasks.entrySet().iterator(); + final Iterator> i = this.tasks.entrySet().iterator(); while (i.hasNext()) { final Entry e = i.next(); @@ -571,16 +562,14 @@ private void executeCrafting(final IEnergyGrid eg, final CraftingGridCache cc) { } } // upgraded interface uses more power - if (m instanceof DualityInterface) - sum *= Math.pow( - 4.0, ((DualityInterface) m).getInstalledUpgrades(Upgrades.PATTERN_CAPACITY)); + if (m instanceof DualityInterface) sum *= Math + .pow(4.0, ((DualityInterface) m).getInstalledUpgrades(Upgrades.PATTERN_CAPACITY)); // check if there is enough power if (eg.extractAEPower(sum, Actionable.SIMULATE, PowerMultiplier.CONFIG) < sum - 0.01) continue; - ic = details.isCraftable() - ? new InventoryCrafting(new ContainerNull(), 3, 3) + ic = details.isCraftable() ? new InventoryCrafting(new ContainerNull(), 3, 3) : new InventoryCrafting(new ContainerNull(), details.getInputs().length, 1); boolean found = false; @@ -588,13 +577,12 @@ private void executeCrafting(final IEnergyGrid eg, final CraftingGridCache cc) { if (input[x] != null) { found = false; for (IAEItemStack ias : getExtractItems(input[x], details)) { - if (details.isCraftable() - && !details.isValidItemForSlot( - x, ias.getItemStack(), this.getWorld())) { + if (details.isCraftable() && !details + .isValidItemForSlot(x, ias.getItemStack(), this.getWorld())) { continue; } - final IAEItemStack ais = - this.inventory.extractItems(ias, Actionable.MODULATE, this.machineSrc); + final IAEItemStack ais = this.inventory + .extractItems(ias, Actionable.MODULATE, this.machineSrc); final ItemStack is = ais == null ? null : ais.getItemStack(); if (is == null) continue; found = true; @@ -618,7 +606,9 @@ private void executeCrafting(final IEnergyGrid eg, final CraftingGridCache cc) { final ItemStack is = ic.getStackInSlot(x); if (is != null) { this.inventory.injectItems( - AEItemStack.create(is), Actionable.MODULATE, this.machineSrc); + AEItemStack.create(is), + Actionable.MODULATE, + this.machineSrc); } } ic = null; @@ -638,11 +628,10 @@ private void executeCrafting(final IEnergyGrid eg, final CraftingGridCache cc) { } if (details.isCraftable()) { - FMLCommonHandler.instance() - .firePlayerCraftingEvent( - Platform.getPlayer((WorldServer) this.getWorld()), - details.getOutput(ic, this.getWorld()), - ic); + FMLCommonHandler.instance().firePlayerCraftingEvent( + Platform.getPlayer((WorldServer) this.getWorld()), + details.getOutput(ic, this.getWorld()), + ic); for (int x = 0; x < ic.getSizeInventory(); x++) { final ItemStack output = Platform.getContainerItem(ic.getStackInSlot(x)); @@ -713,10 +702,7 @@ private void storeItems() { this.markDirty(); } - public ICraftingLink submitJob( - final IGrid g, - final ICraftingJob job, - final BaseActionSource src, + public ICraftingLink submitJob(final IGrid g, final ICraftingJob job, final BaseActionSource src, final ICraftingRequester requestingMachine) { if (!this.tasks.isEmpty() || !this.waitingFor.isEmpty()) { return null; @@ -746,8 +732,9 @@ public ICraftingLink submitJob( this.updateCPU(); final String craftID = this.generateCraftingID(); - this.myLastLink = - new CraftingLink(this.generateLinkData(craftID, requestingMachine == null, false), this); + this.myLastLink = new CraftingLink( + this.generateLinkData(craftID, requestingMachine == null, false), + this); this.prepareElapsedTime(); @@ -755,8 +742,9 @@ public ICraftingLink submitJob( return this.myLastLink; } - final ICraftingLink whatLink = - new CraftingLink(this.generateLinkData(craftID, false, true), requestingMachine); + final ICraftingLink whatLink = new CraftingLink( + this.generateLinkData(craftID, false, true), + requestingMachine); this.submitLink(this.myLastLink); this.submitLink(whatLink); @@ -783,8 +771,7 @@ public ICraftingLink submitJob( @Override public boolean isBusy() { - final Iterator> i = - this.tasks.entrySet().iterator(); + final Iterator> i = this.tasks.entrySet().iterator(); while (i.hasNext()) { if (i.next().getValue().value <= 0) { @@ -835,8 +822,7 @@ private String generateCraftingID() { final int hash = System.identityHashCode(this); final int hmm = this.finalOutput == null ? 0 : this.finalOutput.hashCode(); - return Long.toString(now, Character.MAX_RADIX) - + '-' + return Long.toString(now, Character.MAX_RADIX) + '-' + Integer.toString(hash, Character.MAX_RADIX) + '-' + Integer.toString(hmm, Character.MAX_RADIX); @@ -969,8 +955,7 @@ public void writeToNBT(final NBTTagCompound data) { final NBTTagList list = new NBTTagList(); for (final Entry e : this.tasks.entrySet()) { - final NBTTagCompound item = - this.writeItem(AEItemStack.create(e.getKey().getPattern())); + final NBTTagCompound item = this.writeItem(AEItemStack.create(e.getKey().getPattern())); item.setLong("craftingProgress", e.getValue().value); list.appendTag(item); } @@ -1146,6 +1131,7 @@ public long getStartItemCount() { } private static class TaskProgress { + private long value; } } diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java index f8770dabe00..99f7bb1e4a9 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCalculator.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster.implementations; +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlocks; @@ -26,10 +23,6 @@ import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.MBCalculator; import appeng.tile.qnb.TileQuantumBridge; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class QuantumCalculator extends MBCalculator { @@ -44,11 +37,11 @@ public QuantumCalculator(final IAEMultiBlock t) { public boolean checkMultiblockScale(final WorldCoord min, final WorldCoord max) { if ((max.x - min.x + 1) * (max.y - min.y + 1) * (max.z - min.z + 1) == 9) { - final int ones = - ((max.x - min.x) == 0 ? 1 : 0) + ((max.y - min.y) == 0 ? 1 : 0) + ((max.z - min.z) == 0 ? 1 : 0); + final int ones = ((max.x - min.x) == 0 ? 1 : 0) + ((max.y - min.y) == 0 ? 1 : 0) + + ((max.z - min.z) == 0 ? 1 : 0); - final int threes = - ((max.x - min.x) == 2 ? 1 : 0) + ((max.y - min.y) == 2 ? 1 : 0) + ((max.z - min.z) == 2 ? 1 : 0); + final int threes = ((max.x - min.x) == 2 ? 1 : 0) + ((max.y - min.y) == 2 ? 1 : 0) + + ((max.z - min.z) == 2 ? 1 : 0); return ones == 1 && threes == 2; } @@ -133,8 +126,8 @@ public boolean isValidTile(final TileEntity te) { return te instanceof TileQuantumBridge; } - private boolean isBlockAtLocation( - final IBlockAccess w, final int x, final int y, final int z, final IBlockDefinition def) { + private boolean isBlockAtLocation(final IBlockAccess w, final int x, final int y, final int z, + final IBlockDefinition def) { for (final Block block : def.maybeBlock().asSet()) { return block == w.getBlock(x, y, z); } diff --git a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java index 8737deb1fea..ebfdb368fe1 100644 --- a/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/QuantumCluster.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster.implementations; +import java.util.Iterator; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.world.WorldEvent; + import appeng.api.AEApi; import appeng.api.events.LocatableEventAnnounce; import appeng.api.events.LocatableEventAnnounce.LocatableEvent; @@ -31,14 +33,6 @@ import appeng.tile.qnb.TileQuantumBridge; import appeng.util.iterators.ChainedIterator; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import java.util.Iterator; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.world.WorldEvent; public class QuantumCluster implements ILocatable, IAECluster { @@ -94,8 +88,7 @@ public void updateStatus(final boolean updateGrid) { } } - final ILocatable myOtherSide = this.otherSide == 0 - ? null + final ILocatable myOtherSide = this.otherSide == 0 ? null : AEApi.instance().registries().locatable().getLocatableBy(this.otherSide); boolean shutdown = false; @@ -152,8 +145,7 @@ public void updateStatus(final boolean updateGrid) { } private boolean canUseNode(final long qe) { - final QuantumCluster qc = - (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy(qe); + final QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy(qe); if (qc != null) { final World theWorld = qc.center.getWorldObj(); if (!qc.isDestroyed) { @@ -228,8 +220,7 @@ public Iterator getTiles() { } public boolean isCorner(final TileQuantumBridge tileQuantumBridge) { - return this.getRing()[0] == tileQuantumBridge - || this.getRing()[2] == tileQuantumBridge + return this.getRing()[0] == tileQuantumBridge || this.getRing()[2] == tileQuantumBridge || this.getRing()[4] == tileQuantumBridge || this.getRing()[6] == tileQuantumBridge; } diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java index 617b76d83e9..088a9fd64e6 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCalculator.java @@ -1,31 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster.implementations; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import appeng.api.util.DimensionalCoord; import appeng.api.util.WorldCoord; import appeng.me.cluster.IAECluster; import appeng.me.cluster.IAEMultiBlock; import appeng.me.cluster.MBCalculator; import appeng.tile.spatial.TileSpatialPylon; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class SpatialPylonCalculator extends MBCalculator { @@ -46,7 +39,8 @@ public boolean checkMultiblockScale(final WorldCoord min, final WorldCoord max) @Override public IAECluster createCluster(final World w, final WorldCoord min, final WorldCoord max) { return new SpatialPylonCluster( - new DimensionalCoord(w, min.x, min.y, min.z), new DimensionalCoord(w, max.x, max.y, max.z)); + new DimensionalCoord(w, min.x, min.y, min.z), + new DimensionalCoord(w, max.x, max.y, max.z)); } @Override diff --git a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java index 80545fe4414..975547d0709 100644 --- a/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/SpatialPylonCluster.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.cluster.implementations; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import appeng.api.networking.IGridHost; import appeng.api.util.DimensionalCoord; import appeng.me.cluster.IAECluster; import appeng.tile.spatial.TileSpatialPylon; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; public class SpatialPylonCluster implements IAECluster { diff --git a/src/main/java/appeng/me/energy/EnergyThreshold.java b/src/main/java/appeng/me/energy/EnergyThreshold.java index 8204d717428..26632d0c4b6 100644 --- a/src/main/java/appeng/me/energy/EnergyThreshold.java +++ b/src/main/java/appeng/me/energy/EnergyThreshold.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.energy; diff --git a/src/main/java/appeng/me/energy/EnergyWatcher.java b/src/main/java/appeng/me/energy/EnergyWatcher.java index 70d923ed09b..7a2f394501f 100644 --- a/src/main/java/appeng/me/energy/EnergyWatcher.java +++ b/src/main/java/appeng/me/energy/EnergyWatcher.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.energy; -import appeng.api.networking.energy.IEnergyWatcher; -import appeng.api.networking.energy.IEnergyWatcherHost; -import appeng.me.cache.EnergyGridCache; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; +import appeng.api.networking.energy.IEnergyWatcher; +import appeng.api.networking.energy.IEnergyWatcherHost; +import appeng.me.cache.EnergyGridCache; + /** * Maintain my interests, and a global watch list, they should always be fully synchronized. */ diff --git a/src/main/java/appeng/me/helpers/AENetworkProxy.java b/src/main/java/appeng/me/helpers/AENetworkProxy.java index 4e8cccfce78..485139857c5 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxy.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxy.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.helpers; +import java.util.Collections; +import java.util.EnumSet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.networking.*; import appeng.api.networking.crafting.ICraftingGrid; @@ -37,13 +37,8 @@ import appeng.parts.networking.PartCable; import appeng.tile.AEBaseTile; import appeng.util.Platform; + import com.mojang.authlib.GameProfile; -import java.util.Collections; -import java.util.EnumSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class AENetworkProxy implements IGridBlock { @@ -60,8 +55,8 @@ public class AENetworkProxy implements IGridBlock { private double idleDraw = 1.0; private EntityPlayer owner; - public AENetworkProxy( - final IGridProxyable te, final String nbtName, final ItemStack visual, final boolean inWorld) { + public AENetworkProxy(final IGridProxyable te, final String nbtName, final ItemStack visual, + final boolean inWorld) { this.gp = te; this.nbtName = nbtName; this.worldNode = inWorld; diff --git a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java index 1574269455e..3964369d158 100644 --- a/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java +++ b/src/main/java/appeng/me/helpers/AENetworkProxyMultiblock.java @@ -1,36 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.helpers; +import java.util.Iterator; + +import net.minecraft.item.ItemStack; + import appeng.api.networking.IGridMultiblock; import appeng.api.networking.IGridNode; import appeng.me.cluster.IAECluster; import appeng.me.cluster.IAEMultiBlock; import appeng.util.iterators.ChainedIterator; import appeng.util.iterators.ProxyNodeIterator; -import java.util.Iterator; -import net.minecraft.item.ItemStack; public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMultiblock { - public AENetworkProxyMultiblock( - final IGridProxyable te, final String nbtName, final ItemStack itemStack, final boolean inWorld) { + public AENetworkProxyMultiblock(final IGridProxyable te, final String nbtName, final ItemStack itemStack, + final boolean inWorld) { super(te, nbtName, itemStack, inWorld); } diff --git a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java index 2b088aaa2e9..39b3f92f172 100644 --- a/src/main/java/appeng/me/helpers/ChannelPowerSrc.java +++ b/src/main/java/appeng/me/helpers/ChannelPowerSrc.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.helpers; diff --git a/src/main/java/appeng/me/helpers/GenericInterestManager.java b/src/main/java/appeng/me/helpers/GenericInterestManager.java index 54a76f6ae85..f05df74e690 100644 --- a/src/main/java/appeng/me/helpers/GenericInterestManager.java +++ b/src/main/java/appeng/me/helpers/GenericInterestManager.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.helpers; -import appeng.api.storage.data.IAEStack; -import com.google.common.collect.Multimap; import java.util.Collection; import java.util.LinkedList; +import appeng.api.storage.data.IAEStack; + +import com.google.common.collect.Multimap; + public class GenericInterestManager { private final Multimap container; diff --git a/src/main/java/appeng/me/helpers/IGridProxyable.java b/src/main/java/appeng/me/helpers/IGridProxyable.java index 4f47bdb9109..3cff5b6274a 100644 --- a/src/main/java/appeng/me/helpers/IGridProxyable.java +++ b/src/main/java/appeng/me/helpers/IGridProxyable.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.helpers; diff --git a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java index 18534b576b6..1cecdc0e5e8 100644 --- a/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/AdHocChannelUpdater.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.pathfinding; diff --git a/src/main/java/appeng/me/pathfinding/BackbonePathSegment.java b/src/main/java/appeng/me/pathfinding/BackbonePathSegment.java index 18be135c086..310e1bbfb32 100644 --- a/src/main/java/appeng/me/pathfinding/BackbonePathSegment.java +++ b/src/main/java/appeng/me/pathfinding/BackbonePathSegment.java @@ -1,15 +1,17 @@ package appeng.me.pathfinding; -import appeng.me.cache.PathGridCache; import java.util.*; +import appeng.me.cache.PathGridCache; + public class BackbonePathSegment extends PathSegment { + IPathItem startNode; private Set controllerRoutes = new HashSet<>(); Map> neighbours = new HashMap<>(); - public BackbonePathSegment( - IPathItem node, final PathGridCache myPGC, final Set semiOpen, final Set closed) { + public BackbonePathSegment(IPathItem node, final PathGridCache myPGC, final Set semiOpen, + final Set closed) { super(myPGC, new LinkedList(), semiOpen, closed); startNode = node; } @@ -31,7 +33,8 @@ public void selectControllerRoute() { public boolean switchControllerRoute() { if (controllerRoutes.isEmpty() || startNode.getControllerRoute() == null) return false; if (startNode.getControllerRoute().getControllerRoute() != null - && startNode.getControllerRoute().getControllerRoute().canSupportMoreChannels()) return true; + && startNode.getControllerRoute().getControllerRoute().canSupportMoreChannels()) + return true; controllerRoutes.remove(startNode.getControllerRoute()); if (controllerRoutes.isEmpty()) return false; startNode.setControllerRoute(controllerRoutes.iterator().next(), false); diff --git a/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java b/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java index b2b581bd7e0..eb55c023670 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java +++ b/src/main/java/appeng/me/pathfinding/ControllerChannelUpdater.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.pathfinding; diff --git a/src/main/java/appeng/me/pathfinding/ControllerValidator.java b/src/main/java/appeng/me/pathfinding/ControllerValidator.java index f22bad2ba50..02d566683a5 100644 --- a/src/main/java/appeng/me/pathfinding/ControllerValidator.java +++ b/src/main/java/appeng/me/pathfinding/ControllerValidator.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.pathfinding; diff --git a/src/main/java/appeng/me/pathfinding/IPathItem.java b/src/main/java/appeng/me/pathfinding/IPathItem.java index 08591122a44..29e74b2fa9e 100644 --- a/src/main/java/appeng/me/pathfinding/IPathItem.java +++ b/src/main/java/appeng/me/pathfinding/IPathItem.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.pathfinding; +import java.util.EnumSet; + import appeng.api.networking.GridFlags; import appeng.api.util.IReadOnlyCollection; -import java.util.EnumSet; public interface IPathItem { diff --git a/src/main/java/appeng/me/pathfinding/PathSegment.java b/src/main/java/appeng/me/pathfinding/PathSegment.java index 1ee3a60466b..35214823994 100644 --- a/src/main/java/appeng/me/pathfinding/PathSegment.java +++ b/src/main/java/appeng/me/pathfinding/PathSegment.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.pathfinding; +import java.util.*; + import appeng.api.networking.GridFlags; import appeng.api.networking.IGridMultiblock; import appeng.api.networking.IGridNode; import appeng.me.cache.PathGridCache; -import java.util.*; public class PathSegment { @@ -32,10 +25,7 @@ public class PathSegment { private boolean isDead; protected List open; - public PathSegment( - final PathGridCache myPGC, - final List open, - final Set semiOpen, + public PathSegment(final PathGridCache myPGC, final List open, final Set semiOpen, final Set closed) { this.open = open; this.semiOpen = semiOpen; @@ -67,8 +57,8 @@ public boolean step(Map backbone, TopologyStage final boolean worked = this.useChannel(pi, flags.contains(GridFlags.COMPRESSED_CHANNEL)); if (worked && flags.contains(GridFlags.MULTIBLOCK)) { - final Iterator oni = - ((IGridMultiblock) ((IGridNode) pi).getGridBlock()).getMultiblockNodes(); + final Iterator oni = ((IGridMultiblock) ((IGridNode) pi).getGridBlock()) + .getMultiblockNodes(); while (oni.hasNext()) { final IGridNode otherNodes = oni.next(); if (otherNodes != pi) { diff --git a/src/main/java/appeng/me/storage/AEExternalHandler.java b/src/main/java/appeng/me/storage/AEExternalHandler.java index 8b6288342f7..8072501ecd7 100644 --- a/src/main/java/appeng/me/storage/AEExternalHandler.java +++ b/src/main/java/appeng/me/storage/AEExternalHandler.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.tiles.ITileStorageMonitorable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IExternalStorageHandler; @@ -27,14 +22,12 @@ import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IAEItemStack; import appeng.tile.misc.TileCondenser; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class AEExternalHandler implements IExternalStorageHandler { @Override - public boolean canHandle( - final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource mySrc) { + public boolean canHandle(final TileEntity te, final ForgeDirection d, final StorageChannel channel, + final BaseActionSource mySrc) { if (channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable) { return ((ITileStorageMonitorable) te).getMonitorable(d, mySrc) != null; } @@ -43,8 +36,8 @@ public boolean canHandle( } @Override - public IMEInventory getInventory( - final TileEntity te, final ForgeDirection d, final StorageChannel channel, final BaseActionSource src) { + public IMEInventory getInventory(final TileEntity te, final ForgeDirection d, final StorageChannel channel, + final BaseActionSource src) { if (te instanceof TileCondenser) { if (channel == StorageChannel.ITEMS) { return new VoidItemInventory((TileCondenser) te); diff --git a/src/main/java/appeng/me/storage/CellInventory.java b/src/main/java/appeng/me/storage/CellInventory.java index 24913104946..c417b1025a9 100644 --- a/src/main/java/appeng/me/storage/CellInventory.java +++ b/src/main/java/appeng/me/storage/CellInventory.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -29,14 +31,6 @@ import appeng.api.storage.data.IItemList; import appeng.util.Platform; import appeng.util.item.AEItemStack; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; public class CellInventory implements ICellInventory { @@ -153,14 +147,12 @@ private static boolean isBlackListed(final IAEItemStack input) { return true; } - return BLACK_LIST.contains( - (input.getItemDamage() << Platform.DEF_OFFSET) | Item.getIdFromItem(input.getItem())); + return BLACK_LIST + .contains((input.getItemDamage() << Platform.DEF_OFFSET) | Item.getIdFromItem(input.getItem())); } private boolean isEmpty(final IMEInventory meInventory) { - return meInventory - .getAvailableItems(AEApi.instance().storage().createItemList()) - .isEmpty(); + return meInventory.getAvailableItems(AEApi.instance().storage().createItemList()).isEmpty(); } @Override @@ -322,8 +314,8 @@ private void saveChanges() { } /* - * NBTBase tagSlotCount = tagCompound.getTag( itemSlotCount[x] ); if ( tagSlotCount instanceof - * NBTTagInt ) ((NBTTagInt) tagSlotCount).data = (int) v.getStackSize(); else + * NBTBase tagSlotCount = tagCompound.getTag( itemSlotCount[x] ); if ( tagSlotCount instanceof NBTTagInt ) + * ((NBTTagInt) tagSlotCount).data = (int) v.getStackSize(); else */ this.tagCompound.setLong(itemSlotCount[x], v.getStackSize()); @@ -443,7 +435,7 @@ public boolean canHoldNewItem() { final long bytesFree = this.getFreeBytes(); return (bytesFree > this.getBytesPerType() - || (bytesFree == this.getBytesPerType() && this.getUnusedItemCount() > 0)) + || (bytesFree == this.getBytesPerType() && this.getUnusedItemCount() > 0)) && this.getRemainingItemTypes() > 0; } diff --git a/src/main/java/appeng/me/storage/CellInventoryHandler.java b/src/main/java/appeng/me/storage/CellInventoryHandler.java index ee109b5ef45..8f6afc7c26f 100644 --- a/src/main/java/appeng/me/storage/CellInventoryHandler.java +++ b/src/main/java/appeng/me/storage/CellInventoryHandler.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.FuzzyMode; import appeng.api.config.IncludeExclude; @@ -33,8 +28,6 @@ import appeng.util.prioitylist.FuzzyPriorityList; import appeng.util.prioitylist.OreFilteredList; import appeng.util.prioitylist.PrecisePriorityList; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class CellInventoryHandler extends MEInventoryHandler implements ICellInventoryHandler { @@ -77,8 +70,7 @@ public class CellInventoryHandler extends MEInventoryHandler imple if (hasOreFilter && !filter.isEmpty()) { this.setPartitionList(new OreFilteredList(filter)); } else { - final IItemList priorityList = - AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); for (int x = 0; x < config.getSizeInventory(); x++) { final ItemStack is = config.getStackInSlot(x); if (is != null) { diff --git a/src/main/java/appeng/me/storage/CreativeCellInventory.java b/src/main/java/appeng/me/storage/CreativeCellInventory.java index db38df4df16..1b77a86fa05 100644 --- a/src/main/java/appeng/me/storage/CreativeCellInventory.java +++ b/src/main/java/appeng/me/storage/CreativeCellInventory.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; @@ -28,12 +22,10 @@ import appeng.api.storage.data.IItemList; import appeng.items.contents.CellConfig; import appeng.util.item.AEItemStack; -import net.minecraft.item.ItemStack; public class CreativeCellInventory implements IMEInventoryHandler { - private final IItemList itemListCache = - AEApi.instance().storage().createItemList(); + private final IItemList itemListCache = AEApi.instance().storage().createItemList(); protected CreativeCellInventory(final ItemStack o) { final CellConfig cc = new CellConfig(o); diff --git a/src/main/java/appeng/me/storage/DriveWatcher.java b/src/main/java/appeng/me/storage/DriveWatcher.java index 9cc73a31d75..9812fdc4cec 100644 --- a/src/main/java/appeng/me/storage/DriveWatcher.java +++ b/src/main/java/appeng/me/storage/DriveWatcher.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import net.minecraft.item.ItemStack; + import appeng.api.config.Actionable; import appeng.api.implementations.tiles.IChestOrDrive; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.ICellHandler; import appeng.api.storage.IMEInventory; import appeng.api.storage.data.IAEStack; -import net.minecraft.item.ItemStack; public class DriveWatcher> extends MEInventoryHandler { diff --git a/src/main/java/appeng/me/storage/ItemWatcher.java b/src/main/java/appeng/me/storage/ItemWatcher.java index 3864830cfb0..98b89665f66 100644 --- a/src/main/java/appeng/me/storage/ItemWatcher.java +++ b/src/main/java/appeng/me/storage/ItemWatcher.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; + import appeng.api.networking.storage.IStackWatcher; import appeng.api.networking.storage.IStackWatcherHost; import appeng.api.storage.data.IAEStack; import appeng.me.cache.GridStorageCache; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; /** * Maintain my interests, and a global watch list, they should always be fully synchronized. diff --git a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java index f1f150bafd3..af497afa6f9 100644 --- a/src/main/java/appeng/me/storage/MEIInventoryWrapper.java +++ b/src/main/java/appeng/me/storage/MEIInventoryWrapper.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.config.Actionable; import appeng.api.networking.security.BaseActionSource; import appeng.api.storage.IMEInventory; @@ -27,8 +22,6 @@ import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.item.AEItemStack; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class MEIInventoryWrapper implements IMEInventory { @@ -45,8 +38,8 @@ public IAEItemStack injectItems(final IAEItemStack iox, final Actionable mode, f final ItemStack input = iox.getItemStack(); if (this.adaptor != null) { - final ItemStack is = - mode == Actionable.SIMULATE ? this.adaptor.simulateAdd(input) : this.adaptor.addItems(input); + final ItemStack is = mode == Actionable.SIMULATE ? this.adaptor.simulateAdd(input) + : this.adaptor.addItems(input); if (is == null) { return null; } diff --git a/src/main/java/appeng/me/storage/MEInventoryHandler.java b/src/main/java/appeng/me/storage/MEInventoryHandler.java index 7b8113e95cf..1cc3d750e6c 100644 --- a/src/main/java/appeng/me/storage/MEInventoryHandler.java +++ b/src/main/java/appeng/me/storage/MEInventoryHandler.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; diff --git a/src/main/java/appeng/me/storage/MEMonitorIInventory.java b/src/main/java/appeng/me/storage/MEMonitorIInventory.java index 3498313de79..e8f403f8e9f 100644 --- a/src/main/java/appeng/me/storage/MEMonitorIInventory.java +++ b/src/main/java/appeng/me/storage/MEMonitorIInventory.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map.Entry; +import java.util.NavigableMap; +import java.util.concurrent.ConcurrentSkipListMap; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; @@ -32,20 +33,12 @@ import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.inv.ItemSlot; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map.Entry; -import java.util.NavigableMap; -import java.util.concurrent.ConcurrentSkipListMap; -import net.minecraft.item.ItemStack; public class MEMonitorIInventory implements IMEMonitor { private final InventoryAdaptor adaptor; private final IItemList list = AEApi.instance().storage().createItemList(); - private final HashMap, Object> listeners = - new HashMap, Object>(); + private final HashMap, Object> listeners = new HashMap, Object>(); private final NavigableMap memory; private BaseActionSource mySource; private StorageFilter mode = StorageFilter.EXTRACTABLE_ONLY; @@ -131,8 +124,8 @@ public TickRateModulation onTick() { final CachedItemStack old = this.memory.get(is.getSlot()); high = Math.max(high, is.getSlot()); - final ItemStack newIS = - !is.isExtractable() && this.getMode() == StorageFilter.EXTRACTABLE_ONLY ? null : is.getItemStack(); + final ItemStack newIS = !is.isExtractable() && this.getMode() == StorageFilter.EXTRACTABLE_ONLY ? null + : is.getItemStack(); final ItemStack oldIS = old == null ? null : old.itemStack; if (this.isDifferent(newIS, oldIS)) { @@ -210,8 +203,8 @@ private boolean isDifferent(final ItemStack a, final ItemStack b) { private void postDifference(final Iterable a) { // AELog.info( a.getItemStack().getUnlocalizedName() + " @ " + a.getStackSize() ); if (a != null) { - final Iterator, Object>> i = - this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet() + .iterator(); while (i.hasNext()) { final Entry, Object> l = i.next(); final IMEMonitorHandlerReceiver key = l.getKey(); diff --git a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java index bed4a498020..eac00b40827 100644 --- a/src/main/java/appeng/me/storage/MEMonitorPassThrough.java +++ b/src/main/java/appeng/me/storage/MEMonitorPassThrough.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map.Entry; + import appeng.api.networking.security.BaseActionSource; import appeng.api.networking.storage.IBaseMonitor; import appeng.api.storage.IMEInventory; @@ -28,15 +24,11 @@ import appeng.api.storage.data.IItemList; import appeng.util.Platform; import appeng.util.inv.ItemListIgnoreCrafting; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map.Entry; public class MEMonitorPassThrough> extends MEPassThrough implements IMEMonitor, IMEMonitorHandlerReceiver { - private final HashMap, Object> listeners = - new HashMap, Object>(); + private final HashMap, Object> listeners = new HashMap, Object>(); private BaseActionSource changeSource; private IMEMonitor monitor; @@ -54,22 +46,18 @@ public void setInternal(final IMEInventory i) { } this.monitor = null; - final IItemList before = this.getInternal() == null - ? this.getWrappedChannel().createList() + final IItemList before = this.getInternal() == null ? this.getWrappedChannel().createList() : this.getInternal() - .getAvailableItems(new ItemListIgnoreCrafting( - this.getWrappedChannel().createList())); + .getAvailableItems(new ItemListIgnoreCrafting(this.getWrappedChannel().createList())); super.setInternal(i); if (i instanceof IMEMonitor) { this.monitor = (IMEMonitor) i; } - final IItemList after = this.getInternal() == null - ? this.getWrappedChannel().createList() + final IItemList after = this.getInternal() == null ? this.getWrappedChannel().createList() : this.getInternal() - .getAvailableItems(new ItemListIgnoreCrafting( - this.getWrappedChannel().createList())); + .getAvailableItems(new ItemListIgnoreCrafting(this.getWrappedChannel().createList())); if (this.monitor != null) { this.monitor.addListener(this, this.monitor); @@ -111,8 +99,7 @@ public boolean isValid(final Object verificationToken) { @Override public void postChange(final IBaseMonitor monitor, final Iterable change, final BaseActionSource source) { - final Iterator, Object>> i = - this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { final Entry, Object> e = i.next(); final IMEMonitorHandlerReceiver receiver = e.getKey(); @@ -126,8 +113,7 @@ public void postChange(final IBaseMonitor monitor, final Iterable change, @Override public void onListUpdate() { - final Iterator, Object>> i = - this.listeners.entrySet().iterator(); + final Iterator, Object>> i = this.listeners.entrySet().iterator(); while (i.hasNext()) { final Entry, Object> e = i.next(); final IMEMonitorHandlerReceiver receiver = e.getKey(); diff --git a/src/main/java/appeng/me/storage/MEPassThrough.java b/src/main/java/appeng/me/storage/MEPassThrough.java index edac2f4ae96..9101efcfa32 100644 --- a/src/main/java/appeng/me/storage/MEPassThrough.java +++ b/src/main/java/appeng/me/storage/MEPassThrough.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; diff --git a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java index 5b3f50f5392..82bdbb29e9a 100644 --- a/src/main/java/appeng/me/storage/NetworkInventoryHandler.java +++ b/src/main/java/appeng/me/storage/NetworkInventoryHandler.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; +import java.util.*; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.config.SecurityPermissions; @@ -33,7 +27,6 @@ import appeng.api.storage.data.IItemList; import appeng.me.cache.SecurityCache; import appeng.util.ItemSorters; -import java.util.*; public class NetworkInventoryHandler> implements IMEInventoryHandler { @@ -56,8 +49,7 @@ public int compare(final Integer o1, final Integer o2) { public NetworkInventoryHandler(final StorageChannel chan, final SecurityCache security) { this.myChannel = chan; this.security = security; - this.priorityInventory = - new TreeMap>>(PRIORITY_SORTER); // TreeMultimap.create( + this.priorityInventory = new TreeMap>>(PRIORITY_SORTER); // TreeMultimap.create( // prioritySorter, // hashSorter ); } @@ -88,8 +80,7 @@ public T injectItems(T input, final Actionable type, final BaseActionSource src) while (ii.hasNext() && input != null) { final IMEInventoryHandler inv = ii.next(); - if (inv.validForPass(1) - && inv.canAccept(input) + if (inv.validForPass(1) && inv.canAccept(input) && (inv.isPrioritized(input) || inv.extractItems(input, Actionable.SIMULATE, src) != null)) { input = inv.injectItems(input, type, src); } @@ -181,10 +172,7 @@ public T extractItems(T request, final Actionable mode, final BaseActionSource s return null; } - final Iterator>> i = this.priorityInventory - .descendingMap() - .values() - .iterator(); // priorityInventory.asMap().descendingMap().entrySet().iterator(); + final Iterator>> i = this.priorityInventory.descendingMap().values().iterator(); // priorityInventory.asMap().descendingMap().entrySet().iterator(); final T output = request.copy(); request = request.copy(); diff --git a/src/main/java/appeng/me/storage/NullInventory.java b/src/main/java/appeng/me/storage/NullInventory.java index 03c52c05510..3af7d4da7c8 100644 --- a/src/main/java/appeng/me/storage/NullInventory.java +++ b/src/main/java/appeng/me/storage/NullInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; diff --git a/src/main/java/appeng/me/storage/SecurityInventory.java b/src/main/java/appeng/me/storage/SecurityInventory.java index 58d603b7e14..09bd3fd4585 100644 --- a/src/main/java/appeng/me/storage/SecurityInventory.java +++ b/src/main/java/appeng/me/storage/SecurityInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; @@ -31,12 +23,12 @@ import appeng.api.storage.data.IItemList; import appeng.me.GridAccessException; import appeng.tile.misc.TileSecurity; + import com.mojang.authlib.GameProfile; public class SecurityInventory implements IMEInventoryHandler { - private final IItemList storedItems = - AEApi.instance().storage().createItemList(); + private final IItemList storedItems = AEApi.instance().storage().createItemList(); private final TileSecurity securityTile; public SecurityInventory(final TileSecurity ts) { @@ -64,9 +56,7 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, private boolean hasPermission(final BaseActionSource src) { if (src.isPlayer()) { try { - return this.securityTile - .getProxy() - .getSecurity() + return this.securityTile.getProxy().getSecurity() .hasPermission(((PlayerSource) src).player, SecurityPermissions.SECURITY); } catch (final GridAccessException e) { // :P diff --git a/src/main/java/appeng/me/storage/VoidFluidInventory.java b/src/main/java/appeng/me/storage/VoidFluidInventory.java index b2aea5e1ccb..69345306ab2 100644 --- a/src/main/java/appeng/me/storage/VoidFluidInventory.java +++ b/src/main/java/appeng/me/storage/VoidFluidInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; diff --git a/src/main/java/appeng/me/storage/VoidItemInventory.java b/src/main/java/appeng/me/storage/VoidItemInventory.java index 53f6a0bfef2..224501d7b0d 100644 --- a/src/main/java/appeng/me/storage/VoidItemInventory.java +++ b/src/main/java/appeng/me/storage/VoidItemInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.me.storage; diff --git a/src/main/java/appeng/parts/AEBasePart.java b/src/main/java/appeng/parts/AEBasePart.java index 13610ef5ce9..cac1664ca4d 100644 --- a/src/main/java/appeng/parts/AEBasePart.java +++ b/src/main/java/appeng/parts/AEBasePart.java @@ -1,23 +1,37 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; +import java.io.IOException; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import appeng.api.AEApi; import appeng.api.config.Upgrades; import appeng.api.definitions.IDefinitions; @@ -41,30 +55,12 @@ import appeng.tile.inventory.AppEngInternalAEInventory; import appeng.util.Platform; import appeng.util.SettingsFrom; + import com.google.common.base.Preconditions; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.crash.CrashReportCategory; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradeableHost, ICustomNameObject { @@ -172,8 +168,8 @@ public void setCustomName(String name) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { rh.setBounds(1, 1, 1, 15, 15, 15); rh.renderBlock(x, y, z, renderer); } @@ -189,8 +185,8 @@ public void addEntityCrashInfo(final CrashReportCategory crashreportcategory) { @Override @SideOnly(Side.CLIENT) - public void renderDynamic( - final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer) {} + public void renderDynamic(final double x, final double y, final double z, final IPartRenderHelper rh, + final RenderBlocks renderer) {} @Override public ItemStack getItemStack(final PartItemStack type) { @@ -377,8 +373,7 @@ private boolean useMemoryCard(final EntityPlayer player) { // Blocks and parts share the same soul! final IDefinitions definitions = AEApi.instance().definitions(); if (definitions.parts().iface().isSameAs(is)) { - for (final ItemStack iface : - definitions.blocks().iface().maybeStack(1).asSet()) { + for (final ItemStack iface : definitions.blocks().iface().maybeStack(1).asSet()) { is = iface; } } @@ -418,10 +413,16 @@ private boolean useRenamer(final EntityPlayer player) { @Override public final boolean onActivate(final EntityPlayer player, final Vec3 pos) { - // int x = (int) pos.xCoord, y = (int) pos.yCoord, z = (int) pos.zCoord; + // int x = (int) pos.xCoord, y = (int) pos.yCoord, z = (int) pos.zCoord; int x = this.tile.xCoord, y = this.tile.yCoord, z = this.tile.zCoord; PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract( - player, PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, x, y, z, this.side.flag, player.getEntityWorld()); + player, + PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, + x, + y, + z, + this.side.flag, + player.getEntityWorld()); if (event.isCanceled()) return false; if (this.useMemoryCard(player) || useRenamer(player)) return true; @@ -431,10 +432,16 @@ public final boolean onActivate(final EntityPlayer player, final Vec3 pos) { @Override public final boolean onShiftActivate(final EntityPlayer player, final Vec3 pos) { - // int x = (int) pos.xCoord, y = (int) pos.yCoord, z = (int) pos.zCoord; + // int x = (int) pos.xCoord, y = (int) pos.yCoord, z = (int) pos.zCoord; int x = this.tile.xCoord, y = this.tile.yCoord, z = this.tile.zCoord; PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract( - player, PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, x, y, z, this.side.flag, player.getEntityWorld()); + player, + PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, + x, + y, + z, + this.side.flag, + player.getEntityWorld()); if (event.isCanceled()) return false; if (this.useMemoryCard(player)) { diff --git a/src/main/java/appeng/parts/BusCollisionHelper.java b/src/main/java/appeng/parts/BusCollisionHelper.java index 0e4fedf707b..96ad0a734bd 100644 --- a/src/main/java/appeng/parts/BusCollisionHelper.java +++ b/src/main/java/appeng/parts/BusCollisionHelper.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; -import appeng.api.parts.IPartCollisionHelper; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPartCollisionHelper; + public class BusCollisionHelper implements IPartCollisionHelper { private final List boxes; @@ -35,13 +29,8 @@ public class BusCollisionHelper implements IPartCollisionHelper { private final Entity entity; private final boolean isVisual; - public BusCollisionHelper( - final List boxes, - final ForgeDirection x, - final ForgeDirection y, - final ForgeDirection z, - final Entity e, - final boolean visual) { + public BusCollisionHelper(final List boxes, final ForgeDirection x, final ForgeDirection y, + final ForgeDirection z, final Entity e, final boolean visual) { this.boxes = boxes; this.x = x; this.y = y; @@ -50,8 +39,8 @@ public BusCollisionHelper( this.isVisual = visual; } - public BusCollisionHelper( - final List boxes, final ForgeDirection s, final Entity e, final boolean visual) { + public BusCollisionHelper(final List boxes, final ForgeDirection s, final Entity e, + final boolean visual) { this.boxes = boxes; this.entity = e; this.isVisual = visual; diff --git a/src/main/java/appeng/parts/CableBusContainer.java b/src/main/java/appeng/parts/CableBusContainer.java index e3757d9aed4..a277bab4748 100644 --- a/src/main/java/appeng/parts/CableBusContainer.java +++ b/src/main/java/appeng/parts/CableBusContainer.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; +import java.io.IOException; +import java.util.*; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.YesNo; import appeng.api.exceptions.FailedConnection; @@ -40,19 +47,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.*; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class CableBusContainer extends CableBusStorage implements AEMultiTile, ICableBusContainer { @@ -434,8 +428,7 @@ public boolean isInWorld() { private void updateRedstone() { final TileEntity te = this.getTile(); - this.hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered(te.xCoord, te.yCoord, te.zCoord) - ? YesNo.YES + this.hasRedstone = te.getWorldObj().isBlockIndirectlyGettingPowered(te.xCoord, te.yCoord, te.zCoord) ? YesNo.YES : YesNo.NO; } @@ -578,8 +571,8 @@ public void securityBreak() { } } - public Iterable getSelectedBoundingBoxesFromPool( - final boolean ignoreConnections, final boolean includeFacades, final Entity e, final boolean visual) { + public Iterable getSelectedBoundingBoxesFromPool(final boolean ignoreConnections, + final boolean includeFacades, final Entity e, final boolean visual) { final List boxes = new LinkedList(); final IFacadeContainer fc = this.getFacadeContainer(); @@ -863,8 +856,9 @@ public void readFromNBT(final NBTTagCompound data) { p = this.getPart(side); p.readFromNBT(extra); } else { - AELog.warn("Invalid NBT For CableBus Container: " - + iss.getItem().getClass().getName() + " is not a valid part; it was ignored."); + AELog.warn( + "Invalid NBT For CableBus Container: " + iss.getItem().getClass().getName() + + " is not a valid part; it was ignored."); } } } else { diff --git a/src/main/java/appeng/parts/CableBusStorage.java b/src/main/java/appeng/parts/CableBusStorage.java index 5ae8625823b..9cc884c1825 100644 --- a/src/main/java/appeng/parts/CableBusStorage.java +++ b/src/main/java/appeng/parts/CableBusStorage.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; +import javax.annotation.Nullable; + +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.parts.IPartCable; import appeng.api.parts.IFacadePart; import appeng.api.parts.IPart; -import javax.annotation.Nullable; -import net.minecraftforge.common.util.ForgeDirection; /** * Thin data storage to optimize memory usage for cables. diff --git a/src/main/java/appeng/parts/ICableBusContainer.java b/src/main/java/appeng/parts/ICableBusContainer.java index 1ef494e43e4..ceadc82db0b 100644 --- a/src/main/java/appeng/parts/ICableBusContainer.java +++ b/src/main/java/appeng/parts/ICableBusContainer.java @@ -1,29 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; -import appeng.api.parts.SelectedPart; -import appeng.api.util.AEColor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.EnumSet; import java.util.Random; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -31,6 +20,11 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.SelectedPart; +import appeng.api.util.AEColor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public interface ICableBusContainer { int isProvidingStrongPower(ForgeDirection opposite); diff --git a/src/main/java/appeng/parts/NullCableBusContainer.java b/src/main/java/appeng/parts/NullCableBusContainer.java index c8bf124ac13..8c0a822f608 100644 --- a/src/main/java/appeng/parts/NullCableBusContainer.java +++ b/src/main/java/appeng/parts/NullCableBusContainer.java @@ -1,27 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; -import appeng.api.parts.SelectedPart; -import appeng.api.util.AEColor; import java.util.EnumSet; import java.util.Random; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -29,6 +20,9 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.SelectedPart; +import appeng.api.util.AEColor; + public class NullCableBusContainer implements ICableBusContainer { @Override diff --git a/src/main/java/appeng/parts/PartBasicState.java b/src/main/java/appeng/parts/PartBasicState.java index 33cbb89ac7f..5bf55ea7545 100644 --- a/src/main/java/appeng/parts/PartBasicState.java +++ b/src/main/java/appeng/parts/PartBasicState.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; +import java.io.IOException; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.IPowerChannelState; import appeng.api.networking.GridFlags; import appeng.api.networking.events.MENetworkChannelsChanged; @@ -29,12 +29,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; public abstract class PartBasicState extends AEBasePart implements IPowerChannelState { @@ -60,8 +54,8 @@ public void powerRender(final MENetworkPowerStatusChange c) { } @SideOnly(Side.CLIENT) - public void renderLights( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderLights(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { rh.normalRendering(); this.setColors( (this.getClientFlags() & (POWERED_FLAG | CHANNEL_FLAG)) == (POWERED_FLAG | CHANNEL_FLAG), diff --git a/src/main/java/appeng/parts/PartPlacement.java b/src/main/java/appeng/parts/PartPlacement.java index 82ceecd04a9..609a58e9770 100644 --- a/src/main/java/appeng/parts/PartPlacement.java +++ b/src/main/java/appeng/parts/PartPlacement.java @@ -1,23 +1,36 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.Block.SoundType; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.BlockSnapshot; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.event.world.BlockEvent; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IItems; @@ -35,28 +48,11 @@ import appeng.integration.abstraction.IImmibisMicroblocks; import appeng.util.LookDirection; import appeng.util.Platform; + import com.google.common.base.Optional; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.Block.SoundType; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.BlockSnapshot; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; -import net.minecraftforge.event.world.BlockEvent; public class PartPlacement { @@ -64,16 +60,8 @@ public class PartPlacement { private final ThreadLocal placing = new ThreadLocal(); private boolean wasCanceled = false; - public static boolean place( - final ItemStack held, - final int x, - final int y, - final int z, - final int face, - final EntityPlayer player, - final World world, - PlaceType pass, - final int depth) { + public static boolean place(final ItemStack held, final int x, final int y, final int z, final int face, + final EntityPlayer player, final World world, PlaceType pass, final int depth) { if (depth > 3) { return false; } @@ -99,11 +87,19 @@ public static boolean place( final MovingObjectPosition mop = block.collisionRayTrace(world, x, y, z, dir.getA(), dir.getB()); if (mop != null) { final List is = new LinkedList(); - final SelectedPart sp = - selectPart(player, host, mop.hitVec.addVector(-mop.blockX, -mop.blockY, -mop.blockZ)); + final SelectedPart sp = selectPart( + player, + host, + mop.hitVec.addVector(-mop.blockX, -mop.blockY, -mop.blockZ)); BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( - x, y, z, world, block, world.getBlockMetadata(x, y, z), player); + x, + y, + z, + world, + block, + world.getBlockMetadata(x, y, z), + player); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return false; @@ -170,8 +166,8 @@ public static boolean place( } } else { player.swingItem(); - NetworkHandler.instance.sendToServer( - new PacketPartPlacement(x, y, z, face, getEyeOffset(player))); + NetworkHandler.instance + .sendToServer(new PacketPartPlacement(x, y, z, face, getEyeOffset(player))); return true; } } @@ -183,8 +179,7 @@ public static boolean place( host = ((IFMP) IntegrationRegistry.INSTANCE.getInstance(IntegrationType.FMP)).getOrCreateHost(tile); } - if (host == null - && tile != null + if (host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.ImmibisMicroblocks)) { host = ((IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance(IntegrationType.ImmibisMicroblocks)) .getOrCreateHost(player, face, tile); @@ -202,8 +197,8 @@ public static boolean place( if (sPart != null && sPart.part != null) { if (sPart.part.onShiftActivate(player, mop.hitVec)) { if (world.isRemote) { - NetworkHandler.instance.sendToServer( - new PacketPartPlacement(x, y, z, face, getEyeOffset(player))); + NetworkHandler.instance + .sendToServer(new PacketPartPlacement(x, y, z, face, getEyeOffset(player))); } return true; } @@ -220,8 +215,7 @@ public static boolean place( int te_y = y; int te_z = z; - final IBlockDefinition multiPart = - AEApi.instance().definitions().blocks().multiPart(); + final IBlockDefinition multiPart = AEApi.instance().definitions().blocks().multiPart(); if (host == null && pass == PlaceType.PLACE_ITEM) { ForgeDirection offset = ForgeDirection.UNKNOWN; @@ -246,12 +240,10 @@ public static boolean place( host = ((IFMP) IntegrationRegistry.INSTANCE.getInstance(IntegrationType.FMP)).getOrCreateHost(tile); } - if (host == null - && tile != null + if (host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.ImmibisMicroblocks)) { - host = ((IImmibisMicroblocks) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.ImmibisMicroblocks)) - .getOrCreateHost(player, face, tile); + host = ((IImmibisMicroblocks) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.ImmibisMicroblocks)).getOrCreateHost(player, face, tile); } final Optional maybeMultiPartStack = multiPart.maybeStack(1); @@ -259,28 +251,24 @@ public static boolean place( final Optional maybeMultiPartItemBlock = multiPart.maybeItemBlock(); final boolean hostIsNotPresent = host == null; - final boolean multiPartPresent = maybeMultiPartBlock.isPresent() - && maybeMultiPartStack.isPresent() + final boolean multiPartPresent = maybeMultiPartBlock.isPresent() && maybeMultiPartStack.isPresent() && maybeMultiPartItemBlock.isPresent(); final boolean canMultiPartBePlaced = maybeMultiPartBlock.get().canPlaceBlockAt(world, te_x, te_y, te_z); - if (hostIsNotPresent - && multiPartPresent + if (hostIsNotPresent && multiPartPresent && canMultiPartBePlaced - && maybeMultiPartItemBlock - .get() - .placeBlockAt( - maybeMultiPartStack.get(), - player, - world, - te_x, - te_y, - te_z, - side.ordinal(), - 0.5f, - 0.5f, - 0.5f, - 0)) { + && maybeMultiPartItemBlock.get().placeBlockAt( + maybeMultiPartStack.get(), + player, + world, + te_x, + te_y, + te_z, + side.ordinal(), + 0.5f, + 0.5f, + 0.5f, + 0)) { if (!world.isRemote) { tile = world.getTileEntity(te_x, te_y, te_z); @@ -326,8 +314,7 @@ public static boolean place( side.getOpposite().ordinal(), player, world, - pass == PlaceType.INTERACT_FIRST_PASS - ? PlaceType.INTERACT_SECOND_PASS + pass == PlaceType.INTERACT_FIRST_PASS ? PlaceType.INTERACT_SECOND_PASS : PlaceType.PLACE_ITEM, depth + 1); } @@ -340,8 +327,10 @@ public static boolean place( final LookDirection dir = Platform.getPlayerRay(player, getEyeOffset(player)); final MovingObjectPosition mop = block.collisionRayTrace(world, x, y, z, dir.getA(), dir.getB()); if (mop != null) { - final SelectedPart sp = - selectPart(player, host, mop.hitVec.addVector(-mop.blockX, -mop.blockY, -mop.blockZ)); + final SelectedPart sp = selectPart( + player, + host, + mop.hitVec.addVector(-mop.blockX, -mop.blockY, -mop.blockZ)); if (sp.part != null) { if (!player.isSneaking() && sp.part.onActivate(player, mop.hitVec)) { @@ -356,7 +345,9 @@ public static boolean place( } BlockEvent.PlaceEvent event = new BlockEvent.PlaceEvent( - BlockSnapshot.getBlockSnapshot(world, x, y, z), world.getBlock(x, y, z), player); + BlockSnapshot.getBlockSnapshot(world, x, y, z), + world.getBlock(x, y, z), + player); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return false; @@ -412,8 +403,8 @@ public static IFacadePart isFacade(final ItemStack held, final ForgeDirection si } if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport bc = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); if (bc.isFacade(held)) { return bc.createFacadePart(held, side); } @@ -460,8 +451,8 @@ public void playerInteract(final PlayerInteractEvent event) { supportedItem |= items.colorApplicator().isSameAs(held); if (event.entityPlayer.isSneaking() && held != null && supportedItem) { - NetworkHandler.instance.sendToServer( - new PacketClick(event.x, event.y, event.z, event.face, 0, 0, 0)); + NetworkHandler.instance + .sendToServer(new PacketClick(event.x, event.y, event.z, event.face, 0, 0, 0)); } } } else if (event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote) { diff --git a/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java b/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java index a3c11b59b2a..a45d0fdf04b 100644 --- a/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/BlockUpgradeInventory.java @@ -1,13 +1,15 @@ package appeng.parts.automation; -import appeng.api.config.Upgrades; -import appeng.tile.inventory.IAEAppEngInventory; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import appeng.api.config.Upgrades; +import appeng.tile.inventory.IAEAppEngInventory; + public class BlockUpgradeInventory extends UpgradeInventory { + private final Block block; public BlockUpgradeInventory(final Block block, final IAEAppEngInventory parent, final int s) { diff --git a/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java b/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java index 23ad6ee6f71..88f5b80e4f8 100644 --- a/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/DefinitionUpgradeInventory.java @@ -1,11 +1,13 @@ package appeng.parts.automation; +import net.minecraft.item.ItemStack; + import appeng.api.config.Upgrades; import appeng.api.definitions.IItemDefinition; import appeng.tile.inventory.IAEAppEngInventory; -import net.minecraft.item.ItemStack; public final class DefinitionUpgradeInventory extends UpgradeInventory { + private final IItemDefinition definition; public DefinitionUpgradeInventory(final IItemDefinition definition, final IAEAppEngInventory parent, final int s) { diff --git a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java index 5f1f8b67422..8fef44200e1 100644 --- a/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartAnnihilationPlane.java @@ -1,23 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.world.BlockEvent; + import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; import appeng.api.config.YesNo; @@ -47,28 +58,14 @@ import appeng.util.IWorldCallable; import appeng.util.Platform; import appeng.util.item.AEItemStack; + import com.google.common.collect.Lists; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.world.BlockEvent; public class PartAnnihilationPlane extends PartBasicState implements IGridTickable, IWorldCallable { + private static final IIcon SIDE_ICON = CableBusTextures.PartPlaneSides.getIcon(); private static final IIcon BACK_ICON = CableBusTextures.PartTransitionPlaneBack.getIcon(); private static final IIcon STATUS_ICON = CableBusTextures.PartMonitorSidesStatus.getIcon(); @@ -117,22 +114,26 @@ public void getBoxes(final IPartCollisionHelper bch) { final ForgeDirection u = bch.getWorldY(); if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), + this.getSide())) { minX = 0; } if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), + this.getSide())) { maxX = 16; } if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), + this.getSide())) { minY = 0; } if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), + this.getSide())) { maxY = 16; } } @@ -155,18 +156,13 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.renderStaticWithIcon(x, y, z, rh, renderer, ACTIVE_ICON); } - protected void renderStaticWithIcon( - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer, - final IIcon activeIcon) { + protected void renderStaticWithIcon(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer, final IIcon activeIcon) { int minX = 1; final ForgeDirection e = rh.getWorldX(); @@ -175,25 +171,29 @@ protected void renderStaticWithIcon( final TileEntity te = this.getHost().getTile(); if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), + this.getSide())) { minX = 0; } int maxX = 15; if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), + this.getSide())) { maxX = 16; } int minY = 1; if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), + this.getSide())) { minY = 0; } int maxY = 15; if (this.isAnnihilationPlane( - te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), + this.getSide())) { maxY = 16; } @@ -238,8 +238,7 @@ public void onNeighborChanged() { @Override public void onEntityCollision(final Entity entity) { - if (this.isAccepting - && entity instanceof EntityItem + if (this.isAccepting && entity instanceof EntityItem && !entity.isDead && Platform.isServer() && this.getProxy().isActive()) { @@ -335,8 +334,8 @@ private IAEItemStack storeItemStack(final ItemStack item) { try { final IStorageGrid storage = this.getProxy().getStorage(); final IEnergyGrid energy = this.getProxy().getEnergy(); - final IAEItemStack overflow = - Platform.poweredInsert(energy, storage.getItemInventory(), itemToStore, this.mySrc); + final IAEItemStack overflow = Platform + .poweredInsert(energy, storage.getItemInventory(), itemToStore, this.mySrc); this.isAccepting = overflow == null; @@ -349,9 +348,8 @@ private IAEItemStack storeItemStack(final ItemStack item) { } /** - * Handles a possible overflow or none at all. - * It will update the entity to match the leftover stack size as well as mark it as dead without any leftover - * amount. + * Handles a possible overflow or none at all. It will update the entity to match the leftover stack size as well as + * mark it as dead without any leftover amount. * * @param entityItem the entity to update or destroy * @param overflow the leftover {@link IAEItemStack} @@ -434,9 +432,9 @@ private TickRateModulation breakBlock(final boolean modulate) { final List items = this.obtainBlockDrops(w, x, y, z); final float requiredPower = this.calculateEnergyUsage(w, x, y, z, items); - final boolean hasPower = - energy.extractAEPower(requiredPower, Actionable.SIMULATE, PowerMultiplier.CONFIG) - > requiredPower - 0.1; + final boolean hasPower = energy + .extractAEPower(requiredPower, Actionable.SIMULATE, PowerMultiplier.CONFIG) + > requiredPower - 0.1; final boolean canStore = this.canStoreItemStacks(items); if (hasPower && canStore) { @@ -444,7 +442,13 @@ private TickRateModulation breakBlock(final boolean modulate) { energy.extractAEPower(requiredPower, Actionable.MODULATE, PowerMultiplier.CONFIG); this.breakBlockAndStoreItems(w, x, y, z, items); ServerHelper.proxy.sendToAllNearExcept( - null, x, y, z, 64, w, new PacketTransitionEffect(x, y, z, this.getSide(), true)); + null, + x, + y, + z, + 64, + w, + new PacketTransitionEffect(x, y, z, this.getSide(), true)); } else { this.breaking = true; TickHandler.INSTANCE.addCallable(this.getTile().getWorldObj(), this); @@ -464,7 +468,10 @@ private TickRateModulation breakBlock(final boolean modulate) { @Override public TickingRequest getTickingRequest(final IGridNode node) { return new TickingRequest( - TickRates.AnnihilationPlane.getMin(), TickRates.AnnihilationPlane.getMax(), false, true); + TickRates.AnnihilationPlane.getMin(), + TickRates.AnnihilationPlane.getMax(), + false, + true); } @Override @@ -489,23 +496,26 @@ private boolean canHandleBlock(final WorldServer w, final int x, final int y, fi final Block block = w.getBlock(x, y, z); final Material material = block.getMaterial(); final float hardness = block.getBlockHardness(w, x, y, z); - final boolean ignoreMaterials = material == Material.air - || material == Material.lava + final boolean ignoreMaterials = material == Material.air || material == Material.lava || material == Material.water || material.isLiquid(); - final boolean ignoreBlocks = block == Blocks.bedrock - || block == Blocks.end_portal + final boolean ignoreBlocks = block == Blocks.bedrock || block == Blocks.end_portal || block == Blocks.end_portal_frame || block == Blocks.command_block; final EntityPlayer player = owner == null ? Platform.getPlayer(w) : owner; if (permissionCache == YesNo.UNDECIDED) { - BlockEvent.BreakEvent event = - new BlockEvent.BreakEvent(x, y, z, w, block, w.getBlockMetadata(x, y, z), player); + BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( + x, + y, + z, + w, + block, + w.getBlockMetadata(x, y, z), + player); MinecraftForge.EVENT_BUS.post(event); permissionCache = (event.isCanceled()) ? YesNo.NO : YesNo.YES; } - return permissionCache == YesNo.YES - && !ignoreMaterials + return permissionCache == YesNo.YES && !ignoreMaterials && !ignoreBlocks && !w.isAirBlock(x, y, z) && w.blockExists(x, y, z) @@ -521,8 +531,8 @@ protected List obtainBlockDrops(final WorldServer w, final int x, fin /** * Checks if this plane can handle the block at the specific coordinates. */ - protected float calculateEnergyUsage( - final WorldServer w, final int x, final int y, final int z, final List items) { + protected float calculateEnergyUsage(final WorldServer w, final int x, final int y, final int z, + final List items) { final Block block = w.getBlock(x, y, z); final float hardness = block.getBlockHardness(w, x, y, z); @@ -550,8 +560,8 @@ private boolean canStoreItemStacks(final List itemStacks) { for (final ItemStack itemStack : itemStacks) { final IAEItemStack itemToTest = AEItemStack.create(itemStack); - final IAEItemStack overflow = - storage.getItemInventory().injectItems(itemToTest, Actionable.SIMULATE, this.mySrc); + final IAEItemStack overflow = storage.getItemInventory() + .injectItems(itemToTest, Actionable.SIMULATE, this.mySrc); if (overflow == null || itemToTest.getStackSize() > overflow.getStackSize()) { canStore = true; } @@ -564,8 +574,8 @@ private boolean canStoreItemStacks(final List itemStacks) { return canStore; } - private void breakBlockAndStoreItems( - final WorldServer w, final int x, final int y, final int z, final List items) { + private void breakBlockAndStoreItems(final WorldServer w, final int x, final int y, final int z, + final List items) { w.setBlock(x, y, z, Platform.AIR_BLOCK, 0, 3); final AxisAlignedBB box = AxisAlignedBB.getBoundingBox(x - 0.2, y - 0.2, z - 0.2, x + 1.2, y + 1.2, z + 1.2); diff --git a/src/main/java/appeng/parts/automation/PartExportBus.java b/src/main/java/appeng/parts/automation/PartExportBus.java index 3510d2385b9..725eaf32326 100644 --- a/src/main/java/appeng/parts/automation/PartExportBus.java +++ b/src/main/java/appeng/parts/automation/PartExportBus.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; + import appeng.api.config.*; import appeng.api.networking.IGridNode; import appeng.api.networking.crafting.ICraftingGrid; @@ -44,17 +42,15 @@ import appeng.util.Platform; import appeng.util.item.AEItemStack; import appeng.util.prioitylist.OreFilteredList; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Vec3; public class PartExportBus extends PartSharedItemBus implements ICraftingRequester { + private final MultiCraftingTracker craftingTracker = new MultiCraftingTracker(this, 9); private final BaseActionSource mySrc; private long itemToSend = 1; @@ -101,8 +97,8 @@ protected TickRateModulation doBusWork() { final IEnergyGrid energy = this.getProxy().getEnergy(); final ICraftingGrid cg = this.getProxy().getCrafting(); final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting(Settings.FUZZY_MODE); - final SchedulingMode schedulingMode = - (SchedulingMode) this.getConfigManager().getSetting(Settings.SCHEDULING_MODE); + final SchedulingMode schedulingMode = (SchedulingMode) this.getConfigManager() + .getSetting(Settings.SCHEDULING_MODE); if (destination != null) { if (this.getInstalledUpgrades(Upgrades.ORE_FILTER) == 0) { @@ -116,15 +112,14 @@ protected TickRateModulation doBusWork() { if (ais == null || this.itemToSend <= 0 || this.craftOnly()) { if (this.isCraftingEnabled()) { this.didSomething = this.craftingTracker.handleCrafting( - slotToExport, - this.itemToSend, - ais, - destination, - this.getTile().getWorldObj(), - this.getProxy().getGrid(), - cg, - this.mySrc) - || this.didSomething; + slotToExport, + this.itemToSend, + ais, + destination, + this.getTile().getWorldObj(), + this.getProxy().getGrid(), + cg, + this.mySrc) || this.didSomething; } continue; } @@ -132,8 +127,8 @@ protected TickRateModulation doBusWork() { final long before = this.itemToSend; if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0) { - for (final IAEItemStack o : - ImmutableList.copyOf(inv.getStorageList().findFuzzy(ais, fzMode))) { + for (final IAEItemStack o : ImmutableList + .copyOf(inv.getStorageList().findFuzzy(ais, fzMode))) { this.pushItemIntoTarget(destination, energy, inv, o); if (this.itemToSend <= 0) { break; @@ -145,15 +140,14 @@ protected TickRateModulation doBusWork() { if (this.itemToSend == before && this.isCraftingEnabled()) { this.didSomething = this.craftingTracker.handleCrafting( - slotToExport, - this.itemToSend, - ais, - destination, - this.getTile().getWorldObj(), - this.getProxy().getGrid(), - cg, - this.mySrc) - || this.didSomething; + slotToExport, + this.itemToSend, + ais, + destination, + this.getTile().getWorldObj(), + this.getProxy().getGrid(), + cg, + this.mySrc) || this.didSomething; } } @@ -208,8 +202,8 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture( CableBusTextures.PartExportSides.getIcon(), @@ -322,11 +316,8 @@ private boolean isCraftingEnabled() { return this.getInstalledUpgrades(Upgrades.CRAFTING) > 0; } - private void pushItemIntoTarget( - final InventoryAdaptor d, - final IEnergyGrid energy, - final IMEInventory inv, - IAEItemStack ais) { + private void pushItemIntoTarget(final InventoryAdaptor d, final IEnergyGrid energy, + final IMEInventory inv, IAEItemStack ais) { final ItemStack is = ais.getItemStack(); is.stackSize = (int) this.itemToSend; diff --git a/src/main/java/appeng/parts/automation/PartFormationPlane.java b/src/main/java/appeng/parts/automation/PartFormationPlane.java index b3e0ba33ffe..38670b49122 100644 --- a/src/main/java/appeng/parts/automation/PartFormationPlane.java +++ b/src/main/java/appeng/parts/automation/PartFormationPlane.java @@ -1,23 +1,37 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.*; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.BlockSnapshot; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.world.BlockEvent; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.networking.events.MENetworkCellArrayUpdate; @@ -47,29 +61,10 @@ import appeng.util.prioitylist.PrecisePriorityList; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.*; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.BlockSnapshot; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.world.BlockEvent; public class PartFormationPlane extends PartUpgradeable implements ICellContainer, IPriorityHost, IMEInventory { + private final MEInventoryHandler myHandler = new MEInventoryHandler(this, StorageChannel.ITEMS); private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory(this, 63); private EntityPlayer owner = null; @@ -108,8 +103,10 @@ private void updateHandler() { } if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0) { - this.myHandler.setPartitionList(new FuzzyPriorityList( - priorityList, (FuzzyMode) this.getConfigManager().getSetting(Settings.FUZZY_MODE))); + this.myHandler.setPartitionList( + new FuzzyPriorityList( + priorityList, + (FuzzyMode) this.getConfigManager().getSetting(Settings.FUZZY_MODE))); } else { this.myHandler.setPartitionList(new PrecisePriorityList(priorityList)); } @@ -133,12 +130,8 @@ public void updateSetting(final IConfigManager manager, final Enum settingName, } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { super.onChangeInventory(inv, slot, mc, removedStack, newStack); if (inv == this.Config) { @@ -215,22 +208,26 @@ public void getBoxes(final IPartCollisionHelper bch) { final ForgeDirection u = bch.getWorldY(); if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), + this.getSide())) { minX = 0; } if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), + this.getSide())) { maxX = 16; } if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), + this.getSide())) { minY = 0; } if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), + this.getSide())) { maxY = 16; } } @@ -259,8 +256,8 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { int minX = 1; final ForgeDirection e = rh.getWorldX(); @@ -269,25 +266,29 @@ public void renderStatic( final TileEntity te = this.getHost().getTile(); if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - e.offsetX, y - e.offsetY, z - e.offsetZ), + this.getSide())) { minX = 0; } int maxX = 15; if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + e.offsetX, y + e.offsetY, z + e.offsetZ), + this.getSide())) { maxX = 16; } int minY = 1; if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x - u.offsetX, y - u.offsetY, z - u.offsetZ), + this.getSide())) { minY = 0; } int maxY = 15; if (this.isTransitionPlane( - te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), this.getSide())) { + te.getWorldObj().getTileEntity(x + u.offsetX, y + u.offsetY, z + u.offsetZ), + this.getSide())) { maxY = 16; } @@ -299,9 +300,7 @@ public void renderStatic( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), - isActive - ? CableBusTextures.BlockFormPlaneOn.getIcon() - : this.getItemStack().getIconIndex(), + isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.getItemStack().getIconIndex(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon()); @@ -312,9 +311,7 @@ public void renderStatic( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), - isActive - ? CableBusTextures.BlockFormPlaneOn.getIcon() - : this.getItemStack().getIconIndex(), + isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : this.getItemStack().getIconIndex(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon()); @@ -414,12 +411,10 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, final int z = te.zCoord + side.offsetZ; if (w.getBlock(x, y, z).isReplaceable(w, x, y, z)) { - if (placeBlock == YesNo.YES - && (i instanceof ItemBlock - || i instanceof IPlantable - || i instanceof ItemSkull - || i instanceof ItemFirework - || i instanceof ItemReed)) { + if (placeBlock == YesNo.YES && (i instanceof ItemBlock || i instanceof IPlantable + || i instanceof ItemSkull + || i instanceof ItemFirework + || i instanceof ItemReed)) { final EntityPlayer player = Platform.getPlayer((WorldServer) w); Platform.configurePlayer(player, side, this.getTile()); @@ -512,9 +507,16 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, } else { player.setCurrentItemOrArmor(0, is.copy()); BlockSnapshot blockSnapshot = new BlockSnapshot( - w, x, y, z, ((ItemBlock) i).field_150939_a, i.getMetadata(is.getItemDamage())); + w, + x, + y, + z, + ((ItemBlock) i).field_150939_a, + i.getMetadata(is.getItemDamage())); BlockEvent.PlaceEvent event = new BlockEvent.PlaceEvent( - blockSnapshot, w.getBlock(x, y, z), owner == null ? player : owner); + blockSnapshot, + w.getBlock(x, y, z), + owner == null ? player : owner); MinecraftForge.EVENT_BUS.post(event); if (!event.isCanceled()) { i.onItemUse( @@ -548,16 +550,13 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, is.stackSize = (int) maxStorage; final EntityItem ei = new EntityItem( w, - ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) - + 0.5 + ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetX * -0.3 + x, - ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) - + 0.5 + ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetY * -0.3 + y, - ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) - + 0.5 + ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetZ * -0.3 + z, is.copy()); @@ -579,8 +578,8 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, if (!w.spawnEntityInWorld(result)) { if (((EntityItem) result).getEntityItem().getItem() - == Item.getItemFromBlock( - Blocks.dragon_egg)) { // Ducttape fix for HEE replacing the Dragon Egg + == Item.getItemFromBlock(Blocks.dragon_egg)) { // Ducttape fix for HEE replacing the + // Dragon Egg // HEE does cancel the event but does not mark passed entity as dead worked = true; } else { diff --git a/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java b/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java index 0bbd5a28017..dbc392532f3 100644 --- a/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java +++ b/src/main/java/appeng/parts/automation/PartIdentityAnnihilationPlane.java @@ -1,32 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; -import appeng.api.parts.IPart; -import appeng.api.parts.IPartHost; -import appeng.api.parts.IPartRenderHelper; -import appeng.client.texture.CableBusTextures; -import appeng.util.Platform; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.player.EntityPlayer; @@ -37,7 +23,16 @@ import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPart; +import appeng.api.parts.IPartHost; +import appeng.api.parts.IPartRenderHelper; +import appeng.client.texture.CableBusTextures; +import appeng.util.Platform; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane { + private static final IIcon ACTIVE_ICON = CableBusTextures.BlockIdentityAnnihilationPlaneOn.getIcon(); private static final float SILK_TOUCH_FACTOR = 16; @@ -48,8 +43,8 @@ public PartIdentityAnnihilationPlane(final ItemStack is) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.renderStaticWithIcon(x, y, z, rh, renderer, ACTIVE_ICON); } @@ -63,8 +58,8 @@ protected boolean isAnnihilationPlane(final TileEntity blockTileEntity, final Fo } @Override - protected float calculateEnergyUsage( - final WorldServer w, final int x, final int y, final int z, final List items) { + protected float calculateEnergyUsage(final WorldServer w, final int x, final int y, final int z, + final List items) { final float requiredEnergy = super.calculateEnergyUsage(w, x, y, z, items); return requiredEnergy * SILK_TOUCH_FACTOR; diff --git a/src/main/java/appeng/parts/automation/PartImportBus.java b/src/main/java/appeng/parts/automation/PartImportBus.java index 05f01712d06..c5dcc8096a7 100644 --- a/src/main/java/appeng/parts/automation/PartImportBus.java +++ b/src/main/java/appeng/parts/automation/PartImportBus.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Vec3; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.networking.IGridNode; @@ -45,12 +42,9 @@ import appeng.util.prioitylist.OreFilteredList; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; public class PartImportBus extends PartSharedItemBus implements IInventoryDestination { + private final BaseActionSource source; private IMEInventory destination = null; private IAEItemStack lastItemChecked = null; @@ -112,8 +106,8 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture( CableBusTextures.PartImportSides.getIcon(), @@ -167,7 +161,10 @@ public boolean onPartActivate(final EntityPlayer player, final Vec3 pos) { @Override public TickingRequest getTickingRequest(final IGridNode node) { return new TickingRequest( - TickRates.ImportBus.getMin(), TickRates.ImportBus.getMax(), this.getHandler() == null, false); + TickRates.ImportBus.getMin(), + TickRates.ImportBus.getMax(), + this.getHandler() == null, + false); } @Override @@ -189,13 +186,12 @@ protected TickRateModulation doBusWork() { if (myAdaptor != null) { try { this.itemToSend = this.calculateItemsToSend(); - this.itemToSend = Math.min(this.itemToSend, (int) (0.01 - + this.getProxy() - .getEnergy() + this.itemToSend = Math.min( + this.itemToSend, + (int) (0.01 + this.getProxy().getEnergy() .extractAEPower(this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG))); - final IMEMonitor inv = - this.getProxy().getStorage().getItemInventory(); + final IMEMonitor inv = this.getProxy().getStorage().getItemInventory(); final IEnergyGrid energy = this.getProxy().getEnergy(); boolean configured = false; @@ -216,8 +212,7 @@ protected TickRateModulation doBusWork() { if (filterPredicate == null) filterPredicate = OreFilteredList.makeFilter(oreFilterString); for (ItemSlot slot : myAdaptor) { if (this.itemToSend <= 0) break; - if (slot.isExtractable() - && filterPredicate != null + if (slot.isExtractable() && filterPredicate != null && filterPredicate.test(slot.getAEItemStack())) { while (this.itemToSend > 0) { if (this.importStuff(myAdaptor, slot.getAEItemStack(), inv, energy, fzMode)) break; @@ -243,12 +238,8 @@ protected TickRateModulation doBusWork() { return this.worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } - private boolean importStuff( - final InventoryAdaptor myAdaptor, - final IAEItemStack whatToImport, - final IMEMonitor inv, - final IEnergySource energy, - final FuzzyMode fzMode) { + private boolean importStuff(final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, + final IMEMonitor inv, final IEnergySource energy, final FuzzyMode fzMode) { final int toSend = this.calculateMaximumAmountToImport(myAdaptor, whatToImport, inv, fzMode); final ItemStack newItems; @@ -260,14 +251,15 @@ private boolean importStuff( this.configDestination(inv)); } else { newItems = myAdaptor.removeItems( - toSend, whatToImport == null ? null : whatToImport.getItemStack(), this.configDestination(inv)); + toSend, + whatToImport == null ? null : whatToImport.getItemStack(), + this.configDestination(inv)); } if (newItems != null) { newItems.stackSize = (int) (Math.min( - newItems.stackSize, - energy.extractAEPower(newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG)) - + 0.01); + newItems.stackSize, + energy.extractAEPower(newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG)) + 0.01); this.itemToSend -= newItems.stackSize; if (this.lastItemChecked == null || !this.lastItemChecked.isSameType(newItems)) { @@ -276,8 +268,8 @@ private boolean importStuff( this.lastItemChecked.setStackSize(newItems.stackSize); } - final IAEItemStack failed = - Platform.poweredInsert(energy, this.destination, this.lastItemChecked, this.source); + final IAEItemStack failed = Platform + .poweredInsert(energy, this.destination, this.lastItemChecked, this.source); if (failed != null) { myAdaptor.addItems(failed.getItemStack()); @@ -292,11 +284,8 @@ private boolean importStuff( return false; } - private int calculateMaximumAmountToImport( - final InventoryAdaptor myAdaptor, - final IAEItemStack whatToImport, - final IMEMonitor inv, - final FuzzyMode fzMode) { + private int calculateMaximumAmountToImport(final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, + final IMEMonitor inv, final FuzzyMode fzMode) { final int toSend = Math.min(this.itemToSend, 64); final ItemStack itemStackToImport; @@ -313,8 +302,8 @@ private int calculateMaximumAmountToImport( } else { simResult = myAdaptor.simulateRemove(toSend, itemStackToImport, this.configDestination(inv)); } - itemAmountNotStorable = - this.destination.injectItems(AEItemStack.create(simResult), Actionable.SIMULATE, this.source); + itemAmountNotStorable = this.destination + .injectItems(AEItemStack.create(simResult), Actionable.SIMULATE, this.source); if (itemAmountNotStorable != null) { return (int) Math.min(simResult.stackSize - itemAmountNotStorable.getStackSize(), toSend); diff --git a/src/main/java/appeng/parts/automation/PartLevelEmitter.java b/src/main/java/appeng/parts/automation/PartLevelEmitter.java index 7ce4fc99548..5b3a156b1dc 100644 --- a/src/main/java/appeng/parts/automation/PartLevelEmitter.java +++ b/src/main/java/appeng/parts/automation/PartLevelEmitter.java @@ -1,23 +1,32 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import java.util.Collection; +import java.util.Random; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.*; import appeng.api.networking.IGridNode; import appeng.api.networking.crafting.*; @@ -56,29 +65,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Collection; -import java.util.Random; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -public class PartLevelEmitter extends PartUpgradeable - implements IEnergyWatcherHost, - IStackWatcherHost, - ICraftingWatcherHost, - IMEMonitorHandlerReceiver, - ICraftingProvider, - IGridTickable { +public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherHost, IStackWatcherHost, + ICraftingWatcherHost, IMEMonitorHandlerReceiver, ICraftingProvider, IGridTickable { private static final int FLAG_ON = 8; @@ -167,10 +156,9 @@ private boolean isLevelEmitterOn() { return this.prevState; } - final boolean flipState = - this.getConfigManager().getSetting(Settings.REDSTONE_EMITTER) == RedstoneMode.LOW_SIGNAL; - return flipState - ? this.reportingValue >= this.lastReportedValue + 1 + final boolean flipState = this.getConfigManager().getSetting(Settings.REDSTONE_EMITTER) + == RedstoneMode.LOW_SIGNAL; + return flipState ? this.reportingValue >= this.lastReportedValue + 1 : this.reportingValue < this.lastReportedValue + 1; } @@ -217,10 +205,7 @@ private void configureWatchers() { } try { - this.getProxy() - .getGrid() - .postEvent(new MENetworkCraftingPatternChange( - this, this.getProxy().getNode())); + this.getProxy().getGrid().postEvent(new MENetworkCraftingPatternChange(this, this.getProxy().getNode())); } catch (final GridAccessException e1) { // :/ } @@ -254,10 +239,7 @@ private void configureWatchers() { try { if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0 || myStack == null) { - this.getProxy() - .getStorage() - .getItemInventory() - .addListener(this, this.getProxy().getGrid()); + this.getProxy().getStorage().getItemInventory().addListener(this, this.getProxy().getGrid()); } else { this.getProxy().getStorage().getItemInventory().removeListener(this); @@ -306,14 +288,9 @@ public void updateWatcher(final IStackWatcher newWatcher) { } @Override - public void onStackChange( - final IItemList o, - final IAEStack fullStack, - final IAEStack diffStack, - final BaseActionSource src, - final StorageChannel chan) { - if (chan == StorageChannel.ITEMS - && fullStack.equals(this.config.getAEStackInSlot(0)) + public void onStackChange(final IItemList o, final IAEStack fullStack, final IAEStack diffStack, + final BaseActionSource src, final StorageChannel chan) { + if (chan == StorageChannel.ITEMS && fullStack.equals(this.config.getAEStackInSlot(0)) && this.getInstalledUpgrades(Upgrades.FUZZY) == 0) { this.lastReportedValue = fullStack.getStackSize(); this.updateState(); @@ -366,9 +343,7 @@ public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall) } @Override - public void postChange( - final IBaseMonitor monitor, - final Iterable change, + public void postChange(final IBaseMonitor monitor, final Iterable change, final BaseActionSource actionSource) { if (canDoWork()) { if (delayedUpdatesQueued) { @@ -613,8 +588,8 @@ private void addVertexWithUV(double x, double y, double z, final double u, final @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { rh.setTexture(this.getItemStack().getIconIndex()); // rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() ); @@ -627,8 +602,7 @@ public void renderStatic( renderer.renderAllFaces = true; final Tessellator tess = Tessellator.instance; - tess.setBrightness(rh.getBlock() - .getMixedBrightnessForBlock(this.getHost().getTile().getWorldObj(), x, y, z)); + tess.setBrightness(rh.getBlock().getMixedBrightnessForBlock(this.getHost().getTile().getWorldObj(), x, y, z)); tess.setColorOpaque_F(1.0F, 1.0F, 1.0F); this.renderTorchAtAngle(x, y, z); @@ -689,12 +663,8 @@ public void updateSetting(final IConfigManager manager, final Enum settingName, } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { if (inv == this.config) { this.configureWatchers(); } diff --git a/src/main/java/appeng/parts/automation/PartSharedItemBus.java b/src/main/java/appeng/parts/automation/PartSharedItemBus.java index 771f67a9e1f..2bcfd378093 100644 --- a/src/main/java/appeng/parts/automation/PartSharedItemBus.java +++ b/src/main/java/appeng/parts/automation/PartSharedItemBus.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import java.util.function.Predicate; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import appeng.api.config.RedstoneMode; import appeng.api.config.Upgrades; import appeng.api.networking.ticking.IGridTickable; @@ -28,13 +27,9 @@ import appeng.tile.inventory.AppEngInternalAEInventory; import appeng.util.InventoryAdaptor; import appeng.util.Platform; -import java.util.function.Predicate; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public abstract class PartSharedItemBus extends PartUpgradeable implements IGridTickable, IOreFilterable { + private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, 9); private int adaptorHash = 0; private InventoryAdaptor adaptor; @@ -110,9 +105,7 @@ protected InventoryAdaptor getHandler() { } protected int availableSlots() { - return Math.min( - 1 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 4, - this.getConfig().getSizeInventory()); + return Math.min(1 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 4, this.getConfig().getSizeInventory()); } protected int calculateItemsToSend() { diff --git a/src/main/java/appeng/parts/automation/PartUpgradeable.java b/src/main/java/appeng/parts/automation/PartUpgradeable.java index 45634a3d856..bb5bfa589c8 100644 --- a/src/main/java/appeng/parts/automation/PartUpgradeable.java +++ b/src/main/java/appeng/parts/automation/PartUpgradeable.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.config.RedstoneMode; import appeng.api.config.Upgrades; import appeng.api.util.IConfigManager; @@ -26,11 +23,9 @@ import appeng.tile.inventory.InvOperation; import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public abstract class PartUpgradeable extends PartBasicState implements IAEAppEngInventory, IConfigManagerHost { + private final IConfigManager manager; private final UpgradeInventory upgrades; @@ -49,12 +44,8 @@ protected int getUpgradeSlots() { public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {} @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { if (inv == this.upgrades) { this.upgradesChanged(); } diff --git a/src/main/java/appeng/parts/automation/StackUpgradeInventory.java b/src/main/java/appeng/parts/automation/StackUpgradeInventory.java index 2c49ebce6fd..1370b766bc2 100644 --- a/src/main/java/appeng/parts/automation/StackUpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/StackUpgradeInventory.java @@ -1,11 +1,13 @@ package appeng.parts.automation; +import net.minecraft.item.ItemStack; + import appeng.api.config.Upgrades; import appeng.tile.inventory.IAEAppEngInventory; import appeng.util.Platform; -import net.minecraft.item.ItemStack; public class StackUpgradeInventory extends UpgradeInventory { + private final ItemStack stack; public StackUpgradeInventory(final ItemStack stack, final IAEAppEngInventory inventory, final int s) { diff --git a/src/main/java/appeng/parts/automation/UpgradeInventory.java b/src/main/java/appeng/parts/automation/UpgradeInventory.java index 5bef90c32b8..1fc4a900785 100644 --- a/src/main/java/appeng/parts/automation/UpgradeInventory.java +++ b/src/main/java/appeng/parts/automation/UpgradeInventory.java @@ -1,35 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.automation; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.Upgrades; import appeng.api.implementations.items.IUpgradeModule; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.IAEAppEngInventory; import appeng.tile.inventory.InvOperation; import appeng.util.Platform; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public abstract class UpgradeInventory extends AppEngInternalInventory implements IAEAppEngInventory { + private final IAEAppEngInventory parent; private boolean cached = false; @@ -107,9 +101,7 @@ public int getInstalledUpgrades(final Upgrades u) { private void updateUpgradeInfo() { this.cached = true; - this.patternCapacityUpgrades = this.inverterUpgrades = - this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.superSpeedUpgrades = - this.fuzzyUpgrades = this.craftingUpgrades = this.oreFilterUpgrades = 0; + this.patternCapacityUpgrades = this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.superSpeedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = this.oreFilterUpgrades = 0; for (final ItemStack is : this) { if (is == null || is.getItem() == null || !(is.getItem() instanceof IUpgradeModule)) { @@ -157,8 +149,8 @@ private void updateUpgradeInfo() { this.superSpeedUpgrades = Math.min(this.superSpeedUpgrades, this.getMaxInstalled(Upgrades.SPEED)); this.inverterUpgrades = Math.min(this.inverterUpgrades, this.getMaxInstalled(Upgrades.INVERTER)); this.craftingUpgrades = Math.min(this.craftingUpgrades, this.getMaxInstalled(Upgrades.CRAFTING)); - this.patternCapacityUpgrades = - Math.min(this.patternCapacityUpgrades, this.getMaxInstalled(Upgrades.PATTERN_CAPACITY)); + this.patternCapacityUpgrades = Math + .min(this.patternCapacityUpgrades, this.getMaxInstalled(Upgrades.PATTERN_CAPACITY)); this.oreFilterUpgrades = Math.min(this.oreFilterUpgrades, this.getMaxInstalled(Upgrades.ORE_FILTER)); } @@ -174,12 +166,8 @@ public void saveChanges() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { this.cached = false; if (this.parent != null && Platform.isServer()) { this.parent.onChangeInventory(inv, slot, mc, removedStack, newStack); diff --git a/src/main/java/appeng/parts/layers/InvLayerData.java b/src/main/java/appeng/parts/layers/InvLayerData.java index 86d9a3b19ad..81c0197442e 100644 --- a/src/main/java/appeng/parts/layers/InvLayerData.java +++ b/src/main/java/appeng/parts/layers/InvLayerData.java @@ -1,24 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; import java.util.List; + import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/appeng/parts/layers/InvSot.java b/src/main/java/appeng/parts/layers/InvSot.java index 3099c644b6d..0241df78420 100644 --- a/src/main/java/appeng/parts/layers/InvSot.java +++ b/src/main/java/appeng/parts/layers/InvSot.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; diff --git a/src/main/java/appeng/parts/layers/LayerIEnergyConnected.java b/src/main/java/appeng/parts/layers/LayerIEnergyConnected.java index 10317dbb589..dcbcd17a85d 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergyConnected.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergyConnected.java @@ -1,14 +1,5 @@ package appeng.parts.layers; -import appeng.api.parts.IPart; -import appeng.api.parts.LayerBase; -import appeng.integration.IntegrationType; -import appeng.parts.p2p.IPartGT5Power; -import appeng.transformer.annotations.Integration; -import gregtech.api.interfaces.tileentity.IEnergyConnected; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; -import ic2.api.energy.tile.IEnergySink; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -19,8 +10,19 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidHandler; +import appeng.api.parts.IPart; +import appeng.api.parts.LayerBase; +import appeng.integration.IntegrationType; +import appeng.parts.p2p.IPartGT5Power; +import appeng.transformer.annotations.Integration; +import gregtech.api.interfaces.tileentity.IEnergyConnected; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import ic2.api.energy.tile.IEnergySink; + @Integration.Interface(iname = IntegrationType.GT, iface = "gregtech.api.interfaces.tileentity.IEnergyConnected") public class LayerIEnergyConnected extends LayerBase implements IEnergyConnected { + public LayerIEnergyConnected() {} public long injectEnergyUnits(byte side, long voltage, long amperage) { @@ -33,12 +35,9 @@ public long injectEnergyUnits(byte side, long voltage, long amperage) { TileEntity source = this.getTileEntityAtSide(side); if (source != null && ((IEnergySink) part).acceptsEnergyFrom(source, dir)) { long rUsedAmperes; - for (rUsedAmperes = 0L; - amperage > rUsedAmperes - && ((IEnergySink) part).getDemandedEnergy() > 0.0D - && ((IEnergySink) part).injectEnergy(dir, (double) voltage, (double) voltage) - < (double) voltage; - ++rUsedAmperes) {} + for (rUsedAmperes = 0L; amperage > rUsedAmperes && ((IEnergySink) part).getDemandedEnergy() > 0.0D + && ((IEnergySink) part).injectEnergy(dir, (double) voltage, (double) voltage) + < (double) voltage; ++rUsedAmperes) {} return rUsedAmperes; } @@ -247,8 +246,7 @@ public final TileEntity getTileEntityOffset(int aX, int aY, int aZ) { } public final TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) { - return aDistance == 1 - ? this.getTileEntityAtSide(aSide) + return aDistance == 1 ? this.getTileEntityAtSide(aSide) : this.getTileEntity( this.getOffsetX(aSide, aDistance), this.getOffsetY(aSide, aDistance), @@ -320,20 +318,17 @@ private boolean crossedChunkBorder(int aX, int aZ) { } public final Block getBlock(int aX, int aY, int aZ) { - return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) - ? Blocks.air + return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) ? Blocks.air : this.worldObj.getBlock(aX, aY, aZ); } public final byte getMetaID(int aX, int aY, int aZ) { - return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) - ? 0 + return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) ? 0 : (byte) this.worldObj.getBlockMetadata(aX, aY, aZ); } public final byte getLightLevel(int aX, int aY, int aZ) { - return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) - ? 0 + return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) ? 0 : (byte) ((int) (this.worldObj.getLightBrightness(aX, aY, aZ) * 15.0F)); } @@ -353,8 +348,7 @@ public final boolean getAir(int aX, int aY, int aZ) { } public final TileEntity getTileEntity(int aX, int aY, int aZ) { - return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) - ? null + return this.crossedChunkBorder(aX, aZ) && !this.worldObj.blockExists(aX, aY, aZ) ? null : this.worldObj.getTileEntity(aX, aY, aZ); } @@ -362,8 +356,7 @@ public final TileEntity getTileEntityAtSide(byte aSide) { int tX = this.getOffsetX(aSide, 1); int tY = this.getOffsetY(aSide, 1); int tZ = this.getOffsetZ(aSide, 1); - return this.crossedChunkBorder(tX, tZ) && !this.worldObj.blockExists(tX, tY, tZ) - ? null + return this.crossedChunkBorder(tX, tZ) && !this.worldObj.blockExists(tX, tY, tZ) ? null : this.worldObj.getTileEntity(tX, tY, tZ); } diff --git a/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java b/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java index ffc1080b754..45f73950e40 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergyHandler.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.parts.IPart; import appeng.api.parts.LayerBase; import cofh.api.energy.IEnergyConnection; import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; -import net.minecraftforge.common.util.ForgeDirection; public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler { diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySink.java b/src/main/java/appeng/parts/layers/LayerIEnergySink.java index 4ca4aa529d4..dcb5739d8af 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySink.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySink.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.parts.IPart; import appeng.api.parts.IPartHost; import appeng.api.parts.LayerBase; @@ -26,10 +23,6 @@ import ic2.api.energy.tile.IEnergyAcceptor; import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergyTile; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; public class LayerIEnergySink extends LayerBase implements IEnergySink { @@ -66,8 +59,8 @@ private void addToENet() { if (!this.isInIC2() && Platform.isServer() && this.isTileValid()) { this.getLayerFlags().add(LayerFlags.IC2_ENET); - MinecraftForge.EVENT_BUS.post( - new ic2.api.energy.event.EnergyTileLoadEvent((IEnergyTile) this.getEnergySinkTile())); + MinecraftForge.EVENT_BUS + .post(new ic2.api.energy.event.EnergyTileLoadEvent((IEnergyTile) this.getEnergySinkTile())); } } @@ -78,8 +71,8 @@ private void removeFromENet() { if (this.isInIC2() && Platform.isServer()) { this.getLayerFlags().remove(LayerFlags.IC2_ENET); - MinecraftForge.EVENT_BUS.post( - new ic2.api.energy.event.EnergyTileUnloadEvent((IEnergyTile) this.getEnergySinkTile())); + MinecraftForge.EVENT_BUS + .post(new ic2.api.energy.event.EnergyTileUnloadEvent((IEnergyTile) this.getEnergySinkTile())); } } diff --git a/src/main/java/appeng/parts/layers/LayerIEnergySource.java b/src/main/java/appeng/parts/layers/LayerIEnergySource.java index 1d992896bac..ff63ec72735 100644 --- a/src/main/java/appeng/parts/layers/LayerIEnergySource.java +++ b/src/main/java/appeng/parts/layers/LayerIEnergySource.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.parts.IPart; import appeng.api.parts.IPartHost; import appeng.api.parts.LayerBase; @@ -27,10 +24,6 @@ import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySource; import ic2.api.energy.tile.IEnergyTile; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; public class LayerIEnergySource extends LayerBase implements IEnergySource { @@ -64,8 +57,8 @@ private void addToENet() { if (!this.isInIC2() && Platform.isServer() && this.isTileValid()) { this.getLayerFlags().add(LayerFlags.IC2_ENET); - MinecraftForge.EVENT_BUS.post( - new ic2.api.energy.event.EnergyTileLoadEvent((IEnergyTile) this.getEnergySourceTile())); + MinecraftForge.EVENT_BUS + .post(new ic2.api.energy.event.EnergyTileLoadEvent((IEnergyTile) this.getEnergySourceTile())); } } @@ -76,8 +69,8 @@ private void removeFromENet() { if (this.isInIC2() && Platform.isServer()) { this.getLayerFlags().remove(LayerFlags.IC2_ENET); - MinecraftForge.EVENT_BUS.post( - new ic2.api.energy.event.EnergyTileUnloadEvent((IEnergyTile) this.getEnergySourceTile())); + MinecraftForge.EVENT_BUS + .post(new ic2.api.energy.event.EnergyTileUnloadEvent((IEnergyTile) this.getEnergySourceTile())); } } diff --git a/src/main/java/appeng/parts/layers/LayerIFluidHandler.java b/src/main/java/appeng/parts/layers/LayerIFluidHandler.java index 8c010b9c0a2..ee5ee9203fc 100644 --- a/src/main/java/appeng/parts/layers/LayerIFluidHandler.java +++ b/src/main/java/appeng/parts/layers/LayerIFluidHandler.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; -import appeng.api.parts.IPart; -import appeng.api.parts.LayerBase; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import appeng.api.parts.IPart; +import appeng.api.parts.LayerBase; + public class LayerIFluidHandler extends LayerBase implements IFluidHandler { private static final FluidTankInfo[] EMPTY_LIST = new FluidTankInfo[0]; diff --git a/src/main/java/appeng/parts/layers/LayerIPipeConnection.java b/src/main/java/appeng/parts/layers/LayerIPipeConnection.java index 9d748a6fbd1..724d2a66e70 100644 --- a/src/main/java/appeng/parts/layers/LayerIPipeConnection.java +++ b/src/main/java/appeng/parts/layers/LayerIPipeConnection.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.parts.IPart; import appeng.api.parts.LayerBase; import appeng.helpers.Reflected; import buildcraft.api.transport.IPipeConnection; import buildcraft.api.transport.IPipeTile.PipeType; -import net.minecraftforge.common.util.ForgeDirection; @Reflected public class LayerIPipeConnection extends LayerBase implements IPipeConnection { diff --git a/src/main/java/appeng/parts/layers/LayerISidedInventory.java b/src/main/java/appeng/parts/layers/LayerISidedInventory.java index 11570778ed8..f631fa37e8e 100644 --- a/src/main/java/appeng/parts/layers/LayerISidedInventory.java +++ b/src/main/java/appeng/parts/layers/LayerISidedInventory.java @@ -1,35 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; -import appeng.api.parts.IPart; -import appeng.api.parts.IPartHost; -import appeng.api.parts.LayerBase; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPart; +import appeng.api.parts.IPartHost; +import appeng.api.parts.LayerBase; + /** * Inventory wrapper for parts, *

@@ -71,7 +65,7 @@ public void notifyNeighbors() { if (inventories.isEmpty() || slotCount == 0) { inventories = null; } else { - sideData = new int[][] {NULL_SIDES, NULL_SIDES, NULL_SIDES, NULL_SIDES, NULL_SIDES, NULL_SIDES}; + sideData = new int[][] { NULL_SIDES, NULL_SIDES, NULL_SIDES, NULL_SIDES, NULL_SIDES, NULL_SIDES }; slots = new ArrayList(Collections.nCopies(slotCount, (InvSot) null)); int offsetForLayer = 0; diff --git a/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java b/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java index 31be9291215..bd74559e125 100644 --- a/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java +++ b/src/main/java/appeng/parts/layers/LayerITileStorageMonitorable.java @@ -1,29 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.tiles.ITileStorageMonitorable; import appeng.api.networking.security.BaseActionSource; import appeng.api.parts.IPart; import appeng.api.parts.LayerBase; import appeng.api.storage.IStorageMonitorable; -import net.minecraftforge.common.util.ForgeDirection; public class LayerITileStorageMonitorable extends LayerBase implements ITileStorageMonitorable { diff --git a/src/main/java/appeng/parts/layers/LayerPressure.java b/src/main/java/appeng/parts/layers/LayerPressure.java index e3be68a4e0e..e955f25c5e7 100644 --- a/src/main/java/appeng/parts/layers/LayerPressure.java +++ b/src/main/java/appeng/parts/layers/LayerPressure.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; -import appeng.api.parts.IPart; -import appeng.api.parts.LayerBase; import javax.annotation.Nullable; + import net.minecraftforge.common.util.ForgeDirection; + import pneumaticCraft.api.tileentity.IAirHandler; import pneumaticCraft.api.tileentity.ISidedPneumaticMachine; +import appeng.api.parts.IPart; +import appeng.api.parts.LayerBase; public class LayerPressure extends LayerBase implements ISidedPneumaticMachine { diff --git a/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java b/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java index 39cdb3e202a..879f1fe8f4d 100644 --- a/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java +++ b/src/main/java/appeng/parts/layers/LayerSidedEnvironment.java @@ -1,38 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.layers; +import javax.annotation.Nullable; + +import li.cil.oc.api.network.Node; +import li.cil.oc.api.network.SidedEnvironment; + +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.parts.IPart; import appeng.api.parts.LayerBase; import appeng.core.Registration; import appeng.helpers.Reflected; import cpw.mods.fml.common.event.FMLInitializationEvent; -import javax.annotation.Nullable; -import li.cil.oc.api.network.Node; -import li.cil.oc.api.network.SidedEnvironment; -import net.minecraftforge.common.util.ForgeDirection; /** * Reflected in {@link Registration#initialize(FMLInitializationEvent)} */ @Reflected public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment { + @Nullable @Override public Node sidedNode(final ForgeDirection side) { diff --git a/src/main/java/appeng/parts/misc/PartCableAnchor.java b/src/main/java/appeng/parts/misc/PartCableAnchor.java index 3616dcd97fa..41bf0811205 100644 --- a/src/main/java/appeng/parts/misc/PartCableAnchor.java +++ b/src/main/java/appeng/parts/misc/PartCableAnchor.java @@ -1,31 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.misc; -import appeng.api.networking.IGridNode; -import appeng.api.parts.*; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import io.netty.buffer.ByteBuf; import java.io.IOException; import java.util.List; import java.util.Random; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -38,6 +26,12 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.IGridNode; +import appeng.api.parts.*; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; + public class PartCableAnchor implements IPart { private ISimplifiedBundle renderCache = null; @@ -74,8 +68,8 @@ public void renderInventory(final IPartRenderHelper instance, final RenderBlocks @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.renderCache = rh.useSimplifiedRendering(x, y, z, this, this.renderCache); final IIcon myIcon = this.is.getIconIndex(); rh.setTexture(myIcon); @@ -90,8 +84,8 @@ public void renderStatic( @Override @SideOnly(Side.CLIENT) - public void renderDynamic( - final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer) {} + public void renderDynamic(final double x, final double y, final double z, final IPartRenderHelper rh, + final RenderBlocks renderer) {} @Override public IIcon getBreakingTexture() { diff --git a/src/main/java/appeng/parts/misc/PartInterface.java b/src/main/java/appeng/parts/misc/PartInterface.java index 684b024e006..d9f7fd1515e 100644 --- a/src/main/java/appeng/parts/misc/PartInterface.java +++ b/src/main/java/appeng/parts/misc/PartInterface.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.misc; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Actionable; import appeng.api.config.Upgrades; import appeng.api.implementations.tiles.ITileStorageMonitorable; @@ -50,32 +57,14 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import appeng.util.inv.IInventoryDestination; + import com.google.common.collect.ImmutableSet; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; -public class PartInterface extends PartBasicState - implements IGridTickable, - IStorageMonitorable, - IInventoryDestination, - IInterfaceHost, - ISidedInventory, - IAEAppEngInventory, - ITileStorageMonitorable, - IPriorityHost { +public class PartInterface extends PartBasicState implements IGridTickable, IStorageMonitorable, IInventoryDestination, + IInterfaceHost, ISidedInventory, IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost { private final DualityInterface duality = new DualityInterface(this.getProxy(), this); @@ -133,8 +122,8 @@ public void gridChanged() { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), @@ -334,12 +323,8 @@ public boolean canExtractItem(final int i, final ItemStack itemstack, final int } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { this.duality.onChangeInventory(inv, slot, mc, removedStack, newStack); } diff --git a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java index a9e8d29998e..5a89655bd48 100644 --- a/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartInvertedToggleBus.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.misc; -import appeng.helpers.Reflected; import net.minecraft.item.ItemStack; +import appeng.helpers.Reflected; + public class PartInvertedToggleBus extends PartToggleBus { + @Reflected public PartInvertedToggleBus(final ItemStack is) { super(is); diff --git a/src/main/java/appeng/parts/misc/PartStorageBus.java b/src/main/java/appeng/parts/misc/PartStorageBus.java index 97af3fc0330..f7f1f378127 100644 --- a/src/main/java/appeng/parts/misc/PartStorageBus.java +++ b/src/main/java/appeng/parts/misc/PartStorageBus.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.misc; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.networking.IGridNode; @@ -64,26 +69,11 @@ import buildcraft.api.transport.IPipeTile.PipeType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; @Interface(iname = IntegrationType.BuildCraftTransport, iface = "buildcraft.api.transport.IPipeConnection") -public class PartStorageBus extends PartUpgradeable - implements IGridTickable, - ICellContainer, - IMEMonitorHandlerReceiver, - IPipeConnection, - IPriorityHost, - IOreFilterable { +public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, + IMEMonitorHandlerReceiver, IPipeConnection, IPriorityHost, IOreFilterable { + private final BaseActionSource mySrc; private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory(this, 63); private int priority = 0; @@ -140,12 +130,8 @@ public void updateSetting(final IConfigManager manager, final Enum settingName, } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { super.onChangeInventory(inv, slot, mc, removedStack, newStack); if (inv == this.Config) { @@ -186,8 +172,7 @@ public IInventory getInventoryByName(final String name) { } private void resetCache(final boolean fullReset) { - if (this.getHost() == null - || this.getHost().getTile() == null + if (this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorldObj() == null || this.getHost().getTile().getWorldObj().isRemote) { return; @@ -212,9 +197,7 @@ public boolean isValid(final Object verificationToken) { } @Override - public void postChange( - final IBaseMonitor monitor, - final Iterable change, + public void postChange(final IBaseMonitor monitor, final Iterable change, final BaseActionSource source) { try { if (this.getProxy().isActive()) { @@ -260,8 +243,8 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), @@ -329,7 +312,10 @@ public boolean onPartActivate(final EntityPlayer player, final Vec3 pos) { @Override public TickingRequest getTickingRequest(final IGridNode node) { return new TickingRequest( - TickRates.StorageBus.getMin(), TickRates.StorageBus.getMax(), this.monitor == null, true); + TickRates.StorageBus.getMin(), + TickRates.StorageBus.getMax(), + this.monitor == null, + true); } @Override @@ -383,11 +369,10 @@ public MEInventoryHandler getInternalHandler() { this.cached = true; final TileEntity self = this.getHost().getTile(); - final TileEntity target = self.getWorldObj() - .getTileEntity( - self.xCoord + this.getSide().offsetX, - self.yCoord + this.getSide().offsetY, - self.zCoord + this.getSide().offsetZ); + final TileEntity target = self.getWorldObj().getTileEntity( + self.xCoord + this.getSide().offsetX, + self.yCoord + this.getSide().offsetY, + self.zCoord + this.getSide().offsetZ); final int newHandlerHash = Platform.generateTileHash(target); @@ -399,13 +384,11 @@ public MEInventoryHandler getInternalHandler() { this.handler = null; this.monitor = null; if (target != null) { - final IExternalStorageHandler esh = AEApi.instance() - .registries() - .externalStorage() + final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage() .getHandler(target, this.getSide().getOpposite(), StorageChannel.ITEMS, this.mySrc); if (esh != null) { - final IMEInventory inv = - esh.getInventory(target, this.getSide().getOpposite(), StorageChannel.ITEMS, this.mySrc); + final IMEInventory inv = esh + .getInventory(target, this.getSide().getOpposite(), StorageChannel.ITEMS, this.mySrc); if (inv instanceof MEMonitorIInventory) { final MEMonitorIInventory h = (MEMonitorIInventory) inv; @@ -422,17 +405,14 @@ public MEInventoryHandler getInternalHandler() { this.handler = new MEInventoryHandler(inv, StorageChannel.ITEMS); - this.handler.setBaseAccess( - (AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS)); + this.handler.setBaseAccess((AccessRestriction) this.getConfigManager().getSetting(Settings.ACCESS)); this.handler.setWhitelist( - this.getInstalledUpgrades(Upgrades.INVERTER) > 0 - ? IncludeExclude.BLACKLIST + this.getInstalledUpgrades(Upgrades.INVERTER) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST); this.handler.setPriority(this.priority); if (this.oreFilterString.isEmpty()) { - final IItemList priorityList = - AEApi.instance().storage().createItemList(); + final IItemList priorityList = AEApi.instance().storage().createItemList(); final int slotsToUse = 18 + this.getInstalledUpgrades(Upgrades.CAPACITY) * 9; for (int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++) { @@ -441,8 +421,10 @@ public MEInventoryHandler getInternalHandler() { } if (this.getInstalledUpgrades(Upgrades.FUZZY) > 0) { - this.handler.setPartitionList(new FuzzyPriorityList(priorityList, (FuzzyMode) - this.getConfigManager().getSetting(Settings.FUZZY_MODE))); + this.handler.setPartitionList( + new FuzzyPriorityList( + priorityList, + (FuzzyMode) this.getConfigManager().getSetting(Settings.FUZZY_MODE))); } else { this.handler.setPartitionList(new PrecisePriorityList(priorityList)); } diff --git a/src/main/java/appeng/parts/misc/PartToggleBus.java b/src/main/java/appeng/parts/misc/PartToggleBus.java index d45fc42518b..326c9f2ff9a 100644 --- a/src/main/java/appeng/parts/misc/PartToggleBus.java +++ b/src/main/java/appeng/parts/misc/PartToggleBus.java @@ -1,23 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.misc; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.exceptions.FailedConnection; import appeng.api.networking.IGridConnection; @@ -33,19 +39,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartToggleBus extends PartBasicState { + private static final int REDSTONE_FLAG = 8; private final AENetworkProxy outerProxy = new AENetworkProxy(this, "outer", null, true); private IGridConnection connection; @@ -133,8 +129,8 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture(this.getItemStack().getIconIndex()); @@ -224,9 +220,7 @@ private void updateInternalState() { if (intention) { try { this.connection = AEApi.instance() - .createGridConnection( - this.getProxy().getNode(), - this.getOuterProxy().getNode()); + .createGridConnection(this.getProxy().getNode(), this.getOuterProxy().getNode()); } catch (final FailedConnection e) { // :( } diff --git a/src/main/java/appeng/parts/networking/PartCable.java b/src/main/java/appeng/parts/networking/PartCable.java index dd4d95df257..c5bf98c3439 100644 --- a/src/main/java/appeng/parts/networking/PartCable.java +++ b/src/main/java/appeng/parts/networking/PartCable.java @@ -1,23 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; +import java.io.IOException; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.config.SecurityPermissions; import appeng.api.definitions.IParts; @@ -42,21 +48,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartCable extends AEBasePart implements IPartCable { - private final int[] channelsOnSide = {0, 0, 0, 0, 0, 0}; + private final int[] channelsOnSide = { 0, 0, 0, 0, 0, 0 }; private EnumSet connections = EnumSet.noneOf(ForgeDirection.class); private boolean powered = false; @@ -267,8 +262,7 @@ public IIcon getGlassTexture(final AEColor c) { default: } - final AEColoredItemDefinition glassCable = - AEApi.instance().definitions().parts().cableGlass(); + final AEColoredItemDefinition glassCable = AEApi.instance().definitions().parts().cableGlass(); final ItemStack glassCableStack = glassCable.stack(AEColor.Transparent, 1); return glassCable.item(AEColor.Transparent).getIconIndex(glassCableStack); @@ -276,8 +270,8 @@ public IIcon getGlassTexture(final AEColor c) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); boolean useCovered = false; boolean requireDetailed = false; @@ -292,8 +286,8 @@ public void renderStatic( break; } } else if (this.getConnections().contains(dir)) { - final TileEntity te = - this.getTile().getWorldObj().getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); + final TileEntity te = this.getTile().getWorldObj() + .getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; if (partHost == null && gh != null && gh.getCableConnectionType(dir) != AECableType.GLASS) { @@ -341,8 +335,7 @@ public void renderStatic( } } - if (this.getConnections().size() != 2 - || !this.nonLinear(this.getConnections()) + if (this.getConnections().size() != 2 || !this.nonLinear(this.getConnections()) || useCovered || requireDetailed) { if (useCovered) { @@ -418,20 +411,17 @@ public void writeToStream(final ByteBuf data) throws IOException { final IPart part = this.getHost().getPart(thisSide); if (part != null) { if (part.getGridNode() != null) { - final IReadOnlyCollection set = - part.getGridNode().getConnections(); + final IReadOnlyCollection set = part.getGridNode().getConnections(); for (final IGridConnection gc : set) { - if (this.getProxy().getNode().hasFlag(GridFlags.ULTRA_DENSE_CAPACITY) - && gc.getOtherSide(this.getProxy().getNode()) - .hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)) { + if (this.getProxy().getNode().hasFlag(GridFlags.ULTRA_DENSE_CAPACITY) && gc + .getOtherSide(this.getProxy().getNode()).hasFlag(GridFlags.ULTRA_DENSE_CAPACITY)) { sideOut |= (gc.getUsedChannels() / 16) << (4 * thisSide.ordinal()); } else if (this.getProxy().getNode().hasFlag(GridFlags.DENSE_CAPACITY) - && gc.getOtherSide(this.getProxy().getNode()) - .hasFlag(GridFlags.DENSE_CAPACITY)) { - sideOut |= (gc.getUsedChannels() / 4) << (4 * thisSide.ordinal()); - } else { - sideOut |= (gc.getUsedChannels()) << (4 * thisSide.ordinal()); - } + && gc.getOtherSide(this.getProxy().getNode()).hasFlag(GridFlags.DENSE_CAPACITY)) { + sideOut |= (gc.getUsedChannels() / 4) << (4 * thisSide.ordinal()); + } else { + sideOut |= (gc.getUsedChannels()) << (4 * thisSide.ordinal()); + } } } } @@ -441,12 +431,12 @@ public void writeToStream(final ByteBuf data) throws IOException { final ForgeDirection side = gc.getDirection(n); if (side != ForgeDirection.UNKNOWN) { final boolean isTier3a = this.getProxy().getNode().hasFlag(GridFlags.ULTRA_DENSE_CAPACITY); - final boolean isTier3b = - gc.getOtherSide(this.getProxy().getNode()).hasFlag(GridFlags.ULTRA_DENSE_CAPACITY); + final boolean isTier3b = gc.getOtherSide(this.getProxy().getNode()) + .hasFlag(GridFlags.ULTRA_DENSE_CAPACITY); final boolean isTier2a = this.getProxy().getNode().hasFlag(GridFlags.DENSE_CAPACITY); - final boolean isTier2b = - gc.getOtherSide(this.getProxy().getNode()).hasFlag(GridFlags.DENSE_CAPACITY); + final boolean isTier2b = gc.getOtherSide(this.getProxy().getNode()) + .hasFlag(GridFlags.DENSE_CAPACITY); if (isTier3a && isTier3b) { sideOut |= (gc.getUsedChannels() / 16) << (4 * side.ordinal()); @@ -552,8 +542,7 @@ public IIcon getCoveredTexture(final AEColor c) { default: } - final AEColoredItemDefinition coveredCable = - AEApi.instance().definitions().parts().cableCovered(); + final AEColoredItemDefinition coveredCable = AEApi.instance().definitions().parts().cableCovered(); final ItemStack coveredCableStack = coveredCable.stack(AEColor.Transparent, 1); return coveredCable.item(AEColor.Transparent).getIconIndex(coveredCableStack); @@ -566,22 +555,16 @@ protected boolean nonLinear(final EnumSet sides) { } @SideOnly(Side.CLIENT) - private void renderGlassConnection( - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer, - final ForgeDirection of) { - final TileEntity te = - this.getTile().getWorldObj().getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); + private void renderGlassConnection(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer, final ForgeDirection of) { + final TileEntity te = this.getTile().getWorldObj() + .getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender(EnumSet.complementOf(EnumSet.of(of))); - if (gh != null - && partHost != null + if (gh != null && partHost != null && gh.getCableConnectionType(of.getOpposite()) == AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart(of.getOpposite()) == null) { @@ -645,65 +628,56 @@ private void renderGlassConnection( } @SideOnly(Side.CLIENT) - void renderCoveredConnection( - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer, - final int channels, - final ForgeDirection of) { - final TileEntity te = - this.getTile().getWorldObj().getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); + void renderCoveredConnection(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer, final int channels, final ForgeDirection of) { + final TileEntity te = this.getTile().getWorldObj() + .getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender(EnumSet.complementOf(EnumSet.of(of))); - if (ghh != null - && partHost != null + if (ghh != null && partHost != null && ghh.getCableConnectionType(of.getOpposite()) == AECableType.GLASS && partHost.getPart(of.getOpposite()) == null && partHost.getColor() != AEColor.Transparent) { rh.setTexture(this.getGlassTexture(partHost.getColor())); - } else if (partHost == null - && ghh != null - && ghh.getCableConnectionType(of.getOpposite()) != AECableType.GLASS) { - rh.setTexture(this.getCoveredTexture(this.getCableColor())); - switch (of) { - case DOWN: - rh.setBounds(5, 0, 5, 11, 4, 11); - break; - case EAST: - rh.setBounds(12, 5, 5, 16, 11, 11); - break; - case NORTH: - rh.setBounds(5, 5, 0, 11, 11, 4); - break; - case SOUTH: - rh.setBounds(5, 5, 12, 11, 11, 16); - break; - case UP: - rh.setBounds(5, 12, 5, 11, 16, 11); - break; - case WEST: - rh.setBounds(0, 5, 5, 4, 11, 11); - break; - default: - return; - } + } else + if (partHost == null && ghh != null && ghh.getCableConnectionType(of.getOpposite()) != AECableType.GLASS) { + rh.setTexture(this.getCoveredTexture(this.getCableColor())); + switch (of) { + case DOWN: + rh.setBounds(5, 0, 5, 11, 4, 11); + break; + case EAST: + rh.setBounds(12, 5, 5, 16, 11, 11); + break; + case NORTH: + rh.setBounds(5, 5, 0, 11, 11, 4); + break; + case SOUTH: + rh.setBounds(5, 5, 12, 11, 11, 16); + break; + case UP: + rh.setBounds(5, 12, 5, 11, 16, 11); + break; + case WEST: + rh.setBounds(0, 5, 5, 4, 11, 11); + break; + default: + return; + } - rh.renderBlock(x, y, z, renderer); + rh.renderBlock(x, y, z, renderer); - rh.setTexture(this.getTexture(this.getCableColor())); - } else if (ghh != null - && partHost != null - && ghh.getCableConnectionType(of.getOpposite()) == AECableType.COVERED - && partHost.getColor() != AEColor.Transparent - && partHost.getPart(of.getOpposite()) == null) { - rh.setTexture(this.getCoveredTexture(partHost.getColor())); - } else { - rh.setTexture(this.getCoveredTexture(this.getCableColor())); - } + rh.setTexture(this.getTexture(this.getCableColor())); + } else if (ghh != null && partHost != null + && ghh.getCableConnectionType(of.getOpposite()) == AECableType.COVERED + && partHost.getColor() != AEColor.Transparent + && partHost.getPart(of.getOpposite()) == null) { + rh.setTexture(this.getCoveredTexture(partHost.getColor())); + } else { + rh.setTexture(this.getCoveredTexture(this.getCableColor())); + } switch (of) { case DOWN: @@ -734,16 +708,10 @@ void renderCoveredConnection( } @SideOnly(Side.CLIENT) - void renderSmartConnection( - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer, - final int channels, - final ForgeDirection of) { - final TileEntity te = - this.getTile().getWorldObj().getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); + void renderSmartConnection(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer, final int channels, final ForgeDirection of) { + final TileEntity te = this.getTile().getWorldObj() + .getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; AEColor myColor = this.getCableColor(); @@ -751,75 +719,69 @@ void renderSmartConnection( rh.setFacesToRender(EnumSet.complementOf(EnumSet.of(of))); boolean isGlass = false; - if (ghh != null - && partHost != null + if (ghh != null && partHost != null && ghh.getCableConnectionType(of.getOpposite()) == AECableType.GLASS && partHost.getPart(of.getOpposite()) == null && partHost.getColor() != AEColor.Transparent) { isGlass = true; rh.setTexture(this.getGlassTexture(myColor = partHost.getColor())); - } else if (partHost == null - && ghh != null - && ghh.getCableConnectionType(of.getOpposite()) != AECableType.GLASS) { - rh.setTexture(this.getSmartTexture(myColor)); - switch (of) { - case DOWN: - rh.setBounds(5, 0, 5, 11, 4, 11); - break; - case EAST: - rh.setBounds(12, 5, 5, 16, 11, 11); - break; - case NORTH: - rh.setBounds(5, 5, 0, 11, 11, 4); - break; - case SOUTH: - rh.setBounds(5, 5, 12, 11, 11, 16); - break; - case UP: - rh.setBounds(5, 12, 5, 11, 16, 11); - break; - case WEST: - rh.setBounds(0, 5, 5, 4, 11, 11); - break; - default: - return; - } - rh.renderBlock(x, y, z, renderer); + } else + if (partHost == null && ghh != null && ghh.getCableConnectionType(of.getOpposite()) != AECableType.GLASS) { + rh.setTexture(this.getSmartTexture(myColor)); + switch (of) { + case DOWN: + rh.setBounds(5, 0, 5, 11, 4, 11); + break; + case EAST: + rh.setBounds(12, 5, 5, 16, 11, 11); + break; + case NORTH: + rh.setBounds(5, 5, 0, 11, 11, 4); + break; + case SOUTH: + rh.setBounds(5, 5, 12, 11, 11, 16); + break; + case UP: + rh.setBounds(5, 12, 5, 11, 16, 11); + break; + case WEST: + rh.setBounds(0, 5, 5, 4, 11, 11); + break; + default: + return; + } + rh.renderBlock(x, y, z, renderer); - this.setSmartConnectionRotations(of, renderer); - final IIcon firstIcon = - new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); - final IIcon secondIcon = - new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); - - if (of == ForgeDirection.EAST || of == ForgeDirection.WEST) { - final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); - final FlippableIcon ico = blk.getRendererInstance().getTexture(ForgeDirection.EAST); - ico.setFlip(false, true); - } + this.setSmartConnectionRotations(of, renderer); + final IIcon firstIcon = new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); + final IIcon secondIcon = new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); - Tessellator.instance.setBrightness(15 << 20 | 15 << 4); - Tessellator.instance.setColorOpaque_I(myColor.blackVariant); - rh.setTexture(firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon); - this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); + if (of == ForgeDirection.EAST || of == ForgeDirection.WEST) { + final AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); + final FlippableIcon ico = blk.getRendererInstance().getTexture(ForgeDirection.EAST); + ico.setFlip(false, true); + } - Tessellator.instance.setColorOpaque_I(myColor.whiteVariant); - rh.setTexture(secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon); - this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); + Tessellator.instance.setBrightness(15 << 20 | 15 << 4); + Tessellator.instance.setColorOpaque_I(myColor.blackVariant); + rh.setTexture(firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon); + this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + Tessellator.instance.setColorOpaque_I(myColor.whiteVariant); + rh.setTexture(secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon); + this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); - rh.setTexture(this.getTexture(this.getCableColor())); - } else if (ghh != null - && partHost != null - && ghh.getCableConnectionType(of.getOpposite()) != AECableType.GLASS - && partHost.getColor() != AEColor.Transparent - && partHost.getPart(of.getOpposite()) == null) { - rh.setTexture(this.getSmartTexture(myColor = partHost.getColor())); - } else { - rh.setTexture(this.getSmartTexture(this.getCableColor())); - } + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + + rh.setTexture(this.getTexture(this.getCableColor())); + } else if (ghh != null && partHost != null + && ghh.getCableConnectionType(of.getOpposite()) != AECableType.GLASS + && partHost.getColor() != AEColor.Transparent + && partHost.getPart(of.getOpposite()) == null) { + rh.setTexture(this.getSmartTexture(myColor = partHost.getColor())); + } else { + rh.setTexture(this.getSmartTexture(this.getCableColor())); + } switch (of) { case DOWN: @@ -850,10 +812,8 @@ void renderSmartConnection( if (!isGlass) { this.setSmartConnectionRotations(of, renderer); - final IIcon firstIcon = - new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); - final IIcon secondIcon = - new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); + final IIcon firstIcon = new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); + final IIcon secondIcon = new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); Tessellator.instance.setBrightness(15 << 20 | 15 << 4); Tessellator.instance.setColorOpaque_I(myColor.blackVariant); @@ -864,8 +824,7 @@ void renderSmartConnection( rh.setTexture(secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon); this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } } @@ -979,13 +938,8 @@ protected CableBusTextures getChannelTex(int i, final boolean b) { } @SideOnly(Side.CLIENT) - protected void renderAllFaces( - final AEBaseBlock blk, - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer) { + protected void renderAllFaces(final AEBaseBlock blk, final int x, final int y, final int z, + final IPartRenderHelper rh, final RenderBlocks renderer) { rh.setBounds( (float) renderer.renderMinX * 16.0f, (float) renderer.renderMinY * 16.0f, @@ -994,15 +948,40 @@ protected void renderAllFaces( (float) renderer.renderMaxY * 16.0f, (float) renderer.renderMaxZ * 16.0f); rh.renderFace( - x, y, z, blk.getRendererInstance().getTexture(ForgeDirection.WEST), ForgeDirection.WEST, renderer); + x, + y, + z, + blk.getRendererInstance().getTexture(ForgeDirection.WEST), + ForgeDirection.WEST, + renderer); rh.renderFace( - x, y, z, blk.getRendererInstance().getTexture(ForgeDirection.EAST), ForgeDirection.EAST, renderer); + x, + y, + z, + blk.getRendererInstance().getTexture(ForgeDirection.EAST), + ForgeDirection.EAST, + renderer); rh.renderFace( - x, y, z, blk.getRendererInstance().getTexture(ForgeDirection.NORTH), ForgeDirection.NORTH, renderer); + x, + y, + z, + blk.getRendererInstance().getTexture(ForgeDirection.NORTH), + ForgeDirection.NORTH, + renderer); rh.renderFace( - x, y, z, blk.getRendererInstance().getTexture(ForgeDirection.SOUTH), ForgeDirection.SOUTH, renderer); + x, + y, + z, + blk.getRendererInstance().getTexture(ForgeDirection.SOUTH), + ForgeDirection.SOUTH, + renderer); rh.renderFace( - x, y, z, blk.getRendererInstance().getTexture(ForgeDirection.DOWN), ForgeDirection.DOWN, renderer); + x, + y, + z, + blk.getRendererInstance().getTexture(ForgeDirection.DOWN), + ForgeDirection.DOWN, + renderer); rh.renderFace(x, y, z, blk.getRendererInstance().getTexture(ForgeDirection.UP), ForgeDirection.UP, renderer); } diff --git a/src/main/java/appeng/parts/networking/PartCableCovered.java b/src/main/java/appeng/parts/networking/PartCableCovered.java index 699ae81a756..8fa2702f293 100644 --- a/src/main/java/appeng/parts/networking/PartCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartCableCovered.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; import appeng.api.networking.events.MENetworkChannelsChanged; @@ -34,14 +35,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartCableCovered extends PartCable { + @Reflected public PartCableCovered(final ItemStack is) { super(is); @@ -139,8 +135,8 @@ public IIcon getTexture(final AEColor c) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture(this.getTexture(this.getCableColor())); @@ -223,8 +219,7 @@ public void renderStatic( rh.renderBlockCurrentBounds(x, y, z, renderer); } - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; rh.setTexture(null); } } diff --git a/src/main/java/appeng/parts/networking/PartCableGlass.java b/src/main/java/appeng/parts/networking/PartCableGlass.java index 33573414909..d66b5e99080 100644 --- a/src/main/java/appeng/parts/networking/PartCableGlass.java +++ b/src/main/java/appeng/parts/networking/PartCableGlass.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; -import appeng.helpers.Reflected; import net.minecraft.item.ItemStack; +import appeng.helpers.Reflected; + public class PartCableGlass extends PartCable { + @Reflected public PartCableGlass(final ItemStack is) { super(is); diff --git a/src/main/java/appeng/parts/networking/PartCableSmart.java b/src/main/java/appeng/parts/networking/PartCableSmart.java index 2e68179fd02..8091c2cfb7c 100644 --- a/src/main/java/appeng/parts/networking/PartCableSmart.java +++ b/src/main/java/appeng/parts/networking/PartCableSmart.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; import appeng.api.networking.events.MENetworkChannelsChanged; @@ -37,15 +39,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartCableSmart extends PartCable { + @Reflected public PartCableSmart(final ItemStack is) { super(is); @@ -157,8 +153,8 @@ public IIcon getTexture(final AEColor c) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture(this.getTexture(this.getCableColor())); @@ -202,12 +198,10 @@ public void renderStatic( this.setSmartConnectionRotations(of, renderer); final IIcon firstIcon = new TaughtIcon( - this.getChannelTex(this.getChannelsOnSide()[of.ordinal()], false) - .getIcon(), + this.getChannelTex(this.getChannelsOnSide()[of.ordinal()], false).getIcon(), -0.2f); final IIcon secondIcon = new TaughtIcon( - this.getChannelTex(this.getChannelsOnSide()[of.ordinal()], true) - .getIcon(), + this.getChannelTex(this.getChannelsOnSide()[of.ordinal()], true).getIcon(), -0.2f); if (of == ForgeDirection.EAST || of == ForgeDirection.WEST) { @@ -225,8 +219,7 @@ public void renderStatic( rh.setTexture(secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon); this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = - renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; rh.setTexture(this.getTexture(this.getCableColor())); } @@ -253,12 +246,10 @@ public void renderStatic( final IIcon def = this.getTexture(this.getCableColor()); final IIcon off = new OffsetIcon(def, 0, -12); - final IIcon firstTaughtIcon = - new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); + final IIcon firstTaughtIcon = new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); final IIcon firstOffsetIcon = new OffsetIcon(firstTaughtIcon, 0, -12); - final IIcon secondTaughtIcon = - new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); + final IIcon secondTaughtIcon = new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); final IIcon secondOffsetIcon = new OffsetIcon(secondTaughtIcon, 0, -12); switch (selectedSide) { @@ -325,7 +316,12 @@ public void renderStatic( Tessellator.instance.setColorOpaque_I(this.getCableColor().blackVariant); rh.setTexture( - firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstOffsetIcon, firstTaughtIcon, fpA); + firstOffsetIcon, + firstOffsetIcon, + firstOffsetIcon, + firstOffsetIcon, + firstTaughtIcon, + fpA); this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); Tessellator.instance.setColorOpaque_I(this.getCableColor().whiteVariant); @@ -376,8 +372,7 @@ public void renderStatic( } } - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; rh.setTexture(null); } } diff --git a/src/main/java/appeng/parts/networking/PartDenseCable.java b/src/main/java/appeng/parts/networking/PartDenseCable.java index e47ed2d08b2..7ea88c5a901 100644 --- a/src/main/java/appeng/parts/networking/PartDenseCable.java +++ b/src/main/java/appeng/parts/networking/PartDenseCable.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.networking.GridFlags; import appeng.api.networking.IGridHost; @@ -40,16 +43,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartDenseCable extends PartCable { + @Reflected public PartDenseCable(final ItemStack is) { super(is); @@ -180,12 +176,7 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override public IIcon getTexture(final AEColor c) { if (c == AEColor.Transparent) { - return AEApi.instance() - .definitions() - .parts() - .cableSmart() - .stack(AEColor.Transparent, 1) - .getIconIndex(); + return AEApi.instance().definitions().parts().cableSmart().stack(AEColor.Transparent, 1).getIconIndex(); } return this.getSmartTexture(c); @@ -193,8 +184,8 @@ public IIcon getTexture(final AEColor c) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture(this.getTexture(this.getCableColor())); @@ -233,12 +224,10 @@ public void renderStatic( final IIcon def = this.getTexture(this.getCableColor()); final IIcon off = new OffsetIcon(def, 0, -12); - final IIcon firstIcon = - new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); + final IIcon firstIcon = new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); final IIcon firstOffset = new OffsetIcon(firstIcon, 0, -12); - final IIcon secondIcon = - new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); + final IIcon secondIcon = new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); final IIcon secondOffset = new OffsetIcon(secondIcon, 0, -12); switch (selectedSide) { @@ -322,58 +311,42 @@ public void renderStatic( } } - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; rh.setTexture(null); } @SideOnly(Side.CLIENT) - private void renderDenseConnection( - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer, - final int channels, - final ForgeDirection of) { - final TileEntity te = - this.getTile().getWorldObj().getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); + private void renderDenseConnection(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer, final int channels, final ForgeDirection of) { + final TileEntity te = this.getTile().getWorldObj() + .getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; AEColor myColor = this.getCableColor(); /* * ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && - * partHost.getPart( - * of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor() - * ) ); - * } else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) { - * rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, 0, 3, 13, 4, 13 ); - * break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, 13, 4 - * ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( 3, 12, 3, 13, 16, - * 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y, - * z, renderer ); - * if ( true ) { setSmartConnectionRotations( of, renderer ); IIcon firstIcon = new TaughtIcon( getChannelTex( - * channels, false ).getIcon(), -0.2f ); IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true - * ).getIcon(), - * -0.2f ); - * if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock) - * rh.getBlock(); FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( - * false, true ); } + * partHost.getPart( of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = + * partHost.getColor() ) ); } else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != + * AECableType.GLASS ) { rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, + * 0, 3, 13, 4, 13 ); break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( + * 3, 3, 0, 13, 13, 4 ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( + * 3, 12, 3, 13, 16, 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } + * rh.renderBlock( x, y, z, renderer ); if ( true ) { setSmartConnectionRotations( of, renderer ); IIcon + * firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f ); IIcon secondIcon = new + * TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f ); if ( of == ForgeDirection.EAST || of == + * ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); FlippableIcon ico = + * blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip( false, true ); } * Tessellator.INSTANCE.setBrightness( 15 << 20 | 15 << 5 ); Tessellator.INSTANCE.setColorOpaque_I( * myColor.mediumVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); - * renderAllFaces( (AEBaseBlock) - * rh.getBlock(), x, y, z, renderer ); - * Tessellator.INSTANCE.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, - * secondIcon, secondIcon, secondIcon, - * secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); - * renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = - * renderer.uvRotateTop = renderer.uvRotateWest = 0; } - * rh.setTexture( getTexture( getCableColor() ) ); } + * renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); Tessellator.INSTANCE.setColorOpaque_I( + * myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon + * ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer ); renderer.uvRotateBottom = + * renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = + * renderer.uvRotateWest = 0; } rh.setTexture( getTexture( getCableColor() ) ); } */ rh.setFacesToRender(EnumSet.complementOf(EnumSet.of(of, of.getOpposite()))); - if (ghh != null - && partHost != null + if (ghh != null && partHost != null && ghh.getCableConnectionType(of) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart(of.getOpposite()) == null) { @@ -412,10 +385,8 @@ private void renderDenseConnection( if (!isGlass) { this.setSmartConnectionRotations(of, renderer); - final IIcon firstIcon = - new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); - final IIcon secondIcon = - new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); + final IIcon firstIcon = new TaughtIcon(this.getChannelTex(channels, false).getIcon(), -0.2f); + final IIcon secondIcon = new TaughtIcon(this.getChannelTex(channels, true).getIcon(), -0.2f); Tessellator.instance.setBrightness(15 << 20 | 15 << 4); Tessellator.instance.setColorOpaque_I(myColor.blackVariant); @@ -426,18 +397,15 @@ private void renderDenseConnection( rh.setTexture(secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon); this.renderAllFaces((AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer); - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; } } private boolean isSmart(final ForgeDirection of) { - final TileEntity te = this.getTile() - .getWorldObj() - .getTileEntity( - this.getTile().xCoord + of.offsetX, - this.getTile().yCoord + of.offsetY, - this.getTile().zCoord + of.offsetZ); + final TileEntity te = this.getTile().getWorldObj().getTileEntity( + this.getTile().xCoord + of.offsetX, + this.getTile().yCoord + of.offsetY, + this.getTile().zCoord + of.offsetZ); if (te instanceof IGridHost) { final AECableType t = ((IGridHost) te).getCableConnectionType(of.getOpposite()); return t == AECableType.SMART; @@ -486,16 +454,13 @@ protected IIcon getDenseTexture(final AEColor c) { } private boolean isDense(final ForgeDirection of) { - final TileEntity te = this.getTile() - .getWorldObj() - .getTileEntity( - this.getTile().xCoord + of.offsetX, - this.getTile().yCoord + of.offsetY, - this.getTile().zCoord + of.offsetZ); + final TileEntity te = this.getTile().getWorldObj().getTileEntity( + this.getTile().xCoord + of.offsetX, + this.getTile().yCoord + of.offsetY, + this.getTile().zCoord + of.offsetZ); if (te instanceof IGridHost) { final AECableType t = ((IGridHost) te).getCableConnectionType(of.getOpposite()); - return t == AECableType.DENSE - || t == AECableType.DENSE_COVERED + return t == AECableType.DENSE || t == AECableType.DENSE_COVERED || t == AECableType.ULTRA_DENSE_SMART || t == AECableType.ULTRA_DENSE; } diff --git a/src/main/java/appeng/parts/networking/PartDenseCableCovered.java b/src/main/java/appeng/parts/networking/PartDenseCableCovered.java index 78fdb2b59cd..4d2de5dcd58 100644 --- a/src/main/java/appeng/parts/networking/PartDenseCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartDenseCableCovered.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; +import java.util.EnumSet; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.AEApi; import appeng.api.networking.GridFlags; import appeng.api.networking.IGridHost; @@ -39,15 +41,9 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartDenseCableCovered extends PartCable { + @Reflected public PartDenseCableCovered(final ItemStack is) { super(is); @@ -166,12 +162,7 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override public IIcon getTexture(final AEColor c) { if (c == AEColor.Transparent) { - return AEApi.instance() - .definitions() - .parts() - .cableCovered() - .stack(AEColor.Transparent, 1) - .getIconIndex(); + return AEApi.instance().definitions().parts().cableCovered().stack(AEColor.Transparent, 1).getIconIndex(); } return this.getCoveredTexture(c); @@ -179,8 +170,8 @@ public IIcon getTexture(final AEColor c) { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture(this.getTexture(this.getCableColor())); @@ -256,27 +247,20 @@ public void renderStatic( } } - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; rh.setTexture(null); } @SideOnly(Side.CLIENT) - private void renderDenseCoveredConnection( - final int x, - final int y, - final int z, - final IPartRenderHelper rh, - final RenderBlocks renderer, - final ForgeDirection of) { - final TileEntity te = - this.getTile().getWorldObj().getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); + private void renderDenseCoveredConnection(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer, final ForgeDirection of) { + final TileEntity te = this.getTile().getWorldObj() + .getTileEntity(x + of.offsetX, y + of.offsetY, z + of.offsetZ); final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null; final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null; rh.setFacesToRender(EnumSet.complementOf(EnumSet.of(of, of.getOpposite()))); - if (ghh != null - && partHost != null + if (ghh != null && partHost != null && ghh.getCableConnectionType(of) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent && partHost.getPart(of.getOpposite()) == null) { @@ -353,16 +337,13 @@ protected IIcon getDenseCoveredTexture(final AEColor c) { } private boolean isDense(final ForgeDirection of) { - final TileEntity te = this.getTile() - .getWorldObj() - .getTileEntity( - this.getTile().xCoord + of.offsetX, - this.getTile().yCoord + of.offsetY, - this.getTile().zCoord + of.offsetZ); + final TileEntity te = this.getTile().getWorldObj().getTileEntity( + this.getTile().xCoord + of.offsetX, + this.getTile().yCoord + of.offsetY, + this.getTile().zCoord + of.offsetZ); if (te instanceof IGridHost) { final AECableType t = ((IGridHost) te).getCableConnectionType(of.getOpposite()); - return t == AECableType.DENSE - || t == AECableType.DENSE_COVERED + return t == AECableType.DENSE || t == AECableType.DENSE_COVERED || t == AECableType.ULTRA_DENSE || t == AECableType.ULTRA_DENSE_SMART; } diff --git a/src/main/java/appeng/parts/networking/PartQuartzFiber.java b/src/main/java/appeng/parts/networking/PartQuartzFiber.java index b0105d7a0ec..60648bf7c2b 100644 --- a/src/main/java/appeng/parts/networking/PartQuartzFiber.java +++ b/src/main/java/appeng/parts/networking/PartQuartzFiber.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.networking; +import java.util.EnumSet; +import java.util.Set; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import appeng.api.config.Actionable; import appeng.api.networking.GridFlags; import appeng.api.networking.IGridNode; @@ -32,21 +37,14 @@ import appeng.parts.AEBasePart; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.EnumSet; -import java.util.Set; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider { - private final AENetworkProxy outerProxy = - new AENetworkProxy(this, "outer", this.getProxy().getMachineRepresentation(), true); + private final AENetworkProxy outerProxy = new AENetworkProxy( + this, + "outer", + this.getProxy().getMachineRepresentation(), + true); public PartQuartzFiber(final ItemStack is) { super(is); @@ -79,8 +77,8 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { final IIcon myIcon = this.getItemStack().getIconIndex(); rh.setTexture(myIcon); rh.setBounds(6, 6, 10, 10, 10, 16); diff --git a/src/main/java/appeng/parts/networking/PartUltraDenseCableCovered.java b/src/main/java/appeng/parts/networking/PartUltraDenseCableCovered.java index 10b26f54d47..822aef1c08a 100644 --- a/src/main/java/appeng/parts/networking/PartUltraDenseCableCovered.java +++ b/src/main/java/appeng/parts/networking/PartUltraDenseCableCovered.java @@ -1,15 +1,17 @@ package appeng.parts.networking; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import appeng.api.AEApi; import appeng.api.networking.GridFlags; import appeng.api.util.AECableType; import appeng.api.util.AEColor; import appeng.client.texture.CableBusTextures; import appeng.helpers.Reflected; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class PartUltraDenseCableCovered extends PartDenseCableCovered { + @Reflected public PartUltraDenseCableCovered(final ItemStack is) { super(is); @@ -24,11 +26,7 @@ public AECableType getCableConnectionType() { @Override public IIcon getTexture(final AEColor c) { if (c == AEColor.Transparent) { - return AEApi.instance() - .definitions() - .parts() - .cableUltraDenseCovered() - .stack(AEColor.Transparent, 1) + return AEApi.instance().definitions().parts().cableUltraDenseCovered().stack(AEColor.Transparent, 1) .getIconIndex(); } diff --git a/src/main/java/appeng/parts/networking/PartUltraDenseCableSmart.java b/src/main/java/appeng/parts/networking/PartUltraDenseCableSmart.java index 08d412b3ebd..1e521f99614 100644 --- a/src/main/java/appeng/parts/networking/PartUltraDenseCableSmart.java +++ b/src/main/java/appeng/parts/networking/PartUltraDenseCableSmart.java @@ -1,15 +1,17 @@ package appeng.parts.networking; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import appeng.api.AEApi; import appeng.api.networking.GridFlags; import appeng.api.util.AECableType; import appeng.api.util.AEColor; import appeng.client.texture.CableBusTextures; import appeng.helpers.Reflected; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class PartUltraDenseCableSmart extends PartDenseCable { + @Reflected public PartUltraDenseCableSmart(final ItemStack is) { super(is); @@ -24,11 +26,7 @@ public AECableType getCableConnectionType() { @Override public IIcon getTexture(final AEColor c) { if (c == AEColor.Transparent) { - return AEApi.instance() - .definitions() - .parts() - .cableUltraDenseSmart() - .stack(AEColor.Transparent, 1) + return AEApi.instance().definitions().parts().cableUltraDenseSmart().stack(AEColor.Transparent, 1) .getIconIndex(); } diff --git a/src/main/java/appeng/parts/p2p/IPartGT5Power.java b/src/main/java/appeng/parts/p2p/IPartGT5Power.java index fe94ae2e2dd..672ed469733 100644 --- a/src/main/java/appeng/parts/p2p/IPartGT5Power.java +++ b/src/main/java/appeng/parts/p2p/IPartGT5Power.java @@ -1,6 +1,7 @@ package appeng.parts.p2p; public interface IPartGT5Power { + long injectEnergyUnits(long voltage, long amperage); boolean inputEnergy(); diff --git a/src/main/java/appeng/parts/p2p/PartP2PGT5Power.java b/src/main/java/appeng/parts/p2p/PartP2PGT5Power.java index 00219f2a8ff..787f8bf1c9a 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PGT5Power.java +++ b/src/main/java/appeng/parts/p2p/PartP2PGT5Power.java @@ -1,5 +1,15 @@ package appeng.parts.p2p; +import javax.annotation.Nullable; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.core.AEConfig; import appeng.me.GridAccessException; import cofh.api.energy.IEnergyReceiver; @@ -10,16 +20,9 @@ import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.util.GT_Utility; import ic2.api.energy.tile.IEnergySink; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class PartP2PGT5Power extends PartP2PTunnel implements IPartGT5Power { + private TileEntity cachedTarget; private boolean isCachedTargetValid; @@ -57,8 +60,7 @@ protected IIcon getTypeTexture() { @Override public boolean onPartActivate(EntityPlayer player, Vec3 pos) { - if (!super.onPartActivate(player, pos) - && !player.worldObj.isRemote + if (!super.onPartActivate(player, pos) && !player.worldObj.isRemote && player.inventory.getCurrentItem() == null) { PartP2PGT5Power input = this.getInput(); String inputLoc; @@ -66,8 +68,14 @@ public boolean onPartActivate(EntityPlayer player, Vec3 pos) { inputLoc = "no input"; } else { TileEntity te = input.getHost().getTile(); - inputLoc = "[" + te.getWorldObj().provider.dimensionId + "](" + te.xCoord + ", " + te.yCoord + ", " - + te.zCoord + ")"; + inputLoc = "[" + te.getWorldObj().provider.dimensionId + + "](" + + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + ")"; } player.addChatMessage(chatComponent("------", "")); @@ -93,8 +101,7 @@ public long injectEnergyUnits(long voltage, long amperage) { amperes -= received; if (amperes <= 0L) break; } - } catch (GridAccessException ignored) { - } + } catch (GridAccessException ignored) {} return amperesUsed; } else { return 0L; @@ -142,11 +149,11 @@ private long doOutput(long aVoltage, long aAmperage) { if (te instanceof IEnergySink) { if (((IEnergySink) te).acceptsEnergyFrom(this.getTile(), oppositeSide)) { long rUsedAmperes = 0L; - while (aAmperage > rUsedAmperes - && ((IEnergySink) te).getDemandedEnergy() > 0.0D + while (aAmperage > rUsedAmperes && ((IEnergySink) te).getDemandedEnergy() > 0.0D && ((IEnergySink) te) - .injectEnergy(oppositeSide, (double) aVoltage, (double) aVoltage) - < (double) aVoltage) ++rUsedAmperes; + .injectEnergy(oppositeSide, (double) aVoltage, (double) aVoltage) + < (double) aVoltage) + ++rUsedAmperes; return rUsedAmperes; } @@ -157,38 +164,34 @@ private long doOutput(long aVoltage, long aAmperage) { return 1L; } - if (GregTech_API.mRFExplosions - && GregTech_API.sMachineExplosions + if (GregTech_API.mRFExplosions && GregTech_API.sMachineExplosions && ((IEnergyReceiver) te).getMaxEnergyStored(oppositeSide) < rfOut * 600 && rfOut > 32 * GregTech_API.mEUtoRF / 100) { - float tStrength = (long) rfOut < GT_Values.V[0] - ? 1.0F - : ((long) rfOut < GT_Values.V[1] - ? 2.0F - : ((long) rfOut < GT_Values.V[2] - ? 3.0F - : ((long) rfOut < GT_Values.V[3] - ? 4.0F - : ((long) rfOut < GT_Values.V[4] - ? 5.0F - : ((long) rfOut < GT_Values.V[4] * 2L - ? 6.0F - : ((long) rfOut < GT_Values.V[5] - ? 7.0F + float tStrength = (long) rfOut < GT_Values.V[0] ? 1.0F + : ((long) rfOut < GT_Values.V[1] ? 2.0F + : ((long) rfOut < GT_Values.V[2] ? 3.0F + : ((long) rfOut < GT_Values.V[3] ? 4.0F + : ((long) rfOut < GT_Values.V[4] ? 5.0F + : ((long) rfOut < GT_Values.V[4] * 2L ? 6.0F + : ((long) rfOut < GT_Values.V[5] ? 7.0F : ((long) rfOut < GT_Values.V[6] ? 8.0F : ((long) rfOut - < GT_Values - .V[ - 7] - ? 9.0F - : 10.0F)))))))); + < GT_Values.V[7] + ? 9.0F + : 10.0F)))))))); int tX = te.xCoord; int tY = te.yCoord; int tZ = te.zCoord; World tWorld = te.getWorldObj(); GT_Utility.sendSoundToPlayers( - tWorld, GregTech_API.sSoundList.get(209), 1.0F, -1.0F, tX, tY, tZ); + tWorld, + GregTech_API.sSoundList.get(209), + 1.0F, + -1.0F, + tX, + tY, + tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) { tWorld.createExplosion( diff --git a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java index cfb9dea6430..df665ed99c3 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java +++ b/src/main/java/appeng/parts/p2p/PartP2PIC2Power.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import java.util.LinkedList; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.PowerUnits; import appeng.integration.IntegrationType; import appeng.me.GridAccessException; @@ -27,19 +28,10 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.LinkedList; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; @InterfaceList( - value = { - @Interface(iface = "ic2.api.energy.tile.IEnergySink", iname = IntegrationType.IC2), - @Interface(iface = "ic2.api.energy.tile.IEnergySource", iname = IntegrationType.IC2) - }) + value = { @Interface(iface = "ic2.api.energy.tile.IEnergySink", iname = IntegrationType.IC2), + @Interface(iface = "ic2.api.energy.tile.IEnergySource", iname = IntegrationType.IC2) }) public class PartP2PIC2Power extends PartP2PTunnel implements ic2.api.energy.tile.IEnergySink, ic2.api.energy.tile.IEnergySource { diff --git a/src/main/java/appeng/parts/p2p/PartP2PInterface.java b/src/main/java/appeng/parts/p2p/PartP2PInterface.java index 217489b26e2..30daa5140ec 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PInterface.java +++ b/src/main/java/appeng/parts/p2p/PartP2PInterface.java @@ -1,5 +1,20 @@ package appeng.parts.p2p; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.Upgrades; @@ -32,32 +47,15 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import appeng.util.inv.IInventoryDestination; + import com.google.common.collect.ImmutableSet; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; public class PartP2PInterface extends PartP2PTunnel - implements IGridTickable, - IStorageMonitorable, - IInventoryDestination, - IInterfaceHost, - ISidedInventory, - IAEAppEngInventory, - ITileStorageMonitorable, - IPriorityHost { + implements IGridTickable, IStorageMonitorable, IInventoryDestination, IInterfaceHost, ISidedInventory, + IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost { @Reflected public PartP2PInterface(ItemStack is) { @@ -65,6 +63,7 @@ public PartP2PInterface(ItemStack is) { } private final DualityInterface duality = new DualityInterface(this.getProxy(), this) { + @Override public void updateCraftingList() { if (!isOutput()) { @@ -80,8 +79,7 @@ public void updateCraftingList() { this.craftingList = p2p.duality.craftingList; try { - this.gridProxy - .getGrid() + this.gridProxy.getGrid() .postEvent(new MENetworkCraftingPatternChange(this, this.gridProxy.getNode())); } catch (final GridAccessException e) { // :P @@ -115,13 +113,7 @@ public int getInstalledUpgrades(final Upgrades u) { @Override @SideOnly(Side.CLIENT) protected IIcon getTypeTexture() { - return AEApi.instance() - .definitions() - .blocks() - .iface() - .maybeBlock() - .get() - .getBlockTextureFromSide(0); + return AEApi.instance().definitions().blocks().iface().maybeBlock().get().getBlockTextureFromSide(0); } @Override @@ -304,12 +296,8 @@ public boolean canExtractItem(final int i, final ItemStack itemstack, final int } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { this.duality.onChangeInventory(inv, slot, mc, removedStack, newStack); } diff --git a/src/main/java/appeng/parts/p2p/PartP2PItems.java b/src/main/java/appeng/parts/p2p/PartP2PItems.java index 1b470a7c3f0..9d6515deef1 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PItems.java +++ b/src/main/java/appeng/parts/p2p/PartP2PItems.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridNode; import appeng.api.networking.events.MENetworkBootingStatusChange; import appeng.api.networking.events.MENetworkChannelsChanged; @@ -43,17 +48,6 @@ import buildcraft.api.transport.IPipeTile.PipeType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; @Interface(iface = "buildcraft.api.transport.IPipeConnection", iname = IntegrationType.BuildCraftTransport) public class PartP2PItems extends PartP2PTunnel @@ -111,12 +105,10 @@ private IInventory getOutputInv() { IInventory output = null; if (this.getProxy().isActive()) { - final TileEntity te = this.getTile() - .getWorldObj() - .getTileEntity( - this.getTile().xCoord + this.getSide().offsetX, - this.getTile().yCoord + this.getSide().offsetY, - this.getTile().zCoord + this.getSide().offsetZ); + final TileEntity te = this.getTile().getWorldObj().getTileEntity( + this.getTile().xCoord + this.getSide().offsetX, + this.getTile().yCoord + this.getSide().offsetY, + this.getTile().zCoord + this.getSide().offsetZ); if (this.which.contains(this)) { return null; @@ -125,13 +117,12 @@ private IInventory getOutputInv() { this.which.add(this); if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { - final IBuildCraftTransport buildcraft = (IBuildCraftTransport) - IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + final IBuildCraftTransport buildcraft = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); if (buildcraft.isPipe(te, this.getSide().getOpposite())) { try { output = new WrapperBCPipe(te, this.getSide().getOpposite()); - } catch (final Throwable ignore) { - } + } catch (final Throwable ignore) {} } } @@ -145,8 +136,7 @@ private IInventory getOutputInv() { if (te instanceof TileEntityChest) { output = Platform.GetChestInv(te); } else if (te instanceof ISidedInventory) { - output = new WrapperMCISidedInventory( - (ISidedInventory) te, this.getSide().getOpposite()); + output = new WrapperMCISidedInventory((ISidedInventory) te, this.getSide().getOpposite()); } else if (te instanceof IInventory) { output = (IInventory) te; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PLight.java b/src/main/java/appeng/parts/p2p/PartP2PLight.java index 07996cad29f..64b80e8bf50 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLight.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLight.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import java.io.IOException; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import appeng.api.networking.IGridNode; import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkPowerStatusChange; @@ -29,13 +30,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class PartP2PLight extends PartP2PTunnel implements IGridTickable { @@ -127,12 +121,10 @@ private void setLightLevel(final int out) { private int blockLight(final int emit) { if (this.opacity < 0) { final TileEntity te = this.getTile(); - this.opacity = 255 - - te.getWorldObj() - .getBlockLightOpacity( - te.xCoord + this.getSide().offsetX, - te.yCoord + this.getSide().offsetY, - te.zCoord + this.getSide().offsetZ); + this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( + te.xCoord + this.getSide().offsetX, + te.yCoord + this.getSide().offsetY, + te.zCoord + this.getSide().offsetZ); } return (int) (emit * (this.opacity / 255.0f)); diff --git a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java index 0d1a88dd64f..677b0854103 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PLiquids.java +++ b/src/main/java/appeng/parts/p2p/PartP2PLiquids.java @@ -1,30 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; -import appeng.me.GridAccessException; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Stack; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -35,11 +25,15 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import appeng.me.GridAccessException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class PartP2PLiquids extends PartP2PTunnel implements IFluidHandler { private static final ThreadLocal> DEPTH = new ThreadLocal<>(); - private static final FluidTankInfo[] ACTIVE_TANK = {new FluidTankInfo(null, 10000)}; - private static final FluidTankInfo[] INACTIVE_TANK = {new FluidTankInfo(null, 0)}; + private static final FluidTankInfo[] ACTIVE_TANK = { new FluidTankInfo(null, 10000) }; + private static final FluidTankInfo[] INACTIVE_TANK = { new FluidTankInfo(null, 0) }; private IFluidHandler cachedTank; private int tmpUsed; @@ -196,12 +190,10 @@ private IFluidHandler getTarget() { return this.cachedTank; } - final TileEntity te = this.getTile() - .getWorldObj() - .getTileEntity( - this.getTile().xCoord + this.getSide().offsetX, - this.getTile().yCoord + this.getSide().offsetY, - this.getTile().zCoord + this.getSide().offsetZ); + final TileEntity te = this.getTile().getWorldObj().getTileEntity( + this.getTile().xCoord + this.getSide().offsetX, + this.getTile().yCoord + this.getSide().offsetY, + this.getTile().zCoord + this.getSide().offsetZ); if (te instanceof IFluidHandler) { return this.cachedTank = (IFluidHandler) te; } diff --git a/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java b/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java index 06ea7466347..1751d0c374c 100644 --- a/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java +++ b/src/main/java/appeng/parts/p2p/PartP2POpenComputers.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import javax.annotation.Nullable; + +import li.cil.oc.api.API; +import li.cil.oc.api.Items; +import li.cil.oc.api.Network; +import li.cil.oc.api.network.*; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.events.MENetworkBootingStatusChange; import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkEventSubscribe; @@ -28,23 +32,13 @@ import appeng.transformer.annotations.Integration.InterfaceList; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import javax.annotation.Nullable; -import li.cil.oc.api.API; -import li.cil.oc.api.Items; -import li.cil.oc.api.Network; -import li.cil.oc.api.network.*; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; @InterfaceList( - value = { - @Interface(iface = "li.cil.oc.api.network.Environment", iname = IntegrationType.OpenComputers), - @Interface(iface = "li.cil.oc.api.network.SidedEnvironment", iname = IntegrationType.OpenComputers) - }) + value = { @Interface(iface = "li.cil.oc.api.network.Environment", iname = IntegrationType.OpenComputers), + @Interface(iface = "li.cil.oc.api.network.SidedEnvironment", iname = IntegrationType.OpenComputers) }) public final class PartP2POpenComputers extends PartP2PTunnel implements Environment, SidedEnvironment { + @Nullable private final Node node; diff --git a/src/main/java/appeng/parts/p2p/PartP2PPressure.java b/src/main/java/appeng/parts/p2p/PartP2PPressure.java index 49170177880..7ddd9a72487 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PPressure.java +++ b/src/main/java/appeng/parts/p2p/PartP2PPressure.java @@ -1,46 +1,41 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; -import appeng.api.networking.IGridNode; -import appeng.api.networking.ticking.IGridTickable; -import appeng.api.networking.ticking.TickRateModulation; -import appeng.api.networking.ticking.TickingRequest; -import appeng.core.settings.TickRates; -import appeng.integration.IntegrationType; -import appeng.transformer.annotations.Integration.Interface; -import appeng.util.Platform; import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; + import pneumaticCraft.api.block.BlockSupplier; import pneumaticCraft.api.tileentity.AirHandlerSupplier; import pneumaticCraft.api.tileentity.IAirHandler; import pneumaticCraft.api.tileentity.ISidedPneumaticMachine; +import appeng.api.networking.IGridNode; +import appeng.api.networking.ticking.IGridTickable; +import appeng.api.networking.ticking.TickRateModulation; +import appeng.api.networking.ticking.TickingRequest; +import appeng.core.settings.TickRates; +import appeng.integration.IntegrationType; +import appeng.transformer.annotations.Integration.Interface; +import appeng.util.Platform; @Interface(iface = "pneumaticCraft.api.tileentity.ISidedPneumaticMachine", iname = IntegrationType.PneumaticCraft) public final class PartP2PPressure extends PartP2PTunnel implements ISidedPneumaticMachine, IGridTickable { + private static final String PRESSURE_NBT_TAG = "pneumaticCraft"; private static final String PRESSURE_TYPE_ICON_NAME = "compressedIronBlock"; diff --git a/src/main/java/appeng/parts/p2p/PartP2PRFPower.java b/src/main/java/appeng/parts/p2p/PartP2PRFPower.java index 6d771a70096..6ce76cdd1c2 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRFPower.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRFPower.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import java.util.Stack; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.PowerUnits; import appeng.integration.IntegrationType; import appeng.integration.modules.helpers.NullRFHandler; @@ -28,15 +28,10 @@ import cofh.api.energy.IEnergyReceiver; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Stack; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; -@InterfaceList(value = {@Interface(iface = "cofh.api.energy.IEnergyReceiver", iname = IntegrationType.RF)}) +@InterfaceList(value = { @Interface(iface = "cofh.api.energy.IEnergyReceiver", iname = IntegrationType.RF) }) public final class PartP2PRFPower extends PartP2PTunnel implements IEnergyReceiver { + private static final ThreadLocal> THREAD_STACK = new ThreadLocal>(); /** * Default element based on the null element pattern @@ -90,8 +85,8 @@ public int receiveEnergy(final ForgeDirection from, int maxReceive, final boolea try { for (final PartP2PRFPower t : this.getOutputs()) { if (Platform.getRandomInt() % 2 > 0) { - final int receiver = - t.getOutput().receiveEnergy(t.getSide().getOpposite(), maxReceive, simulate); + final int receiver = t.getOutput() + .receiveEnergy(t.getSide().getOpposite(), maxReceive, simulate); maxReceive -= receiver; total += receiver; @@ -103,8 +98,8 @@ public int receiveEnergy(final ForgeDirection from, int maxReceive, final boolea if (maxReceive > 0) { for (final PartP2PRFPower t : this.getOutputs()) { - final int receiver = - t.getOutput().receiveEnergy(t.getSide().getOpposite(), maxReceive, simulate); + final int receiver = t.getOutput() + .receiveEnergy(t.getSide().getOpposite(), maxReceive, simulate); maxReceive -= receiver; total += receiver; @@ -115,8 +110,7 @@ public int receiveEnergy(final ForgeDirection from, int maxReceive, final boolea } this.queueTunnelDrain(PowerUnits.RF, total); - } catch (final GridAccessException ignored) { - } + } catch (final GridAccessException ignored) {} if (stack.pop() != this) { throw new IllegalStateException("Invalid Recursion detected."); @@ -142,17 +136,15 @@ private IEnergyReceiver getOutput() { if (this.isOutput()) { if (!this.cachedTarget) { final TileEntity self = this.getTile(); - final TileEntity te = self.getWorldObj() - .getTileEntity( - self.xCoord + this.getSide().offsetX, - self.yCoord + this.getSide().offsetY, - self.zCoord + this.getSide().offsetZ); + final TileEntity te = self.getWorldObj().getTileEntity( + self.xCoord + this.getSide().offsetX, + self.yCoord + this.getSide().offsetY, + self.zCoord + this.getSide().offsetZ); this.outputTarget = te instanceof IEnergyReceiver ? (IEnergyReceiver) te : null; this.cachedTarget = true; } - if (this.outputTarget == null - || !this.outputTarget.canConnectEnergy(this.getSide().getOpposite())) { + if (this.outputTarget == null || !this.outputTarget.canConnectEnergy(this.getSide().getOpposite())) { return NULL_HANDLER; } diff --git a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java index fbbfefc202f..df76ec38961 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PRedstone.java +++ b/src/main/java/appeng/parts/p2p/PartP2PRedstone.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import appeng.api.networking.events.MENetworkBootingStatusChange; import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkEventSubscribe; @@ -26,13 +26,6 @@ import appeng.util.Platform; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.block.BlockRedstoneWire; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class PartP2PRedstone extends PartP2PTunnel { @@ -142,8 +135,8 @@ public void onNeighborChanged() { srcSide = 1; } this.power = b.isProvidingStrongPower(this.getTile().getWorldObj(), x, y, z, srcSide); - this.power = Math.max( - this.power, b.isProvidingWeakPower(this.getTile().getWorldObj(), x, y, z, srcSide)); + this.power = Math + .max(this.power, b.isProvidingWeakPower(this.getTile().getWorldObj(), x, y, z, srcSide)); this.sendToOutput(this.power); } else { this.sendToOutput(0); diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java index 8606574f341..764cc503b51 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnel.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnel.java @@ -1,23 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.*; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.ForgeEventFactory; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -40,23 +46,14 @@ import appeng.parts.PartBasicState; import appeng.util.Platform; import buildcraft.api.tools.IToolWrench; + import com.google.common.base.Optional; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.ForgeEventFactory; public abstract class PartP2PTunnel extends PartBasicState { + private final TunnelCollection type = new TunnelCollection(null, this.getClass()); private boolean output; private long freq; @@ -65,8 +62,8 @@ public PartP2PTunnel(final ItemStack is) { super(is); } - public TunnelCollection getCollection( - final Collection collection, final Class c) { + public TunnelCollection getCollection(final Collection collection, + final Class c) { if (this.type.matches(c)) { this.type.setSource(collection); return this.type; @@ -129,8 +126,7 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende * @return If enabled it returns the icon of an AE quartz block, else vanilla quartz block icon */ protected IIcon getTypeTexture() { - final Optional maybeBlock = - AEApi.instance().definitions().blocks().quartz().maybeBlock(); + final Optional maybeBlock = AEApi.instance().definitions().blocks().quartz().maybeBlock(); if (maybeBlock.isPresent()) { return maybeBlock.get().getIcon(0, 0); } else { @@ -140,8 +136,8 @@ protected IIcon getTypeTexture() { @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); rh.setTexture(this.getTypeTexture()); @@ -175,15 +171,13 @@ public void renderStatic( @Override public ItemStack getItemStack(final PartItemStack type) { - if (type == PartItemStack.World - || type == PartItemStack.Network + if (type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick) { return super.getItemStack(type); } - final Optional maybeMEStack = - AEApi.instance().definitions().parts().p2PTunnelME().maybeStack(1); + final Optional maybeMEStack = AEApi.instance().definitions().parts().p2PTunnelME().maybeStack(1); if (maybeMEStack.isPresent()) { return maybeMEStack.get(); } @@ -272,78 +266,67 @@ public boolean onPartActivate(final EntityPlayer player, final Vec3 pos) { switch (tt) { case LIGHT: - for (final ItemStack stack : - parts.p2PTunnelLight().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelLight().maybeStack(1).asSet()) { newType = stack; } break; case RF_POWER: - for (final ItemStack stack : - parts.p2PTunnelRF().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelRF().maybeStack(1).asSet()) { newType = stack; } break; case FLUID: - for (final ItemStack stack : - parts.p2PTunnelLiquids().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelLiquids().maybeStack(1).asSet()) { newType = stack; } break; case IC2_POWER: - for (final ItemStack stack : - parts.p2PTunnelEU().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelEU().maybeStack(1).asSet()) { newType = stack; } break; case ITEM: - for (final ItemStack stack : - parts.p2PTunnelItems().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelItems().maybeStack(1).asSet()) { newType = stack; } break; case ME: - for (final ItemStack stack : - parts.p2PTunnelME().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelME().maybeStack(1).asSet()) { newType = stack; } break; case REDSTONE: - for (final ItemStack stack : - parts.p2PTunnelRedstone().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelRedstone().maybeStack(1).asSet()) { newType = stack; } break; case COMPUTER_MESSAGE: - for (final ItemStack stack : - parts.p2PTunnelOpenComputers().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelOpenComputers().maybeStack(1).asSet()) { newType = stack; } break; case PRESSURE: - for (final ItemStack stack : - parts.p2PTunnelPneumaticCraft().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelPneumaticCraft().maybeStack(1).asSet()) { newType = stack; } break; case GT_POWER: - for (final ItemStack stack : - parts.p2PTunnelGregtech().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelGregtech().maybeStack(1).asSet()) { newType = stack; } break; case ME_INTERFACE: - for (final ItemStack stack : - parts.p2PTunnelMEInterface().maybeStack(1).asSet()) { + for (final ItemStack stack : parts.p2PTunnelMEInterface().maybeStack(1).asSet()) { newType = stack; } break; @@ -392,8 +375,12 @@ private void printConnectionInfo(EntityPlayer player) { if (input == null) player.addChatMessage(PlayerMessages.TunnelNotConnected.get()); else { TileEntity t = input.getTile(); - player.addChatMessage(new ChatComponentTranslation( - PlayerMessages.TunnelInputIsAt.getName(), t.xCoord, t.yCoord, t.zCoord)); + player.addChatMessage( + new ChatComponentTranslation( + PlayerMessages.TunnelInputIsAt.getName(), + t.xCoord, + t.yCoord, + t.zCoord)); } } else { try { @@ -403,9 +390,8 @@ private void printConnectionInfo(EntityPlayer player) { player.addChatMessage(PlayerMessages.TunnelOutputsAreAt.get()); for (PartP2PTunnel t : oo) { TileEntity te = t.getTile(); - if (te != null) - player.addChatMessage( - new ChatComponentText("(" + te.xCoord + ", " + te.yCoord + ", " + te.zCoord + ")")); + if (te != null) player.addChatMessage( + new ChatComponentText("(" + te.xCoord + ", " + te.yCoord + ", " + te.zCoord + ")")); } } } catch (GridAccessException ignored) { @@ -496,10 +482,9 @@ public void setCustomName(String name) { i.setCustomNameInternal(name); try { for (T o : getOutputs()) o.setCustomNameInternal(name); - } catch (GridAccessException ignored) { - } + } catch (GridAccessException ignored) {} } else // let unlinked tunnel have a name - super.setCustomName(name); + super.setCustomName(name); } void setCustomNameInternal(String name) { diff --git a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java index 59c0ebca8eb..c127de04367 100644 --- a/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java +++ b/src/main/java/appeng/parts/p2p/PartP2PTunnelME.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.p2p; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.LinkedList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.exceptions.FailedConnection; import appeng.api.networking.GridFlags; @@ -35,14 +37,6 @@ import appeng.me.cache.helpers.Connections; import appeng.me.cache.helpers.TunnelConnection; import appeng.me.helpers.AENetworkProxy; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.LinkedList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class PartP2PTunnelME extends PartP2PTunnel implements IGridTickable { @@ -52,9 +46,8 @@ public class PartP2PTunnelME extends PartP2PTunnel implements I public PartP2PTunnelME(final ItemStack is) { super(is); this.getProxy().setFlags(GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL); - if (AEConfig.instance.p2pBackboneTransfer) - this.outerProxy.setFlags( - GridFlags.DENSE_CAPACITY, GridFlags.ULTRA_DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED); + if (AEConfig.instance.p2pBackboneTransfer) this.outerProxy + .setFlags(GridFlags.DENSE_CAPACITY, GridFlags.ULTRA_DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED); else this.outerProxy.setFlags(GridFlags.DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED); } @@ -157,8 +150,7 @@ public void updateConnections(final Connections connections) { this.connection.getConnections().clear(); } else if (connections.isCreate()) { - final Iterator i = - this.connection.getConnections().values().iterator(); + final Iterator i = this.connection.getConnections().values().iterator(); while (i.hasNext()) { final TunnelConnection cw = i.next(); try { @@ -184,15 +176,13 @@ public void updateConnections(final Connections connections) { for (final PartP2PTunnelME me : newSides) { try { - connections - .getConnections() - .put( - me.getGridNode(), - new TunnelConnection( - me, - AEApi.instance() - .createGridConnection( - this.outerProxy.getNode(), me.outerProxy.getNode()))); + connections.getConnections().put( + me.getGridNode(), + new TunnelConnection( + me, + AEApi.instance().createGridConnection( + this.outerProxy.getNode(), + me.outerProxy.getNode()))); } catch (final FailedConnection e) { final TileEntity start = this.getTile(); final TileEntity end = me.getTile(); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java b/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java index 1b5c869d351..fd331ab074e 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartDisplay.java @@ -1,38 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.api.parts.IPartRenderHelper; -import appeng.client.texture.CableBusTextures; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPartRenderHelper; +import appeng.client.texture.CableBusTextures; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * A more sophisticated part overlapping all 3 textures. *

- * Subclass this if you need want a new part and need all 3 textures. - * For more concrete implementations, the direct abstract subclasses might be a better alternative. + * Subclass this if you need want a new part and need all 3 textures. For more concrete implementations, the direct + * abstract subclasses might be a better alternative. * * @author AlgorithmX2 * @author yueh @@ -54,7 +47,12 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende final IIcon backTexture = CableBusTextures.PartMonitorBack.getIcon(); rh.setTexture( - sideTexture, sideTexture, backTexture, this.getItemStack().getIconIndex(), sideTexture, sideTexture); + sideTexture, + sideTexture, + backTexture, + this.getItemStack().getIconIndex(), + sideTexture, + sideTexture); rh.renderInventoryBox(renderer); rh.setInvColor(this.getColor().whiteVariant); @@ -72,15 +70,20 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { this.setRenderCache(rh.useSimplifiedRendering(x, y, z, this, this.getRenderCache())); final IIcon sideTexture = CableBusTextures.PartMonitorSides.getIcon(); final IIcon backTexture = CableBusTextures.PartMonitorBack.getIcon(); rh.setTexture( - sideTexture, sideTexture, backTexture, this.getItemStack().getIconIndex(), sideTexture, sideTexture); + sideTexture, + sideTexture, + backTexture, + this.getItemStack().getIconIndex(), + sideTexture, + sideTexture); rh.setBounds(2, 2, 14, 14, 14, 16); rh.renderBlock(x, y, z, renderer); @@ -90,8 +93,8 @@ public void renderStatic( Tessellator.instance.setBrightness(l << 20 | l << 4); } - renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = - renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this.getSpin(); + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this + .getSpin(); Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant); rh.renderFace(x, y, z, this.getFrontBright().getIcon(), ForgeDirection.SOUTH, renderer); @@ -102,8 +105,7 @@ public void renderStatic( Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant); rh.renderFace(x, y, z, this.getFrontColored().getIcon(), ForgeDirection.SOUTH, renderer); - renderer.uvRotateBottom = renderer.uvRotateEast = - renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; + renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; final IIcon sideStatusTexture = CableBusTextures.PartMonitorSidesStatus.getIcon(); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java b/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java index 3bbf4d6877f..d178c002e82 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartMonitor.java @@ -1,23 +1,34 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; +import java.io.IOException; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import appeng.api.implementations.parts.IPartStorageMonitor; import appeng.api.networking.security.BaseActionSource; import appeng.api.networking.storage.IStackWatcher; @@ -40,22 +51,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.GLAllocation; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; /** * A basic subclass for any item monitor like display with an item icon and an amount. @@ -70,6 +65,7 @@ */ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements IPartStorageMonitor, IStackWatcherHost { + private static final IWideReadableNumberConverter NUMBER_CONVERTER = ReadableNumberConverter.INSTANCE; private IAEItemStack configuredItem; private String lastHumanReadableText; @@ -219,8 +215,8 @@ protected void finalize() throws Throwable { @Override @SideOnly(Side.CLIENT) - public void renderDynamic( - final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderDynamic(final double x, final double y, final double z, final IPartRenderHelper rh, + final RenderBlocks renderer) { if (this.dspList == null) { this.dspList = GLAllocation.generateDisplayLists(1); } @@ -349,12 +345,8 @@ public void updateWatcher(final IStackWatcher newWatcher) { } @Override - public void onStackChange( - final IItemList o, - final IAEStack fullStack, - final IAEStack diffStack, - final BaseActionSource src, - final StorageChannel chan) { + public void onStackChange(final IItemList o, final IAEStack fullStack, final IAEStack diffStack, + final BaseActionSource src, final StorageChannel chan) { if (this.configuredItem != null) { if (fullStack == null) { this.configuredItem.setStackSize(0); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartPanel.java b/src/main/java/appeng/parts/reporting/AbstractPartPanel.java index 9ce30b98eda..61f21a750f6 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartPanel.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartPanel.java @@ -1,34 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.api.parts.IPartRenderHelper; -import appeng.api.util.AEColor; -import appeng.client.texture.CableBusTextures; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.parts.IPartRenderHelper; +import appeng.api.util.AEColor; +import appeng.client.texture.CableBusTextures; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * A very simple part for emitting light. *

@@ -40,6 +33,7 @@ * @since rv3 */ public abstract class AbstractPartPanel extends AbstractPartReporting { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartMonitor_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartMonitor_Colored; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartMonitor_Colored; @@ -77,7 +71,12 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende final IIcon backTexture = CableBusTextures.PartMonitorBack.getIcon(); rh.setTexture( - sideTexture, sideTexture, backTexture, this.getItemStack().getIconIndex(), sideTexture, sideTexture); + sideTexture, + sideTexture, + backTexture, + this.getItemStack().getIconIndex(), + sideTexture, + sideTexture); rh.renderInventoryBox(renderer); rh.setInvColor(this.getBrightnessColor()); @@ -89,13 +88,18 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende @Override @SideOnly(Side.CLIENT) - public void renderStatic( - final int x, final int y, final int z, final IPartRenderHelper rh, final RenderBlocks renderer) { + public void renderStatic(final int x, final int y, final int z, final IPartRenderHelper rh, + final RenderBlocks renderer) { final IIcon sideTexture = CableBusTextures.PartMonitorSides.getIcon(); final IIcon backTexture = CableBusTextures.PartMonitorBack.getIcon(); rh.setTexture( - sideTexture, sideTexture, backTexture, this.getItemStack().getIconIndex(), sideTexture, sideTexture); + sideTexture, + sideTexture, + backTexture, + this.getItemStack().getIconIndex(), + sideTexture, + sideTexture); rh.setBounds(2, 2, 14, 14, 14, 16); rh.renderBlock(x, y, z, renderer); @@ -113,8 +117,8 @@ public void renderStatic( } /** - * How bright the color the panel should appear. Usually it depends on a {@link AEColor} variant. - * This does not affect the actual light level of the part. + * How bright the color the panel should appear. Usually it depends on a {@link AEColor} variant. This does not + * affect the actual light level of the part. * * @return the brightness to be used. */ diff --git a/src/main/java/appeng/parts/reporting/AbstractPartReporting.java b/src/main/java/appeng/parts/reporting/AbstractPartReporting.java index 762a003f18c..a95ee124b83 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartReporting.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartReporting.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.parts.IPartMonitor; import appeng.api.networking.GridFlags; @@ -30,14 +32,6 @@ import appeng.parts.AEBasePart; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; /** * The most basic class for any part reporting information, like terminals or monitors. This can also include basic @@ -45,8 +39,8 @@ *

* It deals with the most basic functionalities like network data, grid registration or the rotation of the actual part. *

- * The direct abstract subclasses are usually a better entry point for adding new concrete ones. - * But this might be an ideal starting point to completely new type, which does not resemble any existing one. + * The direct abstract subclasses are usually a better entry point for adding new concrete ones. But this might be an + * ideal starting point to completely new type, which does not resemble any existing one. * * @author AlgorithmX2 * @author yueh @@ -206,12 +200,10 @@ public final void onPlacement(final EntityPlayer player, final ItemStack held, f private final int blockLight(final int emit) { if (this.opacity < 0) { final TileEntity te = this.getTile(); - this.opacity = 255 - - te.getWorldObj() - .getBlockLightOpacity( - te.xCoord + this.getSide().offsetX, - te.yCoord + this.getSide().offsetY, - te.zCoord + this.getSide().offsetZ); + this.opacity = 255 - te.getWorldObj().getBlockLightOpacity( + te.xCoord + this.getSide().offsetX, + te.yCoord + this.getSide().offsetY, + te.zCoord + this.getSide().offsetZ); } return (int) (emit * (this.opacity / 255.0f)); diff --git a/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java b/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java index a0f8c0bd7e6..662488e9bfb 100644 --- a/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java +++ b/src/main/java/appeng/parts/reporting/AbstractPartTerminal.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; + import appeng.api.config.Settings; import appeng.api.config.SortDir; import appeng.api.config.SortOrder; @@ -36,12 +36,6 @@ import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; import appeng.util.Platform; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Vec3; /** * Anything resembling an network terminal with view cells can reuse this. @@ -147,12 +141,8 @@ public IInventory getViewCellStorage() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { this.getHost().markForSave(); } } diff --git a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java index 2faf3536016..aa5bc08cf6a 100644 --- a/src/main/java/appeng/parts/reporting/PartConversionMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartConversionMonitor.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; +import java.util.Collections; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.energy.IEnergySource; import appeng.api.networking.security.PlayerSource; import appeng.api.storage.IMEMonitor; @@ -28,15 +29,9 @@ import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.item.AEItemStack; -import java.util.Collections; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Vec3; -import net.minecraftforge.common.util.ForgeDirection; public class PartConversionMonitor extends AbstractPartMonitor { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartConversionMonitor_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartConversionMonitor_Dark; private static final CableBusTextures FRONT_DARK_ICON_LOCKED = CableBusTextures.PartConversionMonitor_Dark_Locked; @@ -76,8 +71,7 @@ public boolean onPartShiftActivate(final EntityPlayer player, final Vec3 pos) { } final IEnergySource energy = this.getProxy().getEnergy(); - final IMEMonitor cell = - this.getProxy().getStorage().getItemInventory(); + final IMEMonitor cell = this.getProxy().getStorage().getItemInventory(); final IAEItemStack input = AEItemStack.create(item); if (ModeB) { @@ -86,15 +80,16 @@ public boolean onPartShiftActivate(final EntityPlayer player, final Vec3 pos) { if (input.equals(targetStack)) { final IAEItemStack insertItem = input.copy(); insertItem.setStackSize(targetStack.stackSize); - final IAEItemStack failedToInsert = - Platform.poweredInsert(energy, cell, insertItem, new PlayerSource(player, this)); + final IAEItemStack failedToInsert = Platform + .poweredInsert(energy, cell, insertItem, new PlayerSource(player, this)); player.inventory.setInventorySlotContents( - x, failedToInsert == null ? null : failedToInsert.getItemStack()); + x, + failedToInsert == null ? null : failedToInsert.getItemStack()); } } } else { - final IAEItemStack failedToInsert = - Platform.poweredInsert(energy, cell, input, new PlayerSource(player, this)); + final IAEItemStack failedToInsert = Platform + .poweredInsert(energy, cell, input, new PlayerSource(player, this)); player.inventory.setInventorySlotContents( player.inventory.currentItem, failedToInsert == null ? null : failedToInsert.getItemStack()); @@ -116,14 +111,13 @@ protected void extractItem(final EntityPlayer player) { } final IEnergySource energy = this.getProxy().getEnergy(); - final IMEMonitor cell = - this.getProxy().getStorage().getItemInventory(); + final IMEMonitor cell = this.getProxy().getStorage().getItemInventory(); final ItemStack is = input.getItemStack(); input.setStackSize(is.getMaxStackSize()); - final IAEItemStack retrieved = - Platform.poweredExtraction(energy, cell, input, new PlayerSource(player, this)); + final IAEItemStack retrieved = Platform + .poweredExtraction(energy, cell, input, new PlayerSource(player, this)); if (retrieved != null) { ItemStack newItems = retrieved.getItemStack(); final InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor(player, ForgeDirection.UNKNOWN); diff --git a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java index e52235f89a6..7645bea658b 100644 --- a/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartCraftingTerminal.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.client.texture.CableBusTextures; -import appeng.core.sync.GuiBridge; -import appeng.helpers.Reflected; -import appeng.tile.inventory.AppEngInternalInventory; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import appeng.client.texture.CableBusTextures; +import appeng.core.sync.GuiBridge; +import appeng.helpers.Reflected; +import appeng.tile.inventory.AppEngInternalInventory; + public class PartCraftingTerminal extends AbstractPartTerminal { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartCraftingTerm_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartCraftingTerm_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartCraftingTerm_Colored; diff --git a/src/main/java/appeng/parts/reporting/PartDarkPanel.java b/src/main/java/appeng/parts/reporting/PartDarkPanel.java index 81328dc2857..abb12151949 100644 --- a/src/main/java/appeng/parts/reporting/PartDarkPanel.java +++ b/src/main/java/appeng/parts/reporting/PartDarkPanel.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.helpers.Reflected; import net.minecraft.item.ItemStack; +import appeng.helpers.Reflected; + public class PartDarkPanel extends AbstractPartPanel { @Reflected diff --git a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java index 5595094b5ac..f914fa4309f 100644 --- a/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartInterfaceTerminal.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.client.texture.CableBusTextures; -import appeng.core.sync.GuiBridge; -import appeng.util.Platform; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.Vec3; +import appeng.client.texture.CableBusTextures; +import appeng.core.sync.GuiBridge; +import appeng.util.Platform; + public class PartInterfaceTerminal extends AbstractPartDisplay { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartInterfaceTerm_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartInterfaceTerm_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartInterfaceTerm_Colored; diff --git a/src/main/java/appeng/parts/reporting/PartPanel.java b/src/main/java/appeng/parts/reporting/PartPanel.java index 56301b9d2c2..94731b2fd7b 100644 --- a/src/main/java/appeng/parts/reporting/PartPanel.java +++ b/src/main/java/appeng/parts/reporting/PartPanel.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.helpers.Reflected; import net.minecraft.item.ItemStack; +import appeng.helpers.Reflected; + public class PartPanel extends AbstractPartPanel { @Reflected diff --git a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java index 4214dce617f..75f436f937b 100644 --- a/src/main/java/appeng/parts/reporting/PartPatternTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartPatternTerminal.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.implementations.ICraftingPatternItem; import appeng.api.networking.crafting.ICraftingPatternDetails; import appeng.api.storage.data.IAEItemStack; @@ -28,13 +27,9 @@ import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.BiggerAppEngInventory; import appeng.tile.inventory.InvOperation; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class PartPatternTerminal extends AbstractPartTerminal { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartPatternTerm_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartPatternTerm_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartPatternTerm_Colored; @@ -103,12 +98,8 @@ public GuiBridge getGui(final EntityPlayer p) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { if (inv == this.pattern && slot == 1) { final ItemStack stack = this.pattern.getStackInSlot(1); @@ -118,8 +109,8 @@ public void onChangeInventory( final NBTTagCompound encodedValue = stack.getTagCompound(); if (encodedValue != null) { - final ICraftingPatternDetails details = pattern.getPatternForItem( - stack, this.getHost().getTile().getWorldObj()); + final ICraftingPatternDetails details = pattern + .getPatternForItem(stack, this.getHost().getTile().getWorldObj()); final boolean substitute = encodedValue.getBoolean("substitute"); final boolean beSubstitute = encodedValue.getBoolean("beSubstitute"); final boolean isCrafting = encodedValue.getBoolean("crafting"); @@ -128,8 +119,8 @@ public void onChangeInventory( if (details == null) { inItems = PatternHelper.loadIAEItemStackFromNBT(encodedValue.getTagList("in", 10), true, null); - outItems = - PatternHelper.loadIAEItemStackFromNBT(encodedValue.getTagList("out", 10), true, null); + outItems = PatternHelper + .loadIAEItemStackFromNBT(encodedValue.getTagList("out", 10), true, null); } else { inItems = details.getInputs(); outItems = details.getOutputs(); diff --git a/src/main/java/appeng/parts/reporting/PartPatternTerminalEx.java b/src/main/java/appeng/parts/reporting/PartPatternTerminalEx.java index cbef9d1a9a9..271fc1d3ae0 100644 --- a/src/main/java/appeng/parts/reporting/PartPatternTerminalEx.java +++ b/src/main/java/appeng/parts/reporting/PartPatternTerminalEx.java @@ -1,5 +1,12 @@ package appeng.parts.reporting; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.implementations.ICraftingPatternItem; import appeng.api.networking.crafting.ICraftingPatternDetails; import appeng.api.storage.data.IAEItemStack; @@ -10,13 +17,9 @@ import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.BiggerAppEngInventory; import appeng.tile.inventory.InvOperation; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class PartPatternTerminalEx extends AbstractPartTerminal { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartPatternTerm_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartPatternTerm_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartPatternTerm_Colored; @@ -90,12 +93,8 @@ public GuiBridge getGui(final EntityPlayer p) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { if (inv == this.pattern && slot == 1) { final ItemStack stack = this.pattern.getStackInSlot(1); @@ -104,8 +103,8 @@ public void onChangeInventory( final NBTTagCompound encodedValue = stack.getTagCompound(); if (encodedValue != null) { - final ICraftingPatternDetails details = pattern.getPatternForItem( - stack, this.getHost().getTile().getWorldObj()); + final ICraftingPatternDetails details = pattern + .getPatternForItem(stack, this.getHost().getTile().getWorldObj()); final boolean substitute = encodedValue.getBoolean("substitute"); final IAEItemStack[] inItems; final IAEItemStack[] outItems; @@ -114,8 +113,8 @@ public void onChangeInventory( if (details == null) { inItems = PatternHelper.loadIAEItemStackFromNBT(encodedValue.getTagList("in", 10), true, null); - outItems = - PatternHelper.loadIAEItemStackFromNBT(encodedValue.getTagList("out", 10), false, null); + outItems = PatternHelper + .loadIAEItemStackFromNBT(encodedValue.getTagList("out", 10), false, null); } else { inItems = details.getInputs(); outItems = details.getOutputs(); diff --git a/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java b/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java index fe191f25b96..ddd83ad6922 100644 --- a/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java +++ b/src/main/java/appeng/parts/reporting/PartSemiDarkPanel.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.helpers.Reflected; import net.minecraft.item.ItemStack; +import appeng.helpers.Reflected; + public class PartSemiDarkPanel extends AbstractPartPanel { @Reflected diff --git a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java index 3a9ccfca835..8e65e38a6b0 100644 --- a/src/main/java/appeng/parts/reporting/PartStorageMonitor.java +++ b/src/main/java/appeng/parts/reporting/PartStorageMonitor.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; +import net.minecraft.item.ItemStack; + import appeng.client.texture.CableBusTextures; import appeng.helpers.Reflected; -import net.minecraft.item.ItemStack; /** * @author AlgorithmX2 @@ -29,11 +22,11 @@ * @since rv0 */ public class PartStorageMonitor extends AbstractPartMonitor { + private static final CableBusTextures FRONT_BRIGHT_ICON = CableBusTextures.PartStorageMonitor_Bright; private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartStorageMonitor_Dark; private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartStorageMonitor_Colored; - private static final CableBusTextures FRONT_COLORED_ICON_LOCKED = - CableBusTextures.PartStorageMonitor_Colored_Locked; + private static final CableBusTextures FRONT_COLORED_ICON_LOCKED = CableBusTextures.PartStorageMonitor_Colored_Locked; @Reflected public PartStorageMonitor(final ItemStack is) { diff --git a/src/main/java/appeng/parts/reporting/PartTerminal.java b/src/main/java/appeng/parts/reporting/PartTerminal.java index 2ec9311e4e4..2b2cf281ca5 100644 --- a/src/main/java/appeng/parts/reporting/PartTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartTerminal.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.parts.reporting; -import appeng.client.texture.CableBusTextures; import net.minecraft.item.ItemStack; +import appeng.client.texture.CableBusTextures; + public class PartTerminal extends AbstractPartTerminal { public PartTerminal(final ItemStack is) { diff --git a/src/main/java/appeng/recipes/AEItemResolver.java b/src/main/java/appeng/recipes/AEItemResolver.java index 93cfe0cc623..57fe8b792f3 100644 --- a/src/main/java/appeng/recipes/AEItemResolver.java +++ b/src/main/java/appeng/recipes/AEItemResolver.java @@ -1,23 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IDefinitions; import appeng.api.definitions.IItems; @@ -33,7 +27,6 @@ import appeng.items.misc.ItemCrystalSeed; import appeng.items.parts.ItemMultiPart; import appeng.items.parts.PartType; -import net.minecraft.item.ItemStack; public class AEItemResolver implements ISubItemResolver { @@ -50,8 +43,8 @@ public Object resolveItemByName(final String nameSpace, final String itemName) { } if (itemName.startsWith("LumenPaintBall.")) { - return this.paintBall( - items.coloredLumenPaintBall(), itemName.substring(itemName.indexOf('.') + 1), true); + return this + .paintBall(items.coloredLumenPaintBall(), itemName.substring(itemName.indexOf('.') + 1), true); } if (itemName.equals("CableGlass")) { @@ -63,8 +56,7 @@ public Object resolveItemByName(final String nameSpace, final String itemName) { } if (itemName.equals("CableCovered")) { - return new ResolverResultSet( - "CableCovered", parts.cableCovered().allStacks(1)); + return new ResolverResultSet("CableCovered", parts.cableCovered().allStacks(1)); } if (itemName.startsWith("CableCovered.")) { @@ -88,8 +80,7 @@ public Object resolveItemByName(final String nameSpace, final String itemName) { } if (itemName.equals("CableDenseCovered")) { - return new ResolverResultSet( - "CableDenseCovered", parts.cableDenseCovered().allStacks(1)); + return new ResolverResultSet("CableDenseCovered", parts.cableDenseCovered().allStacks(1)); } if (itemName.startsWith("CableDenseCovered.")) { @@ -97,8 +88,7 @@ public Object resolveItemByName(final String nameSpace, final String itemName) { } if (itemName.equals("CableUltraDenseSmart")) { - return new ResolverResultSet( - "CableUltraDenseSmart", parts.cableUltraDenseSmart().allStacks(1)); + return new ResolverResultSet("CableUltraDenseSmart", parts.cableUltraDenseSmart().allStacks(1)); } if (itemName.startsWith("CableUltraDenseSmart.")) { @@ -106,8 +96,7 @@ public Object resolveItemByName(final String nameSpace, final String itemName) { } if (itemName.equals("CableUltraDenseCovered")) { - return new ResolverResultSet( - "CableUltraDenseCovered", parts.cableUltraDenseCovered().allStacks(1)); + return new ResolverResultSet("CableUltraDenseCovered", parts.cableUltraDenseCovered().allStacks(1)); } if (itemName.startsWith("CableUltraDenseCovered.")) { @@ -132,8 +121,7 @@ public Object resolveItemByName(final String nameSpace, final String itemName) { final String materialName = itemName.substring(itemName.indexOf('.') + 1); final MaterialType mt = MaterialType.valueOf(materialName); // itemName = itemName.substring( 0, itemName.indexOf( "." ) ); - if (mt.getItemInstance() == ItemMultiMaterial.instance - && mt.getDamageValue() >= 0 + if (mt.getItemInstance() == ItemMultiMaterial.instance && mt.getDamageValue() >= 0 && mt.isRegistered()) { return new ResolverResult("ItemMultiMaterial", mt.getDamageValue()); } diff --git a/src/main/java/appeng/recipes/CustomRecipeConfig.java b/src/main/java/appeng/recipes/CustomRecipeConfig.java index 36c1587c674..2826ba04635 100644 --- a/src/main/java/appeng/recipes/CustomRecipeConfig.java +++ b/src/main/java/appeng/recipes/CustomRecipeConfig.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; @@ -24,5 +16,6 @@ * @since rv3 22.08.2015 */ public interface CustomRecipeConfig { + boolean isEnabled(); } diff --git a/src/main/java/appeng/recipes/CustomRecipeForgeConfiguration.java b/src/main/java/appeng/recipes/CustomRecipeForgeConfiguration.java index 179900613ec..a80cd622c0e 100644 --- a/src/main/java/appeng/recipes/CustomRecipeForgeConfiguration.java +++ b/src/main/java/appeng/recipes/CustomRecipeForgeConfiguration.java @@ -1,40 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; -import com.google.common.base.Preconditions; import javax.annotation.Nonnull; + import net.minecraftforge.common.config.Configuration; +import com.google.common.base.Preconditions; + /** * @author thatsIch * @version rv3 - 23.08.2015 * @since rv3 23.08.2015 */ public class CustomRecipeForgeConfiguration implements CustomRecipeConfig { + private final boolean isEnabled; public CustomRecipeForgeConfiguration(@Nonnull final Configuration config) { Preconditions.checkNotNull(config); this.isEnabled = config.getBoolean( - "enabled", "general", true, "If true, the custom recipes are enabled. Acts as a master switch."); + "enabled", + "general", + true, + "If true, the custom recipes are enabled. Acts as a master switch."); } @Override diff --git a/src/main/java/appeng/recipes/GroupIngredient.java b/src/main/java/appeng/recipes/GroupIngredient.java index eac2a4f2267..0039b19229c 100644 --- a/src/main/java/appeng/recipes/GroupIngredient.java +++ b/src/main/java/appeng/recipes/GroupIngredient.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; -import appeng.api.exceptions.MissingIngredientError; -import appeng.api.exceptions.RecipeError; -import appeng.api.exceptions.RegistrationError; -import appeng.api.recipes.IIngredient; -import com.google.common.base.Preconditions; import java.util.Arrays; import java.util.LinkedList; import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.exceptions.MissingIngredientError; +import appeng.api.exceptions.RecipeError; +import appeng.api.exceptions.RegistrationError; +import appeng.api.recipes.IIngredient; + +import com.google.common.base.Preconditions; + public class GroupIngredient implements IIngredient { private final String name; diff --git a/src/main/java/appeng/recipes/Ingredient.java b/src/main/java/appeng/recipes/Ingredient.java index 489f50d458e..35c1310d020 100644 --- a/src/main/java/appeng/recipes/Ingredient.java +++ b/src/main/java/appeng/recipes/Ingredient.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; @@ -25,14 +25,9 @@ import appeng.api.recipes.IIngredient; import appeng.api.recipes.ResolverResult; import appeng.api.recipes.ResolverResultSet; + import com.google.common.base.Preconditions; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; public class Ingredient implements IIngredient { @@ -77,8 +72,7 @@ public Ingredient(final RecipeHandler handler, final String input, final int qty sel = OreDictionary.WILDCARD_VALUE; } else { try { - final Object ro = - AEApi.instance().registries().recipes().resolveItem(this.nameSpace, tmpName); + final Object ro = AEApi.instance().registries().recipes().resolveItem(this.nameSpace, tmpName); if (ro instanceof ResolverResult) { final ResolverResult rr = (ResolverResult) ro; tmpName = rr.itemName; @@ -150,19 +144,17 @@ public ItemStack getItemStack() throws RegistrationError, MissingIngredientError /* * Object o = Item.itemRegistry.getObject( nameSpace + ":" + itemName ); if ( o instanceof Item ) return new - * ItemStack( (Item) o, qty, meta ); - * if ( o instanceof Block ) return new ItemStack( (Block) o, qty, meta ); - * o = Item.itemRegistry.getObject( nameSpace + ":item." + itemName ); if ( o instanceof Item ) return new - * ItemStack( (Item) o, qty, meta ); - * o = Block.blockRegistry.getObject( nameSpace + ":tile." + itemName ); if ( o instanceof Block && (!(o - * instanceof BlockAir)) ) return new ItemStack( (Block) o, qty, meta ); + * ItemStack( (Item) o, qty, meta ); if ( o instanceof Block ) return new ItemStack( (Block) o, qty, meta ); o = + * Item.itemRegistry.getObject( nameSpace + ":item." + itemName ); if ( o instanceof Item ) return new + * ItemStack( (Item) o, qty, meta ); o = Block.blockRegistry.getObject( nameSpace + ":tile." + itemName ); if ( + * o instanceof Block && (!(o instanceof BlockAir)) ) return new ItemStack( (Block) o, qty, meta ); */ throw new MissingIngredientError("Unable to find item: " + this.toString()); } - private ItemStack makeItemStack( - final Item it, final int quantity, final int damageValue, final NBTTagCompound compound) { + private ItemStack makeItemStack(final Item it, final int quantity, final int damageValue, + final NBTTagCompound compound) { final ItemStack is = new ItemStack(it, quantity, damageValue); is.setTagCompound(compound); return is; @@ -193,7 +185,7 @@ public ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredient return set; } - return new ItemStack[] {this.getItemStack()}; + return new ItemStack[] { this.getItemStack() }; } @Override diff --git a/src/main/java/appeng/recipes/IngredientSet.java b/src/main/java/appeng/recipes/IngredientSet.java index e0698b5ea05..66fd3217adb 100644 --- a/src/main/java/appeng/recipes/IngredientSet.java +++ b/src/main/java/appeng/recipes/IngredientSet.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; import appeng.api.recipes.IIngredient; import appeng.api.recipes.ResolverResultSet; + import com.google.common.base.Preconditions; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class IngredientSet implements IIngredient { diff --git a/src/main/java/appeng/recipes/MissedIngredientSet.java b/src/main/java/appeng/recipes/MissedIngredientSet.java index dfcc02381d5..aee73a4793a 100644 --- a/src/main/java/appeng/recipes/MissedIngredientSet.java +++ b/src/main/java/appeng/recipes/MissedIngredientSet.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; diff --git a/src/main/java/appeng/recipes/RecipeData.java b/src/main/java/appeng/recipes/RecipeData.java index 8ad0a3b55bc..8da53d9d0cd 100644 --- a/src/main/java/appeng/recipes/RecipeData.java +++ b/src/main/java/appeng/recipes/RecipeData.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; -import appeng.api.recipes.ICraftHandler; import java.util.*; +import appeng.api.recipes.ICraftHandler; + public class RecipeData { final Map aliases = new HashMap(); diff --git a/src/main/java/appeng/recipes/RecipeHandler.java b/src/main/java/appeng/recipes/RecipeHandler.java index e4458cc6c68..55978cea6c2 100644 --- a/src/main/java/appeng/recipes/RecipeHandler.java +++ b/src/main/java/appeng/recipes/RecipeHandler.java @@ -1,23 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.*; +import java.util.Map.Entry; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import javax.annotation.Nonnull; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IBlocks; import appeng.api.definitions.IDefinitions; @@ -39,23 +45,14 @@ import appeng.items.parts.ItemMultiPart; import appeng.recipes.handlers.IWebsiteSerializer; import appeng.recipes.handlers.OreRegistration; + import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.HashMultimap; + import cpw.mods.fml.common.LoaderState; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.*; -import java.util.Map.Entry; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; -import javax.annotation.Nonnull; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; /** * @author AlgorithmX2 @@ -64,6 +61,7 @@ * @since rv0 */ public class RecipeHandler implements IRecipeHandler { + private final RecipeData data; private final List tokens = new LinkedList(); @@ -90,8 +88,7 @@ public String getName(@Nonnull final IIngredient i) { for (final ItemStack is : i.getItemStackSet()) { return this.getName(is); } - } catch (final RecipeError ignored) { - } catch (final Throwable t) { + } catch (final RecipeError ignored) {} catch (final Throwable t) { t.printStackTrace(); // :P } @@ -170,8 +167,7 @@ private String getName(final ItemStack is) throws RecipeError { } } else if (is.getItem() instanceof ItemMultiMaterial) { realName = realName.replace("ItemMultiMaterial", "ItemMaterial"); - realName += - '.' + ((ItemMultiMaterial) is.getItem()).getTypeByStack(is).name(); + realName += '.' + ((ItemMultiMaterial) is.getItem()).getTypeByStack(is).name(); } else if (is.getItem() instanceof ItemMultiPart) { realName = realName.replace("ItemMultiPart", "ItemPart"); realName += '.' + ((ItemMultiPart) is.getItem()).getTypeByStack(is).name(); @@ -479,42 +475,42 @@ private void processTokens(final IRecipeLoader loader, final String file, final final String operation = this.tokens.remove(0).toLowerCase(); if (operation.equals("exceptions") - && (this.tokens.get(0).equals("true") - || this.tokens.get(0).equals("false"))) { + && (this.tokens.get(0).equals("true") || this.tokens.get(0).equals("false"))) { if (this.tokens.size() == 1) { this.data.exceptions = this.tokens.get(0).equals("true"); } else { throw new RecipeError("exceptions must be true or false explicitly."); } } else if (operation.equals("crash") - && (this.tokens.get(0).equals("true") - || this.tokens.get(0).equals("false"))) { - if (this.tokens.size() == 1) { - this.data.crash = this.tokens.get(0).equals("true"); - } else { - throw new RecipeError("crash must be true or false explicitly."); - } - } else if (operation.equals("erroronmissing")) { - if (this.tokens.size() == 1 - && (this.tokens.get(0).equals("true") - || this.tokens.get(0).equals("false"))) { - this.data.errorOnMissing = this.tokens.get(0).equals("true"); - } else { - throw new RecipeError("erroronmissing must be true or false explicitly."); - } - } else if (operation.equals("import")) { - if (this.tokens.size() == 1) { - (new RecipeHandler(this)).parseRecipes(loader, this.tokens.get(0)); + && (this.tokens.get(0).equals("true") || this.tokens.get(0).equals("false"))) { + if (this.tokens.size() == 1) { + this.data.crash = this.tokens.get(0).equals("true"); + } else { + throw new RecipeError("crash must be true or false explicitly."); + } + } else + if (operation.equals("erroronmissing")) { + if (this.tokens.size() == 1 + && (this.tokens.get(0).equals("true") || this.tokens.get(0).equals("false"))) { + this.data.errorOnMissing = this.tokens.get(0).equals("true"); + } else { + throw new RecipeError("erroronmissing must be true or false explicitly."); + } + } else if (operation.equals("import")) { + if (this.tokens.size() == 1) { + (new RecipeHandler(this)).parseRecipes(loader, this.tokens.get(0)); + } else { + throw new RecipeError("Import must have exactly 1 input."); + } } else { - throw new RecipeError("Import must have exactly 1 input."); + throw new RecipeError( + operation + ": " + this.tokens.toString() + "; recipe without an output."); } - } else { - throw new RecipeError(operation + ": " + this.tokens.toString() + "; recipe without an output."); - } } } catch (final RecipeError e) { - AELog.warn("Recipe Error '" + e.getMessage() + "' near line:" + line + " in " + file + " with: " - + this.tokens.toString()); + AELog.warn( + "Recipe Error '" + e + .getMessage() + "' near line:" + line + " in " + file + " with: " + this.tokens.toString()); if (this.data.exceptions) { AELog.debug(e); } diff --git a/src/main/java/appeng/recipes/game/DisassembleRecipe.java b/src/main/java/appeng/recipes/game/DisassembleRecipe.java index 778a4a26adc..0b3cb91299b 100644 --- a/src/main/java/appeng/recipes/game/DisassembleRecipe.java +++ b/src/main/java/appeng/recipes/game/DisassembleRecipe.java @@ -1,41 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.game; -import appeng.api.AEApi; -import appeng.api.definitions.*; -import appeng.api.storage.IMEInventory; -import appeng.api.storage.StorageChannel; -import appeng.api.storage.data.IAEItemStack; -import appeng.api.storage.data.IItemList; -import com.google.common.base.Optional; import java.util.HashMap; import java.util.Map; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.api.definitions.*; +import appeng.api.storage.IMEInventory; +import appeng.api.storage.StorageChannel; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.storage.data.IItemList; + +import com.google.common.base.Optional; + public final class DisassembleRecipe implements IRecipe { + private static final ItemStack MISMATCHED_STACK = null; private final Map cellMappings; @@ -90,16 +87,13 @@ private ItemStack getOutput(final IInventory inventory) { } // handle storage cells - for (final ItemStack storageCellStack : - this.getCellOutput(stackInSlot).asSet()) { + for (final ItemStack storageCellStack : this.getCellOutput(stackInSlot).asSet()) { // make sure the storage cell stackInSlot empty... - final IMEInventory cellInv = AEApi.instance() - .registries() - .cell() + final IMEInventory cellInv = AEApi.instance().registries().cell() .getCellInventory(stackInSlot, null, StorageChannel.ITEMS); if (cellInv != null) { - final IItemList list = - cellInv.getAvailableItems(StorageChannel.ITEMS.createList()); + final IItemList list = cellInv + .getAvailableItems(StorageChannel.ITEMS.createList()); if (!list.isEmpty()) { return null; } @@ -109,8 +103,7 @@ private ItemStack getOutput(final IInventory inventory) { } // handle crafting storage blocks - for (final ItemStack craftingStorageStack : - this.getNonCellOutput(stackInSlot).asSet()) { + for (final ItemStack craftingStorageStack : this.getNonCellOutput(stackInSlot).asSet()) { output = craftingStorageStack; } } @@ -155,7 +148,7 @@ public int getRecipeSize() { @Nullable @Override public ItemStack getRecipeOutput() // no default output.. - { + { return null; } } diff --git a/src/main/java/appeng/recipes/game/FacadeRecipe.java b/src/main/java/appeng/recipes/game/FacadeRecipe.java index 3d571ea55e0..55229dc87b0 100644 --- a/src/main/java/appeng/recipes/game/FacadeRecipe.java +++ b/src/main/java/appeng/recipes/game/FacadeRecipe.java @@ -1,29 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.game; -import appeng.api.AEApi; -import appeng.api.definitions.IComparableDefinition; -import appeng.api.definitions.IDefinitions; -import appeng.items.parts.ItemFacade; -import com.google.common.base.Optional; import javax.annotation.Nullable; + import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -31,7 +19,15 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import appeng.api.AEApi; +import appeng.api.definitions.IComparableDefinition; +import appeng.api.definitions.IDefinitions; +import appeng.items.parts.ItemFacade; + +import com.google.common.base.Optional; + public final class FacadeRecipe implements IRecipe { + private final IComparableDefinition anchor; private final Optional maybeFacade; @@ -49,12 +45,10 @@ public boolean matches(final InventoryCrafting inv, final World w) { @Nullable private ItemStack getOutput(final IInventory inv, final boolean createFacade) { - if (inv.getStackInSlot(0) == null - && inv.getStackInSlot(2) == null + if (inv.getStackInSlot(0) == null && inv.getStackInSlot(2) == null && inv.getStackInSlot(6) == null && inv.getStackInSlot(8) == null) { - if (this.anchor.isSameAs(inv.getStackInSlot(1)) - && this.anchor.isSameAs(inv.getStackInSlot(3)) + if (this.anchor.isSameAs(inv.getStackInSlot(1)) && this.anchor.isSameAs(inv.getStackInSlot(3)) && this.anchor.isSameAs(inv.getStackInSlot(5)) && this.anchor.isSameAs(inv.getStackInSlot(7))) { for (final Item facadeItemDefinition : this.maybeFacade.asSet()) { @@ -84,7 +78,7 @@ public int getRecipeSize() { @Override public ItemStack getRecipeOutput() // no default output.. - { + { return null; } } diff --git a/src/main/java/appeng/recipes/game/IRecipeBakeable.java b/src/main/java/appeng/recipes/game/IRecipeBakeable.java index aabeb8a3beb..553c8bb0f0d 100644 --- a/src/main/java/appeng/recipes/game/IRecipeBakeable.java +++ b/src/main/java/appeng/recipes/game/IRecipeBakeable.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.game; @@ -21,5 +13,6 @@ import appeng.api.exceptions.RegistrationError; public interface IRecipeBakeable { + void bake() throws RegistrationError; } diff --git a/src/main/java/appeng/recipes/game/ShapedRecipe.java b/src/main/java/appeng/recipes/game/ShapedRecipe.java index 41db3873aef..cd1ed03b5fe 100644 --- a/src/main/java/appeng/recipes/game/ShapedRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapedRecipe.java @@ -1,36 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.game; -import appeng.api.exceptions.MissingIngredientError; -import appeng.api.exceptions.RegistrationError; -import appeng.api.recipes.IIngredient; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; + import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.exceptions.MissingIngredientError; +import appeng.api.exceptions.RegistrationError; +import appeng.api.recipes.IIngredient; + public class ShapedRecipe implements IRecipe, IRecipeBakeable { + // Added in for future ease of change, but hard coded for now. private static final int MAX_CRAFT_GRID_WIDTH = 3; private static final int MAX_CRAFT_GRID_HEIGHT = 3; @@ -213,9 +208,8 @@ private boolean checkItemEquals(final ItemStack target, final ItemStack input) { if (input == null && target != null || input != null && target == null) { return false; } - return (target.getItem() == input.getItem() - && (target.getItemDamage() == OreDictionary.WILDCARD_VALUE - || target.getItemDamage() == input.getItemDamage())); + return (target.getItem() == input.getItem() && (target.getItemDamage() == OreDictionary.WILDCARD_VALUE + || target.getItemDamage() == input.getItemDamage())); } public ShapedRecipe setMirrored(final boolean mirror) { diff --git a/src/main/java/appeng/recipes/game/ShapelessRecipe.java b/src/main/java/appeng/recipes/game/ShapelessRecipe.java index 0a1c7bc85e3..0c723ec5de2 100644 --- a/src/main/java/appeng/recipes/game/ShapelessRecipe.java +++ b/src/main/java/appeng/recipes/game/ShapelessRecipe.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.game; -import appeng.api.exceptions.MissingIngredientError; -import appeng.api.exceptions.RegistrationError; -import appeng.api.recipes.IIngredient; import java.util.ArrayList; + import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.exceptions.MissingIngredientError; +import appeng.api.exceptions.RegistrationError; +import appeng.api.recipes.IIngredient; + public class ShapelessRecipe implements IRecipe, IRecipeBakeable { private final ArrayList input = new ArrayList(); @@ -116,9 +110,8 @@ public ItemStack getRecipeOutput() { } private boolean checkItemEquals(final ItemStack target, final ItemStack input) { - return (target.getItem() == input.getItem() - && (target.getItemDamage() == OreDictionary.WILDCARD_VALUE - || target.getItemDamage() == input.getItemDamage())); + return (target.getItem() == input.getItem() && (target.getItemDamage() == OreDictionary.WILDCARD_VALUE + || target.getItemDamage() == input.getItemDamage())); } /** diff --git a/src/main/java/appeng/recipes/handlers/Crusher.java b/src/main/java/appeng/recipes/handlers/Crusher.java index 2e58eaed04c..0a590657aa9 100644 --- a/src/main/java/appeng/recipes/handlers/Crusher.java +++ b/src/main/java/appeng/recipes/handlers/Crusher.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -29,8 +25,6 @@ import appeng.integration.abstraction.IRC; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import net.minecraft.item.ItemStack; public class Crusher implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/Grind.java b/src/main/java/appeng/recipes/handlers/Grind.java index 8d3126e8727..74511828460 100644 --- a/src/main/java/appeng/recipes/handlers/Grind.java +++ b/src/main/java/appeng/recipes/handlers/Grind.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; @@ -28,8 +24,6 @@ import appeng.core.features.AEFeature; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import net.minecraft.item.ItemStack; public class Grind implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/GrindFZ.java b/src/main/java/appeng/recipes/handlers/GrindFZ.java index a5d7c251605..188645c94f2 100644 --- a/src/main/java/appeng/recipes/handlers/GrindFZ.java +++ b/src/main/java/appeng/recipes/handlers/GrindFZ.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -29,8 +25,6 @@ import appeng.integration.abstraction.IFZ; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import net.minecraft.item.ItemStack; public class GrindFZ implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/HCCrusher.java b/src/main/java/appeng/recipes/handlers/HCCrusher.java index 349dd2e6447..8bb0574a261 100644 --- a/src/main/java/appeng/recipes/handlers/HCCrusher.java +++ b/src/main/java/appeng/recipes/handlers/HCCrusher.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -27,9 +24,6 @@ import appeng.recipes.RecipeHandler; import appeng.util.Platform; import cpw.mods.fml.common.event.FMLInterModComms; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class HCCrusher implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/IWebsiteSerializer.java b/src/main/java/appeng/recipes/handlers/IWebsiteSerializer.java index dab7ac37c73..087cf7718cd 100644 --- a/src/main/java/appeng/recipes/handlers/IWebsiteSerializer.java +++ b/src/main/java/appeng/recipes/handlers/IWebsiteSerializer.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; import appeng.recipes.RecipeHandler; -import net.minecraft.item.ItemStack; public interface IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/Inscribe.java b/src/main/java/appeng/recipes/handlers/Inscribe.java index f32f466e8a7..62e30cf0ae7 100644 --- a/src/main/java/appeng/recipes/handlers/Inscribe.java +++ b/src/main/java/appeng/recipes/handlers/Inscribe.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; import appeng.api.features.IInscriberRecipe; import appeng.api.features.InscriberProcessType; import appeng.core.features.registries.entries.InscriberRecipe; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.item.ItemStack; /** * recipe translation for inscribe process @@ -38,6 +32,7 @@ * @since rv0 */ public final class Inscribe extends InscriberProcess { + @Override public void register() throws RegistrationError, MissingIngredientError { if (this.getImprintable() == null) { @@ -50,10 +45,8 @@ public void register() throws RegistrationError, MissingIngredientError { final ItemStack[] realInput = this.getImprintable().getItemStackSet(); final List inputs = new ArrayList(realInput.length); Collections.addAll(inputs, realInput); - final ItemStack top = - (this.getTopOptional() == null) ? null : this.getTopOptional().getItemStack(); - final ItemStack bot = - (this.getBotOptional() == null) ? null : this.getBotOptional().getItemStack(); + final ItemStack top = (this.getTopOptional() == null) ? null : this.getTopOptional().getItemStack(); + final ItemStack bot = (this.getBotOptional() == null) ? null : this.getBotOptional().getItemStack(); final ItemStack output = this.getOutput().getItemStack(); final InscriberProcessType type = InscriberProcessType.Inscribe; diff --git a/src/main/java/appeng/recipes/handlers/InscriberProcess.java b/src/main/java/appeng/recipes/handlers/InscriberProcess.java index cb1e1459d59..9e9aeb0ebcf 100644 --- a/src/main/java/appeng/recipes/handlers/InscriberProcess.java +++ b/src/main/java/appeng/recipes/handlers/InscriberProcess.java @@ -1,5 +1,11 @@ package appeng.recipes.handlers; +import java.util.List; + +import javax.annotation.Nullable; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -7,9 +13,6 @@ import appeng.api.recipes.IIngredient; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import javax.annotation.Nullable; -import net.minecraft.item.ItemStack; /** * basic inscriber process for recipes @@ -20,6 +23,7 @@ * @since rv0 */ public abstract class InscriberProcess implements ICraftHandler, IWebsiteSerializer { + @Nullable private IIngredient imprintable; diff --git a/src/main/java/appeng/recipes/handlers/Macerator.java b/src/main/java/appeng/recipes/handlers/Macerator.java index 0172b6b3988..f73c35e47f8 100644 --- a/src/main/java/appeng/recipes/handlers/Macerator.java +++ b/src/main/java/appeng/recipes/handlers/Macerator.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -29,8 +25,6 @@ import appeng.integration.abstraction.IIC2; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import net.minecraft.item.ItemStack; public class Macerator implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/MekCrusher.java b/src/main/java/appeng/recipes/handlers/MekCrusher.java index 618cdf64d6f..9156a76893e 100644 --- a/src/main/java/appeng/recipes/handlers/MekCrusher.java +++ b/src/main/java/appeng/recipes/handlers/MekCrusher.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -29,8 +25,6 @@ import appeng.integration.abstraction.IMekanism; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import net.minecraft.item.ItemStack; public class MekCrusher implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/MekEnrichment.java b/src/main/java/appeng/recipes/handlers/MekEnrichment.java index 3b2ce2c408c..c90eb712e08 100644 --- a/src/main/java/appeng/recipes/handlers/MekEnrichment.java +++ b/src/main/java/appeng/recipes/handlers/MekEnrichment.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -29,8 +25,6 @@ import appeng.integration.abstraction.IMekanism; import appeng.recipes.RecipeHandler; import appeng.util.Platform; -import java.util.List; -import net.minecraft.item.ItemStack; public class MekEnrichment implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/OreRegistration.java b/src/main/java/appeng/recipes/handlers/OreRegistration.java index 3d10c2f7831..f092cd601b6 100644 --- a/src/main/java/appeng/recipes/handlers/OreRegistration.java +++ b/src/main/java/appeng/recipes/handlers/OreRegistration.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; import appeng.api.recipes.ICraftHandler; import appeng.api.recipes.IIngredient; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class OreRegistration implements ICraftHandler { diff --git a/src/main/java/appeng/recipes/handlers/Press.java b/src/main/java/appeng/recipes/handlers/Press.java index b15c127ea3d..7ef4c7775ab 100644 --- a/src/main/java/appeng/recipes/handlers/Press.java +++ b/src/main/java/appeng/recipes/handlers/Press.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RegistrationError; import appeng.api.features.IInscriberRecipe; import appeng.api.features.InscriberProcessType; import appeng.core.features.registries.entries.InscriberRecipe; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.item.ItemStack; /** * recipe translation for pressing in the inscriber @@ -38,6 +32,7 @@ * @since rv0 */ public final class Press extends InscriberProcess { + @Override public void register() throws RegistrationError, MissingIngredientError { if (this.getImprintable() == null) { @@ -50,10 +45,8 @@ public void register() throws RegistrationError, MissingIngredientError { final ItemStack[] realInput = this.getImprintable().getItemStackSet(); final List inputs = new ArrayList(realInput.length); Collections.addAll(inputs, realInput); - final ItemStack top = - (this.getTopOptional() == null) ? null : this.getTopOptional().getItemStack(); - final ItemStack bot = - (this.getBotOptional() == null) ? null : this.getBotOptional().getItemStack(); + final ItemStack top = (this.getTopOptional() == null) ? null : this.getTopOptional().getItemStack(); + final ItemStack bot = (this.getBotOptional() == null) ? null : this.getBotOptional().getItemStack(); final ItemStack output = this.getOutput().getItemStack(); final InscriberProcessType type = InscriberProcessType.Press; diff --git a/src/main/java/appeng/recipes/handlers/Pulverizer.java b/src/main/java/appeng/recipes/handlers/Pulverizer.java index b1221261e1a..b59ac7c9c13 100644 --- a/src/main/java/appeng/recipes/handlers/Pulverizer.java +++ b/src/main/java/appeng/recipes/handlers/Pulverizer.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -26,9 +23,6 @@ import appeng.recipes.RecipeHandler; import appeng.util.Platform; import cpw.mods.fml.common.event.FMLInterModComms; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class Pulverizer implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/Shaped.java b/src/main/java/appeng/recipes/handlers/Shaped.java index 82840a10bf6..5a63e0bed9f 100644 --- a/src/main/java/appeng/recipes/handlers/Shaped.java +++ b/src/main/java/appeng/recipes/handlers/Shaped.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -28,9 +25,6 @@ import appeng.recipes.game.ShapedRecipe; import appeng.util.Platform; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.item.ItemStack; public class Shaped implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/Shapeless.java b/src/main/java/appeng/recipes/handlers/Shapeless.java index 1930bf0053c..5455b05ad1d 100644 --- a/src/main/java/appeng/recipes/handlers/Shapeless.java +++ b/src/main/java/appeng/recipes/handlers/Shapeless.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -28,9 +25,6 @@ import appeng.recipes.game.ShapelessRecipe; import appeng.util.Platform; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.item.ItemStack; public class Shapeless implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/handlers/Smelt.java b/src/main/java/appeng/recipes/handlers/Smelt.java index ed22bf54b01..0cf62ecb5d9 100644 --- a/src/main/java/appeng/recipes/handlers/Smelt.java +++ b/src/main/java/appeng/recipes/handlers/Smelt.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.handlers; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RegistrationError; @@ -26,8 +22,6 @@ import appeng.recipes.RecipeHandler; import appeng.util.Platform; import cpw.mods.fml.common.registry.GameRegistry; -import java.util.List; -import net.minecraft.item.ItemStack; public class Smelt implements ICraftHandler, IWebsiteSerializer { diff --git a/src/main/java/appeng/recipes/loader/ConfigLoader.java b/src/main/java/appeng/recipes/loader/ConfigLoader.java index 6748d5cae4e..4967bcf0f26 100644 --- a/src/main/java/appeng/recipes/loader/ConfigLoader.java +++ b/src/main/java/appeng/recipes/loader/ConfigLoader.java @@ -1,35 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.loader; -import appeng.api.recipes.IRecipeLoader; -import com.google.common.base.Preconditions; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; + import javax.annotation.Nonnull; +import appeng.api.recipes.IRecipeLoader; + +import com.google.common.base.Preconditions; + /** * Loads the recipes from the config folder */ public final class ConfigLoader implements IRecipeLoader { + private final File generatedRecipesDir; private final File userRecipesDir; @@ -42,7 +38,8 @@ public ConfigLoader(final File generatedRecipesDir, final File userRecipesDir) { public BufferedReader getFile(@Nonnull final String relativeFilePath) throws Exception { Preconditions.checkNotNull(relativeFilePath); Preconditions.checkArgument( - !relativeFilePath.isEmpty(), "Supplying an empty String will result creating a reader of a folder."); + !relativeFilePath.isEmpty(), + "Supplying an empty String will result creating a reader of a folder."); final File generatedFile = new File(this.generatedRecipesDir, relativeFilePath); final File userFile = new File(this.userRecipesDir, relativeFilePath); diff --git a/src/main/java/appeng/recipes/loader/JarLoader.java b/src/main/java/appeng/recipes/loader/JarLoader.java index 8f2b2ded9e3..0759de6cfc6 100644 --- a/src/main/java/appeng/recipes/loader/JarLoader.java +++ b/src/main/java/appeng/recipes/loader/JarLoader.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.loader; -import appeng.api.recipes.IRecipeLoader; -import com.google.common.base.Preconditions; import java.io.BufferedReader; import java.io.InputStreamReader; + import javax.annotation.Nonnull; +import appeng.api.recipes.IRecipeLoader; + +import com.google.common.base.Preconditions; + public class JarLoader implements IRecipeLoader { private final String rootPath; diff --git a/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java b/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java index a3cc473736c..6838494a05a 100644 --- a/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java +++ b/src/main/java/appeng/recipes/loader/RecipeResourceCopier.java @@ -1,24 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.loader; -import com.google.common.base.Preconditions; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -33,9 +24,13 @@ import java.util.jar.JarFile; import java.util.regex.Matcher; import java.util.regex.Pattern; + import javax.annotation.Nonnull; + import org.apache.commons.io.FileUtils; +import com.google.common.base.Preconditions; + /** * copies recipes in jars onto file system includes the readme, needs to be modified if other files needs to be handled * @@ -44,6 +39,7 @@ * @since rv3 11.05.2015 */ public class RecipeResourceCopier { + /** * Most expected size of recipes found */ @@ -76,7 +72,8 @@ public RecipeResourceCopier(@Nonnull final String root) { * @param identifier only copy files which end with the identifier * @param destination destination folder to which the recipes are copied to * @throws URISyntaxException {@see #getResourceListing} - * @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not possible + * @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not + * possible * @throws NullPointerException if either parameter is null * @throws IllegalArgumentException if destination is not a directory */ @@ -92,12 +89,12 @@ public void copyTo(@Nonnull final String identifier, @Nonnull final File destina * @param destination destination folder to which the recipes are copied to * @param directory the folder to copy. * @throws URISyntaxException {@see #getResourceListing} - * @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not possible + * @throws IOException {@see #getResourceListing} and if copying the detected resource to file is not + * possible * @see {RecipeResourceCopier#copyTo(File)} */ - private void copyTo( - @Nonnull final String identifier, @Nonnull final File destination, @Nonnull final String directory) - throws URISyntaxException, IOException { + private void copyTo(@Nonnull final String identifier, @Nonnull final File destination, + @Nonnull final String directory) throws URISyntaxException, IOException { assert identifier != null; assert destination != null; assert directory != null; @@ -126,9 +123,8 @@ private void copyTo( * @param fileName the file to copy * @throws IOException if copying the file is not possible */ - private void copyFile( - @Nonnull final File destination, @Nonnull final String directory, @Nonnull final String fileName) - throws IOException { + private void copyFile(@Nonnull final File destination, @Nonnull final String directory, + @Nonnull final String fileName) throws IOException { assert destination != null; assert directory != null; assert fileName != null; @@ -144,7 +140,8 @@ private void copyFile( } /** - * List directory contents for a resource folder. Not recursive. This is basically a brute-force implementation. Works for regular files and also JARs. + * List directory contents for a resource folder. Not recursive. This is basically a brute-force implementation. + * Works for regular files and also JARs. * * @param clazz Any java class that lives in the same place as the resources you want. * @param path Should end with "/", but not start with one. @@ -186,8 +183,7 @@ private String[] getResourceListing(@Nonnull final Class clazz, @Nonnull fina if (dirURL == null) { /* - * In case of a jar file, we can't actually find a directory. - * Have to assume the same jar as clazz. + * In case of a jar file, we can't actually find a directory. Have to assume the same jar as clazz. */ final String className = clazz.getName(); final Matcher matcher = DOT_COMPILE_PATTERN.matcher(className); @@ -205,8 +201,8 @@ private String[] getResourceListing(@Nonnull final Class clazz, @Nonnull fina final JarFile jar = new JarFile(URLDecoder.decode(jarPath, UTF_8_ENCODING)); try { final Enumeration entries = jar.entries(); // gives ALL entries in jar - final Collection result = - new HashSet(INITIAL_RESOURCE_CAPACITY); // avoid duplicates + final Collection result = new HashSet(INITIAL_RESOURCE_CAPACITY); // avoid + // duplicates // in case it is a // subdirectory diff --git a/src/main/java/appeng/recipes/ores/IOreListener.java b/src/main/java/appeng/recipes/ores/IOreListener.java index 011f9751e88..5a39aa6e494 100644 --- a/src/main/java/appeng/recipes/ores/IOreListener.java +++ b/src/main/java/appeng/recipes/ores/IOreListener.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.ores; @@ -23,8 +15,7 @@ public interface IOreListener { /** - * Called with various items registered in the dictionary. - * AppEng.oreDictionary.observe(...) to register them. + * Called with various items registered in the dictionary. AppEng.oreDictionary.observe(...) to register them. * * @param name name of ore * @param item item with name diff --git a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java index 6bdd8db8a6a..3b431ea00ab 100644 --- a/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java +++ b/src/main/java/appeng/recipes/ores/OreDictionaryHandler.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.recipes.ores; -import appeng.core.AELog; -import appeng.recipes.game.IRecipeBakeable; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraftforge.oredict.OreDictionary; +import appeng.core.AELog; +import appeng.recipes.game.IRecipeBakeable; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + public class OreDictionaryHandler { public static final OreDictionaryHandler INSTANCE = new OreDictionaryHandler(); diff --git a/src/main/java/appeng/server/AECommand.java b/src/main/java/appeng/server/AECommand.java index bc20244f761..4d3c22ba485 100644 --- a/src/main/java/appeng/server/AECommand.java +++ b/src/main/java/appeng/server/AECommand.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server; -import com.google.common.base.Joiner; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.command.WrongUsageException; import net.minecraft.server.MinecraftServer; +import com.google.common.base.Joiner; + public final class AECommand extends CommandBase { + private final MinecraftServer srv; public AECommand(final MinecraftServer server) { @@ -61,14 +56,9 @@ public String getCommandUsage(final ICommandSender icommandsender) { public List addTabCompletionOptions(ICommandSender sender, String[] ss) { List l = new ArrayList<>(); String test = ss.length == 0 ? "" : ss[0].trim(); - if (ss.length == 0 - || ss.length == 1 - && (test.isEmpty() - || Arrays.stream(Commands.values()) - .anyMatch(c -> c.toString().startsWith(test)))) - Arrays.stream(Commands.values()) - .map(Commands::toString) - .filter(c -> test.isEmpty() || c.startsWith(test)) + if (ss.length == 0 || ss.length == 1 + && (test.isEmpty() || Arrays.stream(Commands.values()).anyMatch(c -> c.toString().startsWith(test)))) + Arrays.stream(Commands.values()).map(Commands::toString).filter(c -> test.isEmpty() || c.startsWith(test)) .forEach(l::add); return l; } diff --git a/src/main/java/appeng/server/AccessType.java b/src/main/java/appeng/server/AccessType.java index b1880e99e29..16377f4fa1f 100644 --- a/src/main/java/appeng/server/AccessType.java +++ b/src/main/java/appeng/server/AccessType.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server; diff --git a/src/main/java/appeng/server/Commands.java b/src/main/java/appeng/server/Commands.java index 9f007c1c9d5..ee1b067ca34 100644 --- a/src/main/java/appeng/server/Commands.java +++ b/src/main/java/appeng/server/Commands.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server; @@ -21,6 +13,7 @@ import appeng.server.subcommands.*; public enum Commands { + Chunklogger(4, new ChunkLogger()), Supporters(0, new Supporters()), profile(2, new Profile()), diff --git a/src/main/java/appeng/server/ISubCommand.java b/src/main/java/appeng/server/ISubCommand.java index fc25d00d12e..accdef04e97 100644 --- a/src/main/java/appeng/server/ISubCommand.java +++ b/src/main/java/appeng/server/ISubCommand.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server; diff --git a/src/main/java/appeng/server/ServerHelper.java b/src/main/java/appeng/server/ServerHelper.java index f31d7f6454d..c2d35429ea6 100644 --- a/src/main/java/appeng/server/ServerHelper.java +++ b/src/main/java/appeng/server/ServerHelper.java @@ -1,36 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server; -import appeng.api.parts.CableRenderMode; -import appeng.block.AEBaseBlock; -import appeng.client.ActionKey; -import appeng.client.EffectType; -import appeng.core.CommonHelper; -import appeng.core.sync.AppEngPacket; -import appeng.core.sync.network.NetworkHandler; -import appeng.items.tools.ToolNetworkTool; -import appeng.util.Platform; -import cpw.mods.fml.common.FMLCommonHandler; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -40,6 +23,17 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import appeng.api.parts.CableRenderMode; +import appeng.block.AEBaseBlock; +import appeng.client.ActionKey; +import appeng.client.EffectType; +import appeng.core.CommonHelper; +import appeng.core.sync.AppEngPacket; +import appeng.core.sync.network.NetworkHandler; +import appeng.items.tools.ToolNetworkTool; +import appeng.util.Platform; +import cpw.mods.fml.common.FMLCommonHandler; + public class ServerHelper extends CommonHelper { private EntityPlayer renderModeBased; @@ -71,14 +65,8 @@ public List getPlayers() { } @Override - public void sendToAllNearExcept( - final EntityPlayer p, - final double x, - final double y, - final double z, - final double dist, - final World w, - final AppEngPacket packet) { + public void sendToAllNearExcept(final EntityPlayer p, final double x, final double y, final double z, + final double dist, final World w, final AppEngPacket packet) { if (Platform.isClient()) { return; } @@ -99,13 +87,8 @@ public void sendToAllNearExcept( } @Override - public void spawnEffect( - final EffectType type, - final World worldObj, - final double posX, - final double posY, - final double posZ, - final Object o) { + public void spawnEffect(final EffectType type, final World worldObj, final double posX, final double posY, + final double posZ, final Object o) { // :P } diff --git a/src/main/java/appeng/server/subcommands/ChunkLogger.java b/src/main/java/appeng/server/subcommands/ChunkLogger.java index ff7c1be6cdf..996078c0c4e 100644 --- a/src/main/java/appeng/server/subcommands/ChunkLogger.java +++ b/src/main/java/appeng/server/subcommands/ChunkLogger.java @@ -1,34 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server.subcommands; -import appeng.core.AEConfig; -import appeng.core.AELog; -import appeng.core.features.AEFeature; -import appeng.server.ISubCommand; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentTranslation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.ChunkEvent; +import appeng.core.AEConfig; +import appeng.core.AELog; +import appeng.core.features.AEFeature; +import appeng.server.ISubCommand; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + public class ChunkLogger implements ISubCommand { private boolean enabled = false; @@ -46,10 +39,10 @@ private void displayStack() { boolean output = false; for (final StackTraceElement e : Thread.currentThread().getStackTrace()) { if (output) { - AELog.info(" " + e.getClassName() + '.' + e.getMethodName() + " (" + e.getLineNumber() + ')'); + AELog.info( + " " + e.getClassName() + '.' + e.getMethodName() + " (" + e.getLineNumber() + ')'); } else { - output = e.getClassName().contains("EventBus") - && e.getMethodName().contains("post"); + output = e.getClassName().contains("EventBus") && e.getMethodName().contains("post"); } } } diff --git a/src/main/java/appeng/server/subcommands/Profile.java b/src/main/java/appeng/server/subcommands/Profile.java index 3d3b7a74b8e..ba6126dc562 100644 --- a/src/main/java/appeng/server/subcommands/Profile.java +++ b/src/main/java/appeng/server/subcommands/Profile.java @@ -1,8 +1,5 @@ package appeng.server.subcommands; -import appeng.api.networking.IGridHost; -import appeng.me.Grid; -import appeng.server.ISubCommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; @@ -11,7 +8,12 @@ import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.IGridHost; +import appeng.me.Grid; +import appeng.server.ISubCommand; + public class Profile implements ISubCommand { + @Override public String getHelp(MinecraftServer srv) { return "commands.ae2.Profiler"; @@ -39,8 +41,7 @@ public void call(MinecraftServer srv, String[] args, ICommandSender sender) { sender.addChatMessage(new ChatComponentTranslation("commands.ae2.ProfilerFailed")); return; } - Grid grid = (Grid) - ((IGridHost) tile).getGridNode(ForgeDirection.UNKNOWN).getGrid(); + Grid grid = (Grid) ((IGridHost) tile).getGridNode(ForgeDirection.UNKNOWN).getGrid(); if (grid == null) { sender.addChatMessage(new ChatComponentTranslation("commands.ae2.ProfilerGridDown")); return; diff --git a/src/main/java/appeng/server/subcommands/Supporters.java b/src/main/java/appeng/server/subcommands/Supporters.java index 8fb0806b288..85015ca2896 100644 --- a/src/main/java/appeng/server/subcommands/Supporters.java +++ b/src/main/java/appeng/server/subcommands/Supporters.java @@ -1,29 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.server.subcommands; -import appeng.server.ISubCommand; -import com.google.common.base.Joiner; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; +import appeng.server.ISubCommand; + +import com.google.common.base.Joiner; + public class Supporters implements ISubCommand { @Override @@ -33,10 +27,8 @@ public String getHelp(final MinecraftServer srv) { @Override public void call(final MinecraftServer srv, final String[] data, final ICommandSender sender) { - final String[] who = { - "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", "BevoLJ" - }; - sender.addChatMessage( - new ChatComponentText("Special thanks to " + Joiner.on(", ").join(who))); + final String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", + "BevoLJ" }; + sender.addChatMessage(new ChatComponentText("Special thanks to " + Joiner.on(", ").join(who))); } } diff --git a/src/main/java/appeng/server/subcommands/ToggleDebugPathfinding.java b/src/main/java/appeng/server/subcommands/ToggleDebugPathfinding.java index 2f982a826a9..38df88883ef 100644 --- a/src/main/java/appeng/server/subcommands/ToggleDebugPathfinding.java +++ b/src/main/java/appeng/server/subcommands/ToggleDebugPathfinding.java @@ -1,12 +1,14 @@ package appeng.server.subcommands; -import appeng.core.AEConfig; -import appeng.server.ISubCommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; +import appeng.core.AEConfig; +import appeng.server.ISubCommand; + public class ToggleDebugPathfinding implements ISubCommand { + @Override public String getHelp(MinecraftServer srv) { return "commands.ae2.ToggleDebugPathfinding"; @@ -15,7 +17,8 @@ public String getHelp(MinecraftServer srv) { @Override public void call(MinecraftServer srv, String[] args, ICommandSender sender) { AEConfig.instance.debugPathFinding = !AEConfig.instance.debugPathFinding; - sender.addChatMessage(new ChatComponentText( - "Logging pathfinding is now " + (AEConfig.instance.debugPathFinding ? "on" : "off"))); + sender.addChatMessage( + new ChatComponentText( + "Logging pathfinding is now " + (AEConfig.instance.debugPathFinding ? "on" : "off"))); } } diff --git a/src/main/java/appeng/server/subcommands/ToggleDebugTiming.java b/src/main/java/appeng/server/subcommands/ToggleDebugTiming.java index 3c02f37a18a..9980ae449d1 100644 --- a/src/main/java/appeng/server/subcommands/ToggleDebugTiming.java +++ b/src/main/java/appeng/server/subcommands/ToggleDebugTiming.java @@ -1,12 +1,14 @@ package appeng.server.subcommands; -import appeng.core.AEConfig; -import appeng.server.ISubCommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; +import appeng.core.AEConfig; +import appeng.server.ISubCommand; + public class ToggleDebugTiming implements ISubCommand { + @Override public String getHelp(MinecraftServer srv) { return "commands.ae2.ToggleDebugTiming"; diff --git a/src/main/java/appeng/server/subcommands/ToggleFullAccess.java b/src/main/java/appeng/server/subcommands/ToggleFullAccess.java index e25a3c4d485..1d1664ba758 100644 --- a/src/main/java/appeng/server/subcommands/ToggleFullAccess.java +++ b/src/main/java/appeng/server/subcommands/ToggleFullAccess.java @@ -1,14 +1,17 @@ package appeng.server.subcommands; -import appeng.me.cache.SecurityCache; -import appeng.server.ISubCommand; -import com.mojang.authlib.GameProfile; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; +import appeng.me.cache.SecurityCache; +import appeng.server.ISubCommand; + +import com.mojang.authlib.GameProfile; + public class ToggleFullAccess implements ISubCommand { + @Override public String getHelp(MinecraftServer srv) { return "commands.ae2.ToggleFullAccess"; @@ -27,8 +30,7 @@ public void call(MinecraftServer srv, String[] args, ICommandSender sender) { sender.addChatMessage( new ChatComponentText("Player " + profile.getName() + " has admin access revoked")); } - } else - sender.addChatMessage( - new ChatComponentText("The command is intended to be used in game, not from the server console")); + } else sender.addChatMessage( + new ChatComponentText("The command is intended to be used in game, not from the server console")); } } diff --git a/src/main/java/appeng/services/CompassService.java b/src/main/java/appeng/services/CompassService.java index 10cea36d365..64830edaad0 100644 --- a/src/main/java/appeng/services/CompassService.java +++ b/src/main/java/appeng/services/CompassService.java @@ -1,41 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services; -import appeng.api.AEApi; -import appeng.api.util.DimensionalCoord; -import appeng.services.compass.CompassReader; -import appeng.services.compass.ICompassCallback; -import appeng.util.Platform; -import com.google.common.base.Preconditions; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.concurrent.*; + import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.world.WorldEvent; +import appeng.api.AEApi; +import appeng.api.util.DimensionalCoord; +import appeng.services.compass.CompassReader; +import appeng.services.compass.ICompassCallback; +import appeng.util.Platform; + +import com.google.common.base.Preconditions; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + public final class CompassService { + private static final int CHUNK_SIZE = 16; private final Map worldSet = new HashMap(10); @@ -113,8 +110,7 @@ public Future updateArea(final World w, final int x, final int y, final int z // lower level... final Chunk c = w.getChunkFromBlockCoords(x, z); - for (final Block skyStoneBlock : - AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet()) { + for (final Block skyStoneBlock : AEApi.instance().definitions().blocks().skyStone().maybeBlock().asSet()) { for (int i = 0; i < CHUNK_SIZE; i++) { for (int j = 0; j < CHUNK_SIZE; j++) { for (int k = low_y; k < hi_y; k++) { diff --git a/src/main/java/appeng/services/VersionChecker.java b/src/main/java/appeng/services/VersionChecker.java index c58b3d4d19a..252b996e7f2 100644 --- a/src/main/java/appeng/services/VersionChecker.java +++ b/src/main/java/appeng/services/VersionChecker.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services; +import javax.annotation.Nonnull; + import appeng.core.AELog; import appeng.services.version.VersionCheckerConfig; -import javax.annotation.Nonnull; /** * The updater has been removed diff --git a/src/main/java/appeng/services/compass/CompassException.java b/src/main/java/appeng/services/compass/CompassException.java index d4d4917dae4..23211ab5a62 100644 --- a/src/main/java/appeng/services/compass/CompassException.java +++ b/src/main/java/appeng/services/compass/CompassException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.compass; diff --git a/src/main/java/appeng/services/compass/CompassReader.java b/src/main/java/appeng/services/compass/CompassReader.java index a8aa0d01800..d181d8d61ef 100644 --- a/src/main/java/appeng/services/compass/CompassReader.java +++ b/src/main/java/appeng/services/compass/CompassReader.java @@ -1,30 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.compass; -import com.google.common.base.Preconditions; import java.io.File; import java.util.HashMap; import java.util.Map; + import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; + public final class CompassReader { + private final Map regions = new HashMap(100); private final int dimensionId; private final File worldCompassFolder; diff --git a/src/main/java/appeng/services/compass/CompassRegion.java b/src/main/java/appeng/services/compass/CompassRegion.java index a4c5fb809b7..6e6e3d885f8 100644 --- a/src/main/java/appeng/services/compass/CompassRegion.java +++ b/src/main/java/appeng/services/compass/CompassRegion.java @@ -1,32 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.compass; -import appeng.core.worlddata.MeteorDataNameEncoder; -import com.google.common.base.Preconditions; import java.io.File; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; + import javax.annotation.Nonnull; +import appeng.core.worlddata.MeteorDataNameEncoder; + +import com.google.common.base.Preconditions; + public final class CompassRegion { + private final int lowX; private final int lowZ; private final int world; diff --git a/src/main/java/appeng/services/compass/CompassThreadFactory.java b/src/main/java/appeng/services/compass/CompassThreadFactory.java index c8a4eebf114..def40c12917 100644 --- a/src/main/java/appeng/services/compass/CompassThreadFactory.java +++ b/src/main/java/appeng/services/compass/CompassThreadFactory.java @@ -1,33 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.compass; -import com.google.common.base.Preconditions; import java.util.concurrent.ThreadFactory; + import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; + /** * @author thatsIch * @version rv3 - 31.05.2015 * @since rv3 31.05.2015 */ public final class CompassThreadFactory implements ThreadFactory { + @Override public Thread newThread(@Nonnull final Runnable job) { Preconditions.checkNotNull(job); diff --git a/src/main/java/appeng/services/compass/ICompassCallback.java b/src/main/java/appeng/services/compass/ICompassCallback.java index 1906379f7ee..6cbef194100 100644 --- a/src/main/java/appeng/services/compass/ICompassCallback.java +++ b/src/main/java/appeng/services/compass/ICompassCallback.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.compass; diff --git a/src/main/java/appeng/services/export/CheckType.java b/src/main/java/appeng/services/export/CheckType.java index c11c70121ce..b79901d6545 100644 --- a/src/main/java/appeng/services/export/CheckType.java +++ b/src/main/java/appeng/services/export/CheckType.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; diff --git a/src/main/java/appeng/services/export/Checker.java b/src/main/java/appeng/services/export/Checker.java index 21bcc99d209..6af0ad487fd 100644 --- a/src/main/java/appeng/services/export/Checker.java +++ b/src/main/java/appeng/services/export/Checker.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; @@ -30,6 +22,7 @@ * @since rv3 - 01.09.2015 */ interface Checker { + /** * @param checkedAgainst the object it is checked against * @return non null being either equal or unequal diff --git a/src/main/java/appeng/services/export/ExportConfig.java b/src/main/java/appeng/services/export/ExportConfig.java index 9192aa50cac..08762dd669a 100644 --- a/src/main/java/appeng/services/export/ExportConfig.java +++ b/src/main/java/appeng/services/export/ExportConfig.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; @@ -26,12 +18,10 @@ * @since rv3 14.08.2015 */ public interface ExportConfig { + /** - * config switch to disable the exporting. - * if the recipes system is not used - * there is no reason to export them. - * Still can be useful for debugging purpose, - * thus not tying it to the recipe system directly. + * config switch to disable the exporting. if the recipes system is not used there is no reason to export them. + * Still can be useful for debugging purpose, thus not tying it to the recipe system directly. * * @return true if exporting is enabled */ diff --git a/src/main/java/appeng/services/export/ExportMode.java b/src/main/java/appeng/services/export/ExportMode.java index d11e7f39564..2f678c49cc6 100644 --- a/src/main/java/appeng/services/export/ExportMode.java +++ b/src/main/java/appeng/services/export/ExportMode.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; diff --git a/src/main/java/appeng/services/export/ExportProcess.java b/src/main/java/appeng/services/export/ExportProcess.java index 96d66a7a6c9..52aec0aa2f0 100644 --- a/src/main/java/appeng/services/export/ExportProcess.java +++ b/src/main/java/appeng/services/export/ExportProcess.java @@ -1,35 +1,32 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; +import java.io.File; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Nonnull; + +import net.minecraft.item.Item; + import appeng.core.AELog; + import com.google.common.base.Preconditions; import com.google.common.base.Stopwatch; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; import cpw.mods.fml.common.registry.GameData; -import java.io.File; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; -import net.minecraft.item.Item; /** * Main entry point for exporting the CSV file @@ -41,8 +38,8 @@ * @since rv3 14.08.2015 */ public class ExportProcess implements Runnable { - private static final String FORCE_REFRESH_MESSAGE = - "Force Refresh enabled. Will ignore cache and export CSV content."; + + private static final String FORCE_REFRESH_MESSAGE = "Force Refresh enabled. Will ignore cache and export CSV content."; private static final String CACHE_ENABLED_MESSAGE = "Cache is enabled. Checking for new mod configurations."; private static final String EQUAL_CONTENT_MESSAGE = "Same mod configuration was found. Not updating CSV content."; private static final String UNEQUAL_CONTENT_MESSAGE = "New mod configuration was found. Commencing exporting."; diff --git a/src/main/java/appeng/services/export/Exporter.java b/src/main/java/appeng/services/export/Exporter.java index 664070571f1..b5540fb3d1d 100644 --- a/src/main/java/appeng/services/export/Exporter.java +++ b/src/main/java/appeng/services/export/Exporter.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; @@ -26,6 +18,7 @@ * @since rv3 19.08.2015 */ interface Exporter { + /** * Will export something defined by the Exporter with side effects */ diff --git a/src/main/java/appeng/services/export/ForgeExportConfig.java b/src/main/java/appeng/services/export/ForgeExportConfig.java index 24dd32dc69b..462acd6f9cf 100644 --- a/src/main/java/appeng/services/export/ForgeExportConfig.java +++ b/src/main/java/appeng/services/export/ForgeExportConfig.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; -import com.google.common.base.Preconditions; import javax.annotation.Nonnull; + import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import com.google.common.base.Preconditions; + /** * Offers configuration switches for the user to change the export process * @@ -31,33 +25,29 @@ * @since rv3 14.08.2015 */ public final class ForgeExportConfig implements ExportConfig { + private static final String GENERAL_CATEGORY = "general"; private static final String CACHE_CATEGORY = "cache"; private static final String EXPORT_ITEM_NAMES_KEY = "exportItemNames"; private static final boolean EXPORT_ITEM_NAMES_DEFAULT = true; - private static final String EXPORT_ITEM_NAMES_DESCRIPTION = - "If true, all registered items will be exported containing the internal minecraft name and the localized name to actually find the item you are using. This also contains the item representation of the blocks, but are missing items, which are too much to display e.g. FMP."; + private static final String EXPORT_ITEM_NAMES_DESCRIPTION = "If true, all registered items will be exported containing the internal minecraft name and the localized name to actually find the item you are using. This also contains the item representation of the blocks, but are missing items, which are too much to display e.g. FMP."; private static final String ENABLE_FORCE_REFRESH_KEY = "enableForceRefresh"; private static final boolean ENABLE_FORCE_REFRESH_DEFAULT = false; - private static final String ENABLE_FORCE_REFRESH_DESCRIPTION = - "If true, the CSV exporting will always happen. This will not use the cache to reduce the computation."; + private static final String ENABLE_FORCE_REFRESH_DESCRIPTION = "If true, the CSV exporting will always happen. This will not use the cache to reduce the computation."; private static final String ENABLE_CACHE_KEY = "enableCache"; private static final boolean ENABLE_CACHE_DEFAULT = true; - private static final String ENABLE_CACHE_DESCRIPTION = - "Caching can save processing time, if there are a lot of items."; + private static final String ENABLE_CACHE_DESCRIPTION = "Caching can save processing time, if there are a lot of items."; private static final String ENABLE_ADDITIONAL_INFO_KEY = "enableAdditionalInfo"; private static final boolean ENABLE_ADDITIONAL_INFO_DEFAULT = false; - private static final String ENABLE_ADDITIONAL_INFO_DESCRIPTION = - "Will output more detailed information into the CSV like corresponding items"; + private static final String ENABLE_ADDITIONAL_INFO_DESCRIPTION = "Will output more detailed information into the CSV like corresponding items"; private static final String DIGEST_KEY = "digest"; private static final String DIGEST_DEFAULT = ""; - private static final String DIGEST_DESCRIPTION = - "Digest of all the mods and versions to check if a re-export of the item names is required."; + private static final String DIGEST_DESCRIPTION = "Digest of all the mods and versions to check if a re-export of the item names is required."; private final boolean exportItemNamesEnabled; private final boolean cacheEnabled; @@ -67,7 +57,8 @@ public final class ForgeExportConfig implements ExportConfig { private final Configuration config; /** - * Constructor using the configuration. Apparently there are some race conditions if constructing configurations on multiple file accesses + * Constructor using the configuration. Apparently there are some race conditions if constructing configurations on + * multiple file accesses * * @param config to be wrapped configuration. */ @@ -75,9 +66,12 @@ public ForgeExportConfig(@Nonnull final Configuration config) { this.config = Preconditions.checkNotNull(config); this.exportItemNamesEnabled = this.config.getBoolean( - EXPORT_ITEM_NAMES_KEY, GENERAL_CATEGORY, EXPORT_ITEM_NAMES_DEFAULT, EXPORT_ITEM_NAMES_DESCRIPTION); - this.cacheEnabled = this.config.getBoolean( - ENABLE_CACHE_KEY, CACHE_CATEGORY, ENABLE_CACHE_DEFAULT, ENABLE_CACHE_DESCRIPTION); + EXPORT_ITEM_NAMES_KEY, + GENERAL_CATEGORY, + EXPORT_ITEM_NAMES_DEFAULT, + EXPORT_ITEM_NAMES_DESCRIPTION); + this.cacheEnabled = this.config + .getBoolean(ENABLE_CACHE_KEY, CACHE_CATEGORY, ENABLE_CACHE_DEFAULT, ENABLE_CACHE_DESCRIPTION); this.additionalInformationEnabled = this.config.getBoolean( ENABLE_ADDITIONAL_INFO_KEY, GENERAL_CATEGORY, diff --git a/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java b/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java index 81c3a297fac..3afd0b8e21b 100644 --- a/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java +++ b/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java @@ -1,43 +1,41 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; -import appeng.core.AELog; -import com.google.common.base.Function; -import com.google.common.base.Joiner; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; import java.io.*; import java.nio.charset.Charset; import java.util.List; + import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; + import org.apache.commons.io.FileUtils; +import appeng.core.AELog; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; + /** * handles the exporting including processing, transformation and persisting the information * @@ -46,6 +44,7 @@ * @since rv3 14.08.2015 */ final class MinecraftItemCSVExporter implements Exporter { + private static final String ITEM_CSV_FILE_NAME = "items.csv"; private static final String MINIMAL_HEADER = "Mod:Item:MetaData, Localized Name"; private static final String VERBOSE_HEADER = MINIMAL_HEADER + ", Unlocalized Name, Is Air?, Class Name"; @@ -63,15 +62,12 @@ final class MinecraftItemCSVExporter implements Exporter { /** * @param exportDirectory directory of the resulting export file. Non-null required. - * @param itemRegistry the registry with minecraft items. Needs to be populated at that time, thus the exporting can - * only happen in init (pre-init is the - * phase when all items are determined) + * @param itemRegistry the registry with minecraft items. Needs to be populated at that time, thus the exporting + * can only happen in init (pre-init is the phase when all items are determined) * @param mode mode in which the export should be operated. Resulting CSV will change depending on this. */ - MinecraftItemCSVExporter( - @Nonnull final File exportDirectory, - @Nonnull final FMLControlledNamespacedRegistry itemRegistry, - @Nonnull final ExportMode mode) { + MinecraftItemCSVExporter(@Nonnull final File exportDirectory, + @Nonnull final FMLControlledNamespacedRegistry itemRegistry, @Nonnull final ExportMode mode) { this.exportDirectory = Preconditions.checkNotNull(exportDirectory); Preconditions.checkArgument(!exportDirectory.isFile()); this.itemRegistry = Preconditions.checkNotNull(itemRegistry); @@ -94,8 +90,8 @@ public void export() { try { FileUtils.forceMkdir(this.exportDirectory); - final Writer writer = - new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"))); + final Writer writer = new BufferedWriter( + new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"))); final String header = this.mode == ExportMode.MINIMAL ? MINIMAL_HEADER : VERBOSE_HEADER; writer.write(header); @@ -115,6 +111,7 @@ public void export() { * Extracts item name with meta and the display name */ private static final class TypeExtractFunction implements Function { + private static final String EXTRACTING_NULL_MESSAGE = "extracting type null"; private static final String EXTRACTING_ITEM_MESSAGE = "extracting type %s:%d"; @@ -174,6 +171,7 @@ public String apply(@Nullable final ItemStack input) { * transforms an item into a row representation of the CSV file */ private static final class ItemRowExtractFunction implements Function { + /** * this extension is required to apply the {@link StatCollector} */ @@ -193,8 +191,8 @@ private static final class ItemRowExtractFunction implements Function itemRegistry, @Nonnull final ExportMode mode) { + ItemRowExtractFunction(@Nonnull final FMLControlledNamespacedRegistry itemRegistry, + @Nonnull final ExportMode mode) { this.itemRegistry = Preconditions.checkNotNull(itemRegistry); this.mode = Preconditions.checkNotNull(mode); } @@ -235,8 +233,8 @@ public String apply(@Nullable final Item input) { final Joiner newLineJoiner = Joiner.on('\n'); final Joiner typeJoiner = newLineJoiner.skipNulls(); - final List transformedTypes = - Lists.transform(stacks, new TypeExtractFunction(itemName, this.mode)); + final List transformedTypes = Lists + .transform(stacks, new TypeExtractFunction(itemName, this.mode)); return typeJoiner.join(transformedTypes); } diff --git a/src/main/java/appeng/services/export/ModListChecker.java b/src/main/java/appeng/services/export/ModListChecker.java index 6368ea75aa3..9189b0a8462 100644 --- a/src/main/java/appeng/services/export/ModListChecker.java +++ b/src/main/java/appeng/services/export/ModListChecker.java @@ -1,38 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.export; -import com.google.common.base.Preconditions; -import cpw.mods.fml.common.ModContainer; import java.util.List; + import javax.annotation.Nonnull; + import org.apache.commons.codec.digest.DigestUtils; +import com.google.common.base.Preconditions; +import cpw.mods.fml.common.ModContainer; + /** - * Checks the cached digest against the current mods including their versions. - * Use the config to manipulate the process + * Checks the cached digest against the current mods including their versions. Use the config to manipulate the process * * @author thatsIch * @version rv3 - 01.09.2015 * @since rv3 - 01.09.2015 */ final class ModListChecker implements Checker> { + private final String configHashValue; @Nonnull @@ -47,10 +42,11 @@ final class ModListChecker implements Checker> { } /** - * Compiles a list of all mods and their versions to a digest which is updated, if it differs from the config. This is used to elevate the need to export - * the csv once again, if no change was detected. + * Compiles a list of all mods and their versions to a digest which is updated, if it differs from the config. This + * is used to elevate the need to export the csv once again, if no change was detected. * - * @param modContainers all mods and their versions to check if a difference exists between the current instance and the previous instance + * @param modContainers all mods and their versions to check if a difference exists between the current instance and + * the previous instance * @return CheckType.EQUAL if no change was detected */ @Nonnull diff --git a/src/main/java/appeng/services/export/package-info.java b/src/main/java/appeng/services/export/package-info.java index bf12342a17b..cafd3cfc846 100644 --- a/src/main/java/appeng/services/export/package-info.java +++ b/src/main/java/appeng/services/export/package-info.java @@ -1,27 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ /** - * the export package is to export all the required information for recipes into a convenient CSV file - * often names are difficult to acquire without access to the internal names. + * the export package is to export all the required information for recipes into a convenient CSV file often names are + * difficult to acquire without access to the internal names. *

- * To save from rescanning every start-up it can save a list of mods and their version - * and if only something changed, it requires to update the CSV. + * To save from rescanning every start-up it can save a list of mods and their version and if only something changed, it + * requires to update the CSV. *

* There is no explicit check if it was manually tempered * diff --git a/src/main/java/appeng/services/version/BaseVersion.java b/src/main/java/appeng/services/version/BaseVersion.java index 1fd3c77d5c3..b4a7d8702db 100644 --- a/src/main/java/appeng/services/version/BaseVersion.java +++ b/src/main/java/appeng/services/version/BaseVersion.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; -import com.google.common.base.Preconditions; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; + /** * Base version of {@link Version}. *

* Provides a unified way to test for equality and print a formatted string */ public abstract class BaseVersion implements Version { + @Nonnegative private final int revision; diff --git a/src/main/java/appeng/services/version/Channel.java b/src/main/java/appeng/services/version/Channel.java index 35cf2148c16..7abb54c433e 100644 --- a/src/main/java/appeng/services/version/Channel.java +++ b/src/main/java/appeng/services/version/Channel.java @@ -1,26 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; /** - * Represents the release channel of Applied Energistics. The mod is either in Alpha, Beta or Stable channel. - * Any more might be confusing to the end-user + * Represents the release channel of Applied Energistics. The mod is either in Alpha, Beta or Stable channel. Any more + * might be confusing to the end-user */ public enum Channel { Alpha, diff --git a/src/main/java/appeng/services/version/DefaultVersion.java b/src/main/java/appeng/services/version/DefaultVersion.java index 96e1b1c9056..3d2200c2a76 100644 --- a/src/main/java/appeng/services/version/DefaultVersion.java +++ b/src/main/java/appeng/services/version/DefaultVersion.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -22,17 +14,17 @@ import javax.annotation.Nonnull; /** - * AE prints version like rv2-beta-8 - * GitHub prints version like rv2.beta.8 + * AE prints version like rv2-beta-8 GitHub prints version like rv2.beta.8 */ public final class DefaultVersion extends BaseVersion { + /** * @param revision natural number * @param channel either alpha, beta or release * @param build natural number */ - public DefaultVersion( - @Nonnegative final int revision, @Nonnull final Channel channel, @Nonnegative final int build) { + public DefaultVersion(@Nonnegative final int revision, @Nonnull final Channel channel, + @Nonnegative final int build) { super(revision, channel, build); } diff --git a/src/main/java/appeng/services/version/DoNotCheckVersion.java b/src/main/java/appeng/services/version/DoNotCheckVersion.java index 97fa55b991f..69711477679 100644 --- a/src/main/java/appeng/services/version/DoNotCheckVersion.java +++ b/src/main/java/appeng/services/version/DoNotCheckVersion.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -22,6 +14,7 @@ * Exceptional template for {@link Version}, when the mod does not want a check */ public final class DoNotCheckVersion extends BaseVersion { + public DoNotCheckVersion() { super(Integer.MAX_VALUE, Channel.Stable, Integer.MAX_VALUE); } diff --git a/src/main/java/appeng/services/version/MissingVersion.java b/src/main/java/appeng/services/version/MissingVersion.java index 54aff638450..3b4aadd406d 100644 --- a/src/main/java/appeng/services/version/MissingVersion.java +++ b/src/main/java/appeng/services/version/MissingVersion.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -22,6 +14,7 @@ * Exceptional template when the {@link Version} could not be retrieved */ public final class MissingVersion extends BaseVersion { + public MissingVersion() { super(0, Channel.Alpha, 0); } diff --git a/src/main/java/appeng/services/version/ModVersionFetcher.java b/src/main/java/appeng/services/version/ModVersionFetcher.java index b8d68fea4ab..12598b88021 100644 --- a/src/main/java/appeng/services/version/ModVersionFetcher.java +++ b/src/main/java/appeng/services/version/ModVersionFetcher.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; +import javax.annotation.Nonnull; + import appeng.core.AELog; import appeng.services.version.exceptions.VersionCheckerException; -import javax.annotation.Nonnull; /** * Wrapper for {@link VersionParser} to check if the check is happening in developer environment or in a pull request. @@ -28,6 +21,7 @@ * In that case ignore the check. */ public final class ModVersionFetcher implements VersionFetcher { + private static final Version EXCEPTIONAL_VERSION = new MissingVersion(); @Nonnull @@ -45,7 +39,7 @@ public ModVersionFetcher(@Nonnull final String rawModVersion, @Nonnull final Ver * Parses only, if not checked in developer environment or in a pull request * * @return {@link DoNotCheckVersion} if in developer environment or pull request, {@link MissingVersion} in case of - * a parser exception or else the parsed {@link Version}. + * a parser exception or else the parsed {@link Version}. */ @Override public Version get() { diff --git a/src/main/java/appeng/services/version/Version.java b/src/main/java/appeng/services/version/Version.java index 9d669a86388..c1a9417fe84 100644 --- a/src/main/java/appeng/services/version/Version.java +++ b/src/main/java/appeng/services/version/Version.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -22,6 +14,7 @@ * Stores version information, which are easily compared */ public interface Version { + /** * @return revision of this version */ @@ -38,10 +31,9 @@ public interface Version { int build(); /** - * A version is never if these criteria are met: - * if the current revision is higher than the compared revision OR - * if revision are equal and the current channel is higher than the compared channel (Stable > Beta > Alpha) OR - * if revision, channel are equal and the build is higher than the compared build + * A version is never if these criteria are met: if the current revision is higher than the compared revision OR if + * revision are equal and the current channel is higher than the compared channel (Stable > Beta > Alpha) OR if + * revision, channel are equal and the build is higher than the compared build * * @return true if criteria are met */ diff --git a/src/main/java/appeng/services/version/VersionCheckerConfig.java b/src/main/java/appeng/services/version/VersionCheckerConfig.java index 19401cd8cc5..002bef9d99b 100644 --- a/src/main/java/appeng/services/version/VersionCheckerConfig.java +++ b/src/main/java/appeng/services/version/VersionCheckerConfig.java @@ -1,34 +1,31 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; -import appeng.core.AELog; -import com.google.common.base.Preconditions; import java.io.File; import java.util.Date; + import javax.annotation.Nonnull; + import net.minecraftforge.common.config.Configuration; +import appeng.core.AELog; + +import com.google.common.base.Preconditions; + /** * Separate config file to handle the version checker */ public final class VersionCheckerConfig { + private static final int DEFAULT_INTERVAL_HOURS = 24; private static final int MIN_INTERVAL_HOURS = 0; private static final int MAX_INTERVAL_HOURS = 7 * 24; @@ -61,7 +58,10 @@ public VersionCheckerConfig(@Nonnull final File file) { // initializes default values by caching this.isEnabled = this.config.getBoolean( - "enabled", "general", true, "If true, the version checker is enabled. Acts as a master switch."); + "enabled", + "general", + true, + "If true, the version checker is enabled. Acts as a master switch."); this.lastCheck = this.config.getString( "lastCheck", diff --git a/src/main/java/appeng/services/version/VersionFetcher.java b/src/main/java/appeng/services/version/VersionFetcher.java index b343ac0f98c..d27b06ffc91 100644 --- a/src/main/java/appeng/services/version/VersionFetcher.java +++ b/src/main/java/appeng/services/version/VersionFetcher.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -22,5 +14,6 @@ * Processes base information to retrieve a {@link Version} */ public interface VersionFetcher { + Version get(); } diff --git a/src/main/java/appeng/services/version/VersionParser.java b/src/main/java/appeng/services/version/VersionParser.java index 6b7cfdb650c..ee06f0af936 100644 --- a/src/main/java/appeng/services/version/VersionParser.java +++ b/src/main/java/appeng/services/version/VersionParser.java @@ -1,33 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; -import appeng.services.version.exceptions.*; -import com.google.common.base.Preconditions; import java.util.Scanner; import java.util.regex.Pattern; + import javax.annotation.Nonnull; +import appeng.services.version.exceptions.*; + +import com.google.common.base.Preconditions; + /** * can parse a version in form of rv2-beta-8 or rv2.beta.8 */ public final class VersionParser { + private static final Pattern PATTERN_DOT = Pattern.compile("\\."); private static final Pattern PATTERN_DASH = Pattern.compile("-"); private static final Pattern PATTERN_REVISION = Pattern.compile("[^0-9]+"); @@ -70,9 +66,8 @@ private String transformDelimiter(@Nonnull final String raw) throws MissingSepar } /** - * parses the {@link Version} out of the split. - * The split must have a length of 3, - * representing revision, channel and build. + * parses the {@link Version} out of the split. The split must have a length of 3, representing revision, channel + * and build. * * @param splitRaw raw version split with length of 3 * @return {@link Version} represented by the splitRaw @@ -127,8 +122,7 @@ private int parseRevision(@Nonnull final String rawRevision) throws InvalidRevis * @throws InvalidChannelException if not one of {@link Channel} values. */ private Channel parseChannel(@Nonnull final String rawChannel) throws InvalidChannelException { - if (!(rawChannel.equalsIgnoreCase(Channel.Alpha.name()) - || rawChannel.equalsIgnoreCase(Channel.Beta.name()) + if (!(rawChannel.equalsIgnoreCase(Channel.Alpha.name()) || rawChannel.equalsIgnoreCase(Channel.Beta.name()) || rawChannel.equalsIgnoreCase(Channel.Stable.name()))) { throw new InvalidChannelException(); } diff --git a/src/main/java/appeng/services/version/exceptions/InvalidBuildException.java b/src/main/java/appeng/services/version/exceptions/InvalidBuildException.java index 6d3d9bbff07..14e03db988a 100644 --- a/src/main/java/appeng/services/version/exceptions/InvalidBuildException.java +++ b/src/main/java/appeng/services/version/exceptions/InvalidBuildException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.exceptions; @@ -22,6 +14,7 @@ * Indicates a invalid build number, which is any string except a natural number. */ public class InvalidBuildException extends VersionCheckerException { + private static final long serialVersionUID = 3015432444672364991L; public InvalidBuildException() { diff --git a/src/main/java/appeng/services/version/exceptions/InvalidChannelException.java b/src/main/java/appeng/services/version/exceptions/InvalidChannelException.java index b9e35b77ebc..fa276477e12 100644 --- a/src/main/java/appeng/services/version/exceptions/InvalidChannelException.java +++ b/src/main/java/appeng/services/version/exceptions/InvalidChannelException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.exceptions; @@ -24,6 +16,7 @@ * Indicates an invalid {@link Channel} value. */ public class InvalidChannelException extends VersionCheckerException { + private static final long serialVersionUID = -1306378515002341620L; public InvalidChannelException() { diff --git a/src/main/java/appeng/services/version/exceptions/InvalidRevisionException.java b/src/main/java/appeng/services/version/exceptions/InvalidRevisionException.java index 897b6a1ec92..8d9e7baf8f3 100644 --- a/src/main/java/appeng/services/version/exceptions/InvalidRevisionException.java +++ b/src/main/java/appeng/services/version/exceptions/InvalidRevisionException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.exceptions; diff --git a/src/main/java/appeng/services/version/exceptions/InvalidVersionException.java b/src/main/java/appeng/services/version/exceptions/InvalidVersionException.java index c8bf008cccd..6944cfa5e46 100644 --- a/src/main/java/appeng/services/version/exceptions/InvalidVersionException.java +++ b/src/main/java/appeng/services/version/exceptions/InvalidVersionException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.exceptions; diff --git a/src/main/java/appeng/services/version/exceptions/MissingSeparatorException.java b/src/main/java/appeng/services/version/exceptions/MissingSeparatorException.java index 3360c430a62..1f360de71f5 100644 --- a/src/main/java/appeng/services/version/exceptions/MissingSeparatorException.java +++ b/src/main/java/appeng/services/version/exceptions/MissingSeparatorException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.exceptions; @@ -24,6 +16,7 @@ * Valid separators are a dash ("-") or dot (".") */ public class MissingSeparatorException extends VersionCheckerException { + private static final long serialVersionUID = 8366370192017020750L; public MissingSeparatorException() { diff --git a/src/main/java/appeng/services/version/exceptions/VersionCheckerException.java b/src/main/java/appeng/services/version/exceptions/VersionCheckerException.java index 7358dd7e712..1595f5acf08 100644 --- a/src/main/java/appeng/services/version/exceptions/VersionCheckerException.java +++ b/src/main/java/appeng/services/version/exceptions/VersionCheckerException.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.exceptions; @@ -24,6 +16,7 @@ * A super class for any exception thrown by the version checker for easier handling. */ public class VersionCheckerException extends Exception { + private static final long serialVersionUID = 4582501864800542884L; public VersionCheckerException(@Nonnull String string) { diff --git a/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java b/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java index a4c8ad34467..888debb02b3 100644 --- a/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java +++ b/src/main/java/appeng/services/version/github/DefaultFormattedRelease.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.github; -import appeng.services.version.Version; import javax.annotation.Nonnull; +import appeng.services.version.Version; + /** * Default template when a {@link FormattedRelease} is needed. */ public final class DefaultFormattedRelease implements FormattedRelease { + @Nonnull private final Version version; diff --git a/src/main/java/appeng/services/version/github/FormattedRelease.java b/src/main/java/appeng/services/version/github/FormattedRelease.java index 2e2fdb40ff5..564e5ee9695 100644 --- a/src/main/java/appeng/services/version/github/FormattedRelease.java +++ b/src/main/java/appeng/services/version/github/FormattedRelease.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.github; @@ -24,6 +16,7 @@ * Represents the acquired, processed information through github about a release of Applied Energistics 2 */ public interface FormattedRelease { + /** * @return changelog */ diff --git a/src/main/java/appeng/services/version/github/MissingFormattedRelease.java b/src/main/java/appeng/services/version/github/MissingFormattedRelease.java index 95fe4c01f95..fee870b6d00 100644 --- a/src/main/java/appeng/services/version/github/MissingFormattedRelease.java +++ b/src/main/java/appeng/services/version/github/MissingFormattedRelease.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.github; +import javax.annotation.Nonnull; + import appeng.services.version.MissingVersion; import appeng.services.version.Version; -import javax.annotation.Nonnull; /** * Exceptional template, when no meaningful {@link FormattedRelease} could be obtained */ public final class MissingFormattedRelease implements FormattedRelease { + @Nonnull private final Version version; diff --git a/src/main/java/appeng/services/version/github/Release.java b/src/main/java/appeng/services/version/github/Release.java index db61d4ec3aa..60ab9e51645 100644 --- a/src/main/java/appeng/services/version/github/Release.java +++ b/src/main/java/appeng/services/version/github/Release.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.github; @@ -22,6 +14,7 @@ * Template class for Gson to write values from the Json Object into an actual class */ public class Release { + /** * name of the tag it is saved */ diff --git a/src/main/java/appeng/services/version/github/ReleaseFetcher.java b/src/main/java/appeng/services/version/github/ReleaseFetcher.java index b87bf7aa722..487ee38e1f6 100644 --- a/src/main/java/appeng/services/version/github/ReleaseFetcher.java +++ b/src/main/java/appeng/services/version/github/ReleaseFetcher.java @@ -1,42 +1,38 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version.github; +import java.io.IOException; +import java.lang.reflect.Type; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; + +import javax.annotation.Nonnull; + +import org.apache.commons.io.IOUtils; + import appeng.core.AELog; import appeng.services.version.Channel; import appeng.services.version.Version; import appeng.services.version.VersionCheckerConfig; import appeng.services.version.VersionParser; import appeng.services.version.exceptions.VersionCheckerException; + import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import java.io.IOException; -import java.lang.reflect.Type; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; -import javax.annotation.Nonnull; -import org.apache.commons.io.IOUtils; public final class ReleaseFetcher { - private static final String GITHUB_RELEASES_URL = - "https://api.github.com/repos/xsun2001/Applied-Energistics-2-Unofficial/releases"; + + private static final String GITHUB_RELEASES_URL = "https://api.github.com/repos/xsun2001/Applied-Energistics-2-Unofficial/releases"; private static final FormattedRelease EXCEPTIONAL_RELEASE = new MissingFormattedRelease(); @Nonnull @@ -98,5 +94,6 @@ private FormattedRelease getLatestFitRelease(final Iterable releases) t return EXCEPTIONAL_RELEASE; } - private static final class ReleasesTypeToken extends TypeToken> {} + private static final class ReleasesTypeToken extends TypeToken> { + } } diff --git a/src/main/java/appeng/spatial/BiomeGenStorage.java b/src/main/java/appeng/spatial/BiomeGenStorage.java index aaaeacdc5d2..be53228e951 100644 --- a/src/main/java/appeng/spatial/BiomeGenStorage.java +++ b/src/main/java/appeng/spatial/BiomeGenStorage.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; diff --git a/src/main/java/appeng/spatial/CachedPlane.java b/src/main/java/appeng/spatial/CachedPlane.java index 7e1d0803da6..dac3bb57d34 100644 --- a/src/main/java/appeng/spatial/CachedPlane.java +++ b/src/main/java/appeng/spatial/CachedPlane.java @@ -1,35 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; -import appeng.api.AEApi; -import appeng.api.definitions.IBlockDefinition; -import appeng.api.movable.IMovableHandler; -import appeng.api.movable.IMovableRegistry; -import appeng.api.util.WorldCoord; -import appeng.core.AELog; -import appeng.core.worlddata.WorldData; -import appeng.util.Platform; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.ChunkPosition; @@ -39,7 +24,17 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.AEApi; +import appeng.api.definitions.IBlockDefinition; +import appeng.api.movable.IMovableHandler; +import appeng.api.movable.IMovableRegistry; +import appeng.api.util.WorldCoord; +import appeng.core.AELog; +import appeng.core.worlddata.WorldData; +import appeng.util.Platform; + public class CachedPlane { + private final int x_size; private final int z_size; private final int cx_size; @@ -55,17 +50,10 @@ public class CachedPlane { private final World world; private final IMovableRegistry reg = AEApi.instance().registries().movable(); private final LinkedList updates = new LinkedList(); - private final IBlockDefinition matrixFrame = - AEApi.instance().definitions().blocks().matrixFrame(); + private final IBlockDefinition matrixFrame = AEApi.instance().definitions().blocks().matrixFrame(); private int verticalBits; - public CachedPlane( - final World w, - final int minX, - final int minY, - final int minZ, - final int maxX, - final int maxY, + public CachedPlane(final World w, final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) { this.world = w; @@ -112,8 +100,7 @@ public CachedPlane( for (int cx = 0; cx < this.cx_size; cx++) { for (int cz = 0; cz < this.cz_size; cz++) { - final LinkedList> rawTiles = - new LinkedList>(); + final LinkedList> rawTiles = new LinkedList>(); final LinkedList deadTiles = new LinkedList(); final Chunk c = w.getChunkFromChunkCoords(minCX + cx, minCZ + cz); @@ -123,8 +110,7 @@ public CachedPlane( for (final Entry tx : rawTiles) { final ChunkPosition cp = tx.getKey(); final TileEntity te = tx.getValue(); - if (te.xCoord >= minX - && te.xCoord <= maxX + if (te.xCoord >= minX && te.xCoord <= maxX && te.yCoord >= minY && te.yCoord <= maxY && te.zCoord >= minZ @@ -133,17 +119,19 @@ public CachedPlane( this.tiles.add(te); deadTiles.add(cp); } else { - final Object[] details = - this.myColumns[te.xCoord - minX][te.zCoord - minZ].getDetails(te.yCoord); + final Object[] details = this.myColumns[te.xCoord - minX][te.zCoord - minZ] + .getDetails(te.yCoord); final Block blk = (Block) details[0]; // don't skip air, just let the code replace it... - if (blk != null - && blk.isAir(c.worldObj, te.xCoord, te.yCoord, te.zCoord) + if (blk != null && blk.isAir(c.worldObj, te.xCoord, te.yCoord, te.zCoord) && blk.isReplaceable(c.worldObj, te.xCoord, te.yCoord, te.zCoord)) { c.worldObj.setBlock(te.xCoord, te.yCoord, te.zCoord, Platform.AIR_BLOCK); c.worldObj.notifyBlocksOfNeighborChange( - te.xCoord, te.yCoord, te.zCoord, Platform.AIR_BLOCK); + te.xCoord, + te.yCoord, + te.zCoord, + Platform.AIR_BLOCK); } else { this.myColumns[te.xCoord - minX][te.zCoord - minZ].setSkip(te.yCoord); } @@ -160,14 +148,16 @@ public CachedPlane( if (list != null) { for (final Object o : list) { final NextTickListEntry entry = (NextTickListEntry) o; - if (entry.xCoord >= minX - && entry.xCoord <= maxX + if (entry.xCoord >= minX && entry.xCoord <= maxX && entry.yCoord >= minY && entry.yCoord <= maxY && entry.zCoord >= minZ && entry.zCoord <= maxZ) { final NextTickListEntry newEntry = new NextTickListEntry( - entry.xCoord, entry.yCoord, entry.zCoord, entry.func_151351_a()); + entry.xCoord, + entry.yCoord, + entry.zCoord, + entry.func_151351_a()); newEntry.scheduledTime = entry.scheduledTime - k; this.ticks.add(newEntry); } @@ -227,7 +217,12 @@ void swap(final CachedPlane dst) { for (final TileEntity te : this.tiles) { dst.addTile( - te.xCoord - this.x_offset, te.yCoord - this.y_offset, te.zCoord - this.z_offset, te, this, mr); + te.xCoord - this.x_offset, + te.yCoord - this.y_offset, + te.zCoord - this.z_offset, + te, + this, + mr); } for (final TileEntity te : dst.tiles) { @@ -244,7 +239,10 @@ void swap(final CachedPlane dst) { for (final NextTickListEntry entry : dst.ticks) { this.addTick( - entry.xCoord - dst.x_offset, entry.yCoord - dst.y_offset, entry.zCoord - dst.z_offset, entry); + entry.xCoord - dst.x_offset, + entry.yCoord - dst.y_offset, + entry.zCoord - dst.z_offset, + entry); } startTime = System.nanoTime(); @@ -265,19 +263,16 @@ private void markForUpdate(final int x, final int y, final int z) { } private void addTick(final int x, final int y, final int z, final NextTickListEntry entry) { - this.getWorld() - .scheduleBlockUpdate( - x + this.x_offset, y + this.y_offset, z + this.z_offset, entry.func_151351_a(), (int) - entry.scheduledTime); + this.getWorld().scheduleBlockUpdate( + x + this.x_offset, + y + this.y_offset, + z + this.z_offset, + entry.func_151351_a(), + (int) entry.scheduledTime); } - private void addTile( - final int x, - final int y, - final int z, - final TileEntity te, - final CachedPlane alternateDestination, - final IMovableRegistry mr) { + private void addTile(final int x, final int y, final int z, final TileEntity te, + final CachedPlane alternateDestination, final IMovableRegistry mr) { try { final Column c = this.myColumns[x][z]; @@ -332,9 +327,7 @@ private void updateChunks() { final Chunk c = this.myChunks[x][z]; for (int y = 1; y < 255; y += 32) { - WorldData.instance() - .compassData() - .service() + WorldData.instance().compassData().service() .updateArea(this.getWorld(), c.xPosition << 4, y, c.zPosition << 4); } @@ -356,7 +349,7 @@ private class Column { private final int x; private final int z; private final Chunk c; - private final Object[] ch = {0, 0, 0}; + private final Object[] ch = { 0, 0, 0 }; private final ExtendedBlockStorage[] storage; private List skipThese = null; @@ -371,15 +364,15 @@ public Column(final Chunk chunk, final int x, final int z, final int chunkY, fin final int by = (ay + chunkY); ExtendedBlockStorage extendedblockstorage = this.storage[by]; if (extendedblockstorage == null) { - extendedblockstorage = - this.storage[by] = new ExtendedBlockStorage(by << 4, !this.c.worldObj.provider.hasNoSky); + extendedblockstorage = this.storage[by] = new ExtendedBlockStorage( + by << 4, + !this.c.worldObj.provider.hasNoSky); } } } private void setBlockIDWithMetadata(final int y, final Object[] blk) { - for (final Block matrixFrameBlock : - CachedPlane.this.matrixFrame.maybeBlock().asSet()) { + for (final Block matrixFrameBlock : CachedPlane.this.matrixFrame.maybeBlock().asSet()) { if (blk[0] == matrixFrameBlock) { blk[0] = Platform.AIR_BLOCK; } diff --git a/src/main/java/appeng/spatial/DefaultSpatialHandler.java b/src/main/java/appeng/spatial/DefaultSpatialHandler.java index 89e546bb948..0133a95be7d 100644 --- a/src/main/java/appeng/spatial/DefaultSpatialHandler.java +++ b/src/main/java/appeng/spatial/DefaultSpatialHandler.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; -import appeng.api.movable.IMovableHandler; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import appeng.api.movable.IMovableHandler; + public class DefaultSpatialHandler implements IMovableHandler { /** diff --git a/src/main/java/appeng/spatial/ISpatialVisitor.java b/src/main/java/appeng/spatial/ISpatialVisitor.java index 31331de0b79..772ddd63dc7 100644 --- a/src/main/java/appeng/spatial/ISpatialVisitor.java +++ b/src/main/java/appeng/spatial/ISpatialVisitor.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; diff --git a/src/main/java/appeng/spatial/StorageChunkProvider.java b/src/main/java/appeng/spatial/StorageChunkProvider.java index 124ca30cca6..941f95f3a5e 100644 --- a/src/main/java/appeng/spatial/StorageChunkProvider.java +++ b/src/main/java/appeng/spatial/StorageChunkProvider.java @@ -1,27 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; -import appeng.api.AEApi; -import appeng.core.AEConfig; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.World; @@ -29,18 +20,18 @@ import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.ChunkProviderGenerate; +import appeng.api.AEApi; +import appeng.core.AEConfig; + public class StorageChunkProvider extends ChunkProviderGenerate { + private static final int SQUARE_CHUNK_SIZE = 256; private static final Block[] BLOCKS; static { BLOCKS = new Block[255 * SQUARE_CHUNK_SIZE]; - for (final Block matrixFrameBlock : AEApi.instance() - .definitions() - .blocks() - .matrixFrame() - .maybeBlock() + for (final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock() .asSet()) { for (int x = 0; x < BLOCKS.length; x++) { BLOCKS[x] = matrixFrameBlock; diff --git a/src/main/java/appeng/spatial/StorageHelper.java b/src/main/java/appeng/spatial/StorageHelper.java index ff7436a61d1..0e0e414be2c 100644 --- a/src/main/java/appeng/spatial/StorageHelper.java +++ b/src/main/java/appeng/spatial/StorageHelper.java @@ -1,28 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; -import appeng.api.AEApi; -import appeng.api.util.WorldCoord; -import appeng.core.stats.Achievements; -import appeng.util.Platform; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityHanging; @@ -34,6 +23,11 @@ import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import appeng.api.AEApi; +import appeng.api.util.WorldCoord; +import appeng.core.stats.Achievements; +import appeng.util.Platform; + public class StorageHelper { private static StorageHelper instance; @@ -85,9 +79,7 @@ private Entity teleportEntity(Entity entity, final TelDestination link) { } // load the chunk! - WorldServer.class - .cast(newWorld) - .getChunkProvider() + WorldServer.class.cast(newWorld).getChunkProvider() .loadChunk(MathHelper.floor_double(link.x) >> 4, MathHelper.floor_double(link.z) >> 4); final boolean diffDestination = newWorld != oldWorld; @@ -97,10 +89,10 @@ private Entity teleportEntity(Entity entity, final TelDestination link) { Achievements.SpatialIOExplorer.addToPlayer(player); } - player.mcServer - .getConfigurationManager() - .transferPlayerToDimension( - player, link.dim.provider.dimensionId, new METeleporter(newWorld, link)); + player.mcServer.getConfigurationManager().transferPlayerToDimension( + player, + link.dim.provider.dimensionId, + new METeleporter(newWorld, link)); } else { final int entX = entity.chunkCoordX; final int entZ = entity.chunkCoordZ; @@ -153,14 +145,8 @@ private Entity teleportEntity(Entity entity, final TelDestination link) { return entity; } - private void transverseEdges( - final int minX, - final int minY, - final int minZ, - final int maxX, - final int maxY, - final int maxZ, - final ISpatialVisitor visitor) { + private void transverseEdges(final int minX, final int minY, final int minZ, final int maxX, final int maxY, + final int maxZ, final ISpatialVisitor visitor) { for (int y = minY; y < maxY; y++) { for (int z = minZ; z < maxZ; z++) { visitor.visit(minX, y, z); @@ -183,27 +169,12 @@ private void transverseEdges( } } - public void swapRegions( - final World src - /** over world **/ - , - final World dst - /** storage cell **/ - , - final int x, - final int y, - final int z, - final int i, - final int j, - final int k, - final int scaleX, - final int scaleY, - final int scaleZ) { - for (final Block matrixFrameBlock : AEApi.instance() - .definitions() - .blocks() - .matrixFrame() - .maybeBlock() + public void swapRegions(final World src + /** over world **/ + , final World dst/** storage cell **/ + ,final int x, final int y, final int z, final int i, final int j, final int k, final int scaleX, + final int scaleY, final int scaleZ) { + for (final Block matrixFrameBlock : AEApi.instance().definitions().blocks().matrixFrame().maybeBlock() .asSet()) { this.transverseEdges( i - 1, @@ -215,11 +186,11 @@ public void swapRegions( new WrapInMatrixFrame(matrixFrameBlock, 0, dst)); } - final AxisAlignedBB srcBox = - AxisAlignedBB.getBoundingBox(x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1); + final AxisAlignedBB srcBox = AxisAlignedBB + .getBoundingBox(x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1); - final AxisAlignedBB dstBox = - AxisAlignedBB.getBoundingBox(i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1); + final AxisAlignedBB dstBox = AxisAlignedBB + .getBoundingBox(i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1); final CachedPlane cDst = new CachedPlane(dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ); final CachedPlane cSrc = new CachedPlane(src, x, y, z, x + scaleX, y + scaleY, z + scaleZ); @@ -247,18 +218,28 @@ public void swapRegions( } this.transverseEdges( - x - 1, y - 1, z - 1, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1, new TriggerUpdates(src)); + x - 1, + y - 1, + z - 1, + x + scaleX + 1, + y + scaleY + 1, + z + scaleZ + 1, + new TriggerUpdates(src)); this.transverseEdges( - i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new TriggerUpdates(dst)); + i - 1, + j - 1, + k - 1, + i + scaleX + 1, + j + scaleY + 1, + k + scaleZ + 1, + new TriggerUpdates(dst)); this.transverseEdges(x, y, z, x + scaleX, y + scaleY, z + scaleZ, new TriggerUpdates(src)); this.transverseEdges(i, j, k, i + scaleX, j + scaleY, k + scaleZ, new TriggerUpdates(dst)); /* * IChunkProvider cp = destination.getChunkProvider(); if ( cp instanceof ChunkProviderServer ) { - * ChunkProviderServer - * srv = (ChunkProviderServer) cp; srv.unloadAllChunks(); } - * cp.unloadQueuedChunks(); + * ChunkProviderServer srv = (ChunkProviderServer) cp; srv.unloadAllChunks(); } cp.unloadQueuedChunks(); */ } @@ -306,15 +287,8 @@ private static class TelDestination { private final int yOff; private final int zOff; - TelDestination( - final World dimension, - final AxisAlignedBB srcBox, - final double x, - final double y, - final double z, - final int tileX, - final int tileY, - final int tileZ) { + TelDestination(final World dimension, final AxisAlignedBB srcBox, final double x, final double y, + final double z, final int tileX, final int tileY, final int tileZ) { this.dim = dimension; this.x = Math.min(srcBox.maxX - 0.5, Math.max(srcBox.minX + 0.5, x + tileX)); this.y = Math.min(srcBox.maxY - 0.5, Math.max(srcBox.minY + 0.5, y + tileY)); @@ -335,16 +309,20 @@ public METeleporter(final WorldServer par1WorldServer, final TelDestination d) { } @Override - public void placeInPortal( - final Entity par1Entity, final double par2, final double par4, final double par6, final float par8) { + public void placeInPortal(final Entity par1Entity, final double par2, final double par4, final double par6, + final float par8) { par1Entity.setLocationAndAngles( - this.destination.x, this.destination.y, this.destination.z, par1Entity.rotationYaw, 0.0F); + this.destination.x, + this.destination.y, + this.destination.z, + par1Entity.rotationYaw, + 0.0F); par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D; } @Override - public boolean placeInExistingPortal( - final Entity par1Entity, final double par2, final double par4, final double par6, final float par8) { + public boolean placeInExistingPortal(final Entity par1Entity, final double par2, final double par4, + final double par6, final float par8) { return false; } diff --git a/src/main/java/appeng/spatial/StorageWorldProvider.java b/src/main/java/appeng/spatial/StorageWorldProvider.java index 334b38f39c1..a5e2a41cbd3 100644 --- a/src/main/java/appeng/spatial/StorageWorldProvider.java +++ b/src/main/java/appeng/spatial/StorageWorldProvider.java @@ -1,28 +1,15 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.spatial; -import appeng.client.render.SpatialSkyRender; -import appeng.core.AppEng; -import appeng.core.Registration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.Vec3; @@ -33,6 +20,12 @@ import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.client.IRenderHandler; +import appeng.client.render.SpatialSkyRender; +import appeng.core.AppEng; +import appeng.core.Registration; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class StorageWorldProvider extends WorldProvider { public StorageWorldProvider() { diff --git a/src/main/java/appeng/tile/AEBaseInvTile.java b/src/main/java/appeng/tile/AEBaseInvTile.java index 5dc903d99fb..7f9e9fce59a 100644 --- a/src/main/java/appeng/tile/AEBaseInvTile.java +++ b/src/main/java/appeng/tile/AEBaseInvTile.java @@ -1,28 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile; -import appeng.block.AEBaseBlock; -import appeng.tile.events.TileEventType; -import appeng.tile.inventory.IAEAppEngInventory; -import appeng.tile.inventory.InvOperation; import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -31,6 +20,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import appeng.block.AEBaseBlock; +import appeng.tile.events.TileEventType; +import appeng.tile.inventory.IAEAppEngInventory; +import appeng.tile.inventory.InvOperation; + public abstract class AEBaseInvTile extends AEBaseTile implements ISidedInventory, IAEAppEngInventory { @TileEvent(TileEventType.WORLD_NBT_READ) @@ -126,8 +120,8 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public abstract void onChangeInventory( - IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added); + public abstract void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, + ItemStack added); @Override public final int[] getAccessibleSlotsFromSide(final int side) { diff --git a/src/main/java/appeng/tile/AEBaseTile.java b/src/main/java/appeng/tile/AEBaseTile.java index 15303d9ce26..48dc0036664 100644 --- a/src/main/java/appeng/tile/AEBaseTile.java +++ b/src/main/java/appeng/tile/AEBaseTile.java @@ -1,23 +1,33 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile; +import java.lang.ref.WeakReference; +import java.lang.reflect.Method; +import java.util.*; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.tiles.ISegmentedInventory; import appeng.api.util.ICommonTile; import appeng.api.util.IConfigManager; @@ -34,30 +44,12 @@ import appeng.util.SettingsFrom; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.lang.ref.WeakReference; -import java.lang.reflect.Method; -import java.util.*; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile, ICustomNameObject { - private static final ThreadLocal> DROP_NO_ITEMS = - new ThreadLocal>(); - private static final Map, Map>> HANDLERS = - new HashMap, Map>>(); - private static final Map, IStackSrc> ITEM_STACKS = - new HashMap, IStackSrc>(); + private static final ThreadLocal> DROP_NO_ITEMS = new ThreadLocal>(); + private static final Map, Map>> HANDLERS = new HashMap, Map>>(); + private static final Map, IStackSrc> ITEM_STACKS = new HashMap, IStackSrc>(); private int renderFragment = 0; @Nullable @@ -118,8 +110,7 @@ public final void readFromNBT(final NBTTagCompound data) { this.forward = ForgeDirection.valueOf(data.getString("orientation_forward")); this.up = ForgeDirection.valueOf(data.getString("orientation_up")); } - } catch (final IllegalArgumentException ignored) { - } + } catch (final IllegalArgumentException ignored) {} for (final AETileEventHandler h : this.getHandlerListFor(TileEventType.WORLD_NBT_READ)) { h.readFromNBT(this, data); @@ -287,8 +278,8 @@ private Map> getEventToHandlers() { final Map> storedHandlers = HANDLERS.get(clazz); if (storedHandlers == null) { - final Map> newStoredHandlers = - new EnumMap>(TileEventType.class); + final Map> newStoredHandlers = new EnumMap>( + TileEventType.class); HANDLERS.put(clazz, newStoredHandlers); @@ -306,8 +297,8 @@ private Map> getEventToHandlers() { } @Nonnull - private List getHandlers( - final Map> eventToHandlers, final TileEventType event) { + private List getHandlers(final Map> eventToHandlers, + final TileEventType event) { final List oldHandlers = eventToHandlers.get(event); if (oldHandlers == null) { @@ -320,8 +311,8 @@ private List getHandlers( } } - private void addHandler( - final Map> handlerSet, final TileEventType value, final Method m) { + private void addHandler(final Map> handlerSet, final TileEventType value, + final Method m) { List list = handlerSet.get(value); if (list == null) { diff --git a/src/main/java/appeng/tile/TileEvent.java b/src/main/java/appeng/tile/TileEvent.java index 8d8c4bca9ef..9c31972d085 100644 --- a/src/main/java/appeng/tile/TileEvent.java +++ b/src/main/java/appeng/tile/TileEvent.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile; -import appeng.tile.events.TileEventType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import appeng.tile.events.TileEventType; + @Retention(RetentionPolicy.RUNTIME) public @interface TileEvent { diff --git a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java index baaf9a7d656..f2ed6c35760 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingMonitorTile.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.crafting; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.tiles.IColorableTile; import appeng.api.storage.data.IAEItemStack; import appeng.api.util.AEColor; @@ -27,10 +25,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class TileCraftingMonitorTile extends TileCraftingTile implements IColorableTile { diff --git a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java index 8d4f2d445eb..d6c30c78b98 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingStorageTile.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.crafting; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.definitions.IBlocks; import appeng.block.crafting.BlockAdvancedCraftingStorage; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class TileCraftingStorageTile extends TileCraftingTile { + private static final int KILO_SCALAR = 1024; @Override @@ -34,44 +28,37 @@ protected ItemStack getItemFromTile(final Object obj) { switch (storage) { case 4: - for (final ItemStack stack : - blocks.craftingStorage4k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage4k().maybeStack(1).asSet()) { return stack; } break; case 16: - for (final ItemStack stack : - blocks.craftingStorage16k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage16k().maybeStack(1).asSet()) { return stack; } break; case 64: - for (final ItemStack stack : - blocks.craftingStorage64k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage64k().maybeStack(1).asSet()) { return stack; } break; case 256: - for (final ItemStack stack : - blocks.craftingStorage256k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage256k().maybeStack(1).asSet()) { return stack; } break; case 1024: - for (final ItemStack stack : - blocks.craftingStorage1024k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage1024k().maybeStack(1).asSet()) { return stack; } break; case 4096: - for (final ItemStack stack : - blocks.craftingStorage4096k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage4096k().maybeStack(1).asSet()) { return stack; } break; case 16384: - for (final ItemStack stack : - blocks.craftingStorage16384k().maybeStack(1).asSet()) { + for (final ItemStack stack : blocks.craftingStorage16384k().maybeStack(1).asSet()) { return stack; } break; diff --git a/src/main/java/appeng/tile/crafting/TileCraftingTile.java b/src/main/java/appeng/tile/crafting/TileCraftingTile.java index c0d23164c65..fd4797783e6 100644 --- a/src/main/java/appeng/tile/crafting/TileCraftingTile.java +++ b/src/main/java/appeng/tile/crafting/TileCraftingTile.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.crafting; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.LinkedList; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.implementations.IPowerChannelState; @@ -40,17 +43,9 @@ import appeng.tile.events.TileEventType; import appeng.tile.grid.AENetworkTile; import appeng.util.Platform; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IPowerChannelState { + private final CraftingCPUCalculator calc = new CraftingCPUCalculator(this); private ISimplifiedBundle lightCache; @@ -73,12 +68,8 @@ protected AENetworkProxy createProxy() { @Override protected ItemStack getItemFromTile(final Object obj) { if (((TileCraftingTile) obj).isAccelerator()) { - for (final ItemStack accelerator : AEApi.instance() - .definitions() - .blocks() - .craftingAccelerator() - .maybeStack(1) - .asSet()) { + for (final ItemStack accelerator : AEApi.instance().definitions().blocks().craftingAccelerator() + .maybeStack(1).asSet()) { return accelerator; } } @@ -262,13 +253,12 @@ public void breakCluster() { this.cluster + " does not contain any kind of blocks, which were destroyed."); } - for (IAEItemStack ais : - inv.getAvailableItems(AEApi.instance().storage().createItemList())) { + for (IAEItemStack ais : inv.getAvailableItems(AEApi.instance().storage().createItemList())) { ais = ais.copy(); ais.setStackSize(ais.getItemStack().getMaxStackSize()); while (true) { - final IAEItemStack g = - inv.extractItems(ais.copy(), Actionable.MODULATE, this.cluster.getActionSource()); + final IAEItemStack g = inv + .extractItems(ais.copy(), Actionable.MODULATE, this.cluster.getActionSource()); if (g == null) { break; } diff --git a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java index ef99b424b15..1be23b77b46 100644 --- a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java +++ b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.crafting; +import java.io.IOException; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.definitions.ITileDefinition; @@ -56,20 +60,11 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.util.ForgeDirection; public class TileMolecularAssembler extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable, ICraftingMachine, IPowerChannelState { - private static final int[] SIDES = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + + private static final int[] SIDES = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; private final InventoryCrafting craftingInv; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 9 + 2); @@ -86,8 +81,7 @@ public class TileMolecularAssembler extends AENetworkInvTile private boolean reboot = true; public TileMolecularAssembler() { - final ITileDefinition assembler = - AEApi.instance().definitions().blocks().molecularAssembler(); + final ITileDefinition assembler = AEApi.instance().definitions().blocks().molecularAssembler(); this.settings = new ConfigManager(this); this.settings.registerSetting(Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE); @@ -102,8 +96,8 @@ private int getUpgradeSlots() { } @Override - public boolean pushPattern( - final ICraftingPatternDetails patternDetails, final InventoryCrafting table, final ForgeDirection where) { + public boolean pushPattern(final ICraftingPatternDetails patternDetails, final InventoryCrafting table, + final ForgeDirection where) { if (this.myPattern == null) { boolean isEmpty = true; for (int x = 0; x < this.inv.getSizeInventory(); x++) { @@ -312,11 +306,7 @@ private boolean hasPattern() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (inv == this.inv) { this.recalculatePlan(); @@ -416,9 +406,10 @@ public TickRateModulation tickingRequest(final IGridNode node, int ticksSinceLas this.progress = 0; final ItemStack output = this.myPlan.getOutput(this.craftingInv, this.getWorldObj()); if (output != null) { - FMLCommonHandler.instance() - .firePlayerCraftingEvent( - Platform.getPlayer((WorldServer) this.getWorldObj()), output, this.craftingInv); + FMLCommonHandler.instance().firePlayerCraftingEvent( + Platform.getPlayer((WorldServer) this.getWorldObj()), + output, + this.craftingInv); this.pushOut(output.copy()); @@ -436,7 +427,11 @@ public TickRateModulation tickingRequest(final IGridNode node, int ticksSinceLas try { final TargetPoint where = new TargetPoint( - this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32); + this.worldObj.provider.dimensionId, + this.xCoord, + this.yCoord, + this.zCoord, + 32); final IAEItemStack item = AEItemStack.create(output); NetworkHandler.instance.sendToAllAround( new PacketAssemblerAnimation(this.xCoord, this.yCoord, this.zCoord, (byte) speed, item), @@ -472,13 +467,10 @@ private void ejectHeldItems() { private int userPower(final int ticksPassed, final int bonusValue, final double acceleratorTax) { try { - return (int) (this.getProxy() - .getEnergy() - .extractAEPower( - ticksPassed * bonusValue * acceleratorTax, - Actionable.MODULATE, - PowerMultiplier.CONFIG) - / acceleratorTax); + return (int) (this.getProxy().getEnergy().extractAEPower( + ticksPassed * bonusValue * acceleratorTax, + Actionable.MODULATE, + PowerMultiplier.CONFIG) / acceleratorTax); } catch (final GridAccessException e) { return 0; } diff --git a/src/main/java/appeng/tile/events/AETileEventHandler.java b/src/main/java/appeng/tile/events/AETileEventHandler.java index 2bc8b54cfd6..7eaa5f6b9ee 100644 --- a/src/main/java/appeng/tile/events/AETileEventHandler.java +++ b/src/main/java/appeng/tile/events/AETileEventHandler.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.events; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import net.minecraft.nbt.NBTTagCompound; + import appeng.tile.AEBaseTile; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import net.minecraft.nbt.NBTTagCompound; public final class AETileEventHandler { diff --git a/src/main/java/appeng/tile/events/TileEventType.java b/src/main/java/appeng/tile/events/TileEventType.java index a7ee4b8fd0e..1852cb238ad 100644 --- a/src/main/java/appeng/tile/events/TileEventType.java +++ b/src/main/java/appeng/tile/events/TileEventType.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.events; diff --git a/src/main/java/appeng/tile/grid/AENetworkInvTile.java b/src/main/java/appeng/tile/grid/AENetworkInvTile.java index 1bd0965508e..02ee14a0eba 100644 --- a/src/main/java/appeng/tile/grid/AENetworkInvTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkInvTile.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.grid; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridNode; import appeng.api.networking.security.IActionHost; import appeng.me.helpers.AENetworkProxy; @@ -25,8 +20,6 @@ import appeng.tile.AEBaseInvTile; import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public abstract class AENetworkInvTile extends AEBaseInvTile implements IActionHost, IGridProxyable { diff --git a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java index 70a2d02bc46..1622c3a4e29 100644 --- a/src/main/java/appeng/tile/grid/AENetworkPowerTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkPowerTile.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.grid; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridNode; import appeng.api.networking.security.IActionHost; import appeng.api.util.AECableType; @@ -27,8 +22,6 @@ import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; import appeng.tile.powersink.AEBasePoweredTile; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IActionHost, IGridProxyable { diff --git a/src/main/java/appeng/tile/grid/AENetworkTile.java b/src/main/java/appeng/tile/grid/AENetworkTile.java index fed49f69a6c..d70a8fa1511 100644 --- a/src/main/java/appeng/tile/grid/AENetworkTile.java +++ b/src/main/java/appeng/tile/grid/AENetworkTile.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.grid; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridNode; import appeng.api.networking.security.IActionHost; import appeng.api.util.AECableType; @@ -27,8 +22,6 @@ import appeng.tile.AEBaseTile; import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class AENetworkTile extends AEBaseTile implements IActionHost, IGridProxyable { diff --git a/src/main/java/appeng/tile/grindstone/TileCrank.java b/src/main/java/appeng/tile/grindstone/TileCrank.java index 1e528efccb3..ba6582f14b9 100644 --- a/src/main/java/appeng/tile/grindstone/TileCrank.java +++ b/src/main/java/appeng/tile/grindstone/TileCrank.java @@ -1,38 +1,32 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.grindstone; -import appeng.api.implementations.tiles.ICrankable; -import appeng.helpers.ICustomCollision; -import appeng.tile.AEBaseTile; -import appeng.tile.TileEvent; -import appeng.tile.events.TileEventType; -import appeng.util.Platform; -import io.netty.buffer.ByteBuf; import java.util.Collections; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.implementations.tiles.ICrankable; +import appeng.helpers.ICustomCollision; +import appeng.tile.AEBaseTile; +import appeng.tile.TileEvent; +import appeng.tile.events.TileEventType; +import appeng.util.Platform; +import io.netty.buffer.ByteBuf; + public class TileCrank extends AEBaseTile implements ICustomCollision { private final int ticksPerRotation = 18; @@ -68,7 +62,9 @@ private ICrankable getGrinder() { final ForgeDirection grinder = this.getUp().getOpposite(); final TileEntity te = this.worldObj.getTileEntity( - this.xCoord + grinder.offsetX, this.yCoord + grinder.offsetY, this.zCoord + grinder.offsetZ); + this.xCoord + grinder.offsetX, + this.yCoord + grinder.offsetY, + this.zCoord + grinder.offsetZ); if (te instanceof ICrankable) { return (ICrankable) te; } @@ -128,34 +124,30 @@ public boolean power() { } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean isVisual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean isVisual) { final double xOff = -0.15 * this.getUp().offsetX; final double yOff = -0.15 * this.getUp().offsetY; final double zOff = -0.15 * this.getUp().offsetZ; - return Collections.singletonList(AxisAlignedBB.getBoundingBox( - xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85)); + return Collections.singletonList( + AxisAlignedBB + .getBoundingBox(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85)); } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { final double xOff = -0.15 * this.getUp().offsetX; final double yOff = -0.15 * this.getUp().offsetY; final double zOff = -0.15 * this.getUp().offsetZ; - out.add(AxisAlignedBB.getBoundingBox( - xOff + 0.15, - yOff + 0.15, - zOff + 0.15, // ahh - xOff + 0.85, - yOff + 0.85, - zOff + 0.85)); + out.add( + AxisAlignedBB.getBoundingBox( + xOff + 0.15, + yOff + 0.15, + zOff + 0.15, // ahh + xOff + 0.85, + yOff + 0.85, + zOff + 0.85)); } public float getVisibleRotation() { diff --git a/src/main/java/appeng/tile/grindstone/TileGrinder.java b/src/main/java/appeng/tile/grindstone/TileGrinder.java index d93a2939384..72f14bb3ef9 100644 --- a/src/main/java/appeng/tile/grindstone/TileGrinder.java +++ b/src/main/java/appeng/tile/grindstone/TileGrinder.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.grindstone; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.features.IGrinderEntry; import appeng.api.implementations.tiles.ICrankable; @@ -28,16 +27,11 @@ import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.inv.WrapperInventoryRange; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class TileGrinder extends AEBaseInvTile implements ICrankable { - private final int[] inputs = {0, 1, 2}; - private final int[] sides = {0, 1, 2, 3, 4, 5}; + private final int[] inputs = { 0, 1, 2 }; + private final int[] sides = { 0, 1, 2, 3, 4, 5 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 7); private int points; @@ -54,11 +48,7 @@ public IInventory getInternalInventory() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) {} @Override @@ -133,8 +123,8 @@ public void applyTurn() { } this.points = 0; - final InventoryAdaptor sia = - InventoryAdaptor.getAdaptor(new WrapperInventoryRange(this, 3, 3, true), ForgeDirection.EAST); + final InventoryAdaptor sia = InventoryAdaptor + .getAdaptor(new WrapperInventoryRange(this, 3, 3, true), ForgeDirection.EAST); this.addItem(sia, r.getOutput()); diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java index 0d42b14940c..a10d4379b5e 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalAEInventory.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.inventory; +import java.util.Iterator; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.AEApi; import appeng.api.storage.data.IAEItemStack; import appeng.core.AELog; @@ -25,11 +24,6 @@ import appeng.util.item.AEItemStack; import appeng.util.iterators.AEInvIterator; import appeng.util.iterators.InvIterator; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class AppEngInternalAEInventory implements IInventory, Iterable { @@ -78,8 +72,7 @@ private void writeToNBT(final NBTTagCompound target) { } target.setTag("#" + x, c); - } catch (final Exception ignored) { - } + } catch (final Exception ignored) {} } } diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java index 407ea26e912..5af4850126d 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java @@ -1,34 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.inventory; -import appeng.api.storage.IMEInventory; -import appeng.core.AELog; -import appeng.me.storage.MEIInventoryWrapper; -import appeng.util.Platform; -import appeng.util.iterators.InvIterator; import java.util.Iterator; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import appeng.api.storage.IMEInventory; +import appeng.core.AELog; +import appeng.me.storage.MEIInventoryWrapper; +import appeng.util.Platform; +import appeng.util.iterators.InvIterator; + public class AppEngInternalInventory implements IInventory, Iterable { private final int size; @@ -198,8 +192,7 @@ protected void writeToNBT(final NBTTagCompound target) { } target.setTag("#" + x, c); - } catch (final Exception ignored) { - } + } catch (final Exception ignored) {} } } diff --git a/src/main/java/appeng/tile/inventory/AppEngNullInventory.java b/src/main/java/appeng/tile/inventory/AppEngNullInventory.java index 1c09f15751c..78e14efa374 100644 --- a/src/main/java/appeng/tile/inventory/AppEngNullInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngNullInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.inventory; diff --git a/src/main/java/appeng/tile/inventory/BiggerAppEngInventory.java b/src/main/java/appeng/tile/inventory/BiggerAppEngInventory.java index 73759d31384..89943f6c272 100644 --- a/src/main/java/appeng/tile/inventory/BiggerAppEngInventory.java +++ b/src/main/java/appeng/tile/inventory/BiggerAppEngInventory.java @@ -1,8 +1,9 @@ package appeng.tile.inventory; +import net.minecraft.nbt.NBTTagCompound; + import appeng.core.AELog; import appeng.util.Platform; -import net.minecraft.nbt.NBTTagCompound; public class BiggerAppEngInventory extends AppEngInternalInventory { @@ -20,8 +21,7 @@ protected void writeToNBT(final NBTTagCompound target) { } target.setTag("#" + x, c); - } catch (final Exception ignored) { - } + } catch (final Exception ignored) {} } } diff --git a/src/main/java/appeng/tile/inventory/IAEAppEngInventory.java b/src/main/java/appeng/tile/inventory/IAEAppEngInventory.java index bb2d021dab7..4b6c5a10df4 100644 --- a/src/main/java/appeng/tile/inventory/IAEAppEngInventory.java +++ b/src/main/java/appeng/tile/inventory/IAEAppEngInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.inventory; diff --git a/src/main/java/appeng/tile/inventory/InvOperation.java b/src/main/java/appeng/tile/inventory/InvOperation.java index da9cedbf4ef..000c0a4a71d 100644 --- a/src/main/java/appeng/tile/inventory/InvOperation.java +++ b/src/main/java/appeng/tile/inventory/InvOperation.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.inventory; diff --git a/src/main/java/appeng/tile/misc/TileCellWorkbench.java b/src/main/java/appeng/tile/misc/TileCellWorkbench.java index e64c2c7206f..c2cd5640203 100644 --- a/src/main/java/appeng/tile/misc/TileCellWorkbench.java +++ b/src/main/java/appeng/tile/misc/TileCellWorkbench.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import appeng.api.config.CopyMode; import appeng.api.config.Settings; import appeng.api.config.Upgrades; @@ -35,11 +34,6 @@ import appeng.tile.inventory.InvOperation; import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, IAEAppEngInventory, IConfigManagerHost, IOreFilterable { @@ -133,12 +127,8 @@ public int getInstalledUpgrades(final Upgrades u) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) { + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) { if (inv == this.cell && !this.locked) { this.locked = true; diff --git a/src/main/java/appeng/tile/misc/TileCharger.java b/src/main/java/appeng/tile/misc/TileCharger.java index cfb1cdd4504..3bb0d200a28 100644 --- a/src/main/java/appeng/tile/misc/TileCharger.java +++ b/src/main/java/appeng/tile/misc/TileCharger.java @@ -1,23 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import java.io.IOException; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -38,18 +40,10 @@ import appeng.util.Platform; import appeng.util.item.AEItemStack; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class TileCharger extends AENetworkPowerTile implements ICrankable { - private final int[] sides = {0}; + private final int[] sides = { 0 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 1); private int tickTickTimer = 0; @@ -110,12 +104,10 @@ public void Tick_TileCharger() { try { this.injectExternalPower( PowerUnits.AE, - this.getProxy() - .getEnergy() - .extractAEPower( - Math.min(150.0, getInternalMaxPower() - this.getInternalCurrentPower()), - Actionable.MODULATE, - PowerMultiplier.ONE)); + this.getProxy().getEnergy().extractAEPower( + Math.min(150.0, getInternalMaxPower() - this.getInternalCurrentPower()), + Actionable.MODULATE, + PowerMultiplier.ONE)); this.tickTickTimer = 20; // keep ticking... } catch (final GridAccessException e) { // continue! @@ -133,8 +125,8 @@ public void Tick_TileCharger() { if (ps.getAEMaxPower(myItem) > ps.getAECurrentPower(myItem)) { final double oldPower = this.getInternalCurrentPower(); - final double adjustment = ps.injectAEPower( - myItem, this.extractAEPower(150.0, Actionable.MODULATE, PowerMultiplier.CONFIG)); + final double adjustment = ps + .injectAEPower(myItem, this.extractAEPower(150.0, Actionable.MODULATE, PowerMultiplier.CONFIG)); this.setInternalCurrentPower(this.getInternalCurrentPower() + adjustment); if (oldPower > this.getInternalCurrentPower()) { this.requiresUpdate = true; @@ -143,21 +135,19 @@ public void Tick_TileCharger() { } } else if (this.getInternalCurrentPower() == getInternalMaxPower() && materials.certusQuartzCrystal().isSameAs(myItem)) { - if (Platform.getRandomFloat() > 0.8f) // simulate wait - { - this.extractAEPower( - this.getInternalMaxPower() / PowerMultiplier.CONFIG.multiplier, - Actionable.MODULATE, - PowerMultiplier.CONFIG); // 1500 - - for (final ItemStack charged : materials - .certusQuartzCrystalCharged() - .maybeStack(myItem.stackSize) - .asSet()) { - this.setInventorySlotContents(0, charged); + if (Platform.getRandomFloat() > 0.8f) // simulate wait + { + this.extractAEPower( + this.getInternalMaxPower() / PowerMultiplier.CONFIG.multiplier, + Actionable.MODULATE, + PowerMultiplier.CONFIG); // 1500 + + for (final ItemStack charged : materials.certusQuartzCrystalCharged() + .maybeStack(myItem.stackSize).asSet()) { + this.setInventorySlotContents(0, charged); + } + } } - } - } } @Override @@ -188,9 +178,7 @@ public void applyTurn() { if (materials.certusQuartzCrystal().isSameAs(myItem)) { this.extractAEPower(this.getInternalMaxPower(), Actionable.MODULATE, PowerMultiplier.CONFIG); // 1500 - for (final ItemStack charged : materials - .certusQuartzCrystalCharged() - .maybeStack(myItem.stackSize) + for (final ItemStack charged : materials.certusQuartzCrystalCharged().maybeStack(myItem.stackSize) .asSet()) { this.setInventorySlotContents(0, charged); } @@ -221,11 +209,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { this.markForUpdate(); } @@ -239,11 +223,7 @@ public boolean canExtractItem(final int slotIndex, final ItemStack extractedItem } } - return AEApi.instance() - .definitions() - .materials() - .certusQuartzCrystalCharged() - .isSameAs(extractedItem); + return AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs(extractedItem); } @Override diff --git a/src/main/java/appeng/tile/misc/TileCondenser.java b/src/main/java/appeng/tile/misc/TileCondenser.java index 6964fbd8751..0134bb9df78 100644 --- a/src/main/java/appeng/tile/misc/TileCondenser.java +++ b/src/main/java/appeng/tile/misc/TileCondenser.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import appeng.api.AEApi; import appeng.api.config.CondenserOutput; import appeng.api.config.Settings; @@ -33,19 +34,11 @@ import appeng.util.ConfigManager; import appeng.util.IConfigManagerHost; import appeng.util.Platform; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileCondenser extends AEBaseInvTile implements IFluidHandler, IConfigManagerHost, IConfigurableObject { - private static final FluidTankInfo[] EMPTY = {new FluidTankInfo(null, 10)}; - private final int[] sides = {0, 1}; + private static final FluidTankInfo[] EMPTY = { new FluidTankInfo(null, 10) }; + private final int[] sides = { 0, 1 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 3); private final ConfigManager cm = new ConfigManager(this); @@ -122,14 +115,12 @@ private ItemStack getOutput() { switch ((CondenserOutput) this.cm.getSetting(Settings.CONDENSER_OUTPUT)) { case MATTER_BALLS: - for (final ItemStack matterBallStack : - materials.matterBall().maybeStack(1).asSet()) { + for (final ItemStack matterBallStack : materials.matterBall().maybeStack(1).asSet()) { return matterBallStack; } case SINGULARITY: - for (final ItemStack singularityStack : - materials.singularity().maybeStack(1).asSet()) { + for (final ItemStack singularityStack : materials.singularity().maybeStack(1).asSet()) { return singularityStack; } @@ -165,11 +156,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (slot == 0) { final ItemStack is = inv.getStackInSlot(0); diff --git a/src/main/java/appeng/tile/misc/TileInscriber.java b/src/main/java/appeng/tile/misc/TileInscriber.java index 368a5ea9608..ea71127c300 100644 --- a/src/main/java/appeng/tile/misc/TileInscriber.java +++ b/src/main/java/appeng/tile/misc/TileInscriber.java @@ -1,23 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import java.io.IOException; +import java.util.EnumSet; +import java.util.List; + +import javax.annotation.Nullable; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -52,17 +56,9 @@ import appeng.util.Platform; import appeng.util.inv.WrapperInventoryRange; import appeng.util.item.AEItemStack; + import com.google.common.collect.Lists; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.EnumSet; -import java.util.List; -import javax.annotation.Nullable; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; /** * @author AlgorithmX2 @@ -73,9 +69,9 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable, IUpgradeableHost, IConfigManagerHost { private final int maxProcessingTime = 100; - private final int[] top = {0}; - private final int[] bottom = {1}; - private final int[] sides = {2, 3}; + private final int[] top = { 0 }; + private final int[] bottom = { 1 }; + private final int[] sides = { 2, 3 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 4); private final IConfigManager settings; private final UpgradeInventory upgrades; @@ -92,8 +88,7 @@ public TileInscriber() { this.getProxy().setIdlePowerUsage(0); this.settings = new ConfigManager(this); - final ITileDefinition inscriberDefinition = - AEApi.instance().definitions().blocks().inscriber(); + final ITileDefinition inscriberDefinition = AEApi.instance().definitions().blocks().inscriber(); this.upgrades = new DefinitionUpgradeInventory(inscriberDefinition, this, this.getUpgradeSlots()); } @@ -134,8 +129,7 @@ public boolean readFromStream_TileInscriber(final ByteBuf data) throws IOExcepti for (int num = 0; num < this.inv.getSizeInventory(); num++) { if ((slot & (1 << num)) > 0) { - this.inv.setInventorySlotContents( - num, AEItemStack.loadItemStackFromPacket(data).getItemStack()); + this.inv.setInventorySlotContents(num, AEItemStack.loadItemStackFromPacket(data).getItemStack()); } else { this.inv.setInventorySlotContents(num, null); } @@ -208,8 +202,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { return true; } - for (final ItemStack optionals : - AEApi.instance().registries().inscriber().getOptionals()) { + for (final ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals()) { if (Platform.isSameItemPrecise(optionals, itemstack)) { return true; } @@ -220,11 +213,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { try { if (mc != InvOperation.markDirty) { @@ -297,8 +286,7 @@ public IInscriberRecipe getTask() { return null; } - final IComparableDefinition namePress = - AEApi.instance().definitions().materials().namePress(); + final IComparableDefinition namePress = AEApi.instance().definitions().materials().namePress(); final boolean isNameA = namePress.isSameAs(plateA); final boolean isNameB = namePress.isSameAs(plateB); @@ -339,24 +327,17 @@ public IInscriberRecipe getTask() { } } - for (final IInscriberRecipe recipe : - AEApi.instance().registries().inscriber().getRecipes()) { + for (final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes()) { final boolean matchA = (plateA == null && !recipe.getTopOptional().isPresent()) - || (Platform.isSameItemPrecise( - plateA, recipe.getTopOptional().orNull())) - && // and... + || (Platform.isSameItemPrecise(plateA, recipe.getTopOptional().orNull())) && // and... (plateB == null && !recipe.getBottomOptional().isPresent()) - | (Platform.isSameItemPrecise( - plateB, recipe.getBottomOptional().orNull())); + | (Platform.isSameItemPrecise(plateB, recipe.getBottomOptional().orNull())); final boolean matchB = (plateB == null && !recipe.getTopOptional().isPresent()) - || (Platform.isSameItemPrecise( - plateB, recipe.getTopOptional().orNull())) - && // and... + || (Platform.isSameItemPrecise(plateB, recipe.getTopOptional().orNull())) && // and... (plateA == null && !recipe.getBottomOptional().isPresent()) - | (Platform.isSameItemPrecise( - plateA, recipe.getBottomOptional().orNull())); + | (Platform.isSameItemPrecise(plateA, recipe.getBottomOptional().orNull())); if (matchA || matchB) { for (final ItemStack option : recipe.getInputs()) { @@ -377,8 +358,8 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi final IInscriberRecipe out = this.getTask(); if (out != null) { final ItemStack outputCopy = out.getOutput().copy(); - final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( - new WrapperInventoryRange(this.inv, 3, 1, true), ForgeDirection.UNKNOWN); + final InventoryAdaptor ad = InventoryAdaptor + .getAdaptor(new WrapperInventoryRange(this.inv, 3, 1, true), ForgeDirection.UNKNOWN); if (ad.addItems(outputCopy) == null) { this.setProcessingTime(0); @@ -430,8 +411,8 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi final IInscriberRecipe out = this.getTask(); if (out != null) { final ItemStack outputCopy = out.getOutput().copy(); - final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( - new WrapperInventoryRange(this.inv, 3, 1, true), ForgeDirection.UNKNOWN); + final InventoryAdaptor ad = InventoryAdaptor + .getAdaptor(new WrapperInventoryRange(this.inv, 3, 1, true), ForgeDirection.UNKNOWN); if (ad.simulateAdd(outputCopy) == null) { this.setSmash(true); this.finalStep = 0; diff --git a/src/main/java/appeng/tile/misc/TileInterface.java b/src/main/java/appeng/tile/misc/TileInterface.java index 9a11ea7c6c8..0b6c5d9c980 100644 --- a/src/main/java/appeng/tile/misc/TileInterface.java +++ b/src/main/java/appeng/tile/misc/TileInterface.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import java.util.EnumSet; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Actionable; import appeng.api.config.Upgrades; import appeng.api.implementations.IPowerChannelState; @@ -50,26 +53,12 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import appeng.util.inv.IInventoryDestination; + import com.google.common.collect.ImmutableSet; import io.netty.buffer.ByteBuf; -import java.util.EnumSet; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -public class TileInterface extends AENetworkInvTile - implements IGridTickable, - ITileStorageMonitorable, - IStorageMonitorable, - IInventoryDestination, - IInterfaceHost, - IPriorityHost, - IPowerChannelState { +public class TileInterface extends AENetworkInvTile implements IGridTickable, ITileStorageMonitorable, + IStorageMonitorable, IInventoryDestination, IInterfaceHost, IPriorityHost, IPowerChannelState { private final DualityInterface duality = new DualityInterface(this.getProxy(), this); private ForgeDirection pointAt = ForgeDirection.UNKNOWN; @@ -110,7 +99,8 @@ public void setSide(final ForgeDirection axis) { this.setOrientation(this.pointAt, this.pointAt); } else { this.setOrientation( - this.pointAt.offsetY != 0 ? ForgeDirection.SOUTH : ForgeDirection.UP, this.pointAt.getOpposite()); + this.pointAt.offsetY != 0 ? ForgeDirection.SOUTH : ForgeDirection.UP, + this.pointAt.getOpposite()); } this.getProxy().setValidSides(EnumSet.complementOf(EnumSet.of(this.pointAt))); @@ -205,11 +195,7 @@ public IInventory getInternalInventory() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { this.duality.onChangeInventory(inv, slot, mc, removed, added); } diff --git a/src/main/java/appeng/tile/misc/TileLightDetector.java b/src/main/java/appeng/tile/misc/TileLightDetector.java index 405fd2dd85d..a1e49b0e726 100644 --- a/src/main/java/appeng/tile/misc/TileLightDetector.java +++ b/src/main/java/appeng/tile/misc/TileLightDetector.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; diff --git a/src/main/java/appeng/tile/misc/TilePaint.java b/src/main/java/appeng/tile/misc/TilePaint.java index 510d2bd8de0..618998a62be 100644 --- a/src/main/java/appeng/tile/misc/TilePaint.java +++ b/src/main/java/appeng/tile/misc/TilePaint.java @@ -1,36 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; -import appeng.api.util.AEColor; -import appeng.helpers.Splotch; -import appeng.items.misc.ItemPaintBall; -import appeng.tile.AEBaseTile; -import appeng.tile.TileEvent; -import appeng.tile.events.TileEventType; -import com.google.common.collect.ImmutableList; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -39,6 +23,18 @@ import net.minecraft.world.EnumSkyBlock; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.util.AEColor; +import appeng.helpers.Splotch; +import appeng.items.misc.ItemPaintBall; +import appeng.tile.AEBaseTile; +import appeng.tile.TileEvent; +import appeng.tile.events.TileEventType; + +import com.google.common.collect.ImmutableList; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + public class TilePaint extends AEBaseTile { private static final int LIGHT_PER_DOT = 12; @@ -135,8 +131,8 @@ public void onNeighborBlockChange() { } public boolean isSideValid(final ForgeDirection side) { - final Block blk = this.worldObj.getBlock( - this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ); + final Block blk = this.worldObj + .getBlock(this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ); return blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, @@ -192,8 +188,8 @@ public int getLightLevel() { } public void addBlot(final ItemStack type, final ForgeDirection side, final Vec3 hitVec) { - final Block blk = this.worldObj.getBlock( - this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ); + final Block blk = this.worldObj + .getBlock(this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ); if (blk.isSideSolid( this.worldObj, this.xCoord + side.offsetX, diff --git a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java index 0aef8bdef9c..5bfba5de407 100644 --- a/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java +++ b/src/main/java/appeng/tile/misc/TileQuartzGrowthAccelerator.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import java.util.EnumSet; + +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.tiles.ICrystalGrowthAccelerator; import appeng.api.networking.events.MENetworkEventSubscribe; @@ -29,8 +25,6 @@ import appeng.tile.grid.AENetworkTile; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import java.util.EnumSet; -import net.minecraftforge.common.util.ForgeDirection; public class TileQuartzGrowthAccelerator extends AENetworkTile implements IPowerChannelState, ICrystalGrowthAccelerator { diff --git a/src/main/java/appeng/tile/misc/TileSecurity.java b/src/main/java/appeng/tile/misc/TileSecurity.java index 8dbd78eb6f9..72499b3e498 100644 --- a/src/main/java/appeng/tile/misc/TileSecurity.java +++ b/src/main/java/appeng/tile/misc/TileSecurity.java @@ -1,23 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.events.LocatableEventAnnounce; @@ -56,26 +62,9 @@ import appeng.util.Platform; import appeng.util.item.AEItemStack; import io.netty.buffer.ByteBuf; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -public class TileSecurity extends AENetworkTile - implements ITerminalHost, - IAEAppEngInventory, - ILocatable, - IConfigManagerHost, - ISecurityProvider, - IColorableTile { +public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEAppEngInventory, ILocatable, + IConfigManagerHost, ISecurityProvider, IColorableTile { private static int difference = 0; private final AppEngInternalInventory configSlot = new AppEngInternalInventory(this, 1); @@ -102,12 +91,8 @@ public TileSecurity() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removedStack, - final ItemStack newStack) {} + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, + final ItemStack removedStack, final ItemStack newStack) {} @Override public void getDrops(final World w, final int x, final int y, final int z, final List drops) { @@ -176,8 +161,8 @@ public void readFromNBT_TileSecurity(final NBTTagCompound data) { for (final Object key : storedItems.func_150296_c()) { final NBTBase obj = storedItems.getTag((String) key); if (obj instanceof NBTTagCompound) { - this.inventory.getStoredItems().add(AEItemStack.create(ItemStack.loadItemStackFromNBT((NBTTagCompound) - obj))); + this.inventory.getStoredItems() + .add(AEItemStack.create(ItemStack.loadItemStackFromNBT((NBTTagCompound) obj))); } } } diff --git a/src/main/java/appeng/tile/misc/TileSkyCompass.java b/src/main/java/appeng/tile/misc/TileSkyCompass.java index 15e07aab386..61c7a7bda83 100644 --- a/src/main/java/appeng/tile/misc/TileSkyCompass.java +++ b/src/main/java/appeng/tile/misc/TileSkyCompass.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; diff --git a/src/main/java/appeng/tile/misc/TileVibrationChamber.java b/src/main/java/appeng/tile/misc/TileVibrationChamber.java index a6ec3696cc1..4beb6558c4f 100644 --- a/src/main/java/appeng/tile/misc/TileVibrationChamber.java +++ b/src/main/java/appeng/tile/misc/TileVibrationChamber.java @@ -1,23 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.misc; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Actionable; import appeng.api.networking.IGridNode; import appeng.api.networking.energy.IEnergyGrid; @@ -36,17 +35,12 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.common.util.ForgeDirection; public class TileVibrationChamber extends AENetworkInvTile implements IGridTickable { + private static final int FUEL_SLOT_INDEX = 0; private static final double POWER_PER_TICK = 5; - private static final int[] ACCESSIBLE_SLOTS = {FUEL_SLOT_INDEX}; + private static final int[] ACCESSIBLE_SLOTS = { FUEL_SLOT_INDEX }; private static final int MAX_BURN_SPEED = 200; private static final double DILATION_SCALING = 100.0; private static final int MIN_BURN_SPEED = 20; @@ -110,11 +104,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (this.getBurnTime() <= 0) { if (this.canEatFuel()) { diff --git a/src/main/java/appeng/tile/networking/TileCableBus.java b/src/main/java/appeng/tile/networking/TileCableBus.java index 320c1344247..7e9d97d7a76 100644 --- a/src/main/java/appeng/tile/networking/TileCableBus.java +++ b/src/main/java/appeng/tile/networking/TileCableBus.java @@ -1,23 +1,28 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.IGridNode; import appeng.api.parts.IFacadeContainer; import appeng.api.parts.IPart; @@ -39,17 +44,6 @@ import appeng.tile.events.TileEventType; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import java.io.IOException; -import java.util.List; -import java.util.Set; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomCollision { @@ -90,8 +84,7 @@ public boolean readFromStream_TileCableBus(final ByteBuf data) throws IOExceptio protected void updateTileSetting() { if (this.getCableBus().isRequiresDynamicRender()) { try { - final TileCableBus tcb = - (TileCableBus) BlockCableBus.getTesrTile().newInstance(); + final TileCableBus tcb = (TileCableBus) BlockCableBus.getTesrTile().newInstance(); tcb.copyFrom(this); this.getWorldObj().setTileEntity(this.xCoord, this.yCoord, this.zCoord, tcb); } catch (final Throwable ignored) { @@ -239,8 +232,8 @@ public boolean isBlocked(final ForgeDirection side) { } @Override - public Iterable getSelectedBoundingBoxesFromPool( - final World w, final int x, final int y, final int z, final Entity e, final boolean visual) { + public Iterable getSelectedBoundingBoxesFromPool(final World w, final int x, final int y, + final int z, final Entity e, final boolean visual) { return this.getCableBus().getSelectedBoundingBoxesFromPool(false, true, e, visual); } @@ -277,8 +270,8 @@ public Set getLayerFlags() { @Override public void cleanup() { if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.ImmibisMicroblocks)) { - final IImmibisMicroblocks imb = - (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance(IntegrationType.ImmibisMicroblocks); + final IImmibisMicroblocks imb = (IImmibisMicroblocks) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.ImmibisMicroblocks); if (imb != null && imb.leaveParts(this)) { return; } @@ -288,14 +281,8 @@ public void cleanup() { } @Override - public void addCollidingBlockToList( - final World w, - final int x, - final int y, - final int z, - final AxisAlignedBB bb, - final List out, - final Entity e) { + public void addCollidingBlockToList(final World w, final int x, final int y, final int z, final AxisAlignedBB bb, + final List out, final Entity e) { for (final AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool(w, x, y, z, e, false)) { out.add(AxisAlignedBB.getBoundingBox(bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ)); } @@ -303,8 +290,7 @@ public void addCollidingBlockToList( @Override public void notifyNeighbors() { - if (this.worldObj != null - && this.worldObj.blockExists(this.xCoord, this.yCoord, this.zCoord) + if (this.worldObj != null && this.worldObj.blockExists(this.xCoord, this.yCoord, this.zCoord) && !CableBusContainer.isLoading()) { Platform.notifyBlocksOfNeighbors(this.worldObj, this.xCoord, this.yCoord, this.zCoord); } diff --git a/src/main/java/appeng/tile/networking/TileCableBusTESR.java b/src/main/java/appeng/tile/networking/TileCableBusTESR.java index 8ebd71361e6..3f83122a5ae 100644 --- a/src/main/java/appeng/tile/networking/TileCableBusTESR.java +++ b/src/main/java/appeng/tile/networking/TileCableBusTESR.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; @@ -26,8 +18,7 @@ public class TileCableBusTESR extends TileCableBus { protected void updateTileSetting() { if (!this.getCableBus().isRequiresDynamicRender()) { try { - final TileCableBus tcb = - (TileCableBus) BlockCableBus.getNoTesrTile().newInstance(); + final TileCableBus tcb = (TileCableBus) BlockCableBus.getNoTesrTile().newInstance(); tcb.copyFrom(this); this.getWorldObj().setTileEntity(this.xCoord, this.yCoord, this.zCoord, tcb); } catch (final Throwable ignored) { diff --git a/src/main/java/appeng/tile/networking/TileController.java b/src/main/java/appeng/tile/networking/TileController.java index 99a1039e189..e3842c7074d 100644 --- a/src/main/java/appeng/tile/networking/TileController.java +++ b/src/main/java/appeng/tile/networking/TileController.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; +import java.util.EnumSet; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Actionable; import appeng.api.networking.GridFlags; import appeng.api.networking.events.MENetworkControllerChange; @@ -31,12 +29,9 @@ import appeng.tile.grid.AENetworkPowerTile; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.InvOperation; -import java.util.EnumSet; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class TileController extends AENetworkPowerTile { + private static final IInventory NULL_INVENTORY = new AppEngInternalInventory(null, 0); private static final int[] ACCESSIBLE_SLOTS_BY_SIDE = {}; @@ -74,8 +69,7 @@ public void onNeighborChange(final boolean force) { final boolean oldValid = this.isValid; - this.isValid = (xx && !yy && !zz) - || (!xx && yy && !zz) + this.isValid = (xx && !yy && !zz) || (!xx && yy && !zz) || (!xx && !yy && zz) || ((xx ? 1 : 0) + (yy ? 1 : 0) + (zz ? 1 : 0) <= 1); @@ -164,11 +158,7 @@ public IInventory getInternalInventory() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) {} @Override diff --git a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java index b4efa9b21d0..1fb4412e458 100644 --- a/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileCreativeEnergyCell.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; import appeng.api.networking.energy.IAEPowerStorage; import appeng.api.util.AECableType; import appeng.tile.grid.AENetworkTile; -import net.minecraftforge.common.util.ForgeDirection; public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerStorage { diff --git a/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java b/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java index 284c17b2265..9cc06deecc3 100644 --- a/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileDenseEnergyCell.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; diff --git a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java index 569e09ce34c..e2b596bc5e2 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java +++ b/src/main/java/appeng/tile/networking/TileEnergyAcceptor.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.networking.energy.IEnergyGrid; @@ -27,10 +24,6 @@ import appeng.tile.grid.AENetworkPowerTile; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.InvOperation; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class TileEnergyAcceptor extends AENetworkPowerTile { @@ -93,10 +86,8 @@ protected double funnelPowerIntoStorage(final double power, final Actionable mod protected double extractAEPower(double amt, final Actionable mode) { double res = super.extractAEPower(amt, mode); try { - if (getInternalCurrentPower() < getInternalMaxPower()) - this.getProxy() - .getGrid() - .postEvent(new MENetworkPowerStorage(this, MENetworkPowerStorage.PowerEventType.REQUEST_POWER)); + if (getInternalCurrentPower() < getInternalMaxPower()) this.getProxy().getGrid() + .postEvent(new MENetworkPowerStorage(this, MENetworkPowerStorage.PowerEventType.REQUEST_POWER)); } catch (final GridAccessException ignored) { } @@ -109,11 +100,7 @@ public IInventory getInternalInventory() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) {} @Override diff --git a/src/main/java/appeng/tile/networking/TileEnergyCell.java b/src/main/java/appeng/tile/networking/TileEnergyCell.java index 65ccd8f1dfa..b182698fedd 100644 --- a/src/main/java/appeng/tile/networking/TileEnergyCell.java +++ b/src/main/java/appeng/tile/networking/TileEnergyCell.java @@ -1,23 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -30,8 +25,6 @@ import appeng.tile.events.TileEventType; import appeng.tile.grid.AENetworkTile; import appeng.util.SettingsFrom; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage { @@ -123,9 +116,7 @@ public final double injectAEPower(double amt, final Actionable mode) { } if (this.internalCurrentPower < 0.01 && amt > 0.01) { - this.getProxy() - .getNode() - .getGrid() + this.getProxy().getNode().getGrid() .postEvent(new MENetworkPowerStorage(this, PowerEventType.PROVIDE_POWER)); } diff --git a/src/main/java/appeng/tile/networking/TileWireless.java b/src/main/java/appeng/tile/networking/TileWireless.java index 26f822f4519..5dd64baa81e 100644 --- a/src/main/java/appeng/tile/networking/TileWireless.java +++ b/src/main/java/appeng/tile/networking/TileWireless.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.networking; +import java.util.EnumSet; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.implementations.IPowerChannelState; import appeng.api.implementations.tiles.IWirelessAccessPoint; @@ -37,17 +35,13 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import java.util.EnumSet; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoint, IPowerChannelState { public static final int POWERED_FLAG = 1; public static final int CHANNEL_FLAG = 2; - private final int[] sides = {0}; + private final int[] sides = { 0 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 1); private int clientFlags = 0; @@ -121,11 +115,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { // :P } diff --git a/src/main/java/appeng/tile/powersink/AEBasePoweredTile.java b/src/main/java/appeng/tile/powersink/AEBasePoweredTile.java index 872d893374e..acf9ddbcefc 100644 --- a/src/main/java/appeng/tile/powersink/AEBasePoweredTile.java +++ b/src/main/java/appeng/tile/powersink/AEBasePoweredTile.java @@ -1,21 +1,14 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.powersink; -public abstract class AEBasePoweredTile extends RedstoneFlux {} +public abstract class AEBasePoweredTile extends RedstoneFlux { +} diff --git a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java index e19eb21b502..ef9cd394545 100644 --- a/src/main/java/appeng/tile/powersink/AERootPoweredTile.java +++ b/src/main/java/appeng/tile/powersink/AERootPoweredTile.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.powersink; +import java.util.EnumSet; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; @@ -27,9 +24,6 @@ import appeng.tile.AEBaseInvTile; import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; -import java.util.EnumSet; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public abstract class AERootPoweredTile extends AEBaseInvTile implements IAEPowerStorage { @@ -73,7 +67,8 @@ protected double getFunnelPowerDemand(final double maxRequired) { public final double injectExternalPower(final PowerUnits input, final double amt) { return PowerUnits.AE.convertTo( - input, this.funnelPowerIntoStorage(input.convertTo(PowerUnits.AE, amt), Actionable.MODULATE)); + input, + this.funnelPowerIntoStorage(input.convertTo(PowerUnits.AE, amt), Actionable.MODULATE)); } protected double funnelPowerIntoStorage(final double power, final Actionable mode) { diff --git a/src/main/java/appeng/tile/powersink/GTPowerSink.java b/src/main/java/appeng/tile/powersink/GTPowerSink.java index b5ec9f9ee31..8c80bdaafd5 100644 --- a/src/main/java/appeng/tile/powersink/GTPowerSink.java +++ b/src/main/java/appeng/tile/powersink/GTPowerSink.java @@ -1,12 +1,5 @@ package appeng.tile.powersink; -import appeng.api.config.Actionable; -import appeng.api.config.PowerUnits; -import appeng.integration.IntegrationType; -import appeng.transformer.annotations.Integration; -import appeng.util.Platform; -import gregtech.api.interfaces.tileentity.IEnergyConnected; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -15,8 +8,17 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.fluids.IFluidHandler; +import appeng.api.config.Actionable; +import appeng.api.config.PowerUnits; +import appeng.integration.IntegrationType; +import appeng.transformer.annotations.Integration; +import appeng.util.Platform; +import gregtech.api.interfaces.tileentity.IEnergyConnected; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + @Integration.Interface(iname = IntegrationType.GT, iface = "gregtech.api.interfaces.tileentity.IEnergyConnected") public abstract class GTPowerSink extends AERootPoweredTile implements IEnergyConnected { + @Override public long injectEnergyUnits(byte side, long voltage, long amperage) { double e = PowerUnits.EU.convertTo(PowerUnits.AE, voltage * amperage); diff --git a/src/main/java/appeng/tile/powersink/IC2.java b/src/main/java/appeng/tile/powersink/IC2.java index 57b226e2c4f..5151949b4f3 100644 --- a/src/main/java/appeng/tile/powersink/IC2.java +++ b/src/main/java/appeng/tile/powersink/IC2.java @@ -1,23 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.powersink; +import java.util.EnumSet; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.PowerUnits; import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; @@ -25,9 +22,6 @@ import appeng.transformer.annotations.Integration.Interface; import appeng.util.Platform; import ic2.api.energy.tile.IEnergySink; -import java.util.EnumSet; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; @Interface(iname = IntegrationType.IC2, iface = "ic2.api.energy.tile.IEnergySink") public abstract class IC2 extends GTPowerSink implements IEnergySink { diff --git a/src/main/java/appeng/tile/powersink/MekJoules.java b/src/main/java/appeng/tile/powersink/MekJoules.java index 11f58ebef33..8785dd993c5 100644 --- a/src/main/java/appeng/tile/powersink/MekJoules.java +++ b/src/main/java/appeng/tile/powersink/MekJoules.java @@ -9,11 +9,11 @@ // * // * Applied Energistics 2 is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU Lesser General Public License for more details. // * // * You should have received a copy of the GNU Lesser General Public License -// * along with Applied Energistics 2. If not, see . +// * along with Applied Energistics 2. If not, see . // */ // // package appeng.tile.powersink; @@ -30,41 +30,41 @@ // public abstract class MekJoules extends RedstoneFlux implements IStrictEnergyAcceptor // { // -// @Override -// public double getEnergy() -// { -// return 0; -// } +// @Override +// public double getEnergy() +// { +// return 0; +// } // -// @Override -// public void setEnergy( final double energy ) -// { -// final double extra = this.injectExternalPower( PowerUnits.MK, energy ); -// this.setInternalCurrentPower( this.getInternalCurrentPower() + PowerUnits.MK.convertTo( PowerUnits.AE, extra ) ); -// } +// @Override +// public void setEnergy( final double energy ) +// { +// final double extra = this.injectExternalPower( PowerUnits.MK, energy ); +// this.setInternalCurrentPower( this.getInternalCurrentPower() + PowerUnits.MK.convertTo( PowerUnits.AE, extra ) ); +// } // -// @Override -// public double getMaxEnergy() -// { -// return this.getExternalPowerDemand( PowerUnits.MK, 100000 ); -// } +// @Override +// public double getMaxEnergy() +// { +// return this.getExternalPowerDemand( PowerUnits.MK, 100000 ); +// } // -// @Override -// public double transferEnergyToAcceptor( final ForgeDirection side, double amount ) -// { -// final double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE ); -// if( amount > demand ) -// { -// amount = demand; -// } +// @Override +// public double transferEnergyToAcceptor( final ForgeDirection side, double amount ) +// { +// final double demand = this.getExternalPowerDemand( PowerUnits.MK, Double.MAX_VALUE ); +// if( amount > demand ) +// { +// amount = demand; +// } // -// final double overflow = this.injectExternalPower( PowerUnits.MK, amount ); -// return amount - overflow; -// } +// final double overflow = this.injectExternalPower( PowerUnits.MK, amount ); +// return amount - overflow; +// } // -// @Override -// public boolean canReceiveEnergy( final ForgeDirection side ) -// { -// return this.getPowerSides().contains( side ); -// } +// @Override +// public boolean canReceiveEnergy( final ForgeDirection side ) +// { +// return this.getPowerSides().contains( side ); +// } // } diff --git a/src/main/java/appeng/tile/powersink/RedstoneFlux.java b/src/main/java/appeng/tile/powersink/RedstoneFlux.java index 83319d3adb2..d0363d57e09 100644 --- a/src/main/java/appeng/tile/powersink/RedstoneFlux.java +++ b/src/main/java/appeng/tile/powersink/RedstoneFlux.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.powersink; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.PowerUnits; import appeng.integration.IntegrationType; import appeng.transformer.annotations.Integration.Interface; import cofh.api.energy.IEnergyReceiver; -import net.minecraftforge.common.util.ForgeDirection; @Interface(iname = IntegrationType.RF, iface = "cofh.api.energy.IEnergyReceiver") public abstract class RedstoneFlux extends IC2 implements IEnergyReceiver { + @Override public final int receiveEnergy(final ForgeDirection from, final int maxReceive, final boolean simulate) { final int networkRFDemand = (int) Math.floor(this.getExternalPowerDemand(PowerUnits.RF, maxReceive)); diff --git a/src/main/java/appeng/tile/powersink/RotaryCraft.java b/src/main/java/appeng/tile/powersink/RotaryCraft.java index 3223afc04fe..3adafc63ddb 100644 --- a/src/main/java/appeng/tile/powersink/RotaryCraft.java +++ b/src/main/java/appeng/tile/powersink/RotaryCraft.java @@ -9,11 +9,11 @@ // * // * Applied Energistics 2 is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU Lesser General Public License for more details. // * // * You should have received a copy of the GNU Lesser General Public License -// * along with Applied Energistics 2. If not, see . +// * along with Applied Energistics 2. If not, see . // */ // // package appeng.tile.powersink; @@ -40,147 +40,147 @@ // public abstract class RotaryCraft extends IC2 implements AdvancedShaftPowerReceiver, Transducerable // { // -// private int omega = 0; -// private int torque = 0; -// private long power = 0; -// private int alpha = 0; -// -// private long currentPower = 0; -// -// @TileEvent( TileEventType.TICK ) -// @Method( iname = IntegrationType.RotaryCraft ) -// public void Tick_RotaryCraft() -// { -// if( this.worldObj != null && !this.worldObj.isRemote && this.currentPower > 0 ) -// { -// this.injectExternalPower( PowerUnits.WA, this.currentPower ); -// this.currentPower = 0; -// } -// } -// -// @Override -// public final boolean addPower( final int torque, final int omega, final long power, final ForgeDirection side ) -// { -// this.omega = omega; -// this.torque = torque; -// this.power = power; -// -// this.currentPower += power; -// -// return true; -// -// } -// -// @Override -// public final int getOmega() -// { -// return this.omega; -// } -// -// @Override -// public final int getTorque() -// { -// return this.torque; -// } -// -// @Override -// public final long getPower() -// { -// return this.power; -// } -// -// @Override -// public final String getName() -// { -// return "AE"; -// } -// -// @Override -// public final int getIORenderAlpha() -// { -// return this.alpha; -// } -// -// @Override -// public final void setIORenderAlpha( final int io ) -// { -// this.alpha = io; -// } -// -// public final boolean canReadFromBlock( final int x, final int y, final int z ) -// { -// ForgeDirection side = ForgeDirection.UNKNOWN; -// -// if( x == this.xCoord - 1 ) -// { -// side = ForgeDirection.WEST; -// } -// else if( x == this.xCoord + 1 ) -// { -// side = ForgeDirection.EAST; -// } -// else if( z == this.zCoord - 1 ) -// { -// side = ForgeDirection.NORTH; -// } -// else if( z == this.zCoord + 1 ) -// { -// side = ForgeDirection.SOUTH; -// } -// else if( y == this.yCoord - 1 ) -// { -// side = ForgeDirection.DOWN; -// } -// else if( y == this.yCoord + 1 ) -// { -// side = ForgeDirection.UP; -// } -// -// return this.getPowerSides().contains( side ); -// } -// -// @Override -// public final boolean canReadFrom( final ForgeDirection side ) -// { -// return this.getPowerSides().contains( side ); -// } -// -// @Override -// public final boolean isReceiving() -// { -// return true; -// } -// -// @Override -// public final int getMinTorque( final int available ) -// { -// return 1; -// } -// -// @Override -// public final ArrayList getMessages( final World world, final int x, final int y, final int z, final int side +// private int omega = 0; +// private int torque = 0; +// private long power = 0; +// private int alpha = 0; +// +// private long currentPower = 0; +// +// @TileEvent( TileEventType.TICK ) +// @Method( iname = IntegrationType.RotaryCraft ) +// public void Tick_RotaryCraft() +// { +// if( this.worldObj != null && !this.worldObj.isRemote && this.currentPower > 0 ) +// { +// this.injectExternalPower( PowerUnits.WA, this.currentPower ); +// this.currentPower = 0; +// } +// } +// +// @Override +// public final boolean addPower( final int torque, final int omega, final long power, final ForgeDirection side ) +// { +// this.omega = omega; +// this.torque = torque; +// this.power = power; +// +// this.currentPower += power; +// +// return true; +// +// } +// +// @Override +// public final int getOmega() +// { +// return this.omega; +// } +// +// @Override +// public final int getTorque() +// { +// return this.torque; +// } +// +// @Override +// public final long getPower() +// { +// return this.power; +// } +// +// @Override +// public final String getName() +// { +// return "AE"; +// } +// +// @Override +// public final int getIORenderAlpha() +// { +// return this.alpha; +// } +// +// @Override +// public final void setIORenderAlpha( final int io ) +// { +// this.alpha = io; +// } +// +// public final boolean canReadFromBlock( final int x, final int y, final int z ) +// { +// ForgeDirection side = ForgeDirection.UNKNOWN; +// +// if( x == this.xCoord - 1 ) +// { +// side = ForgeDirection.WEST; +// } +// else if( x == this.xCoord + 1 ) +// { +// side = ForgeDirection.EAST; +// } +// else if( z == this.zCoord - 1 ) +// { +// side = ForgeDirection.NORTH; +// } +// else if( z == this.zCoord + 1 ) +// { +// side = ForgeDirection.SOUTH; +// } +// else if( y == this.yCoord - 1 ) +// { +// side = ForgeDirection.DOWN; +// } +// else if( y == this.yCoord + 1 ) +// { +// side = ForgeDirection.UP; +// } +// +// return this.getPowerSides().contains( side ); +// } +// +// @Override +// public final boolean canReadFrom( final ForgeDirection side ) +// { +// return this.getPowerSides().contains( side ); +// } +// +// @Override +// public final boolean isReceiving() +// { +// return true; +// } +// +// @Override +// public final int getMinTorque( final int available ) +// { +// return 1; +// } +// +// @Override +// public final ArrayList getMessages( final World world, final int x, final int y, final int z, final int side // ) -// { -// final String out; -// if( this.power >= 1000000000 ) -// { -// out = String.format( "Receiving %.3f GW @ %d rad/s.", this.power / 1000000000.0D, this.omega ); -// } -// else if( this.power >= 1000000 ) -// { -// out = String.format( "Receiving %.3f MW @ %d rad/s.", this.power / 1000000.0D, this.omega ); -// } -// else if( this.power >= 1000 ) -// { -// out = String.format( "Receiving %.3f kW @ %d rad/s.", this.power / 1000.0D, this.omega ); -// } -// else -// { -// out = String.format( "Receiving %d W @ %d rad/s.", this.power, this.omega ); -// } -// -// final ArrayList messages = new ArrayList( 1 ); -// messages.add( out ); -// return messages; -// } +// { +// final String out; +// if( this.power >= 1000000000 ) +// { +// out = String.format( "Receiving %.3f GW @ %d rad/s.", this.power / 1000000000.0D, this.omega ); +// } +// else if( this.power >= 1000000 ) +// { +// out = String.format( "Receiving %.3f MW @ %d rad/s.", this.power / 1000000.0D, this.omega ); +// } +// else if( this.power >= 1000 ) +// { +// out = String.format( "Receiving %.3f kW @ %d rad/s.", this.power / 1000.0D, this.omega ); +// } +// else +// { +// out = String.format( "Receiving %d W @ %d rad/s.", this.power, this.omega ); +// } +// +// final ArrayList messages = new ArrayList( 1 ); +// messages.add( out ); +// return messages; +// } // } diff --git a/src/main/java/appeng/tile/powersink/UniversalElectricity.java b/src/main/java/appeng/tile/powersink/UniversalElectricity.java index bdbe879f225..193c7e0798d 100644 --- a/src/main/java/appeng/tile/powersink/UniversalElectricity.java +++ b/src/main/java/appeng/tile/powersink/UniversalElectricity.java @@ -1,73 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.powersink; /* - * import net.minecraftforge.common.util.ForgeDirection; - * import universalelectricity.core.block.IElectrical; - * import universalelectricity.core.electricity.ElectricityPack; - * import appeng.api.config.PowerUnits; - * public abstract class UniversalElectricity extends ThermalExpansion implements IElectrical - * { - * @Override - * public final boolean canConnect(ForgeDirection direction) - * { - * return internalCanAcceptPower && getPowerSides().contains( direction ); - * } - * @Override - * public final float receiveElectricity(ForgeDirection from, ElectricityPack receive, boolean doReceive) - * { - * float accepted = 0; - * double receivedPower = receive.getWatts(); - * if ( doReceive ) - * { - * accepted = (float) (receivedPower - injectExternalPower( PowerUnits.KJ, receivedPower )); - * } - * else - * { - * double whatIWant = getExternalPowerDemand( PowerUnits.KJ ); - * if ( whatIWant > receivedPower ) - * accepted = (float) receivedPower; - * else - * accepted = (float) whatIWant; - * } - * return accepted; - * } - * @Override - * public final float getRequest(ForgeDirection direction) - * { - * return (float) getExternalPowerDemand( PowerUnits.KJ ); - * } - * @Override - * public final float getVoltage() - * { - * return 120; - * } - * @Override - * public final ElectricityPack provideElectricity(ForgeDirection from, ElectricityPack request, boolean doProvide) - * { - * return null; // cannot be dis-charged - * } - * @Override - * public final float getProvide(ForgeDirection direction) - * { - * return 0; - * } - * } + * import net.minecraftforge.common.util.ForgeDirection; import universalelectricity.core.block.IElectrical; import + * universalelectricity.core.electricity.ElectricityPack; import appeng.api.config.PowerUnits; public abstract class + * UniversalElectricity extends ThermalExpansion implements IElectrical { + * @Override public final boolean canConnect(ForgeDirection direction) { return internalCanAcceptPower && + * getPowerSides().contains( direction ); } + * @Override public final float receiveElectricity(ForgeDirection from, ElectricityPack receive, boolean doReceive) { + * float accepted = 0; double receivedPower = receive.getWatts(); if ( doReceive ) { accepted = (float) (receivedPower - + * injectExternalPower( PowerUnits.KJ, receivedPower )); } else { double whatIWant = getExternalPowerDemand( + * PowerUnits.KJ ); if ( whatIWant > receivedPower ) accepted = (float) receivedPower; else accepted = (float) + * whatIWant; } return accepted; } + * @Override public final float getRequest(ForgeDirection direction) { return (float) getExternalPowerDemand( + * PowerUnits.KJ ); } + * @Override public final float getVoltage() { return 120; } + * @Override public final ElectricityPack provideElectricity(ForgeDirection from, ElectricityPack request, boolean + * doProvide) { return null; // cannot be dis-charged } + * @Override public final float getProvide(ForgeDirection direction) { return 0; } } */ diff --git a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java index c3c97867532..3fbd0775077 100644 --- a/src/main/java/appeng/tile/qnb/TileQuantumBridge.java +++ b/src/main/java/appeng/tile/qnb/TileQuantumBridge.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.qnb; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.networking.GridFlags; @@ -38,20 +39,15 @@ import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.inventory.InvOperation; import appeng.util.Platform; + import com.google.common.base.Optional; import io.netty.buffer.ByteBuf; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock { + private final byte corner = 16; private final int[] sidesRing = {}; - private final int[] sidesLink = {0}; + private final int[] sidesLink = { 0 }; private final AppEngInternalInventory internalInventory = new AppEngInternalInventory(this, 1); private final byte hasSingularity = 32; private final byte powered = 64; @@ -112,11 +108,7 @@ public IInventory getInternalInventory() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (this.cluster != null) { this.cluster.updateStatus(true); @@ -132,12 +124,7 @@ public int[] getAccessibleSlotsBySide(final ForgeDirection side) { } private boolean isCenter() { - for (final Block link : AEApi.instance() - .definitions() - .blocks() - .quantumLink() - .maybeBlock() - .asSet()) { + for (final Block link : AEApi.instance().definitions().blocks().quantumLink().maybeBlock().asSet()) { return this.getBlockType() == link; } @@ -159,8 +146,7 @@ public void onChunkUnload() { public void onReady() { super.onReady(); - final IBlockDefinition quantumRing = - AEApi.instance().definitions().blocks().quantumRing(); + final IBlockDefinition quantumRing = AEApi.instance().definitions().blocks().quantumRing(); final Optional maybeLinkBlock = quantumRing.maybeBlock(); final Optional maybeLinkStack = quantumRing.maybeStack(1); @@ -185,7 +171,10 @@ public void disconnect(final boolean affectWorld) { if (AEConfig.instance.debugPathFinding) { AELog.debug( "Pathfinding: QNB at (%d %d %d) is disconnecting, affectWorld = %b", - xCoord, yCoord, zCoord, affectWorld); + xCoord, + yCoord, + zCoord, + affectWorld); } if (!affectWorld) { this.cluster.setUpdateStatus(false); @@ -215,7 +204,11 @@ public void updateStatus(final QuantumCluster c, final byte flags, final boolean if (AEConfig.instance.debugPathFinding) { AELog.debug( "Pathfinding: QNB at (%d %d %d) is updating, affectWorld = %b, flags = %d", - xCoord, yCoord, zCoord, affectWorld, (int) flags); + xCoord, + yCoord, + zCoord, + affectWorld, + (int) flags); } this.cluster = c; @@ -241,8 +234,8 @@ public EnumSet getConnections() { final EnumSet set = EnumSet.noneOf(ForgeDirection.class); for (final ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { - final TileEntity te = this.worldObj.getTileEntity( - this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ); + final TileEntity te = this.worldObj + .getTileEntity(this.xCoord + d.offsetX, this.yCoord + d.offsetY, this.zCoord + d.offsetZ); if (te instanceof TileQuantumBridge) { set.add(d); } diff --git a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java index 8a1fbd1a3e4..51e2162cfe5 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.spatial; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; import appeng.api.config.YesNo; @@ -40,15 +38,10 @@ import appeng.tile.inventory.InvOperation; import appeng.util.IWorldCallable; import appeng.util.Platform; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallable { - private final int[] sides = {0, 1}; + private final int[] sides = { 0, 1 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 2); private YesNo lastRedstoneState = YesNo.UNDECIDED; @@ -121,8 +114,8 @@ public Void call(final World world) throws Exception { if (Math.abs(pr - req) < req * 0.001) { final MENetworkEvent res = gi.postEvent(new MENetworkSpatialEvent(this, req)); if (!res.isCanceled()) { - final TransitionResult tr = - sc.doSpatialTransition(cell, this.worldObj, spc.getMin(), spc.getMax(), true); + final TransitionResult tr = sc + .doSpatialTransition(cell, this.worldObj, spc.getMin(), spc.getMax(), true); if (tr.success) { energy.extractAEPower(req, Actionable.MODULATE, PowerMultiplier.CONFIG); this.setInventorySlotContents(0, null); @@ -157,11 +150,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) {} @Override diff --git a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java index 932bd35d6c0..6b29ecae2d4 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialPylon.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialPylon.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.spatial; +import java.util.EnumSet; + +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.networking.GridFlags; import appeng.api.networking.events.MENetworkChannelsChanged; import appeng.api.networking.events.MENetworkEventSubscribe; @@ -32,8 +28,6 @@ import appeng.tile.events.TileEventType; import appeng.tile.grid.AENetworkTile; import io.netty.buffer.ByteBuf; -import java.util.EnumSet; -import net.minecraftforge.common.util.ForgeDirection; public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock { diff --git a/src/main/java/appeng/tile/storage/TileChest.java b/src/main/java/appeng/tile/storage/TileChest.java index 1edfef5f63c..9b6e6e6b4d8 100644 --- a/src/main/java/appeng/tile/storage/TileChest.java +++ b/src/main/java/appeng/tile/storage/TileChest.java @@ -1,23 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.storage; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.implementations.tiles.IColorableTile; @@ -50,26 +57,13 @@ import appeng.util.Platform; import appeng.util.item.AEFluidStack; import io.netty.buffer.ByteBuf; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHandler, ITerminalHost, IPriorityHost, IConfigManagerHost, IColorableTile { private static final ChestNoHandler NO_HANDLER = new ChestNoHandler(); - private static final int[] SIDES = {0}; - private static final int[] FRONT = {1}; + private static final int[] SIDES = { 0 }; + private static final int[] FRONT = { 1 }; private static final int[] NO_SLOTS = {}; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 2); private final BaseActionSource mySrc = new MachineSource(this); @@ -154,10 +148,10 @@ private IMEInventoryHandler getHandler(final StorageChannel channel) throws Ches if (this.cellHandler != null) { double power = 1.0; - final IMEInventoryHandler itemCell = - this.cellHandler.getCellInventory(is, this, StorageChannel.ITEMS); - final IMEInventoryHandler fluidCell = - this.cellHandler.getCellInventory(is, this, StorageChannel.FLUIDS); + final IMEInventoryHandler itemCell = this.cellHandler + .getCellInventory(is, this, StorageChannel.ITEMS); + final IMEInventoryHandler fluidCell = this.cellHandler + .getCellInventory(is, this, StorageChannel.FLUIDS); if (itemCell != null) { power += this.cellHandler.cellIdleDrain(is, itemCell); @@ -219,16 +213,14 @@ public int getCellStatus(final int slot) { if (handler instanceof ChestMonitorHandler) { return ch.getStatusForCell(cell, ((ChestMonitorHandler) handler).getInternalHandler()); } - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} try { final IMEInventoryHandler handler = this.getHandler(StorageChannel.FLUIDS); if (handler instanceof ChestMonitorHandler) { return ch.getStatusForCell(cell, ((ChestMonitorHandler) handler).getInternalHandler()); } - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} } return 0; @@ -245,8 +237,7 @@ public boolean isPowered() { if (!gridPowered) { try { gridPowered = this.getProxy().getEnergy().isNetworkPowered(); - } catch (final GridAccessException ignored) { - } + } catch (final GridAccessException ignored) {} } return super.getAECurrentPower() > 1 || gridPowered; @@ -290,15 +281,14 @@ public void Tick_TileChest() { try { if (!this.getProxy().getEnergy().isNetworkPowered()) { - final double powerUsed = - this.extractAEPower(idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG); // drain + final double powerUsed = this.extractAEPower(idleUsage, Actionable.MODULATE, PowerMultiplier.CONFIG); // drain if (powerUsed + 0.1 >= idleUsage != (this.state & 0x40) > 0) { this.recalculateDisplay(); } } } catch (final GridAccessException e) { - final double powerUsed = this.extractAEPower( - this.getProxy().getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG); // drain + final double powerUsed = this + .extractAEPower(this.getProxy().getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG); // drain if (powerUsed + 0.1 >= idleUsage != (this.state & 0x40) > 0) { this.recalculateDisplay(); } @@ -358,8 +348,7 @@ public boolean readFromStream_TileChest(final ByteBuf data) { this.lastStateChange = this.worldObj.getTotalWorldTime(); - return oldPaintedColor != this.paintedColor - || (this.state & 0xDB6DB6DB) != (oldState & 0xDB6DB6DB) + return oldPaintedColor != this.paintedColor || (this.state & 0xDB6DB6DB) != (oldState & 0xDB6DB6DB) || !Platform.isSameItemPrecise(oldType, this.storageType); } @@ -411,11 +400,7 @@ public void setInventorySlotContents(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (slot == 1) { this.itemCell = null; @@ -458,8 +443,7 @@ public boolean canInsertItem(final int slotIndex, final ItemStack insertingItem, Actionable.SIMULATE, this.mySrc); return returns == null || returns.getStackSize() != insertingItem.stackSize; - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} } return false; } @@ -493,7 +477,10 @@ private void tryToStoreContents() { final IMEInventory cell = this.getHandler(StorageChannel.ITEMS); final IAEItemStack returns = Platform.poweredInsert( - this, cell, AEApi.instance().storage().createItemStack(this.inv.getStackInSlot(0)), this.mySrc); + this, + cell, + AEApi.instance().storage().createItemStack(this.inv.getStackInSlot(0)), + this.mySrc); if (returns == null) { this.inv.setInventorySlotContents(0, null); @@ -501,8 +488,7 @@ private void tryToStoreContents() { this.inv.setInventorySlotContents(0, returns.getItemStack()); } } - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} } @Override @@ -560,15 +546,16 @@ public int fill(final ForgeDirection from, final FluidStack resource, final bool this.extractAEPower(req, Actionable.MODULATE, PowerMultiplier.CONFIG); final IAEStack results = h.injectItems( - AEFluidStack.create(resource), doFill ? Actionable.MODULATE : Actionable.SIMULATE, this.mySrc); + AEFluidStack.create(resource), + doFill ? Actionable.MODULATE : Actionable.SIMULATE, + this.mySrc); if (results == null) { return resource.amount; } return resource.amount - (int) results.getStackSize(); - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} } return 0; } @@ -588,8 +575,7 @@ public boolean canFill(final ForgeDirection from, final Fluid fluid) { try { final IMEInventoryHandler h = this.getHandler(StorageChannel.FLUIDS); return h.canAccept(AEFluidStack.create(new FluidStack(fluid, 1))); - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} return false; } @@ -603,10 +589,9 @@ public FluidTankInfo[] getTankInfo(final ForgeDirection from) { try { final IMEInventoryHandler h = this.getHandler(StorageChannel.FLUIDS); if (h.getChannel() == StorageChannel.FLUIDS) { - return new FluidTankInfo[] {new FluidTankInfo(null, 1)}; // eh? + return new FluidTankInfo[] { new FluidTankInfo(null, 1) }; // eh? } - } catch (final ChestNoHandler ignored) { - } + } catch (final ChestNoHandler ignored) {} return null; } @@ -681,6 +666,7 @@ public void saveChanges(final IMEInventory cellInventory) { } private static class ChestNoHandler extends Exception { + private static final long serialVersionUID = 7995805326136526631L; } @@ -709,9 +695,7 @@ public void postChange(final IBaseMonitor monitor, final Iterable change, || (source instanceof PlayerSource && ((PlayerSource) source).via == TileChest.this)) { try { if (TileChest.this.getProxy().isActive()) { - TileChest.this - .getProxy() - .getStorage() + TileChest.this.getProxy().getStorage() .postAlterationOfStoredItems(this.chan, change, TileChest.this.mySrc); } } catch (final GridAccessException e) { diff --git a/src/main/java/appeng/tile/storage/TileDrive.java b/src/main/java/appeng/tile/storage/TileDrive.java index 1e42bdaa49e..89ac6b48939 100644 --- a/src/main/java/appeng/tile/storage/TileDrive.java +++ b/src/main/java/appeng/tile/storage/TileDrive.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.storage; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.implementations.tiles.IChestOrDrive; import appeng.api.networking.GridFlags; @@ -46,17 +47,10 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPriorityHost { - private final int[] sides = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + private final int[] sides = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 10); private final ICellHandler[] handlersBySlot = new ICellHandler[10]; private final DriveWatcher[] invBySlot = new DriveWatcher[10]; @@ -225,11 +219,7 @@ public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (this.isCached) { this.isCached = false; // recalculate the storage cell. @@ -241,8 +231,7 @@ public void onChangeInventory( final IStorageGrid gs = this.getProxy().getStorage(); Platform.postChanges(gs, removed, added, this.mySrc); - } catch (final GridAccessException ignored) { - } + } catch (final GridAccessException ignored) {} this.markForUpdate(); } @@ -265,18 +254,20 @@ private void updateState() { this.handlersBySlot[x] = null; if (is != null) { - this.handlersBySlot[x] = - AEApi.instance().registries().cell().getHandler(is); + this.handlersBySlot[x] = AEApi.instance().registries().cell().getHandler(is); if (this.handlersBySlot[x] != null) { - IMEInventoryHandler cell = - this.handlersBySlot[x].getCellInventory(is, this, StorageChannel.ITEMS); + IMEInventoryHandler cell = this.handlersBySlot[x] + .getCellInventory(is, this, StorageChannel.ITEMS); if (cell != null) { power += this.handlersBySlot[x].cellIdleDrain(is, cell); - final DriveWatcher ih = - new DriveWatcher(cell, is, this.handlersBySlot[x], this); + final DriveWatcher ih = new DriveWatcher( + cell, + is, + this.handlersBySlot[x], + this); ih.setPriority(this.priority); this.invBySlot[x] = ih; this.items.add(ih); @@ -286,8 +277,11 @@ private void updateState() { if (cell != null) { power += this.handlersBySlot[x].cellIdleDrain(is, cell); - final DriveWatcher ih = - new DriveWatcher(cell, is, this.handlersBySlot[x], this); + final DriveWatcher ih = new DriveWatcher( + cell, + is, + this.handlersBySlot[x], + this); ih.setPriority(this.priority); this.invBySlot[x] = ih; this.fluids.add(ih); diff --git a/src/main/java/appeng/tile/storage/TileIOPort.java b/src/main/java/appeng/tile/storage/TileIOPort.java index d1784ee7cfa..cea907c6fad 100644 --- a/src/main/java/appeng/tile/storage/TileIOPort.java +++ b/src/main/java/appeng/tile/storage/TileIOPort.java @@ -1,23 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.storage; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.implementations.IUpgradeableHost; @@ -54,15 +55,9 @@ import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.inv.WrapperInventoryRange; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable { + private static final int INPUT_SLOT_INDEX_TOP_LEFT = 0; private static final int INPUT_SLOT_INDEX_TOP_RIGHT = 1; private static final int INPUT_SLOT_INDEX_CENTER_LEFT = 2; @@ -80,22 +75,11 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC private final ConfigManager manager; - private final int[] input = { - INPUT_SLOT_INDEX_TOP_LEFT, - INPUT_SLOT_INDEX_TOP_RIGHT, - INPUT_SLOT_INDEX_CENTER_LEFT, - INPUT_SLOT_INDEX_CENTER_RIGHT, - INPUT_SLOT_INDEX_BOTTOM_LEFT, - INPUT_SLOT_INDEX_BOTTOM_RIGHT - }; - private final int[] output = { - OUTPUT_SLOT_INDEX_TOP_LEFT, - OUTPUT_SLOT_INDEX_TOP_RIGHT, - OUTPUT_SLOT_INDEX_CENTER_LEFT, - OUTPUT_SLOT_INDEX_CENTER_RIGHT, - OUTPUT_SLOT_INDEX_BOTTOM_LEFT, - OUTPUT_SLOT_INDEX_BOTTOM_RIGHT - }; + private final int[] input = { INPUT_SLOT_INDEX_TOP_LEFT, INPUT_SLOT_INDEX_TOP_RIGHT, INPUT_SLOT_INDEX_CENTER_LEFT, + INPUT_SLOT_INDEX_CENTER_RIGHT, INPUT_SLOT_INDEX_BOTTOM_LEFT, INPUT_SLOT_INDEX_BOTTOM_RIGHT }; + private final int[] output = { OUTPUT_SLOT_INDEX_TOP_LEFT, OUTPUT_SLOT_INDEX_TOP_RIGHT, + OUTPUT_SLOT_INDEX_CENTER_LEFT, OUTPUT_SLOT_INDEX_CENTER_RIGHT, OUTPUT_SLOT_INDEX_BOTTOM_LEFT, + OUTPUT_SLOT_INDEX_BOTTOM_RIGHT }; private final AppEngInternalInventory cells; private final UpgradeInventory upgrades; @@ -118,8 +102,7 @@ public TileIOPort() { this.mySrc = new MachineSource(this); this.lastRedstoneState = YesNo.UNDECIDED; - final Block ioPortBlock = - AEApi.instance().definitions().blocks().iOPort().maybeBlock().get(); + final Block ioPortBlock = AEApi.instance().definitions().blocks().iOPort().maybeBlock().get(); this.upgrades = new BlockUpgradeInventory(ioPortBlock, this, 3); } @@ -234,11 +217,7 @@ public IInventory getInternalInventory() { } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) { if (this.cells == inv) { this.updateTask(); @@ -314,10 +293,8 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi } try { - final IMEInventory itemNet = - this.getProxy().getStorage().getItemInventory(); - final IMEInventory fluidNet = - this.getProxy().getStorage().getFluidInventory(); + final IMEInventory itemNet = this.getProxy().getStorage().getItemInventory(); + final IMEInventory fluidNet = this.getProxy().getStorage().getFluidInventory(); final IEnergySource energy = this.getProxy().getEnergy(); for (int x = 0; x < 6; x++) { final ItemStack is = this.cells.getStackInSlot(x); @@ -328,8 +305,8 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi if (this.manager.getSetting(Settings.OPERATION_MODE) == OperationMode.EMPTY) { if (itemInv != null) { - ItemsToMove = this.transferContents( - energy, itemInv, itemNet, ItemsToMove, StorageChannel.ITEMS); + ItemsToMove = this + .transferContents(energy, itemInv, itemNet, ItemsToMove, StorageChannel.ITEMS); } if (fluidInv != null) { ItemsToMove = this.transferContents( @@ -341,8 +318,8 @@ public TickRateModulation tickingRequest(final IGridNode node, final int ticksSi } } else { if (itemInv != null) { - ItemsToMove = this.transferContents( - energy, itemNet, itemInv, ItemsToMove, StorageChannel.ITEMS); + ItemsToMove = this + .transferContents(energy, itemNet, itemInv, ItemsToMove, StorageChannel.ITEMS); } if (fluidInv != null) { ItemsToMove = this.transferContents( @@ -391,12 +368,8 @@ private IMEInventory getInv(final ItemStack is, final StorageChannel chan) { return this.cachedFluid; } - private long transferContents( - final IEnergySource energy, - final IMEInventory src, - final IMEInventory destination, - long itemsToMove, - final StorageChannel chan) { + private long transferContents(final IEnergySource energy, final IMEInventory src, final IMEInventory destination, + long itemsToMove, final StorageChannel chan) { final IItemList myList; if (src instanceof IMEMonitor) { myList = ((IMEMonitor) src).getStorageList(); @@ -466,8 +439,8 @@ private boolean shouldMove(final IMEInventory itemInv, final IMEIn private boolean moveSlot(final int x) { final WrapperInventoryRange wir = new WrapperInventoryRange(this, this.output, true); - final ItemStack result = - InventoryAdaptor.getAdaptor(wir, ForgeDirection.UNKNOWN).addItems(this.getStackInSlot(x)); + final ItemStack result = InventoryAdaptor.getAdaptor(wir, ForgeDirection.UNKNOWN) + .addItems(this.getStackInSlot(x)); if (result == null) { this.setInventorySlotContents(x, null); diff --git a/src/main/java/appeng/tile/storage/TileSkyChest.java b/src/main/java/appeng/tile/storage/TileSkyChest.java index 35fca822dcf..226fd0c256e 100644 --- a/src/main/java/appeng/tile/storage/TileSkyChest.java +++ b/src/main/java/appeng/tile/storage/TileSkyChest.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.tile.storage; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.tile.AEBaseInvTile; import appeng.tile.TileEvent; import appeng.tile.events.TileEventType; @@ -25,16 +21,11 @@ import appeng.tile.inventory.InvOperation; import appeng.util.Platform; import io.netty.buffer.ByteBuf; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class TileSkyChest extends AEBaseInvTile { - private final int[] sides = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35 - }; + private final int[] sides = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }; private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 9 * 4); // server private int playerOpen; @@ -78,14 +69,13 @@ public void openInventory() { this.setPlayerOpen(this.getPlayerOpen() + 1); if (this.getPlayerOpen() == 1) { - this.getWorldObj() - .playSoundEffect( - this.xCoord + 0.5D, - this.yCoord + 0.5D, - this.zCoord + 0.5D, - "random.chestopen", - 0.5F, - this.getWorldObj().rand.nextFloat() * 0.1F + 0.9F); + this.getWorldObj().playSoundEffect( + this.xCoord + 0.5D, + this.yCoord + 0.5D, + this.zCoord + 0.5D, + "random.chestopen", + 0.5F, + this.getWorldObj().rand.nextFloat() * 0.1F + 0.9F); this.markForUpdate(); } } @@ -103,24 +93,19 @@ public void closeInventory() { } if (this.getPlayerOpen() == 0) { - this.getWorldObj() - .playSoundEffect( - this.xCoord + 0.5D, - this.yCoord + 0.5D, - this.zCoord + 0.5D, - "random.chestclosed", - 0.5F, - this.getWorldObj().rand.nextFloat() * 0.1F + 0.9F); + this.getWorldObj().playSoundEffect( + this.xCoord + 0.5D, + this.yCoord + 0.5D, + this.zCoord + 0.5D, + "random.chestclosed", + 0.5F, + this.getWorldObj().rand.nextFloat() * 0.1F + 0.9F); this.markForUpdate(); } } @Override - public void onChangeInventory( - final IInventory inv, - final int slot, - final InvOperation mc, - final ItemStack removed, + public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added) {} @Override diff --git a/src/main/java/appeng/transformer/AppEngCore.java b/src/main/java/appeng/transformer/AppEngCore.java index ef122e58d64..f48c36c3615 100644 --- a/src/main/java/appeng/transformer/AppEngCore.java +++ b/src/main/java/appeng/transformer/AppEngCore.java @@ -1,25 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.transformer; +import java.util.Map; + +import javax.annotation.Nullable; + import appeng.core.AEConfig; + import com.google.common.eventbus.EventBus; + import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.Mod.EventHandler; @@ -28,11 +26,10 @@ import cpw.mods.fml.relauncher.FMLRelaunchLog; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; -import java.util.Map; -import javax.annotation.Nullable; @MCVersion("1.7.10") public final class AppEngCore extends DummyModContainer implements IFMLLoadingPlugin { + private final ModMetadata metadata = new ModMetadata(); public AppEngCore() { @@ -54,7 +51,7 @@ public void load(final FMLInitializationEvent event) {} @Override public String[] getASMTransformerClass() { - return new String[] {"appeng.transformer.asm.ASMIntegration", "appeng.transformer.asm.ApiRepairer"}; + return new String[] { "appeng.transformer.asm.ASMIntegration", "appeng.transformer.asm.ApiRepairer" }; } @Override diff --git a/src/main/java/appeng/transformer/MissingCoreMod.java b/src/main/java/appeng/transformer/MissingCoreMod.java index d6df747fa14..b2e09735e68 100644 --- a/src/main/java/appeng/transformer/MissingCoreMod.java +++ b/src/main/java/appeng/transformer/MissingCoreMod.java @@ -1,31 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.transformer; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiErrorScreen; + import cpw.mods.fml.client.CustomModLoadingErrorDisplayException; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiErrorScreen; @SideOnly(Side.CLIENT) public final class MissingCoreMod extends CustomModLoadingErrorDisplayException { + private static final int SHADOW_WHITE = 0xeeeeee; private static final int COLOR_WHITE = 0xffffff; private static final long serialVersionUID = -966774766922821652L; @@ -45,15 +39,15 @@ public void initGui(final GuiErrorScreen errorScreen, final FontRenderer fontRen } @Override - public void drawScreen( - final GuiErrorScreen errorScreen, - final FontRenderer fontRenderer, - final int mouseRelX, - final int mouseRelY, - final float tickTime) { + public void drawScreen(final GuiErrorScreen errorScreen, final FontRenderer fontRenderer, final int mouseRelX, + final int mouseRelY, final float tickTime) { int offset = 10; this.drawCenteredString( - fontRenderer, "Sorry, couldn't load AE2 properly.", errorScreen.width / 2, offset, COLOR_WHITE); + fontRenderer, + "Sorry, couldn't load AE2 properly.", + errorScreen.width / 2, + offset, + COLOR_WHITE); offset += SCREEN_OFFSET; this.drawCenteredString( @@ -124,8 +118,8 @@ public void drawScreen( } } - private void drawCenteredString( - final FontRenderer fontRenderer, final String string, final int x, final int y, final int colour) { + private void drawCenteredString(final FontRenderer fontRenderer, final String string, final int x, final int y, + final int colour) { final String reEncoded = string.replaceAll("\\P{InBasic_Latin}", ""); final int reEncodedWidth = fontRenderer.getStringWidth(reEncoded); final int centeredX = x - reEncodedWidth / 2; diff --git a/src/main/java/appeng/transformer/annotations/Integration.java b/src/main/java/appeng/transformer/annotations/Integration.java index 8bb3cf78152..2f4d7ee840d 100644 --- a/src/main/java/appeng/transformer/annotations/Integration.java +++ b/src/main/java/appeng/transformer/annotations/Integration.java @@ -1,39 +1,35 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.transformer.annotations; -import appeng.integration.IntegrationType; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import appeng.integration.IntegrationType; + public @interface Integration { + @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @interface InterfaceList { + Interface[] value(); } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @interface Interface { + String iface(); IntegrationType iname(); @@ -42,6 +38,7 @@ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @interface Method { + IntegrationType iname(); } } diff --git a/src/main/java/appeng/transformer/asm/ASMIntegration.java b/src/main/java/appeng/transformer/asm/ASMIntegration.java index 9bea8f1520c..cd24d779eed 100644 --- a/src/main/java/appeng/transformer/asm/ASMIntegration.java +++ b/src/main/java/appeng/transformer/asm/ASMIntegration.java @@ -1,31 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.transformer.asm; -import appeng.helpers.Reflected; -import appeng.integration.IntegrationRegistry; -import appeng.integration.IntegrationType; -import appeng.transformer.annotations.Integration; -import cpw.mods.fml.relauncher.FMLRelaunchLog; import java.util.Iterator; + import javax.annotation.Nullable; + import net.minecraft.launchwrapper.IClassTransformer; + import org.apache.logging.log4j.Level; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; @@ -34,8 +24,15 @@ import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.MethodNode; +import appeng.helpers.Reflected; +import appeng.integration.IntegrationRegistry; +import appeng.integration.IntegrationType; +import appeng.transformer.annotations.Integration; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + @Reflected public final class ASMIntegration implements IClassTransformer { + @Reflected public ASMIntegration() { @@ -152,13 +149,23 @@ private boolean stripInterface(final ClassNode classNode, final Class class1, if (iName != null && iFace != null) { final IntegrationType type = IntegrationType.valueOf(iName); if (!IntegrationRegistry.INSTANCE.isEnabled(type)) { - this.log("Removing Interface " + iFace + " from " + classNode.name + " because " + iName - + " integration is disabled."); + this.log( + "Removing Interface " + iFace + + " from " + + classNode.name + + " because " + + iName + + " integration is disabled."); classNode.interfaces.remove(iFace.replace('.', '/')); return true; } else { - this.log("Allowing Interface " + iFace + " from " + classNode.name + " because " + iName - + " integration is enabled."); + this.log( + "Allowing Interface " + iFace + + " from " + + classNode.name + + " because " + + iName + + " integration is enabled."); } } else { throw new IllegalStateException("Unable to handle Method annotation on " + classNode.name); @@ -167,12 +174,8 @@ private boolean stripInterface(final ClassNode classNode, final Class class1, return false; } - private boolean stripMethod( - final ClassNode classNode, - final MethodNode mn, - final Iterator i, - final Class class1, - final AnnotationNode an) { + private boolean stripMethod(final ClassNode classNode, final MethodNode mn, final Iterator i, + final Class class1, final AnnotationNode an) { if (an.values.size() != 2) { throw new IllegalArgumentException("Unable to handle Method annotation on " + classNode.name); } @@ -186,13 +189,23 @@ private boolean stripMethod( if (iName != null) { final IntegrationType type = IntegrationType.valueOf(iName); if (!IntegrationRegistry.INSTANCE.isEnabled(type)) { - this.log("Removing Method " + mn.name + " from " + classNode.name + " because " + iName - + " integration is disabled."); + this.log( + "Removing Method " + mn.name + + " from " + + classNode.name + + " because " + + iName + + " integration is disabled."); i.remove(); return true; } else { - this.log("Allowing Method " + mn.name + " from " + classNode.name + " because " + iName - + " integration is enabled."); + this.log( + "Allowing Method " + mn.name + + " from " + + classNode.name + + " because " + + iName + + " integration is enabled."); } } else { throw new IllegalStateException("Unable to handle Method annotation on " + classNode.name); diff --git a/src/main/java/appeng/transformer/asm/ASMTweaker.java b/src/main/java/appeng/transformer/asm/ASMTweaker.java index 557c5f06b45..a4748f78f3d 100644 --- a/src/main/java/appeng/transformer/asm/ASMTweaker.java +++ b/src/main/java/appeng/transformer/asm/ASMTweaker.java @@ -1,38 +1,36 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.transformer.asm; -import appeng.helpers.Reflected; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.FMLRelaunchLog; import java.util.Iterator; + import javax.annotation.Nullable; + import net.minecraft.launchwrapper.IClassTransformer; + import org.apache.logging.log4j.Level; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; +import appeng.helpers.Reflected; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + @Reflected public final class ASMTweaker implements IClassTransformer { + private static final String[] EXCEPTIONS = new String[0]; private final Multimap privateToPublicMethods = HashMultimap.create(); @@ -41,19 +39,21 @@ public ASMTweaker() { this.privateToPublicMethods.put( "net.minecraft.client.gui.inventory.GuiContainer", new PublicLine("func_146977_a", "(Lnet/minecraft/inventory/Slot;)V")); - this.privateToPublicMethods.put( - "net.minecraft.client.gui.inventory.GuiContainer", new PublicLine("a", "(Lzk;)V")); + this.privateToPublicMethods + .put("net.minecraft.client.gui.inventory.GuiContainer", new PublicLine("a", "(Lzk;)V")); + this.privateToPublicMethods + .put("appeng.tile.AEBaseTile", new PublicLine("writeToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); this.privateToPublicMethods.put( - "appeng.tile.AEBaseTile", new PublicLine("writeToNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); - this.privateToPublicMethods.put( - "appeng.tile.AEBaseTile", new PublicLine("func_145841_b", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); + "appeng.tile.AEBaseTile", + new PublicLine("func_145841_b", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); this.privateToPublicMethods.put("appeng.tile.AEBaseTile", new PublicLine("b", "(Ldh;)V")); + this.privateToPublicMethods + .put("appeng.tile.AEBaseTile", new PublicLine("readFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); this.privateToPublicMethods.put( - "appeng.tile.AEBaseTile", new PublicLine("readFromNBT", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); - this.privateToPublicMethods.put( - "appeng.tile.AEBaseTile", new PublicLine("func_145839_a", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); + "appeng.tile.AEBaseTile", + new PublicLine("func_145839_a", "(Lnet/minecraft/nbt/NBTTagCompound;)V")); this.privateToPublicMethods.put("appeng.tile.AEBaseTile", new PublicLine("a", "(Ldh;)V")); } @@ -79,7 +79,11 @@ public byte[] transform(final String name, final String transformedName, final b for (final MethodNode mn : classNode.methods) { if (mn.name.equals("func_146977_a") || (mn.name.equals("a") && mn.desc.equals("(Lzk;)V"))) { final MethodNode newNode = new MethodNode( - Opcodes.ACC_PUBLIC, "func_146977_a_original", mn.desc, mn.signature, EXCEPTIONS); + Opcodes.ACC_PUBLIC, + "func_146977_a_original", + mn.desc, + mn.signature, + EXCEPTIONS); newNode.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); newNode.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); newNode.instructions.add( @@ -92,8 +96,7 @@ public byte[] transform(final String name, final String transformedName, final b } for (final MethodNode mn : classNode.methods) { - if (mn.name.equals("func_73863_a") - || mn.name.equals("drawScreen") + if (mn.name.equals("func_73863_a") || mn.name.equals("drawScreen") || (mn.name.equals("a") && mn.desc.equals("(IIF)V"))) { final Iterator i = mn.instructions.iterator(); while (i.hasNext()) { @@ -106,7 +109,11 @@ public byte[] transform(final String name, final String transformedName, final b mn.instructions.insertBefore( n, new MethodInsnNode( - Opcodes.INVOKEVIRTUAL, n.owner, n.name, n.desc, false)); + Opcodes.INVOKEVIRTUAL, + n.owner, + n.name, + n.desc, + false)); mn.instructions.remove(in); break; } @@ -120,8 +127,7 @@ public byte[] transform(final String name, final String transformedName, final b classNode.accept(writer); return writer.toByteArray(); } - } catch (final Throwable ignored) { - } + } catch (final Throwable ignored) {} return basicClass; } @@ -141,6 +147,7 @@ private void log(final String string) { } private static final class PublicLine { + private final String name; private final String desc; diff --git a/src/main/java/appeng/transformer/asm/ApiRepairer.java b/src/main/java/appeng/transformer/asm/ApiRepairer.java index 3cf439af522..1a5df2d9113 100644 --- a/src/main/java/appeng/transformer/asm/ApiRepairer.java +++ b/src/main/java/appeng/transformer/asm/ApiRepairer.java @@ -1,35 +1,30 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.transformer.asm; -import appeng.helpers.Reflected; -import cpw.mods.fml.relauncher.FMLRelaunchLog; import java.net.URL; import java.net.URLConnection; + import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.launchwrapper.LaunchClassLoader; + import org.apache.logging.log4j.Level; +import appeng.helpers.Reflected; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + /* - * It is a ClassTransformer which can transformer the older AE2 api class that some addons including, - * which can occur the crash due to java.lang.NoSuchMethodError. - * See also : https://github.com/xsun2001/Applied-Energistics-2-Unofficial/issues/1 + * It is a ClassTransformer which can transformer the older AE2 api class that some addons including, which can occur + * the crash due to java.lang.NoSuchMethodError. See also : + * https://github.com/xsun2001/Applied-Energistics-2-Unofficial/issues/1 */ @Reflected public class ApiRepairer implements IClassTransformer { diff --git a/src/main/java/appeng/util/BlockUpdate.java b/src/main/java/appeng/util/BlockUpdate.java index fbe4f934c32..961af7a11b0 100644 --- a/src/main/java/appeng/util/BlockUpdate.java +++ b/src/main/java/appeng/util/BlockUpdate.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; diff --git a/src/main/java/appeng/util/ClassInstantiation.java b/src/main/java/appeng/util/ClassInstantiation.java index 5d35cecbfbd..6a94e872874 100644 --- a/src/main/java/appeng/util/ClassInstantiation.java +++ b/src/main/java/appeng/util/ClassInstantiation.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; -import appeng.core.AELog; -import com.google.common.base.Optional; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import appeng.core.AELog; + +import com.google.common.base.Optional; + public class ClassInstantiation { + private final Class template; private final Object[] args; diff --git a/src/main/java/appeng/util/ConfigManager.java b/src/main/java/appeng/util/ConfigManager.java index 0c3fafc2fc2..f9a34237337 100644 --- a/src/main/java/appeng/util/ConfigManager.java +++ b/src/main/java/appeng/util/ConfigManager.java @@ -1,34 +1,29 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; +import java.util.EnumMap; +import java.util.Map; +import java.util.Set; + +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.LevelEmitterMode; import appeng.api.config.Settings; import appeng.api.config.StorageFilter; import appeng.api.util.IConfigManager; import appeng.core.AELog; -import java.util.EnumMap; -import java.util.Map; -import java.util.Set; -import net.minecraft.nbt.NBTTagCompound; public final class ConfigManager implements IConfigManager { + private final Map> settings = new EnumMap>(Settings.class); private final IConfigManagerHost target; @@ -73,8 +68,7 @@ public Enum putSetting(final Settings settingName, final Enum newValue) { @Override public void writeToNBT(final NBTTagCompound tagCompound) { for (final Map.Entry> entry : this.settings.entrySet()) { - tagCompound.setString( - entry.getKey().name(), this.settings.get(entry.getKey()).toString()); + tagCompound.setString(entry.getKey().name(), this.settings.get(entry.getKey()).toString()); } } diff --git a/src/main/java/appeng/util/IConfigManagerHost.java b/src/main/java/appeng/util/IConfigManagerHost.java index e9a02c54e18..47bd9cd044e 100644 --- a/src/main/java/appeng/util/IConfigManagerHost.java +++ b/src/main/java/appeng/util/IConfigManagerHost.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; diff --git a/src/main/java/appeng/util/ISlimReadableNumberConverter.java b/src/main/java/appeng/util/ISlimReadableNumberConverter.java index 6f1b230528a..a36e71d6fba 100644 --- a/src/main/java/appeng/util/ISlimReadableNumberConverter.java +++ b/src/main/java/appeng/util/ISlimReadableNumberConverter.java @@ -3,22 +3,20 @@ import javax.annotation.Nonnegative; /** - * Limits a number converter to a char width of at max 3 characters. - * This is generally used for players, who activated the large font extension. + * Limits a number converter to a char width of at max 3 characters. This is generally used for players, who activated + * the large font extension. * * @author thatsIch * @version rv2 * @since rv2 */ public interface ISlimReadableNumberConverter { + /** - * Converts a number into a human readable form. It will not round the number, but down it. - * Will try to cut the number down 1 decimal later, but rarely because of the 3 width limitation. - * Can only handle non negative numbers + * Converts a number into a human readable form. It will not round the number, but down it. Will try to cut the + * number down 1 decimal later, but rarely because of the 3 width limitation. Can only handle non negative numbers *

- * Example: - * 10000L -> 10K - * 9999L -> 9K, not 9.9K cause 4 width + * Example: 10000L -> 10K 9999L -> 9K, not 9.9K cause 4 width * * @param number to be converted number * @return String in SI format cut down as far as possible diff --git a/src/main/java/appeng/util/IWideReadableNumberConverter.java b/src/main/java/appeng/util/IWideReadableNumberConverter.java index 6f003b605fd..ea57610abd8 100644 --- a/src/main/java/appeng/util/IWideReadableNumberConverter.java +++ b/src/main/java/appeng/util/IWideReadableNumberConverter.java @@ -10,14 +10,12 @@ * @since rv2 */ public interface IWideReadableNumberConverter { + /** - * Converts a number into a human readable form. It will not round the number, but down it. - * Will try to cut the number down 1 decimal later if width can be below 4. - * Can only handle non negative numbers + * Converts a number into a human readable form. It will not round the number, but down it. Will try to cut the + * number down 1 decimal later if width can be below 4. Can only handle non negative numbers *

- * Example: - * 10000L -> 10K - * 9999L -> 9999 + * Example: 10000L -> 10K 9999L -> 9999 * * @param number to be converted number * @return String in SI format cut down as far as possible diff --git a/src/main/java/appeng/util/IWorldCallable.java b/src/main/java/appeng/util/IWorldCallable.java index 8e7b9cdcfaa..b65f6cde5b0 100644 --- a/src/main/java/appeng/util/IWorldCallable.java +++ b/src/main/java/appeng/util/IWorldCallable.java @@ -1,25 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; import java.util.concurrent.Callable; + import javax.annotation.Nullable; + import net.minecraft.world.World; /** @@ -31,11 +25,12 @@ * @since rv3 */ public interface IWorldCallable { + /** * Similar to {@link Callable#call()} * - * @param world this param is given to not hold a reference to the world but let the caller handle it. Do not expect a world here thus can be - * null. + * @param world this param is given to not hold a reference to the world but let the caller handle it. Do not expect + * a world here thus can be null. * @return result of call on the world. Can be null. * @throws Exception if the call fails * @see Callable#call() diff --git a/src/main/java/appeng/util/InWorldToolOperationResult.java b/src/main/java/appeng/util/InWorldToolOperationResult.java index a8b3c664d4d..da042925fdf 100644 --- a/src/main/java/appeng/util/InWorldToolOperationResult.java +++ b/src/main/java/appeng/util/InWorldToolOperationResult.java @@ -1,25 +1,18 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.item.ItemStack; diff --git a/src/main/java/appeng/util/InventoryAdaptor.java b/src/main/java/appeng/util/InventoryAdaptor.java index d899e31307f..f5b0f539e52 100644 --- a/src/main/java/appeng/util/InventoryAdaptor.java +++ b/src/main/java/appeng/util/InventoryAdaptor.java @@ -1,30 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; -import appeng.api.config.FuzzyMode; -import appeng.api.config.InsertionMode; -import appeng.integration.IntegrationRegistry; -import appeng.integration.IntegrationType; -import appeng.integration.abstraction.IBetterStorage; -import appeng.util.inv.*; import java.util.ArrayList; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -32,6 +19,13 @@ import net.minecraft.tileentity.TileEntityChest; import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.config.FuzzyMode; +import appeng.api.config.InsertionMode; +import appeng.integration.IntegrationRegistry; +import appeng.integration.IntegrationType; +import appeng.integration.abstraction.IBetterStorage; +import appeng.util.inv.*; + public abstract class InventoryAdaptor implements Iterable { // returns an appropriate adaptor, or null @@ -40,9 +34,8 @@ public static InventoryAdaptor getAdaptor(final Object te, final ForgeDirection return null; } - final IBetterStorage bs = (IBetterStorage) - (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BetterStorage) - ? IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BetterStorage) + final IBetterStorage bs = (IBetterStorage) (IntegrationRegistry.INSTANCE.isEnabled( + IntegrationType.BetterStorage) ? IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BetterStorage) : null); if (te instanceof EntityPlayer) { @@ -78,17 +71,18 @@ public static InventoryAdaptor getAdaptor(final Object te, final ForgeDirection public abstract ItemStack simulateRemove(int amount, ItemStack filter, IInventoryDestination destination); // return what was extracted. - public abstract ItemStack removeSimilarItems( - int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination); + public abstract ItemStack removeSimilarItems(int amount, ItemStack filter, FuzzyMode fuzzyMode, + IInventoryDestination destination); - public abstract ItemStack simulateSimilarRemove( - int amount, ItemStack filter, FuzzyMode fuzzyMode, IInventoryDestination destination); + public abstract ItemStack simulateSimilarRemove(int amount, ItemStack filter, FuzzyMode fuzzyMode, + IInventoryDestination destination); // return what isn't used... public abstract ItemStack addItems(ItemStack toBeAdded); /** - * @param insertionMode advice implementation on how ItemStacks should be inserted. Might not has an effect whatsoever! + * @param insertionMode advice implementation on how ItemStacks should be inserted. Might not has an effect + * whatsoever! */ public ItemStack addItems(ItemStack toBeAdded, InsertionMode insertionMode) { return addItems(toBeAdded); @@ -97,7 +91,8 @@ public ItemStack addItems(ItemStack toBeAdded, InsertionMode insertionMode) { public abstract ItemStack simulateAdd(ItemStack toBeSimulated); /** - * @param insertionMode advice implementation on how ItemStacks should be inserted. Might not has an effect whatsoever! + * @param insertionMode advice implementation on how ItemStacks should be inserted. Might not has an effect + * whatsoever! * @return The leftover itemstack, or null if everything could be inserted */ public ItemStack simulateAdd(ItemStack toBeSimulated, InsertionMode insertionMode) { diff --git a/src/main/java/appeng/util/ItemSorters.java b/src/main/java/appeng/util/ItemSorters.java index 14e472f8554..e59a3244f85 100644 --- a/src/main/java/appeng/util/ItemSorters.java +++ b/src/main/java/appeng/util/ItemSorters.java @@ -1,30 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; +import java.util.Comparator; + import appeng.api.config.SortDir; import appeng.api.storage.data.IAEItemStack; import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IInvTweaks; import appeng.util.item.AEItemStack; -import java.util.Comparator; public class ItemSorters { diff --git a/src/main/java/appeng/util/LookDirection.java b/src/main/java/appeng/util/LookDirection.java index e8bd6cde6f3..5f946ec6f4a 100644 --- a/src/main/java/appeng/util/LookDirection.java +++ b/src/main/java/appeng/util/LookDirection.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; diff --git a/src/main/java/appeng/util/Platform.java b/src/main/java/appeng/util/Platform.java index d4bc1af20c2..1500c401a15 100644 --- a/src/main/java/appeng/util/Platform.java +++ b/src/main/java/appeng/util/Platform.java @@ -1,23 +1,55 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.security.InvalidParameterException; +import java.text.DecimalFormat; +import java.util.*; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.*; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.stats.Achievement; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.util.FakePlayerFactory; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.AEApi; import appeng.api.config.*; import appeng.api.definitions.IItemDefinition; @@ -60,50 +92,15 @@ import appeng.util.item.OreReference; import appeng.util.prioitylist.IPartitionList; import buildcraft.api.tools.IToolWrench; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.relauncher.ReflectionHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.security.InvalidParameterException; -import java.text.DecimalFormat; -import java.util.*; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.inventory.*; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S21PacketChunkData; -import net.minecraft.server.management.PlayerManager; -import net.minecraft.stats.Achievement; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.*; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.util.FakePlayerFactory; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; /** * @author AlgorithmX2 @@ -126,8 +123,9 @@ public class Platform { private static Class playerInstance; private static Method getOrCreateChunkWatcher; private static Method sendToAllPlayersWatchingChunk; - private static GameProfile fakeProfile = - new GameProfile(UUID.fromString("839eb18c-50bc-400c-8291-9383f09763e7"), "[AE2Player]"); + private static GameProfile fakeProfile = new GameProfile( + UUID.fromString("839eb18c-50bc-400c-8291-9383f09763e7"), + "[AE2Player]"); public static Random getRandom() { return RANDOM_GENERATOR; @@ -138,14 +136,14 @@ public static float getRandomFloat() { } /** - * Seed a random number generator from a world seed and grid location. - * The grid can be any arbitrary set of coordinates, e.g. chunk position or block position. - * This method guarantees that for the same inputs (worldSeed, x, z) the same seed will be used. + * Seed a random number generator from a world seed and grid location. The grid can be any arbitrary set of + * coordinates, e.g. chunk position or block position. This method guarantees that for the same inputs (worldSeed, + * x, z) the same seed will be used. * - * @param rng The generator to re-seed. + * @param rng The generator to re-seed. * @param worldSeed Global seed independent of the grid position - * @param x X location in the grid - * @param z Z location in the grid + * @param x X location in the grid + * @param z Z location in the grid */ public static void seedFromGrid(final Random rng, final long worldSeed, final long x, final long z) { rng.setSeed(worldSeed); @@ -178,7 +176,7 @@ public static String formatPowerLong(final long n, final boolean isRate) { unitName = "J"; } - final String[] preFixes = {"k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y"}; + final String[] preFixes = { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" }; String level = ""; int offset = 0; while (p > 1000 && offset < preFixes.length) { @@ -292,11 +290,8 @@ private static boolean isNotValidSetting(final Enum e) { return e == SearchBoxMode.NEI_MANUAL_SEARCH && !IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI); } - public static void openGUI( - @Nonnull final EntityPlayer p, - @Nullable final TileEntity tile, - @Nullable final ForgeDirection side, - @Nonnull final GuiBridge type) { + public static void openGUI(@Nonnull final EntityPlayer p, @Nullable final TileEntity tile, + @Nullable final ForgeDirection side, @Nonnull final GuiBridge type) { if (isClient()) { return; } @@ -370,8 +365,7 @@ private static boolean sameStackStags(final ItemStack a, final ItemStack b) { return true; } - if ((ta == null && tb == null) - || (ta != null && ta.hasNoTags() && tb == null) + if ((ta == null && tb == null) || (ta != null && ta.hasNoTags() && tb == null) || (tb != null && tb.hasNoTags() && ta == null) || (ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags())) { return true; @@ -665,8 +659,12 @@ public static void spawnDrops(final World w, final int x, final int y, final int final double offset_x = (getRandomInt() % 32 - 16) / 82; final double offset_y = (getRandomInt() % 32 - 16) / 82; final double offset_z = (getRandomInt() % 32 - 16) / 82; - final EntityItem ei = - new EntityItem(w, 0.5 + offset_x + x, 0.5 + offset_y + y, 0.2 + offset_z + z, i.copy()); + final EntityItem ei = new EntityItem( + w, + 0.5 + offset_x + x, + 0.5 + offset_y + y, + 0.2 + offset_z + z, + i.copy()); w.spawnEntityInWorld(ei); } } @@ -746,8 +744,7 @@ public static boolean isModLoaded(final String modid) { try { // if this fails for some reason, try the other method. return Loader.isModLoaded(modid); - } catch (final Throwable ignored) { - } + } catch (final Throwable ignored) {} for (final ModContainer f : Loader.instance().getActiveModList()) { if (f.getModId().equals(modid)) { @@ -841,8 +838,8 @@ public static boolean hasSpecialComparison(final ItemStack willAdd) { return false; } - public static boolean isWrench( - final EntityPlayer player, final ItemStack eq, final int x, final int y, final int z) { + public static boolean isWrench(final EntityPlayer player, final ItemStack eq, final int x, final int y, + final int z) { if (eq != null) { try { if (eq.getItem() instanceof IToolWrench) { @@ -1073,10 +1070,10 @@ public static boolean isSameItemFuzzy(final ItemStack a, final ItemStack b, fina } else if (mode == FuzzyMode.PERCENT_99) { return (a.getItemDamageForDisplay() > 1) == (b.getItemDamageForDisplay() > 1); } else { - final float percentDamagedOfA = - 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - final float percentDamagedOfB = - 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); + final float percentDamagedOfA = 1.0f + - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + final float percentDamagedOfB = 1.0f + - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); return (percentDamagedOfA > mode.breakPoint) == (percentDamagedOfB > mode.breakPoint); } @@ -1102,14 +1099,13 @@ public static boolean isSameItemFuzzy(final ItemStack a, final ItemStack b, fina } /* - * // test ore dictionary.. int OreID = getOreID( a ); if ( OreID != -1 ) return OreID == getOreID( b ); - * if ( Mode != FuzzyMode.IGNORE_ALL ) { if ( a.hasTagCompound() && !isShared( a.getTagCompound() ) ) { a = - * Platform.getSharedItemStack( AEItemStack.create( a ) ); } - * if ( b.hasTagCompound() && !isShared( b.getTagCompound() ) ) { b = Platform.getSharedItemStack( - * AEItemStack.create( b ) ); } - * // test regular items with damage values and what not... if ( isShared( a.getTagCompound() ) && isShared( - * b.getTagCompound() ) && a.itemID == b.itemID ) { return ((AppEngSharedNBTTagCompound) - * a.getTagCompound()).compareFuzzyWithRegistry( (AppEngSharedNBTTagCompound) b.getTagCompound() ); } } + * // test ore dictionary.. int OreID = getOreID( a ); if ( OreID != -1 ) return OreID == getOreID( b ); if ( + * Mode != FuzzyMode.IGNORE_ALL ) { if ( a.hasTagCompound() && !isShared( a.getTagCompound() ) ) { a = + * Platform.getSharedItemStack( AEItemStack.create( a ) ); } if ( b.hasTagCompound() && !isShared( + * b.getTagCompound() ) ) { b = Platform.getSharedItemStack( AEItemStack.create( b ) ); } // test regular items + * with damage values and what not... if ( isShared( a.getTagCompound() ) && isShared( b.getTagCompound() ) && + * a.itemID == b.itemID ) { return ((AppEngSharedNBTTagCompound) a.getTagCompound()).compareFuzzyWithRegistry( + * (AppEngSharedNBTTagCompound) b.getTagCompound() ); } } */ return a.isItemEqual(b); @@ -1139,8 +1135,8 @@ public static LookDirection getPlayerRay(final EntityPlayer player, final float return new LookDirection(vec3, vec31); } - public static MovingObjectPosition rayTrace( - final EntityPlayer p, final boolean hitBlocks, final boolean hitEntities) { + public static MovingObjectPosition rayTrace(final EntityPlayer p, final boolean hitBlocks, + final boolean hitEntities) { final World w = p.getEntityWorld(); final float f = 1.0F; @@ -1161,13 +1157,12 @@ public static MovingObjectPosition rayTrace( final Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( - Math.min(vec3.xCoord, vec31.xCoord), - Math.min(vec3.yCoord, vec31.yCoord), - Math.min(vec3.zCoord, vec31.zCoord), - Math.max(vec3.xCoord, vec31.xCoord), - Math.max(vec3.yCoord, vec31.yCoord), - Math.max(vec3.zCoord, vec31.zCoord)) - .expand(16, 16, 16); + Math.min(vec3.xCoord, vec31.xCoord), + Math.min(vec3.yCoord, vec31.yCoord), + Math.min(vec3.zCoord, vec31.zCoord), + Math.max(vec3.xCoord, vec31.xCoord), + Math.max(vec3.yCoord, vec31.yCoord), + Math.max(vec3.zCoord, vec31.zCoord)).expand(16, 16, 16); Entity entity = null; double closest = 9999999.0D; @@ -1224,11 +1219,8 @@ public static long nanoTime() { return 0; } - public static StackType poweredExtraction( - final IEnergySource energy, - final IMEInventory cell, - final StackType request, - final BaseActionSource src) { + public static StackType poweredExtraction(final IEnergySource energy, + final IMEInventory cell, final StackType request, final BaseActionSource src) { final StackType possible = cell.extractItems((StackType) request.copy(), Actionable.SIMULATE, src); long retrieved = 0; @@ -1256,11 +1248,8 @@ public static StackType poweredExtraction( return null; } - public static StackType poweredInsert( - final IEnergySource energy, - final IMEInventory cell, - final StackType input, - final BaseActionSource src) { + public static StackType poweredInsert(final IEnergySource energy, + final IMEInventory cell, final StackType input, final BaseActionSource src) { final StackType possible = cell.injectItems((StackType) input.copy(), Actionable.SIMULATE, src); long stored = input.getStackSize(); @@ -1269,14 +1258,16 @@ public static StackType poweredInsert( } long typeMultiplier = input instanceof IAEFluidStack ? 1000 : 1; - final double availablePower = energy.extractAEPower( - Platform.ceilDiv(stored, typeMultiplier), Actionable.SIMULATE, PowerMultiplier.CONFIG); + final double availablePower = energy + .extractAEPower(Platform.ceilDiv(stored, typeMultiplier), Actionable.SIMULATE, PowerMultiplier.CONFIG); final long itemToAdd = Math.min((long) (availablePower * typeMultiplier + 0.9), stored); if (itemToAdd > 0) { energy.extractAEPower( - Platform.ceilDiv(stored, typeMultiplier), Actionable.MODULATE, PowerMultiplier.CONFIG); + Platform.ceilDiv(stored, typeMultiplier), + Actionable.MODULATE, + PowerMultiplier.CONFIG); if (itemToAdd < input.getStackSize()) { final long original = input.getStackSize(); @@ -1307,8 +1298,8 @@ public static StackType poweredInsert( } @SuppressWarnings("unchecked") - public static void postChanges( - final IStorageGrid gs, final ItemStack removed, final ItemStack added, final BaseActionSource src) { + public static void postChanges(final IStorageGrid gs, final ItemStack removed, final ItemStack added, + final BaseActionSource src) { final IItemList itemChanges = AEApi.instance().storage().createItemList(); final IItemList fluidChanges = AEApi.instance().storage().createFluidList(); IMEInventory myItems = null; @@ -1351,11 +1342,8 @@ public static void postChanges( } } - public static > void postListChanges( - final IItemList before, - final IItemList after, - final IMEMonitorHandlerReceiver meMonitorPassthrough, - final BaseActionSource source) { + public static > void postListChanges(final IItemList before, final IItemList after, + final IMEMonitorHandlerReceiver meMonitorPassthrough, final BaseActionSource source) { final LinkedList changes = new LinkedList(); for (final T is : before) { @@ -1434,8 +1422,18 @@ public static boolean securityCheck(final GridNode a, final GridNode b) { final boolean b_isSecure = isPowered(b.getGrid()) && b.getLastSecurityKey() != -1; if (AEConfig.instance.isFeatureEnabled(AEFeature.LogSecurityAudits)) { - AELog.info("Audit: " + a_isSecure + " : " + b_isSecure + " @ " + a.getLastSecurityKey() + " vs " - + b.getLastSecurityKey() + " & " + a.getPlayerID() + " vs " + b.getPlayerID()); + AELog.info( + "Audit: " + a_isSecure + + " : " + + b_isSecure + + " @ " + + a.getLastSecurityKey() + + " vs " + + b.getLastSecurityKey() + + " & " + + a.getPlayerID() + + " vs " + + b.getPlayerID()); } // can't do that son... @@ -1539,37 +1537,32 @@ public static boolean canAccess(final AENetworkProxy gridProxy, final BaseAction } } - public static ItemStack extractItemsByRecipe( - final IEnergySource energySrc, - final BaseActionSource mySrc, - final IMEMonitor src, - final World w, - final IRecipe r, - final ItemStack output, - final InventoryCrafting ci, - final ItemStack providedTemplate, - final int slot, - final IItemList items, - final Actionable realForFake, + public static ItemStack extractItemsByRecipe(final IEnergySource energySrc, final BaseActionSource mySrc, + final IMEMonitor src, final World w, final IRecipe r, final ItemStack output, + final InventoryCrafting ci, final ItemStack providedTemplate, final int slot, + final IItemList items, final Actionable realForFake, final IPartitionList filter) { return extractItemsByRecipe( - energySrc, mySrc, src, w, r, output, ci, providedTemplate, slot, items, realForFake, filter, 1); - } - - public static ItemStack extractItemsByRecipe( - final IEnergySource energySrc, - final BaseActionSource mySrc, - final IMEMonitor src, - final World w, - final IRecipe r, - final ItemStack output, - final InventoryCrafting ci, - final ItemStack providedTemplate, - final int slot, - final IItemList items, - final Actionable realForFake, - final IPartitionList filter, - int multiple) { + energySrc, + mySrc, + src, + w, + r, + output, + ci, + providedTemplate, + slot, + items, + realForFake, + filter, + 1); + } + + public static ItemStack extractItemsByRecipe(final IEnergySource energySrc, final BaseActionSource mySrc, + final IMEMonitor src, final World w, final IRecipe r, final ItemStack output, + final InventoryCrafting ci, final ItemStack providedTemplate, final int slot, + final IItemList items, final Actionable realForFake, + final IPartitionList filter, int multiple) { if (energySrc.extractAEPower(multiple, Actionable.SIMULATE, PowerMultiplier.CONFIG) > 0.9) { if (providedTemplate == null) { return null; @@ -1661,8 +1654,8 @@ public static ItemStack getContainerItem(final ItemStack stackInSlot) { return ci; } - public static void notifyBlocksOfNeighbors( - final World worldObj, final int xCoord, final int yCoord, final int zCoord) { + public static void notifyBlocksOfNeighbors(final World worldObj, final int xCoord, final int yCoord, + final int zCoord) { if (!worldObj.isRemote) { TickHandler.INSTANCE.addCallable(worldObj, new BlockUpdate(xCoord, yCoord, zCoord)); } @@ -1674,8 +1667,8 @@ public static boolean canRepair(final AEFeature type, final ItemStack a, final I } if (type == AEFeature.CertusQuartzTools) { - final IItemDefinition certusQuartzCrystal = - AEApi.instance().definitions().materials().certusQuartzCrystal(); + final IItemDefinition certusQuartzCrystal = AEApi.instance().definitions().materials() + .certusQuartzCrystal(); return certusQuartzCrystal.isSameAs(b); } @@ -1732,7 +1725,7 @@ public static void sendChunk(final Chunk c, final int verticalBits) { getOrCreateChunkWatcher = ReflectionHelper.findMethod( PlayerManager.class, pm, - new String[] {"getOrCreateChunkWatcher", "func_72690_a"}, + new String[] { "getOrCreateChunkWatcher", "func_72690_a" }, int.class, int.class, boolean.class); @@ -1747,13 +1740,13 @@ public static void sendChunk(final Chunk c, final int verticalBits) { sendToAllPlayersWatchingChunk = ReflectionHelper.findMethod( Platform.playerInstance, playerInstance, - new String[] {"sendToAllPlayersWatchingChunk", "func_151251_a"}, + new String[] { "sendToAllPlayersWatchingChunk", "func_151251_a" }, Packet.class); } if (sendToAllPlayersWatchingChunk != null) { - sendToAllPlayersWatchingChunk.invoke( - playerInstance, new S21PacketChunkData(c, false, verticalBits)); + sendToAllPlayersWatchingChunk + .invoke(playerInstance, new S21PacketChunkData(c, false, verticalBits)); } } } diff --git a/src/main/java/appeng/util/ReadOnlyCollection.java b/src/main/java/appeng/util/ReadOnlyCollection.java index 2cfb6bdeeb2..401a3d1556c 100644 --- a/src/main/java/appeng/util/ReadOnlyCollection.java +++ b/src/main/java/appeng/util/ReadOnlyCollection.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; -import appeng.api.util.IReadOnlyCollection; import java.util.Collection; import java.util.Iterator; +import appeng.api.util.IReadOnlyCollection; + public class ReadOnlyCollection implements IReadOnlyCollection { private final Collection c; diff --git a/src/main/java/appeng/util/ReadableNumberConverter.java b/src/main/java/appeng/util/ReadableNumberConverter.java index 8f2045a2efa..27ce85bf724 100644 --- a/src/main/java/appeng/util/ReadableNumberConverter.java +++ b/src/main/java/appeng/util/ReadableNumberConverter.java @@ -13,6 +13,7 @@ * @since rv2 */ public enum ReadableNumberConverter implements ISlimReadableNumberConverter, IWideReadableNumberConverter { + INSTANCE; /** diff --git a/src/main/java/appeng/util/SettingsFrom.java b/src/main/java/appeng/util/SettingsFrom.java index 5efa2d0244f..7200698fdef 100644 --- a/src/main/java/appeng/util/SettingsFrom.java +++ b/src/main/java/appeng/util/SettingsFrom.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; diff --git a/src/main/java/appeng/util/UUIDMatcher.java b/src/main/java/appeng/util/UUIDMatcher.java index d1cad0c9269..293d2c4495b 100644 --- a/src/main/java/appeng/util/UUIDMatcher.java +++ b/src/main/java/appeng/util/UUIDMatcher.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; @@ -24,6 +16,7 @@ * Regex wrapper for {@link java.util.UUID}s to not rely on try catch */ public final class UUIDMatcher { + /** * String which is the regular expression for {@link java.util.UUID}s */ diff --git a/src/main/java/appeng/util/calculators/ArithHelper.java b/src/main/java/appeng/util/calculators/ArithHelper.java index 8660e6d5423..8f6fac7e262 100644 --- a/src/main/java/appeng/util/calculators/ArithHelper.java +++ b/src/main/java/appeng/util/calculators/ArithHelper.java @@ -35,10 +35,8 @@ public static String sub(String v1, String v2) { /** * multiplication * - * @param v1 - * p1 - * @param v2 - * p2 + * @param v1 p1 + * @param v2 p2 * @return mul */ public static String mul(String v1, String v2) { @@ -50,10 +48,8 @@ public static String mul(String v1, String v2) { /** * division. e = 10^-10 * - * @param v1 - * p1 - * @param v2 - * p2 + * @param v1 p1 + * @param v2 p2 * @return div */ public static String div(String v1, String v2) { @@ -65,7 +61,7 @@ public static String div(String v1, String v2) { /** * rounding * - * @param v p + * @param v p * @param scale scale * @return result */ diff --git a/src/main/java/appeng/util/calculators/Calculator.java b/src/main/java/appeng/util/calculators/Calculator.java index 4f66e675a9c..c2ae0121f10 100644 --- a/src/main/java/appeng/util/calculators/Calculator.java +++ b/src/main/java/appeng/util/calculators/Calculator.java @@ -4,9 +4,10 @@ import java.util.Stack; public class Calculator { + private final Stack postfixStack = new Stack<>(); private final Stack opStack = new Stack<>(); - private final int[] operatPriority = new int[] {0, 3, 2, 1, -1, 1, 0, 2}; + private final int[] operatPriority = new int[] { 0, 3, 2, 1, -1, 1, 0, 2 }; public static double conversion(String expression) { double result = 0; @@ -32,8 +33,7 @@ public static double conversion(String expression) { /** * replace '-' with '~' * - * @param expression - * e.g.-2+-1*(-3E-2)-(-1) -> ~2+~1*(~3E~2)-(~1) + * @param expression e.g.-2+-1*(-3E-2)-(-1) -> ~2+~1*(~3E~2)-(~1) * @return */ private static String transform(String expression) { @@ -61,8 +61,7 @@ private static String transform(String expression) { /** * Do calculation * - * @param expression - * e.g.5+12*(3+5)/7 + * @param expression e.g.5+12*(3+5)/7 * @return */ public double calculate(String expression) { diff --git a/src/main/java/appeng/util/inv/AdaptorBCPipe.java b/src/main/java/appeng/util/inv/AdaptorBCPipe.java index f5b165296e5..be380a3883c 100644 --- a/src/main/java/appeng/util/inv/AdaptorBCPipe.java +++ b/src/main/java/appeng/util/inv/AdaptorBCPipe.java @@ -1,42 +1,37 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Iterator; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import appeng.api.config.FuzzyMode; import appeng.integration.IntegrationRegistry; import appeng.integration.IntegrationType; import appeng.integration.abstraction.IBuildCraftTransport; import appeng.util.InventoryAdaptor; import appeng.util.iterators.NullIterator; -import java.util.Iterator; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class AdaptorBCPipe extends InventoryAdaptor { + private final IBuildCraftTransport buildCraft; private final TileEntity i; private final ForgeDirection d; public AdaptorBCPipe(final TileEntity s, final ForgeDirection dd) { - this.buildCraft = - (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance(IntegrationType.BuildCraftTransport); + this.buildCraft = (IBuildCraftTransport) IntegrationRegistry.INSTANCE + .getInstance(IntegrationType.BuildCraftTransport); if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.BuildCraftTransport)) { if (this.buildCraft.isPipe(s, dd)) { this.i = s; @@ -59,19 +54,13 @@ public ItemStack simulateRemove(final int amount, final ItemStack filter, final } @Override - public ItemStack removeSimilarItems( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack removeSimilarItems(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { return null; } @Override - public ItemStack simulateSimilarRemove( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack simulateSimilarRemove(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { return null; } diff --git a/src/main/java/appeng/util/inv/AdaptorIInventory.java b/src/main/java/appeng/util/inv/AdaptorIInventory.java index 07d97026298..393214c31d9 100644 --- a/src/main/java/appeng/util/inv/AdaptorIInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorIInventory.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Iterator; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import appeng.api.config.FuzzyMode; import appeng.api.config.InsertionMode; import appeng.util.InventoryAdaptor; import appeng.util.Platform; -import java.util.Iterator; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class AdaptorIInventory extends InventoryAdaptor { @@ -34,8 +28,7 @@ public class AdaptorIInventory extends InventoryAdaptor { public AdaptorIInventory(final IInventory s) { this.i = s; - skipStackSizeCheck = i.getClass() - .toString() + skipStackSizeCheck = i.getClass().toString() .equals("class wanion.avaritiaddons.block.chest.infinity.TileEntityInfinityChest"); this.wrapperEnabled = s instanceof IInventoryWrapper; } @@ -47,8 +40,7 @@ public ItemStack removeItems(int amount, ItemStack filter, final IInventoryDesti for (int x = 0; x < s && amount > 0; x++) { final ItemStack is = this.i.getStackInSlot(x); - if (is != null - && this.canRemoveStackFromSlot(x, is) + if (is != null && this.canRemoveStackFromSlot(x, is) && (filter == null || Platform.isSameItemPrecise(is, filter))) { int boundAmounts = amount; if (boundAmounts > is.stackSize) { @@ -95,8 +87,7 @@ public ItemStack simulateRemove(int amount, final ItemStack filter, final IInven for (int x = 0; x < s && amount > 0; x++) { final ItemStack is = this.i.getStackInSlot(x); - if (is != null - && this.canRemoveStackFromSlot(x, is) + if (is != null && this.canRemoveStackFromSlot(x, is) && (filter == null || Platform.isSameItemPrecise(is, filter))) { int boundAmount = amount; if (boundAmount > is.stackSize) { @@ -123,16 +114,12 @@ public ItemStack simulateRemove(int amount, final ItemStack filter, final IInven } @Override - public ItemStack removeSimilarItems( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack removeSimilarItems(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { final int s = this.i.getSizeInventory(); for (int x = 0; x < s; x++) { final ItemStack is = this.i.getStackInSlot(x); - if (is != null - && this.canRemoveStackFromSlot(x, is) + if (is != null && this.canRemoveStackFromSlot(x, is) && (filter == null || Platform.isSameItemFuzzy(is, filter, fuzzyMode))) { int newAmount = amount; if (newAmount > is.stackSize) { @@ -168,17 +155,13 @@ public ItemStack removeSimilarItems( } @Override - public ItemStack simulateSimilarRemove( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack simulateSimilarRemove(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { final int s = this.i.getSizeInventory(); for (int x = 0; x < s; x++) { final ItemStack is = this.i.getStackInSlot(x); - if (is != null - && this.canRemoveStackFromSlot(x, is) + if (is != null && this.canRemoveStackFromSlot(x, is) && (filter == null || Platform.isSameItemFuzzy(is, filter, fuzzyMode))) { int boundAmount = amount; if (boundAmount > is.stackSize) { @@ -236,8 +219,8 @@ public boolean containsItems() { * The ItemStack next is required for inventories, which will fail on isItemValidForSlot() for stacksizes larger * than the limit. * - * @param itemsToAdd itemStack to add to the inventory - * @param modulate true to modulate, false for simulate + * @param itemsToAdd itemStack to add to the inventory + * @param modulate true to modulate, false for simulate * @param insertionMode * @return the left itemstack, which could not be added */ @@ -247,8 +230,7 @@ private ItemStack addItems(final ItemStack itemsToAdd, final boolean modulate, f } final ItemStack left = itemsToAdd.copy(); - final int perOperationLimit = this.skipStackSizeCheck - ? this.i.getInventoryStackLimit() + final int perOperationLimit = this.skipStackSizeCheck ? this.i.getInventoryStackLimit() : Math.min(this.i.getInventoryStackLimit(), itemsToAdd.getMaxStackSize()); final int inventorySize = this.i.getSizeInventory(); diff --git a/src/main/java/appeng/util/inv/AdaptorList.java b/src/main/java/appeng/util/inv/AdaptorList.java index df2263946bb..bfaf27de9e3 100644 --- a/src/main/java/appeng/util/inv/AdaptorList.java +++ b/src/main/java/appeng/util/inv/AdaptorList.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.item.ItemStack; + import appeng.api.config.FuzzyMode; import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.iterators.StackToSlotIterator; -import java.util.Iterator; -import java.util.List; -import net.minecraft.item.ItemStack; public class AdaptorList extends InventoryAdaptor { @@ -86,8 +80,8 @@ public ItemStack simulateRemove(int amount, final ItemStack filter, final IInven } @Override - public ItemStack removeSimilarItems( - int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { + public ItemStack removeSimilarItems(int amount, final ItemStack filter, final FuzzyMode fuzzyMode, + final IInventoryDestination destination) { final int s = this.i.size(); for (int x = 0; x < s; x++) { final ItemStack is = this.i.get(x); @@ -117,8 +111,8 @@ public ItemStack removeSimilarItems( } @Override - public ItemStack simulateSimilarRemove( - int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { + public ItemStack simulateSimilarRemove(int amount, final ItemStack filter, final FuzzyMode fuzzyMode, + final IInventoryDestination destination) { for (final ItemStack is : this.i) { if (is != null && (filter == null || Platform.isSameItemFuzzy(is, filter, fuzzyMode))) { if (amount > is.stackSize) { diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java index 44ed881f710..b0daf7c16c1 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerHand.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerHand.java @@ -1,30 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Iterator; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import appeng.api.config.FuzzyMode; import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.iterators.NullIterator; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; /* * Lets you do simply tests with the players cursor, without messing with the specifics. @@ -75,10 +69,7 @@ public ItemStack simulateRemove(final int amount, final ItemStack filter, final } @Override - public ItemStack removeSimilarItems( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack removeSimilarItems(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { final ItemStack hand = this.player.inventory.getItemStack(); if (hand == null) { @@ -99,10 +90,7 @@ public ItemStack removeSimilarItems( } @Override - public ItemStack simulateSimilarRemove( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack simulateSimilarRemove(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { final ItemStack hand = this.player.inventory.getItemStack(); diff --git a/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java b/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java index 69606931f45..6e29dfcde7a 100644 --- a/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java +++ b/src/main/java/appeng/util/inv/AdaptorPlayerInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; diff --git a/src/main/java/appeng/util/inv/IInventoryDestination.java b/src/main/java/appeng/util/inv/IInventoryDestination.java index 9479d00745b..97def2ef0fa 100644 --- a/src/main/java/appeng/util/inv/IInventoryDestination.java +++ b/src/main/java/appeng/util/inv/IInventoryDestination.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; diff --git a/src/main/java/appeng/util/inv/IInventoryWrapper.java b/src/main/java/appeng/util/inv/IInventoryWrapper.java index 27db4533286..99841dedda7 100644 --- a/src/main/java/appeng/util/inv/IInventoryWrapper.java +++ b/src/main/java/appeng/util/inv/IInventoryWrapper.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; diff --git a/src/main/java/appeng/util/inv/IMEAdaptor.java b/src/main/java/appeng/util/inv/IMEAdaptor.java index ab525870406..49a1145dc95 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptor.java +++ b/src/main/java/appeng/util/inv/IMEAdaptor.java @@ -1,23 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Iterator; + +import net.minecraft.item.ItemStack; + import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; @@ -27,9 +23,8 @@ import appeng.api.storage.data.IItemList; import appeng.util.InventoryAdaptor; import appeng.util.item.AEItemStack; + import com.google.common.collect.ImmutableList; -import java.util.Iterator; -import net.minecraft.item.ItemStack; public class IMEAdaptor extends InventoryAdaptor { @@ -56,8 +51,8 @@ public ItemStack removeItems(final int amount, final ItemStack filter, final IIn return this.doRemoveItems(amount, filter, destination, Actionable.MODULATE); } - private ItemStack doRemoveItems( - final int amount, final ItemStack filter, final IInventoryDestination destination, final Actionable type) { + private ItemStack doRemoveItems(final int amount, final ItemStack filter, final IInventoryDestination destination, + final Actionable type) { IAEItemStack req = null; if (filter == null) { @@ -89,10 +84,7 @@ public ItemStack simulateRemove(final int amount, final ItemStack filter, final } @Override - public ItemStack removeSimilarItems( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack removeSimilarItems(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { if (filter == null) { return this.doRemoveItems(amount, null, destination, Actionable.MODULATE); @@ -100,12 +92,8 @@ public ItemStack removeSimilarItems( return this.doRemoveItemsFuzzy(amount, filter, destination, Actionable.MODULATE, fuzzyMode); } - private ItemStack doRemoveItemsFuzzy( - final int amount, - final ItemStack filter, - final IInventoryDestination destination, - final Actionable type, - final FuzzyMode fuzzyMode) { + private ItemStack doRemoveItemsFuzzy(final int amount, final ItemStack filter, + final IInventoryDestination destination, final Actionable type, final FuzzyMode fuzzyMode) { final IAEItemStack reqFilter = AEItemStack.create(filter); if (reqFilter == null) { return null; @@ -127,10 +115,7 @@ private ItemStack doRemoveItemsFuzzy( } @Override - public ItemStack simulateSimilarRemove( - final int amount, - final ItemStack filter, - final FuzzyMode fuzzyMode, + public ItemStack simulateSimilarRemove(final int amount, final ItemStack filter, final FuzzyMode fuzzyMode, final IInventoryDestination destination) { if (filter == null) { return this.doRemoveItems(amount, null, destination, Actionable.SIMULATE); diff --git a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java index 2606c45581e..5b32a2f78c9 100644 --- a/src/main/java/appeng/util/inv/IMEAdaptorIterator.java +++ b/src/main/java/appeng/util/inv/IMEAdaptorIterator.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Iterator; + import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; -import java.util.Iterator; public final class IMEAdaptorIterator implements Iterator { + private final Iterator stack; private final ItemSlot slot = new ItemSlot(); private final IMEAdaptor parent; diff --git a/src/main/java/appeng/util/inv/IMEInventoryDestination.java b/src/main/java/appeng/util/inv/IMEInventoryDestination.java index 5f93bf57fd0..25ebe7873f9 100644 --- a/src/main/java/appeng/util/inv/IMEInventoryDestination.java +++ b/src/main/java/appeng/util/inv/IMEInventoryDestination.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import net.minecraft.item.ItemStack; + import appeng.api.config.Actionable; import appeng.api.storage.IMEInventory; import appeng.api.storage.data.IAEItemStack; import appeng.util.item.AEItemStack; -import net.minecraft.item.ItemStack; public class IMEInventoryDestination implements IInventoryDestination { diff --git a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java index 332103dd6a2..17820dd2793 100644 --- a/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java +++ b/src/main/java/appeng/util/inv/ItemListIgnoreCrafting.java @@ -1,28 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import java.util.Collection; +import java.util.Iterator; + import appeng.api.config.FuzzyMode; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; -import java.util.Collection; -import java.util.Iterator; public class ItemListIgnoreCrafting implements IItemList { diff --git a/src/main/java/appeng/util/inv/ItemSlot.java b/src/main/java/appeng/util/inv/ItemSlot.java index fc30573a51f..345cd863f2c 100644 --- a/src/main/java/appeng/util/inv/ItemSlot.java +++ b/src/main/java/appeng/util/inv/ItemSlot.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; +import net.minecraft.item.ItemStack; + import appeng.api.storage.data.IAEItemStack; import appeng.util.item.AEItemStack; -import net.minecraft.item.ItemStack; public class ItemSlot { diff --git a/src/main/java/appeng/util/inv/WrapperBCPipe.java b/src/main/java/appeng/util/inv/WrapperBCPipe.java index 4d13cb2e9e2..68fabcf7e0e 100644 --- a/src/main/java/appeng/util/inv/WrapperBCPipe.java +++ b/src/main/java/appeng/util/inv/WrapperBCPipe.java @@ -1,32 +1,25 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; -import appeng.integration.IntegrationRegistry; -import appeng.integration.IntegrationType; -import appeng.integration.abstraction.IBuildCraftTransport; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import appeng.integration.IntegrationRegistry; +import appeng.integration.IntegrationType; +import appeng.integration.abstraction.IBuildCraftTransport; + public class WrapperBCPipe implements IInventory { private final IBuildCraftTransport bc; diff --git a/src/main/java/appeng/util/inv/WrapperChainedInventory.java b/src/main/java/appeng/util/inv/WrapperChainedInventory.java index 873b0293b3a..919d2e7519b 100644 --- a/src/main/java/appeng/util/inv/WrapperChainedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperChainedInventory.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; -import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import com.google.common.collect.ImmutableList; + public class WrapperChainedInventory implements IInventory { private int fullSize = 0; diff --git a/src/main/java/appeng/util/inv/WrapperInvSlot.java b/src/main/java/appeng/util/inv/WrapperInvSlot.java index 34e62cc699e..9b72e1d6b36 100644 --- a/src/main/java/appeng/util/inv/WrapperInvSlot.java +++ b/src/main/java/appeng/util/inv/WrapperInvSlot.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; diff --git a/src/main/java/appeng/util/inv/WrapperInventoryRange.java b/src/main/java/appeng/util/inv/WrapperInventoryRange.java index a65caac51bc..eaec33b586c 100644 --- a/src/main/java/appeng/util/inv/WrapperInventoryRange.java +++ b/src/main/java/appeng/util/inv/WrapperInventoryRange.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; diff --git a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java index c37007193ed..1fcbd25519d 100644 --- a/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java +++ b/src/main/java/appeng/util/inv/WrapperMCISidedInventory.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.inv; diff --git a/src/main/java/appeng/util/item/AEFluidStack.java b/src/main/java/appeng/util/item/AEFluidStack.java index a0842ac2fa2..9709e48caa8 100644 --- a/src/main/java/appeng/util/item/AEFluidStack.java +++ b/src/main/java/appeng/util/item/AEFluidStack.java @@ -1,32 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.api.config.FuzzyMode; -import appeng.api.storage.StorageChannel; -import appeng.api.storage.data.IAEFluidStack; -import appeng.api.storage.data.IAEStack; -import appeng.api.storage.data.IAETagCompound; -import appeng.util.Platform; -import io.netty.buffer.ByteBuf; import java.io.*; + import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTBase; @@ -34,6 +21,14 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import appeng.api.config.FuzzyMode; +import appeng.api.storage.StorageChannel; +import appeng.api.storage.data.IAEFluidStack; +import appeng.api.storage.data.IAEStack; +import appeng.api.storage.data.IAETagCompound; +import appeng.util.Platform; +import io.netty.buffer.ByteBuf; + public final class AEFluidStack extends AEStack implements IAEFluidStack, Comparable { private final int myHash; @@ -63,8 +58,8 @@ private AEFluidStack(@Nonnull final FluidStack is) { this.setCraftable(false); this.setCountRequestable(0); - this.myHash = - this.fluid.hashCode() ^ (this.tagCompound == null ? 0 : System.identityHashCode(this.tagCompound)); + this.myHash = this.fluid.hashCode() + ^ (this.tagCompound == null ? 0 : System.identityHashCode(this.tagCompound)); } public static IAEFluidStack loadFluidStackFromNBT(final NBTTagCompound i) { @@ -267,8 +262,7 @@ public boolean equals(final Object ia) { return true; } - if ((ta == null && tb == null) - || (ta != null && ta.hasNoTags() && tb == null) + if ((ta == null && tb == null) || (ta != null && ta.hasNoTags() && tb == null) || (tb != null && tb.hasNoTags() && ta == null) || (ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags())) { return true; diff --git a/src/main/java/appeng/util/item/AEItemDef.java b/src/main/java/appeng/util/item/AEItemDef.java index 39174459790..a8e578ea99e 100644 --- a/src/main/java/appeng/util/item/AEItemDef.java +++ b/src/main/java/appeng/util/item/AEItemDef.java @@ -1,32 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.util.Platform; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import appeng.util.Platform; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class AEItemDef { static final AESharedNBT LOW_TAG = new AESharedNBT(Integer.MIN_VALUE); @@ -77,8 +71,7 @@ public boolean equals(final Object obj) { return false; } final AEItemDef other = (AEItemDef) obj; - return other.getDamageValue() == this.getDamageValue() - && other.getItem() == this.getItem() + return other.getDamageValue() == this.getDamageValue() && other.getItem() == this.getItem() && this.getTagCompound() == other.getTagCompound(); } diff --git a/src/main/java/appeng/util/item/AEItemStack.java b/src/main/java/appeng/util/item/AEItemStack.java index 7349a3b3b7a..e267c620f4b 100644 --- a/src/main/java/appeng/util/item/AEItemStack.java +++ b/src/main/java/appeng/util/item/AEItemStack.java @@ -1,23 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; +import java.io.*; +import java.security.InvalidParameterException; +import java.util.List; + +import javax.annotation.Nullable; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; + import appeng.api.config.FuzzyMode; import appeng.api.storage.StorageChannel; import appeng.api.storage.data.IAEItemStack; @@ -28,14 +31,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import java.io.*; -import java.security.InvalidParameterException; -import java.util.List; -import javax.annotation.Nullable; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; public final class AEItemStack extends AEStack implements IAEItemStack, Comparable { @@ -69,8 +64,8 @@ private AEItemStack(final ItemStack is) { */ /* - * Super hackery. - * is.itemID = appeng.api.Materials.matQuartz.itemID; damageValue = is.getItemDamage(); is.itemID = itemID; + * Super hackery. is.itemID = appeng.api.Materials.matQuartz.itemID; damageValue = is.getItemDamage(); is.itemID + * = itemID; */ /* @@ -190,8 +185,7 @@ public void writeToNBT(final NBTTagCompound i) { /* * if ( id != null && id instanceof NBTTagShort ) ((NBTTagShort) id).data = (short) this.def.item.itemID; else */ - i.setShort("id", (short) - Item.itemRegistry.getIDForObject(this.getDefinition().getItem())); + i.setShort("id", (short) Item.itemRegistry.getIDForObject(this.getDefinition().getItem())); /* * if ( Count != null && Count instanceof NBTTagByte ) ((NBTTagByte) Count).data = (byte) 0; else @@ -247,10 +241,10 @@ public boolean fuzzyComparison(final Object st, final FuzzyMode mode) { } else if (mode == FuzzyMode.PERCENT_99) { return (a.getItemDamageForDisplay() > 1) == (b.getItemDamageForDisplay() > 1); } else { - final float percentDamageOfA = - 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - final float percentDamageOfB = - 1.0f - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); + final float percentDamageOfA = 1.0f + - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + final float percentDamageOfB = 1.0f + - (float) b.getItemDamageForDisplay() / (float) b.getMaxDamage(); return (percentDamageOfA > mode.breakPoint) == (percentDamageOfB > mode.breakPoint); } @@ -287,10 +281,10 @@ public boolean fuzzyComparison(final Object st, final FuzzyMode mode) { } else if (mode == FuzzyMode.PERCENT_99) { return (a.getItemDamageForDisplay() > 1) == (o.getItemDamageForDisplay() > 1); } else { - final float percentDamageOfA = - 1.0f - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); - final float percentDamageOfB = - 1.0f - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage(); + final float percentDamageOfA = 1.0f + - (float) a.getItemDamageForDisplay() / (float) a.getMaxDamage(); + final float percentDamageOfB = 1.0f + - (float) o.getItemDamageForDisplay() / (float) o.getMaxDamage(); return (percentDamageOfA > mode.breakPoint) == (percentDamageOfB > mode.breakPoint); } @@ -415,8 +409,7 @@ public boolean equals(final Object ia) { return true; } - if ((ta == null && tb == null) - || (ta != null && ta.hasNoTags() && tb == null) + if ((ta == null && tb == null) || (ta != null && ta.hasNoTags() && tb == null) || (tb != null && tb.hasNoTags() && ta == null) || (ta != null && ta.hasNoTags() && tb != null && tb.hasNoTags())) { return true; @@ -448,28 +441,23 @@ public int compareTo(final AEItemStack b) { return id; } - final int damageValue = - this.getDefinition().getDamageValue() - b.getDefinition().getDamageValue(); + final int damageValue = this.getDefinition().getDamageValue() - b.getDefinition().getDamageValue(); if (damageValue != 0) { return damageValue; } - final int displayDamage = - this.getDefinition().getDisplayDamage() - b.getDefinition().getDisplayDamage(); + final int displayDamage = this.getDefinition().getDisplayDamage() - b.getDefinition().getDisplayDamage(); if (displayDamage != 0) { return displayDamage; } - return (this.getDefinition().getTagCompound() == b.getDefinition().getTagCompound()) - ? 0 + return (this.getDefinition().getTagCompound() == b.getDefinition().getTagCompound()) ? 0 : this.compareNBT(b.getDefinition()); } private int compareNBT(final AEItemDef b) { final int nbt = this.compare( - (this.getDefinition().getTagCompound() == null - ? 0 - : this.getDefinition().getTagCompound().getHash()), + (this.getDefinition().getTagCompound() == null ? 0 : this.getDefinition().getTagCompound().getHash()), (b.getTagCompound() == null ? 0 : b.getTagCompound().getHash())); if (nbt == 0) { return this.compare( @@ -507,9 +495,8 @@ public String getModID() { return this.getModName(this.getDefinition().getUniqueID()); } - return this.getModName(this.getDefinition() - .setUniqueID(GameRegistry.findUniqueIdentifierFor( - this.getDefinition().getItem()))); + return this.getModName( + this.getDefinition().setUniqueID(GameRegistry.findUniqueIdentifierFor(this.getDefinition().getItem()))); } private String getModName(final UniqueIdentifier uniqueIdentifier) { @@ -540,8 +527,7 @@ IAEItemStack getLow(final FuzzyMode fuzzy, final boolean ignoreMeta) { newDef.setDisplayDamage(1); } } else { - final int breakpoint = - fuzzy.calculateBreakPoint(this.getDefinition().getMaxDamage()); + final int breakpoint = fuzzy.calculateBreakPoint(this.getDefinition().getMaxDamage()); newDef.setDisplayDamage(breakpoint <= this.getDefinition().getDisplayDamage() ? breakpoint : 0); } @@ -573,11 +559,9 @@ IAEItemStack getHigh(final FuzzyMode fuzzy, final boolean ignoreMeta) { newDef.setDisplayDamage(this.getDefinition().getMaxDamage() + 1); } } else { - final int breakpoint = - fuzzy.calculateBreakPoint(this.getDefinition().getMaxDamage()); + final int breakpoint = fuzzy.calculateBreakPoint(this.getDefinition().getMaxDamage()); newDef.setDisplayDamage( - this.getDefinition().getDisplayDamage() < breakpoint - ? breakpoint - 1 + this.getDefinition().getDisplayDamage() < breakpoint ? breakpoint - 1 : this.getDefinition().getMaxDamage() + 1); } diff --git a/src/main/java/appeng/util/item/AESharedNBT.java b/src/main/java/appeng/util/item/AESharedNBT.java index bd22390ebbc..8af24cb572e 100644 --- a/src/main/java/appeng/util/item/AESharedNBT.java +++ b/src/main/java/appeng/util/item/AESharedNBT.java @@ -1,33 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.api.AEApi; -import appeng.api.features.IItemComparison; -import appeng.api.storage.data.IAETagCompound; -import appeng.util.Platform; import java.lang.ref.WeakReference; import java.util.WeakHashMap; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import appeng.api.AEApi; +import appeng.api.features.IItemComparison; +import appeng.api.storage.data.IAETagCompound; +import appeng.util.Platform; + /* * this is used for the shared NBT Cache. */ @@ -36,8 +30,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound { /* * Shared Tag Compound Cache. */ - private static final WeakHashMap> SHARED_TAG_COMPOUND = - new WeakHashMap>(); + private static final WeakHashMap> SHARED_TAG_COMPOUND = new WeakHashMap>(); private final Item item; private final int meta; private SharedSearchObject sso; diff --git a/src/main/java/appeng/util/item/AEStack.java b/src/main/java/appeng/util/item/AEStack.java index 6d40c46881c..32a2d79a513 100644 --- a/src/main/java/appeng/util/item/AEStack.java +++ b/src/main/java/appeng/util/item/AEStack.java @@ -1,26 +1,19 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; +import java.io.IOException; + import appeng.api.storage.data.IAEStack; import io.netty.buffer.ByteBuf; -import java.io.IOException; public abstract class AEStack implements IAEStack { @@ -115,8 +108,7 @@ public void decCountRequestable(final long i) { @Override public void writeToPacket(final ByteBuf i) throws IOException { - final byte mask = (byte) (this.getType(0) - | (this.getType(this.stackSize) << 2) + final byte mask = (byte) (this.getType(0) | (this.getType(this.stackSize) << 2) | (this.getType(this.countRequestable) << 4) | ((byte) (this.isCraftable ? 1 : 0) << 6) | (this.hasTagCompound() ? 1 : 0) << 7); diff --git a/src/main/java/appeng/util/item/FluidList.java b/src/main/java/appeng/util/item/FluidList.java index 0e8cae4b584..68bd9fd7aaa 100644 --- a/src/main/java/appeng/util/item/FluidList.java +++ b/src/main/java/appeng/util/item/FluidList.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; +import java.util.*; + import appeng.api.config.FuzzyMode; import appeng.api.storage.data.IAEFluidStack; import appeng.api.storage.data.IItemList; -import java.util.*; public final class FluidList implements IItemList { diff --git a/src/main/java/appeng/util/item/HashBasedItemList.java b/src/main/java/appeng/util/item/HashBasedItemList.java index 5e711b49955..1beb7a37edc 100644 --- a/src/main/java/appeng/util/item/HashBasedItemList.java +++ b/src/main/java/appeng/util/item/HashBasedItemList.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2022, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2022, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; +import java.util.*; + import appeng.api.config.FuzzyMode; import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemList; -import java.util.*; public final class HashBasedItemList implements IItemList { @@ -83,8 +76,8 @@ public void addStorage(final IAEItemStack option) { } /* - * public void clean() { Iterator i = iterator(); while (i.hasNext()) { StackType AEI = - * i.next(); if ( !AEI.isMeaningful() ) i.remove(); } } + * public void clean() { Iterator i = iterator(); while (i.hasNext()) { StackType AEI = i.next(); if ( + * !AEI.isMeaningful() ) i.remove(); } } */ @Override diff --git a/src/main/java/appeng/util/item/ItemList.java b/src/main/java/appeng/util/item/ItemList.java index 893e7d50a0d..488f6a4b2f4 100644 --- a/src/main/java/appeng/util/item/ItemList.java +++ b/src/main/java/appeng/util/item/ItemList.java @@ -1,34 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.api.config.FuzzyMode; -import appeng.api.storage.data.IAEItemStack; -import appeng.api.storage.data.IItemList; import java.util.*; import java.util.concurrent.ConcurrentSkipListMap; + import net.minecraftforge.oredict.OreDictionary; +import appeng.api.config.FuzzyMode; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.storage.data.IItemList; + public final class ItemList implements IItemList { - private final NavigableMap records = - new ConcurrentSkipListMap(); + private final NavigableMap records = new ConcurrentSkipListMap(); @Override public void add(final IAEItemStack option) { @@ -71,14 +64,17 @@ public Collection findFuzzy(final IAEItemStack filter, final Fuzzy if (or.getAEEquivalents().size() == 1) { final IAEItemStack is = or.getAEEquivalents().get(0); - return this.findFuzzyDamage( - (AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE); + return this + .findFuzzyDamage((AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE); } else { final Collection output = new LinkedList(); for (final IAEItemStack is : or.getAEEquivalents()) { - output.addAll(this.findFuzzyDamage( - (AEItemStack) is, fuzzy, is.getItemDamage() == OreDictionary.WILDCARD_VALUE)); + output.addAll( + this.findFuzzyDamage( + (AEItemStack) is, + fuzzy, + is.getItemDamage() == OreDictionary.WILDCARD_VALUE)); } return output; @@ -112,8 +108,8 @@ public void addStorage(final IAEItemStack option) { } /* - * public void clean() { Iterator i = iterator(); while (i.hasNext()) { StackType AEI = - * i.next(); if ( !AEI.isMeaningful() ) i.remove(); } } + * public void clean() { Iterator i = iterator(); while (i.hasNext()) { StackType AEI = i.next(); if ( + * !AEI.isMeaningful() ) i.remove(); } } */ @Override @@ -191,8 +187,8 @@ private IAEItemStack putItemRecord(final IAEItemStack itemStack) { return this.records.put(itemStack, itemStack); } - private Collection findFuzzyDamage( - final AEItemStack filter, final FuzzyMode fuzzy, final boolean ignoreMeta) { + private Collection findFuzzyDamage(final AEItemStack filter, final FuzzyMode fuzzy, + final boolean ignoreMeta) { final IAEItemStack low = filter.getLow(fuzzy, ignoreMeta); final IAEItemStack high = filter.getHigh(fuzzy, ignoreMeta); diff --git a/src/main/java/appeng/util/item/ItemModList.java b/src/main/java/appeng/util/item/ItemModList.java index a94bbc5ee09..57fbef5aff4 100644 --- a/src/main/java/appeng/util/item/ItemModList.java +++ b/src/main/java/appeng/util/item/ItemModList.java @@ -1,34 +1,26 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; +import java.util.Collection; + import appeng.api.AEApi; import appeng.api.config.FuzzyMode; import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IItemContainer; -import java.util.Collection; public class ItemModList implements IItemContainer { private final IItemContainer backingStore; - private final IItemContainer overrides = - AEApi.instance().storage().createItemList(); + private final IItemContainer overrides = AEApi.instance().storage().createItemList(); public ItemModList(final IItemContainer backend) { this.backingStore = backend; diff --git a/src/main/java/appeng/util/item/MeaningfulFluidIterator.java b/src/main/java/appeng/util/item/MeaningfulFluidIterator.java index 0d4ee6b2280..6bd79041e2d 100644 --- a/src/main/java/appeng/util/item/MeaningfulFluidIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulFluidIterator.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.api.storage.data.IAEStack; import java.util.Iterator; import java.util.NoSuchElementException; +import appeng.api.storage.data.IAEStack; + public class MeaningfulFluidIterator implements Iterator { private final Iterator parent; diff --git a/src/main/java/appeng/util/item/MeaningfulItemIterator.java b/src/main/java/appeng/util/item/MeaningfulItemIterator.java index bc060b77442..7dc4bd85e85 100644 --- a/src/main/java/appeng/util/item/MeaningfulItemIterator.java +++ b/src/main/java/appeng/util/item/MeaningfulItemIterator.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.api.storage.data.IAEItemStack; import java.util.Iterator; import java.util.NoSuchElementException; +import appeng.api.storage.data.IAEItemStack; + public class MeaningfulItemIterator implements Iterator { private final Iterator parent; diff --git a/src/main/java/appeng/util/item/OreHelper.java b/src/main/java/appeng/util/item/OreHelper.java index 3718a8adc68..6e3305228b4 100644 --- a/src/main/java/appeng/util/item/OreHelper.java +++ b/src/main/java/appeng/util/item/OreHelper.java @@ -1,32 +1,27 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; +import java.util.*; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import appeng.api.storage.data.IAEItemStack; + import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.Sets; -import java.util.*; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class OreHelper { @@ -37,6 +32,7 @@ public class OreHelper { */ private final LoadingCache> oreDictCache = CacheBuilder.newBuilder() .build(new CacheLoader>() { + @Override public List load(final String oreName) { return OreDictionary.getOres(oreName); @@ -76,9 +72,7 @@ public OreReference isOre(final ItemStack itemStack) { boolean sameOre(final AEItemStack aeItemStack, final IAEItemStack is) { if (is instanceof AEItemStack) { - return this.sameOre( - aeItemStack.getDefinition().getIsOre(), - ((AEItemStack) is).getDefinition().getIsOre()); + return this.sameOre(aeItemStack.getDefinition().getIsOre(), ((AEItemStack) is).getDefinition().getIsOre()); } return this.sameOre(aeItemStack, is.getItemStack()); @@ -148,8 +142,8 @@ public boolean equals(final Object obj) { @Override public String toString() { - return "ItemRef [ref=" + this.ref.getUnlocalizedName() + ", damage=" + this.damage + ", hash=" + this.hash - + ']'; + return "ItemRef [ref=" + this.ref + .getUnlocalizedName() + ", damage=" + this.damage + ", hash=" + this.hash + ']'; } } } diff --git a/src/main/java/appeng/util/item/OreListMultiMap.java b/src/main/java/appeng/util/item/OreListMultiMap.java index c2a0198506e..ad1d87401a4 100644 --- a/src/main/java/appeng/util/item/OreListMultiMap.java +++ b/src/main/java/appeng/util/item/OreListMultiMap.java @@ -1,14 +1,17 @@ package appeng.util.item; +import java.util.*; +import java.util.Map.Entry; + import appeng.api.networking.crafting.ICraftingPatternDetails; import appeng.api.storage.data.IAEItemStack; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableListMultimap.Builder; -import java.util.*; -import java.util.Map.Entry; public class OreListMultiMap { + private ImmutableListMultimap map; private final Map> patternHashMap = new HashMap<>(); private ImmutableListMultimap patternMap; @@ -34,8 +37,8 @@ public boolean isPopulated() { public void put(IAEItemStack key, ICraftingPatternDetails val) { if (((AEItemStack) key).getDefinition() != null) { - Collection tmp = patternHashMap.getOrDefault( - ((AEItemStack) key).getDefinition().getMyHash(), null); + Collection tmp = patternHashMap + .getOrDefault(((AEItemStack) key).getDefinition().getMyHash(), null); if (tmp == null) { ArrayList list = new ArrayList<>(); list.add(val); @@ -77,8 +80,8 @@ else if (ids.size() == 1) { public ImmutableList getBeSubstitutePattern(IAEItemStack ias) { if (((AEItemStack) ias).getDefinition() == null) return ImmutableList.of(); - return (ImmutableList) - this.patternMap.get(((AEItemStack) ias).getDefinition().getMyHash()); + return (ImmutableList) this.patternMap + .get(((AEItemStack) ias).getDefinition().getMyHash()); } public void clear() { diff --git a/src/main/java/appeng/util/item/OreReference.java b/src/main/java/appeng/util/item/OreReference.java index f4ec1f9714d..e833ebcf82d 100644 --- a/src/main/java/appeng/util/item/OreReference.java +++ b/src/main/java/appeng/util/item/OreReference.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.api.storage.data.IAEItemStack; import java.util.*; + import net.minecraft.item.ItemStack; +import appeng.api.storage.data.IAEItemStack; + public class OreReference { private final List otherOptions = new LinkedList(); diff --git a/src/main/java/appeng/util/item/SharedSearchObject.java b/src/main/java/appeng/util/item/SharedSearchObject.java index 25154dc37e8..f18d1fd5367 100644 --- a/src/main/java/appeng/util/item/SharedSearchObject.java +++ b/src/main/java/appeng/util/item/SharedSearchObject.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.item; -import appeng.util.Platform; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; +import appeng.util.Platform; + public class SharedSearchObject { private final int def; diff --git a/src/main/java/appeng/util/iterators/AEInvIterator.java b/src/main/java/appeng/util/iterators/AEInvIterator.java index 36abb1a9054..7ded48653a6 100644 --- a/src/main/java/appeng/util/iterators/AEInvIterator.java +++ b/src/main/java/appeng/util/iterators/AEInvIterator.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.iterators; +import java.util.Iterator; + import appeng.api.storage.data.IAEItemStack; import appeng.tile.inventory.AppEngInternalAEInventory; -import java.util.Iterator; public final class AEInvIterator implements Iterator { + private final AppEngInternalAEInventory inventory; private final int size; diff --git a/src/main/java/appeng/util/iterators/ChainedIterator.java b/src/main/java/appeng/util/iterators/ChainedIterator.java index b2934def32a..f39c119946f 100644 --- a/src/main/java/appeng/util/iterators/ChainedIterator.java +++ b/src/main/java/appeng/util/iterators/ChainedIterator.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.iterators; @@ -21,6 +13,7 @@ import java.util.Iterator; public final class ChainedIterator implements Iterator { + private final T[] list; private int offset = 0; diff --git a/src/main/java/appeng/util/iterators/InvIterator.java b/src/main/java/appeng/util/iterators/InvIterator.java index 59762e072f0..ecd8192dcbd 100644 --- a/src/main/java/appeng/util/iterators/InvIterator.java +++ b/src/main/java/appeng/util/iterators/InvIterator.java @@ -1,28 +1,22 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.iterators; import java.util.Iterator; + import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; public final class InvIterator implements Iterator { + private final IInventory inventory; private final int size; diff --git a/src/main/java/appeng/util/iterators/NullIterator.java b/src/main/java/appeng/util/iterators/NullIterator.java index 6705057de6f..e8ca92c7ead 100644 --- a/src/main/java/appeng/util/iterators/NullIterator.java +++ b/src/main/java/appeng/util/iterators/NullIterator.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.iterators; diff --git a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java index 1ba0cb16d19..2c72eaab2c8 100644 --- a/src/main/java/appeng/util/iterators/ProxyNodeIterator.java +++ b/src/main/java/appeng/util/iterators/ProxyNodeIterator.java @@ -1,29 +1,24 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.iterators; -import appeng.api.networking.IGridHost; -import appeng.api.networking.IGridNode; import java.util.Iterator; + import net.minecraftforge.common.util.ForgeDirection; +import appeng.api.networking.IGridHost; +import appeng.api.networking.IGridNode; + public final class ProxyNodeIterator implements Iterator { + private final Iterator hosts; public ProxyNodeIterator(final Iterator hosts) { diff --git a/src/main/java/appeng/util/iterators/StackToSlotIterator.java b/src/main/java/appeng/util/iterators/StackToSlotIterator.java index 06a563eb770..df407ae2c80 100644 --- a/src/main/java/appeng/util/iterators/StackToSlotIterator.java +++ b/src/main/java/appeng/util/iterators/StackToSlotIterator.java @@ -1,27 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.iterators; -import appeng.util.inv.ItemSlot; import java.util.Iterator; + import net.minecraft.item.ItemStack; +import appeng.util.inv.ItemSlot; + public class StackToSlotIterator implements Iterator { private final ItemSlot iss = new ItemSlot(); diff --git a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java index 335223f69cf..9a4d70cb98c 100644 --- a/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/DefaultPriorityList.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.prioitylist; -import appeng.api.storage.data.IAEStack; import java.util.ArrayList; import java.util.List; +import appeng.api.storage.data.IAEStack; + public class DefaultPriorityList> implements IPartitionList { private static final List NULL_LIST = new ArrayList(); diff --git a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java index 976018ccef6..d813ff2b636 100644 --- a/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/FuzzyPriorityList.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.prioitylist; +import java.util.Collection; + import appeng.api.config.FuzzyMode; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; -import java.util.Collection; public class FuzzyPriorityList> implements IPartitionList { diff --git a/src/main/java/appeng/util/prioitylist/IPartitionList.java b/src/main/java/appeng/util/prioitylist/IPartitionList.java index d9bc1952093..dd77964c6a4 100644 --- a/src/main/java/appeng/util/prioitylist/IPartitionList.java +++ b/src/main/java/appeng/util/prioitylist/IPartitionList.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.prioitylist; @@ -21,6 +13,7 @@ import appeng.api.storage.data.IAEStack; public interface IPartitionList> { + boolean isListed(T input); boolean isEmpty(); diff --git a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java index 45a45451b04..8bc9cec1208 100644 --- a/src/main/java/appeng/util/prioitylist/MergedPriorityList.java +++ b/src/main/java/appeng/util/prioitylist/MergedPriorityList.java @@ -1,27 +1,20 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.prioitylist; -import appeng.api.storage.data.IAEStack; import java.util.ArrayList; import java.util.Collection; +import appeng.api.storage.data.IAEStack; + public final class MergedPriorityList> implements IPartitionList { private final Collection> positive = new ArrayList>(); diff --git a/src/main/java/appeng/util/prioitylist/OreFilteredList.java b/src/main/java/appeng/util/prioitylist/OreFilteredList.java index d4d65a4c04d..9316de8f94d 100644 --- a/src/main/java/appeng/util/prioitylist/OreFilteredList.java +++ b/src/main/java/appeng/util/prioitylist/OreFilteredList.java @@ -1,17 +1,21 @@ package appeng.util.prioitylist; -import appeng.api.storage.data.IAEItemStack; -import appeng.core.AELog; import java.util.HashMap; import java.util.function.Predicate; import java.util.regex.Pattern; import java.util.stream.IntStream; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; + import org.apache.commons.lang3.StringUtils; +import appeng.api.storage.data.IAEItemStack; +import appeng.core.AELog; + public class OreFilteredList implements IPartitionList { + private final Predicate filterPredicate; public OreFilteredList(String filter) { @@ -49,9 +53,7 @@ private static Predicate makeMatcher(String f) { if (notAWildcard(f)) { final Predicate test = Pattern.compile(f).asPredicate(); matcher = (is) -> is != null - && IntStream.of(OreDictionary.getOreIDs(is)) - .mapToObj(OreDictionary::getOreName) - .anyMatch(test); + && IntStream.of(OreDictionary.getOreIDs(is)).mapToObj(OreDictionary::getOreName).anyMatch(test); } else if (!f.isEmpty()) { String[] filters = f.split("[&|]"); String lastFilter = null; @@ -83,6 +85,7 @@ private static Predicate makeMatcher(String f) { } private static class OreListMatcher implements Predicate { + final HashMap cache = new HashMap<>(); final Predicate matcher; @@ -97,8 +100,7 @@ public boolean test(IAEItemStack t) { } private static boolean notAWildcard(String f) { - return f.contains("\\") - || f.contains("^") + return f.contains("\\") || f.contains("^") || f.contains("$") || f.contains("+") || f.contains("(") @@ -108,6 +110,7 @@ private static boolean notAWildcard(String f) { } private static class ItemRef { + private final Item ref; private final int damage; private final int hash; @@ -132,17 +135,15 @@ public boolean equals(final Object obj) { @Override public String toString() { - return "ItemRef [ref=" + this.ref.getUnlocalizedName() + ", damage=" + this.damage + ", hash=" + this.hash - + ']'; + return "ItemRef [ref=" + this.ref + .getUnlocalizedName() + ", damage=" + this.damage + ", hash=" + this.hash + ']'; } } private static Predicate filterToItemStackPredicate(String filter) { final Predicate test = filterToPredicate(filter); return (is) -> is != null - && IntStream.of(OreDictionary.getOreIDs(is)) - .mapToObj(OreDictionary::getOreName) - .anyMatch(test); + && IntStream.of(OreDictionary.getOreIDs(is)).mapToObj(OreDictionary::getOreName).anyMatch(test); } private static Predicate filterToPredicate(String filter) { diff --git a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java index 0f732d57705..9b2ad8b6de9 100644 --- a/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java +++ b/src/main/java/appeng/util/prioitylist/PrecisePriorityList.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util.prioitylist; diff --git a/src/main/java/appeng/worldgen/MeteoritePlacer.java b/src/main/java/appeng/worldgen/MeteoritePlacer.java index bde1f574bf8..343c1eda58f 100644 --- a/src/main/java/appeng/worldgen/MeteoritePlacer.java +++ b/src/main/java/appeng/worldgen/MeteoritePlacer.java @@ -1,34 +1,17 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.worldgen; -import appeng.api.AEApi; -import appeng.api.definitions.IBlockDefinition; -import appeng.api.definitions.IBlocks; -import appeng.api.definitions.IMaterials; -import appeng.core.AEConfig; -import appeng.core.features.AEFeature; -import appeng.core.worlddata.WorldData; -import appeng.util.InventoryAdaptor; -import appeng.util.Platform; -import appeng.worldgen.meteorite.*; import java.util.*; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -41,7 +24,19 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; +import appeng.api.AEApi; +import appeng.api.definitions.IBlockDefinition; +import appeng.api.definitions.IBlocks; +import appeng.api.definitions.IMaterials; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; +import appeng.core.worlddata.WorldData; +import appeng.util.InventoryAdaptor; +import appeng.util.Platform; +import appeng.worldgen.meteorite.*; + public final class MeteoritePlacer { + private static final int SKYSTONE_SPAWN_LIMIT = 12; private static final long SEED_OFFSET_CHEST_LOOT = 1; @@ -164,7 +159,10 @@ public MeteoritePlacer(final IMeteoriteWorld world, final NBTTagCompound meteori if (dataSeed == 0) { // Generate a position-based seed Platform.seedFromGrid( - rng, world.getWorld().getSeed(), meteoriteBlob.getInteger("x"), meteoriteBlob.getInteger("z")); + rng, + world.getWorld().getSeed(), + meteoriteBlob.getInteger("x"), + meteoriteBlob.getInteger("z")); while (dataSeed == 0) { dataSeed = rng.nextLong(); } @@ -245,11 +243,15 @@ private void placeCrater(final IMeteoriteWorld w, final int x, final int y, fina } } - for (final Object o : w.getWorld() - .getEntitiesWithinAABB( - EntityItem.class, - AxisAlignedBB.getBoundingBox( - w.minX(x - 30), y - 5, w.minZ(z - 30), w.maxX(x + 30), y + 30, w.maxZ(z + 30)))) { + for (final Object o : w.getWorld().getEntitiesWithinAABB( + EntityItem.class, + AxisAlignedBB.getBoundingBox( + w.minX(x - 30), + y - 5, + w.minZ(z - 30), + w.maxX(x + 30), + y + 30, + w.maxZ(z + 30)))) { final Entity e = (Entity) o; e.setDead(); } @@ -270,8 +272,7 @@ private void placeMeteorite(final IMeteoriteWorld w, final int x, final int y, f final double dz = k - z; if (dx * dx * 0.7 + dy * dy * (j > y ? 1.4 : 0.8) + dz * dz * 0.7 < this.squaredMeteoriteSize) { - for (final Block skyStoneBlock : - skyStoneDefinition.maybeBlock().asSet()) { + for (final Block skyStoneBlock : skyStoneDefinition.maybeBlock().asSet()) { this.putter.put(w, i, j, k, skyStoneBlock); } } @@ -324,8 +325,7 @@ private void placeMeteorite(final IMeteoriteWorld w, final int x, final int y, f switch (lootRng.nextInt(3)) { case 0: final int amount = 1 + lootRng.nextInt(SKYSTONE_SPAWN_LIMIT); - for (final ItemStack skyStoneStack : - skyStoneDefinition.maybeStack(amount).asSet()) { + for (final ItemStack skyStoneStack : skyStoneDefinition.maybeStack(amount).asSet()) { ap.addItems(skyStoneStack); } break; @@ -475,8 +475,7 @@ public boolean spawnMeteoriteCenter() { world.done(); - WorldData.instance() - .spawnData() + WorldData.instance().spawnData() .addNearByMeteorites(world.getWorld().provider.dimensionId, x >> 4, z >> 4, this.settings); return true; } diff --git a/src/main/java/appeng/worldgen/MeteoriteWorldGen.java b/src/main/java/appeng/worldgen/MeteoriteWorldGen.java index 917da61b822..ed35b14720e 100644 --- a/src/main/java/appeng/worldgen/MeteoriteWorldGen.java +++ b/src/main/java/appeng/worldgen/MeteoriteWorldGen.java @@ -1,23 +1,21 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.worldgen; +import java.util.Random; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + import appeng.api.features.IWorldGen.WorldGenType; import appeng.core.AEConfig; import appeng.core.features.registries.WorldGenRegistry; @@ -27,20 +25,12 @@ import appeng.util.Platform; import appeng.worldgen.meteorite.ChunkOnly; import cpw.mods.fml.common.IWorldGenerator; -import java.util.Random; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; public final class MeteoriteWorldGen implements IWorldGenerator { + @Override - public void generate( - final Random rng, - final int chunkX, - final int chunkZ, - final World world, - final IChunkProvider chunkGenerator, - final IChunkProvider chunkProvider) { + public void generate(final Random rng, final int chunkX, final int chunkZ, final World world, + final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider) { if (WorldGenRegistry.INSTANCE.isWorldGenEnabled(WorldGenType.Meteorites, world)) { // Find the meteorite grid cell corresponding to this chunk final int gridCellSize = Math.max(8, AEConfig.instance.minMeteoriteDistance); @@ -51,10 +41,10 @@ public void generate( Platform.seedFromGrid(rng, world.getSeed(), gridX, gridZ); // Calculate a deterministic position of the meteorite in the grid cell final boolean spawnSurfaceMeteor = rng.nextDouble() < AEConfig.instance.meteoriteSpawnChance; - final int meteorX = - (gridX * gridCellSize) + rng.nextInt(gridCellSize - 2 * gridCellMargin) + gridCellMargin; - final int meteorZ = - (gridZ * gridCellSize) + rng.nextInt(gridCellSize - 2 * gridCellMargin) + gridCellMargin; + final int meteorX = (gridX * gridCellSize) + rng.nextInt(gridCellSize - 2 * gridCellMargin) + + gridCellMargin; + final int meteorZ = (gridZ * gridCellSize) + rng.nextInt(gridCellSize - 2 * gridCellMargin) + + gridCellMargin; final int meteorDepth = 180 + rng.nextInt(20); final int meteorChunkX = meteorX >> 4; final int meteorChunkZ = meteorZ >> 4; @@ -80,6 +70,7 @@ public void generate( * Spawns blocks for meteorites that were previously generated in neighboring chunks */ private static final class ExistingMeteoriteSpawn implements IWorldCallable { + private final int chunkX; private final int chunkZ; @@ -123,8 +114,12 @@ public MeteoriteSpawn(final int x, final int depth, final int z, final long seed private boolean tryMeteorite(final World w) { int depth = this.depth; for (int tries = 0; tries < 20; tries++) { - final MeteoritePlacer mp = - new MeteoritePlacer(new ChunkOnly(w, x >> 4, z >> 4), this.seed, x, depth, z); + final MeteoritePlacer mp = new MeteoritePlacer( + new ChunkOnly(w, x >> 4, z >> 4), + this.seed, + x, + depth, + z); if (mp.spawnMeteoriteCenter()) { final int px = x >> 4; @@ -138,8 +133,9 @@ private boolean tryMeteorite(final World w) { } if (WorldData.instance().spawnData().hasGenerated(w.provider.dimensionId, cx, cz)) { - final MeteoritePlacer mp2 = - new MeteoritePlacer(new ChunkOnly(w, cx, cz), mp.getSettings()); + final MeteoritePlacer mp2 = new MeteoritePlacer( + new ChunkOnly(w, cx, cz), + mp.getSettings()); mp2.spawnMeteorite(); } } diff --git a/src/main/java/appeng/worldgen/QuartzWorldGen.java b/src/main/java/appeng/worldgen/QuartzWorldGen.java index 757ada89b68..b852da013c4 100644 --- a/src/main/java/appeng/worldgen/QuartzWorldGen.java +++ b/src/main/java/appeng/worldgen/QuartzWorldGen.java @@ -1,23 +1,23 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.worldgen; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenMinable; + import appeng.api.AEApi; import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlocks; @@ -25,14 +25,9 @@ import appeng.core.AEConfig; import appeng.core.features.registries.WorldGenRegistry; import cpw.mods.fml.common.IWorldGenerator; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.feature.WorldGenMinable; public final class QuartzWorldGen implements IWorldGenerator { + private final WorldGenMinable oreNormal; private final WorldGenMinable oreCharged; @@ -49,13 +44,8 @@ public QuartzWorldGen() { } @Override - public void generate( - final Random r, - final int chunkX, - final int chunkZ, - final World w, - final IChunkProvider chunkGenerator, - final IChunkProvider chunkProvider) { + public void generate(final Random r, final int chunkX, final int chunkZ, final World w, + final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider) { int seaLevel = w.provider.getAverageGroundLevel() + 1; if (seaLevel < 20) { @@ -75,8 +65,8 @@ public void generate( final boolean isCharged = r.nextFloat() > AEConfig.instance.spawnChargedChance; final WorldGenMinable whichOre = isCharged ? this.oreCharged : this.oreNormal; - if (WorldGenRegistry.INSTANCE.isWorldGenEnabled( - isCharged ? WorldGenType.ChargedCertusQuartz : WorldGenType.CertusQuartz, w)) { + if (WorldGenRegistry.INSTANCE + .isWorldGenEnabled(isCharged ? WorldGenType.ChargedCertusQuartz : WorldGenType.CertusQuartz, w)) { final int cx = chunkX * 16 + r.nextInt(22); final int cy = r.nextInt(40 * seaLevel / 64) + r.nextInt(22 * seaLevel / 64) + 12 * seaLevel / 64; final int cz = chunkZ * 16 + r.nextInt(22); diff --git a/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java b/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java index 89ccad1f8b5..b83443e7290 100644 --- a/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java +++ b/src/main/java/appeng/worldgen/meteorite/ChunkOnly.java @@ -1,10 +1,11 @@ package appeng.worldgen.meteorite; -import appeng.util.Platform; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import appeng.util.Platform; + public class ChunkOnly extends StandardWorld { private final Chunk target; diff --git a/src/main/java/appeng/worldgen/meteorite/Fallout.java b/src/main/java/appeng/worldgen/meteorite/Fallout.java index 15589598e8b..2f97751be17 100644 --- a/src/main/java/appeng/worldgen/meteorite/Fallout.java +++ b/src/main/java/appeng/worldgen/meteorite/Fallout.java @@ -1,11 +1,13 @@ package appeng.worldgen.meteorite; -import appeng.api.definitions.IBlockDefinition; -import appeng.util.Platform; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import appeng.api.definitions.IBlockDefinition; +import appeng.util.Platform; + public class Fallout { + private final MeteoriteBlockPutter putter; private final IBlockDefinition skyStoneDefinition; @@ -38,8 +40,7 @@ public void getRandomInset(final double random, final IMeteoriteWorld w, final i } else if (random > 0.7) { this.putter.put(w, x, y, z, Blocks.grass); } else if (random > 0.6) { - for (final Block skyStoneBlock : - this.skyStoneDefinition.maybeBlock().asSet()) { + for (final Block skyStoneBlock : this.skyStoneDefinition.maybeBlock().asSet()) { this.putter.put(w, x, y, z, skyStoneBlock); } } else if (random > 0.5) { diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java b/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java index d0d407c38d9..bc7723cca88 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutCopy.java @@ -1,10 +1,12 @@ package appeng.worldgen.meteorite; +import net.minecraft.block.Block; + import appeng.api.definitions.IBlockDefinition; import appeng.util.Platform; -import net.minecraft.block.Block; public class FalloutCopy extends Fallout { + private static final double SPECIFIED_BLOCK_THRESHOLD = 0.9; private static final double AIR_BLOCK_THRESHOLD = 0.8; private static final double BLOCK_THRESHOLD_STEP = 0.1; @@ -13,13 +15,8 @@ public class FalloutCopy extends Fallout { private final int meta; private final MeteoriteBlockPutter putter; - public FalloutCopy( - final IMeteoriteWorld w, - final int x, - final int y, - final int z, - final MeteoriteBlockPutter putter, - final IBlockDefinition skyStoneDefinition) { + public FalloutCopy(final IMeteoriteWorld w, final int x, final int y, final int z, + final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition) { super(putter, skyStoneDefinition); this.putter = putter; this.block = w.getBlock(x, y, z); diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutSand.java b/src/main/java/appeng/worldgen/meteorite/FalloutSand.java index d4eb8cebc8c..d2e5dc5b08c 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutSand.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutSand.java @@ -1,19 +1,16 @@ package appeng.worldgen.meteorite; -import appeng.api.definitions.IBlockDefinition; import net.minecraft.init.Blocks; +import appeng.api.definitions.IBlockDefinition; + public class FalloutSand extends FalloutCopy { + private static final double GLASS_THRESHOLD = 0.66; private final MeteoriteBlockPutter putter; - public FalloutSand( - final IMeteoriteWorld w, - final int x, - final int y, - final int z, - final MeteoriteBlockPutter putter, - final IBlockDefinition skyStoneDefinition) { + public FalloutSand(final IMeteoriteWorld w, final int x, final int y, final int z, + final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition) { super(w, x, y, z, putter, skyStoneDefinition); this.putter = putter; } diff --git a/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java b/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java index 0445fdd0c5a..a5fc5fd42f6 100644 --- a/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java +++ b/src/main/java/appeng/worldgen/meteorite/FalloutSnow.java @@ -1,20 +1,17 @@ package appeng.worldgen.meteorite; -import appeng.api.definitions.IBlockDefinition; import net.minecraft.init.Blocks; +import appeng.api.definitions.IBlockDefinition; + public class FalloutSnow extends FalloutCopy { + private static final double SNOW_THRESHOLD = 0.7; private static final double ICE_THRESHOLD = 0.5; private final MeteoriteBlockPutter putter; - public FalloutSnow( - final IMeteoriteWorld w, - final int x, - final int y, - final int z, - final MeteoriteBlockPutter putter, - final IBlockDefinition skyStoneDefinition) { + public FalloutSnow(final IMeteoriteWorld w, final int x, final int y, final int z, + final MeteoriteBlockPutter putter, final IBlockDefinition skyStoneDefinition) { super(w, x, y, z, putter, skyStoneDefinition); this.putter = putter; } diff --git a/src/main/java/appeng/worldgen/meteorite/IMeteoriteWorld.java b/src/main/java/appeng/worldgen/meteorite/IMeteoriteWorld.java index 48ff8451a4e..9c72c59a145 100644 --- a/src/main/java/appeng/worldgen/meteorite/IMeteoriteWorld.java +++ b/src/main/java/appeng/worldgen/meteorite/IMeteoriteWorld.java @@ -5,6 +5,7 @@ import net.minecraft.world.World; public interface IMeteoriteWorld { + int minX(int in); int minZ(int in); diff --git a/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java b/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java index 5f77f120991..e4477a397ea 100644 --- a/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java +++ b/src/main/java/appeng/worldgen/meteorite/MeteoriteBlockPutter.java @@ -4,6 +4,7 @@ import net.minecraft.init.Blocks; public class MeteoriteBlockPutter { + public boolean put(final IMeteoriteWorld w, final int i, final int j, final int k, final Block blk) { final Block original = w.getBlock(i, j, k); diff --git a/src/main/java/appeng/worldgen/meteorite/StandardWorld.java b/src/main/java/appeng/worldgen/meteorite/StandardWorld.java index e5c8a3ac339..5184ca0ec5d 100644 --- a/src/main/java/appeng/worldgen/meteorite/StandardWorld.java +++ b/src/main/java/appeng/worldgen/meteorite/StandardWorld.java @@ -1,10 +1,11 @@ package appeng.worldgen.meteorite; -import appeng.util.Platform; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import appeng.util.Platform; + public class StandardWorld implements IMeteoriteWorld { private final World w; diff --git a/src/test/java/appeng/core/worlddata/MeteorDataNameEncoderTest.java b/src/test/java/appeng/core/worlddata/MeteorDataNameEncoderTest.java index c6cf652c4a4..44dc4ac5883 100644 --- a/src/test/java/appeng/core/worlddata/MeteorDataNameEncoderTest.java +++ b/src/test/java/appeng/core/worlddata/MeteorDataNameEncoderTest.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.core.worlddata; @@ -29,6 +21,7 @@ * @since rv3 06.06.2015 */ public class MeteorDataNameEncoderTest { + private static final int WITHOUT_DIMENSION = -5; private static final int WITHOUT_CHUNK_X = 0; private static final int WITHOUT_CHUNK_Z = 13; diff --git a/src/test/java/appeng/services/version/ModVersionFetcherTest.java b/src/test/java/appeng/services/version/ModVersionFetcherTest.java index ffd88c62fd3..bc2e1b6a27e 100644 --- a/src/test/java/appeng/services/version/ModVersionFetcherTest.java +++ b/src/test/java/appeng/services/version/ModVersionFetcherTest.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -27,7 +19,7 @@ * @since rv3 16.05.2015 */ public class ModVersionFetcherTest { - // private static final ModVersionFetcher FETCHER = new ModVersionFetcher( ) + // private static final ModVersionFetcher FETCHER = new ModVersionFetcher( ) private final ModVersionFetcher indev; private final ModVersionFetcher pullRequest; diff --git a/src/test/java/appeng/services/version/VersionParserTest.java b/src/test/java/appeng/services/version/VersionParserTest.java index 55b440cc15e..be3501a99e0 100644 --- a/src/test/java/appeng/services/version/VersionParserTest.java +++ b/src/test/java/appeng/services/version/VersionParserTest.java @@ -2,13 +2,15 @@ import static org.junit.Assert.*; -import appeng.services.version.exceptions.*; import org.junit.Test; +import appeng.services.version.exceptions.*; + /** * Tests for {@link VersionParser} */ public final class VersionParserTest { + private static final String GITHUB_VERSION = "rv2.beta.8"; private static final String GITHUB_INVALID_REVISION = "2.beta.8"; private static final String GITHUB_INVALID_CHANNEL = "rv2.gamma.8"; diff --git a/src/test/java/appeng/services/version/VersionTest.java b/src/test/java/appeng/services/version/VersionTest.java index 28627218f32..9e1d0754484 100644 --- a/src/test/java/appeng/services/version/VersionTest.java +++ b/src/test/java/appeng/services/version/VersionTest.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.services.version; @@ -29,6 +21,7 @@ * @since rv3 16.05.2015 */ public final class VersionTest { + private static final Version DEFAULT_VERSION_RV2_BETA_8 = new DefaultVersion(2, Channel.Beta, 8); private static final Version DEFAULT_VERSION_RV2_BETA_9 = new DefaultVersion(2, Channel.Beta, 9); private static final Version DEFAULT_VERSION_RV3_BETA_8 = new DefaultVersion(3, Channel.Beta, 8); diff --git a/src/test/java/appeng/util/SlimReadableNumberConverterTest.java b/src/test/java/appeng/util/SlimReadableNumberConverterTest.java index 25c06db124f..fd16c83fa6d 100644 --- a/src/test/java/appeng/util/SlimReadableNumberConverterTest.java +++ b/src/test/java/appeng/util/SlimReadableNumberConverterTest.java @@ -12,6 +12,7 @@ * @since rv2 */ public final class SlimReadableNumberConverterTest { + private static final long NUMBER_NEG_999999 = -999999L; private static final String RESULT_NEG_999999 = "-0M"; diff --git a/src/test/java/appeng/util/UUIDMatcherTest.java b/src/test/java/appeng/util/UUIDMatcherTest.java index 16cc1da5bfa..29ab0c96a62 100644 --- a/src/test/java/appeng/util/UUIDMatcherTest.java +++ b/src/test/java/appeng/util/UUIDMatcherTest.java @@ -1,19 +1,11 @@ /* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . + * This file is part of Applied Energistics 2. Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. Applied + * Energistics 2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any + * later version. Applied Energistics 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. You should have received a copy of the GNU Lesser General Public License along with + * Applied Energistics 2. If not, see . */ package appeng.util; @@ -27,6 +19,7 @@ * Tests for {@link UUIDMatcher} */ public final class UUIDMatcherTest { + private static final String IS_UUID = "03ba29a1-d6bd-32ba-90b2-375e4d65abc9"; private static final String NO_UUID = "no"; private static final String INVALID_UUID = "g3ba29a1-d6bd-32ba-90b2-375e4d65abc9"; diff --git a/src/test/java/appeng/util/WideReadableNumberConverterTest.java b/src/test/java/appeng/util/WideReadableNumberConverterTest.java index 00b0b3ec328..c3ac429e150 100644 --- a/src/test/java/appeng/util/WideReadableNumberConverterTest.java +++ b/src/test/java/appeng/util/WideReadableNumberConverterTest.java @@ -12,6 +12,7 @@ * @since rv2 */ public final class WideReadableNumberConverterTest { + private static final long NUMBER_NEG_999999 = -999999L; private static final String RESULT_NEG_999999 = "-0M";