diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/api')
46 files changed, 470 insertions, 506 deletions
diff --git a/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java b/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java index e37a86aaa5..0d9d4d5dc2 100644 --- a/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java +++ b/src/main/java/gtPlusPlus/api/damage/DamageTeslaTower.java @@ -1,11 +1,12 @@ package gtPlusPlus.api.damage; -import gtPlusPlus.core.world.damage.BaseCustomDamageSource; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IChatComponent; +import gtPlusPlus.core.world.damage.BaseCustomDamageSource; + public class DamageTeslaTower extends BaseCustomDamageSource { public DamageTeslaTower(Entity transmitter) { diff --git a/src/main/java/gtPlusPlus/api/enums/Quality.java b/src/main/java/gtPlusPlus/api/enums/Quality.java index d6f0667e20..efcf2a015f 100644 --- a/src/main/java/gtPlusPlus/api/enums/Quality.java +++ b/src/main/java/gtPlusPlus/api/enums/Quality.java @@ -1,8 +1,9 @@ package gtPlusPlus.api.enums; -import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.util.EnumChatFormatting; +import gtPlusPlus.core.util.math.MathUtils; + public enum Quality { // Magic Blue diff --git a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java index 99e14cae01..a85bd42213 100644 --- a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java +++ b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java @@ -1,5 +1,10 @@ package gtPlusPlus.api.helpers; +import java.util.HashMap; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.WeightedCollection; import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; @@ -7,9 +12,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG; import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler; -import java.util.HashMap; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GregtechPlusPlus_API { @@ -22,25 +24,25 @@ public class GregtechPlusPlus_API { public static class Multiblock_API { - private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap = - new HashMap<String, SpecialMultiBehaviour>(); + private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap = new HashMap<String, SpecialMultiBehaviour>(); /** * Register a special behaviour for GT++ Multis to listen use. + * * @param aBehaviour - An Object which has extended {@link SpecialMultiBehaviour}'s base implementation. * @return - Did this behaviour register properly? */ public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) { - if (aBehaviour.getTriggerItem() == null - || aBehaviour.getTriggerItemTooltip() == null + if (aBehaviour.getTriggerItem() == null || aBehaviour.getTriggerItemTooltip() == null || aBehaviour.getTriggerItemTooltip().length() <= 0) { - Logger.INFO("Failed to attach custom multiblock logic to " - + ItemUtils.getItemName(aBehaviour.getTriggerItem())); + Logger.INFO( + "Failed to attach custom multiblock logic to " + + ItemUtils.getItemName(aBehaviour.getTriggerItem())); return false; } mSpecialBehaviourItemMap.put("UniqueKey_" + aBehaviour.hashCode(), aBehaviour); - SpecialBehaviourTooltipHandler.addTooltipForItem( - aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip()); + SpecialBehaviourTooltipHandler + .addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip()); Logger.INFO("Attached custom multiblock logic to " + ItemUtils.getItemName(aBehaviour.getTriggerItem())); return true; } @@ -51,7 +53,8 @@ public class GregtechPlusPlus_API { /** * Allows RTG Fuel pellets from other mods to be used in the RTG hatch. - * @param aStack - The Pellet Stack, sanitsed after passing through. + * + * @param aStack - The Pellet Stack, sanitsed after passing through. * @param aFuelValue - The Fuel Value of the Pellet to be added to the energy storage. * @return - Did register? */ @@ -71,7 +74,8 @@ public class GregtechPlusPlus_API { /** * * Registers an ore block for a dimension. Uses a default weight of 100. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aOredictName - The OreDict name of the Ore to be mined. * @return - If there was a valid Block found in the OreDict for the provided name. */ @@ -82,9 +86,10 @@ public class GregtechPlusPlus_API { /** * * Registers an ore block for a dimension. Uses a default weight of 100. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aOredictName - The OreDict name of the Ore to be mined. - * @param aWeight - The weight of this ore Block. + * @param aWeight - The weight of this ore Block. * @return - If there was a valid Block found in the OreDict for the provided name. */ public static boolean registerOreForVoidMiner(int aDim, String aOredictName, int aWeight) { @@ -107,7 +112,8 @@ public class GregtechPlusPlus_API { /** * Registers an ore block for a dimension. Uses a default weight of 100. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aOreBlock - The Ore Block to be mined. */ public static void registerOreForVoidMiner(int aDim, Block aOreBlock) { @@ -116,9 +122,10 @@ public class GregtechPlusPlus_API { /** * Registers an ore block for a dimension. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aOreBlock - The Ore Block to be mined. - * @param aWeight - The weight of this ore Block. + * @param aWeight - The weight of this ore Block. */ public static void registerOreForVoidMiner(int aDim, Block aOreBlock, int aWeight) { GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aOreBlock, aWeight); @@ -126,7 +133,8 @@ public class GregtechPlusPlus_API { /** * Registers a surface block for a dimension. Uses a default weight of 100. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aDirtBlock - The Dirt/Grass Block to be mined. */ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock) { @@ -135,9 +143,10 @@ public class GregtechPlusPlus_API { /** * Registers a surface block for a dimension. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aDirtBlock - The Dirt/Grass Block to be mined. - * @param aWeight - The weight of this Dirt/Grass Block. + * @param aWeight - The weight of this Dirt/Grass Block. */ public static void registerEarthSurfaceForVoidMiner(int aDim, Block aDirtBlock, int aWeight) { GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aDirtBlock, aWeight); @@ -145,7 +154,8 @@ public class GregtechPlusPlus_API { /** * Registers a stone block for a dimension. Uses a default weight of 100. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aStoneBlock - The Stone Block to be mined. */ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock) { @@ -154,9 +164,10 @@ public class GregtechPlusPlus_API { /** * Registers a stone block for a dimension. - * @param aDim - The Dimension ID + * + * @param aDim - The Dimension ID * @param aStoneBlock - The Stone Block to be mined. - * @param aWeight - The weight of this Stone Block. + * @param aWeight - The weight of this Stone Block. */ public static void registerEarthStoneForVoidMiner(int aDim, Block aStoneBlock, int aWeight) { GregtechPlusPlus_API_Internal.writeBlockToDimensionInCache(aDim, 0, aStoneBlock, aWeight); @@ -190,8 +201,8 @@ public class GregtechPlusPlus_API { aMappedBlocks.put(aWeight, aBlock); } - private static WeightedCollection<Block> getBlockMap( - int aType, HashMap<String, WeightedCollection<Block>> aDimMap) { + private static WeightedCollection<Block> getBlockMap(int aType, + HashMap<String, WeightedCollection<Block>> aDimMap) { WeightedCollection<Block> aMappedBlocks; String aTypeName = ((aType == 0) ? "ore" : (aType == 1) ? "dirt" : (aType == 2) ? "stone" : "error"); aMappedBlocks = aDimMap.get(aTypeName); diff --git a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java index 3f14a9de03..dccb7371d5 100644 --- a/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java +++ b/src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java @@ -1,5 +1,10 @@ package gtPlusPlus.api.helpers; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; @@ -7,9 +12,6 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import net.minecraft.item.ItemStack; public class MaterialHelper { @@ -23,38 +25,25 @@ public class MaterialHelper { /** * Generates a 16 Fluid Pipe + * * @see {@code Example: Copper 16x Pipe (Materials.Copper, Materials.Copper.mName, "Copper", ID, 60, 1000, true)} - * @param aMaterial - Pipe Material - * @param name - Pipe Internal name - * @param displayName - Pipe Display Name - * @param aID - Pipe's Meta ID + * @param aMaterial - Pipe Material + * @param name - Pipe Internal name + * @param displayName - Pipe Display Name + * @param aID - Pipe's Meta ID * @param baseCapacity - Pipes Base Capacity * @param heatCapacity - Pipe Max Temp - * @param gasProof - Is Gas Proof? + * @param gasProof - Is Gas Proof? * @return A boolean which corresponds to whether or not the Pipe was registered to the Ore Dictionary. */ - public static boolean generateHexadecuplePipe( - Materials aMaterial, - String name, - String displayName, - int aID, - int baseCapacity, - int heatCapacity, - boolean gasProof) { + public static boolean generateHexadecuplePipe(Materials aMaterial, String name, String displayName, int aID, + int baseCapacity, int heatCapacity, boolean gasProof) { if (Utils.getGregtechVersionAsInt() >= 50930) { try { Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class; - Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor(new Class[] { - int.class, - String.class, - String.class, - float.class, - Materials.class, - int.class, - int.class, - boolean.class, - int.class - }); + Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor( + new Class[] { int.class, String.class, String.class, float.class, Materials.class, int.class, + int.class, boolean.class, int.class }); if (constructor != null) { GT_MetaPipeEntity_Fluid aPipe; aPipe = constructor.newInstance( @@ -70,13 +59,8 @@ public class MaterialHelper { return GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L)); } - } catch (NoSuchMethodException - | SecurityException - | InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException e) { - } + } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException e) {} } return false; } diff --git a/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java b/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java index ad65c03429..cec4d12716 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IChunkLoader.java @@ -1,6 +1,7 @@ package gtPlusPlus.api.interfaces; import java.util.Set; + import net.minecraft.world.ChunkCoordIntPair; public interface IChunkLoader { diff --git a/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java b/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java index 830b34a41d..06727167bf 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IComparableRecipe.java @@ -2,4 +2,5 @@ package gtPlusPlus.api.interfaces; import gregtech.api.util.GT_Recipe; -public interface IComparableRecipe extends Comparable<GT_Recipe> {} +public interface IComparableRecipe extends Comparable<GT_Recipe> { +} diff --git a/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java b/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java index 9e3ea89606..e3aa00e7a1 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java @@ -1,10 +1,11 @@ package gtPlusPlus.api.interfaces; -import gtPlusPlus.api.objects.minecraft.BlockPos; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import gtPlusPlus.api.objects.minecraft.BlockPos; + public interface IEntityCatcher { public boolean hasEntity(ItemStack aStack); diff --git a/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java b/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java index 251eaa416c..95cd46e443 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IGeneratorWorld.java @@ -1,9 +1,11 @@ package gtPlusPlus.api.interfaces; import java.util.Random; + import net.minecraft.world.World; public abstract interface IGeneratorWorld { + public abstract boolean generate(World paramWorld, Random paramRandom, int paramInt1, int paramInt2); public abstract void initiate(); diff --git a/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java b/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java index b4223fb558..64c2198662 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IGregtechPower.java @@ -1,12 +1,13 @@ package gtPlusPlus.api.interfaces; -import gregtech.api.interfaces.IDescribable; -import gregtech.api.interfaces.tileentity.*; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import gregtech.api.interfaces.IDescribable; +import gregtech.api.interfaces.tileentity.*; + public abstract interface IGregtechPower extends IGearEnergyTileEntity, ITurnable, IGregTechDeviceInformation, IDescribable, IBasicEnergyContainer { @@ -134,10 +135,9 @@ public abstract interface IGregtechPower return true; } - /* boolean onPreTick(TilePoweredGT tilePoweredGT, long mTickTimer2); - - boolean onTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2); - - boolean onPostTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2);*/ + /* + * boolean onPreTick(TilePoweredGT tilePoweredGT, long mTickTimer2); boolean onTick(TilePoweredGT + * iGregTechTileEntity, long mTickTimer2); boolean onPostTick(TilePoweredGT iGregTechTileEntity, long mTickTimer2); + */ } diff --git a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java b/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java index 1f7991540a..d70a19925e 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IPlugin.java @@ -10,9 +10,8 @@ public interface IPlugin { public String getPluginName(); /** - * @return - * A {@link String} object which returns the {@link IPlugin}'s short name. - * This String should only contain 4 Characters. + * @return A {@link String} object which returns the {@link IPlugin}'s short name. This String should only contain 4 + * Characters. */ public String getPluginAbbreviation(); diff --git a/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java b/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java index b61528e4b9..ddb4d4d2f1 100644 --- a/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java +++ b/src/main/java/gtPlusPlus/api/interfaces/IRandomGenerator.java @@ -1,35 +1,18 @@ /* - * Copyright 2005, Nick Galbreath -- nickg [at] modp [dot] com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the modp.com nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This is the standard "new" BSD license: + * Copyright 2005, Nick Galbreath -- nickg [at] modp [dot] com All rights reserved. Redistribution and use in source and + * binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of + * the modp.com nor the names of its contributors may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND |
