diff --git a/src/api/java/cofh/api/item/IToolHammer.java b/src/api/java/cofh/api/item/IToolHammer.java index 66cdc9f3c..b17f22e06 100644 --- a/src/api/java/cofh/api/item/IToolHammer.java +++ b/src/api/java/cofh/api/item/IToolHammer.java @@ -13,10 +13,10 @@ public interface IToolHammer { /** * Called to ensure that the tool can be used on a block. * - * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other - * tools). + * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other tools). * @param user The entity using the tool. - * @param pos Coordinates of the block. + * @param pos Coordinates of the block. + * * @return True if this tool can be used. */ boolean isUsable(ItemStack item, EntityLivingBase user, BlockPos pos); @@ -24,10 +24,10 @@ public interface IToolHammer { /** * Called to ensure that the tool can be used on an entity. * - * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other - * tools). - * @param user The entity using the tool. + * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other tools). + * @param user The entity using the tool. * @param entity The entity the tool is being used on. + * * @return True if this tool can be used. */ boolean isUsable(ItemStack item, EntityLivingBase user, Entity entity); @@ -35,21 +35,18 @@ public interface IToolHammer { /** * Callback for when the tool has been used reactively. * - * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other - * tools). + * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other tools). * @param user The entity using the tool. - * @param pos Coordinates of the block. + * @param pos Coordinates of the block. */ void toolUsed(ItemStack item, EntityLivingBase user, BlockPos pos); /** * Callback for when the tool has been used reactively. * - * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other - * tools). - * @param user The entity using the tool. + * @param item The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other tools). + * @param user The entity using the tool. * @param entity The entity the tool is being used on. */ void toolUsed(ItemStack item, EntityLivingBase user, Entity entity); - } \ No newline at end of file diff --git a/src/api/java/micdoodle8/mods/galacticraft/api/entity/IEntityBreathable.java b/src/api/java/micdoodle8/mods/galacticraft/api/entity/IEntityBreathable.java index 13b1bd8a4..1a8eaebbe 100644 --- a/src/api/java/micdoodle8/mods/galacticraft/api/entity/IEntityBreathable.java +++ b/src/api/java/micdoodle8/mods/galacticraft/api/entity/IEntityBreathable.java @@ -9,4 +9,4 @@ public interface IEntityBreathable { * Whether or not this entity can currently breathe without oxygen in it's vicinity */ boolean canBreath(); -} +} \ No newline at end of file diff --git a/src/api/java/micdoodle8/mods/galacticraft/api/world/ISolarLevel.java b/src/api/java/micdoodle8/mods/galacticraft/api/world/ISolarLevel.java index 6dafcdc14..d52195e78 100644 --- a/src/api/java/micdoodle8/mods/galacticraft/api/world/ISolarLevel.java +++ b/src/api/java/micdoodle8/mods/galacticraft/api/world/ISolarLevel.java @@ -3,8 +3,7 @@ package micdoodle8.mods.galacticraft.api.world; /** * Used to change the solar multiplier of certain world providers *
- * If you have a solar feature in your mod, check whether the world's provider inherits this class and multiply the - * solar generation by the solar multiplier double + * If you have a solar feature in your mod, check whether the world's provider inherits this class and multiply the solar generation by the solar multiplier double * * for example: * @@ -13,4 +12,4 @@ package micdoodle8.mods.galacticraft.api.world; public interface ISolarLevel { double getSolarEnergyMultiplier(); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/Chunk3D.java b/src/main/java/mekanism/api/Chunk3D.java index 44cbcb34b..26389cc4a 100644 --- a/src/main/java/mekanism/api/Chunk3D.java +++ b/src/main/java/mekanism/api/Chunk3D.java @@ -6,29 +6,27 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; /** - * Chunk3D - an integer-based way to keep track of and perform operations on chunks in a Minecraft-based environment. - * This also takes in account the dimension the chunk is in. + * Chunk3D - an integer-based way to keep track of and perform operations on chunks in a Minecraft-based environment. This also takes in account the dimension the chunk + * is in. * * @author aidancbrady */ public class Chunk3D { public int dimensionId; - public int x; public int z; /** * Creates a Chunk3D object from the given x and z coordinates, as well as a dimension. * - * @param x - chunk x location - * @param z - chunk z location + * @param x - chunk x location + * @param z - chunk z location * @param dimension - the dimension this Chunk3D is in */ public Chunk3D(int x, int z, int dimension) { this.x = x; this.z = z; - dimensionId = dimension; } @@ -38,9 +36,8 @@ public class Chunk3D { * @param entity - the entity to get the Chunk3D object from */ public Chunk3D(Entity entity) { - x = ((int) entity.posX) >> 4; - z = ((int) entity.posZ) >> 4; - + x = (int) entity.posX >> 4; + z = (int) entity.posZ >> 4; dimensionId = entity.dimension; } @@ -52,7 +49,6 @@ public class Chunk3D { public Chunk3D(Coord4D coord) { x = coord.x >> 4; z = coord.z >> 4; - dimensionId = coord.dimensionId; } @@ -60,6 +56,7 @@ public class Chunk3D { * Whether or not this chunk exists in the given world. * * @param world - the world to check in + * * @return if the chunk exists */ public boolean exists(World world) { @@ -70,6 +67,7 @@ public class Chunk3D { * Gets a Chunk object corresponding to this Chunk3D's coordinates. * * @param world - the world to get the Chunk object from + * * @return the corresponding Chunk object */ public Chunk getChunk(World world) { @@ -97,10 +95,7 @@ public class Chunk3D { @Override public boolean equals(Object obj) { - return obj instanceof Chunk3D && - ((Chunk3D) obj).x == x && - ((Chunk3D) obj).z == z && - ((Chunk3D) obj).dimensionId == dimensionId; + return obj instanceof Chunk3D && ((Chunk3D) obj).x == x && ((Chunk3D) obj).z == z && ((Chunk3D) obj).dimensionId == dimensionId; } @Override @@ -111,4 +106,4 @@ public class Chunk3D { code = 31 * code + dimensionId; return code; } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/Coord4D.java b/src/main/java/mekanism/api/Coord4D.java index 83027fec0..48abe1125 100644 --- a/src/main/java/mekanism/api/Coord4D.java +++ b/src/main/java/mekanism/api/Coord4D.java @@ -19,8 +19,8 @@ import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint; /** - * Coord4D - an integer-based way to keep track of and perform operations on blocks in a Minecraft-based environment. - * This also takes in account the dimension the coordinate is in. + * Coord4D - an integer-based way to keep track of and perform operations on blocks in a Minecraft-based environment. This also takes in account the dimension the + * coordinate is in. * * @author aidancbrady */ @@ -29,7 +29,6 @@ public class Coord4D { public int x; public int y; public int z; - public int dimensionId; /** @@ -41,23 +40,21 @@ public class Coord4D { this.x = (int) entity.posX; this.y = (int) entity.posY; this.z = (int) entity.posZ; - this.dimensionId = entity.world.provider.getDimension(); } /** * Creates a Coord4D from the defined x, y, z, and dimension values. * - * @param x - x coordinate - * @param y - y coordinate - * @param z - z coordinate + * @param x - x coordinate + * @param y - y coordinate + * @param z - z coordinate * @param dimension - dimension ID */ public Coord4D(double x, double y, double z, int dimension) { this.x = MathHelper.floor(x); this.y = MathHelper.floor(y); this.z = MathHelper.floor(z); - this.dimensionId = dimension; } @@ -73,6 +70,7 @@ public class Coord4D { * Returns a new Coord4D from a defined TileEntity's x, y and z values. * * @param tileEntity - TileEntity at the location that will represent this Coord4D + * * @return the Coord4D object from the TileEntity */ public static Coord4D get(TileEntity tileEntity) { @@ -83,6 +81,7 @@ public class Coord4D { * Returns a new Coord4D from a tag compound. * * @param tag - tag compound to read from + * * @return the Coord4D from the tag compound */ public static Coord4D read(NBTTagCompound tag) { @@ -93,6 +92,7 @@ public class Coord4D { * Returns a new Coord4D from a ByteBuf. * * @param dataStream - data input to read from + * * @return the Coord4D from the data input */ public static Coord4D read(ByteBuf dataStream) { @@ -103,6 +103,7 @@ public class Coord4D { * Gets the state of the block representing this Coord4D. * * @param world - world this Coord4D is in + * * @return the state of this Coord4D's block */ public IBlockState getBlockState(IBlockAccess world) { @@ -122,13 +123,13 @@ public class Coord4D { * Gets the TileEntity of the block representing this Coord4D. * * @param world - world this Coord4D is in + * * @return the TileEntity of this Coord4D's block */ public TileEntity getTileEntity(IBlockAccess world) { if (world instanceof World && !exists((World) world)) { return null; } - return world.getTileEntity(getPos()); } @@ -136,13 +137,13 @@ public class Coord4D { * Gets the Block value of the block representing this Coord4D. * * @param world - world this Coord4D is in + * * @return the Block value of this Coord4D's block */ public Block getBlock(IBlockAccess world) { if (world instanceof World && !exists((World) world)) { return null; } - return getBlockState(world).getBlock(); } @@ -150,6 +151,7 @@ public class Coord4D { * Writes this Coord4D's data to an NBTTagCompound. * * @param nbtTags - tag compound to write to + * * @return the tag compound with this Coord4D's data */ public NBTTagCompound write(NBTTagCompound nbtTags) { @@ -157,7 +159,6 @@ public class Coord4D { nbtTags.setInteger("y", y); nbtTags.setInteger("z", z); nbtTags.setInteger("dimensionId", dimensionId); - return nbtTags; } @@ -199,6 +200,7 @@ public class Coord4D { * @param x - x value to translate * @param y - y value to translate * @param z - z value to translate + * * @return translated Coord4D */ public Coord4D translate(int x, int y, int z) { @@ -209,6 +211,7 @@ public class Coord4D { * Translates this Coord4D by the defined Coord4D's coordinates, regardless of dimension. * * @param coord - coordinates to translate by + * * @return translated Coord4D */ public Coord4D translate(Coord4D coord) { @@ -219,6 +222,7 @@ public class Coord4D { * Creates and returns a new Coord4D translated to the defined offsets of the side. * * @param side - side to translate this Coord4D to + * * @return translated Coord4D */ public Coord4D offset(EnumFacing side) { @@ -228,26 +232,23 @@ public class Coord4D { /** * Creates and returns a new Coord4D translated to the defined offsets of the side by the defined amount. * - * @param side - side to translate this Coord4D to + * @param side - side to translate this Coord4D to * @param amount - how far to translate this Coord4D + * * @return translated Coord4D */ public Coord4D offset(EnumFacing side, int amount) { if (side == null || amount == 0) { return this; } - - return new Coord4D(x + (side.getXOffset() * amount), y + (side.getYOffset() * amount), - z + (side.getZOffset() * amount), dimensionId); + return new Coord4D(x + (side.getXOffset() * amount), y + (side.getYOffset() * amount), z + (side.getZOffset() * amount), dimensionId); } public ItemStack getStack(IBlockAccess world) { IBlockState state = getBlockState(world); - if (state == null || state.getBlock().isAir(state, world, null)) { return ItemStack.EMPTY; } - return new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)); } @@ -255,6 +256,7 @@ public class Coord4D { * Creates and returns a new Coord4D with values representing the difference between the defined Coord4D * * @param other - the Coord4D to subtract from this + * * @return a Coord4D representing the distance between the defined Coord4D */ public Coord4D difference(Coord4D other) { @@ -262,21 +264,19 @@ public class Coord4D { } /** - * A method used to find the EnumFacing represented by the distance of the defined Coord4D. Most likely won't have - * many applicable uses. + * A method used to find the EnumFacing represented by the distance of the defined Coord4D. Most likely won't have many applicable uses. * * @param other - Coord4D to find the side difference of + * * @return EnumFacing representing the side the defined relative Coord4D is on to this */ public EnumFacing sideDifference(Coord4D other) { Coord4D diff = difference(other); - for (EnumFacing side : EnumFacing.VALUES) { if (side.getXOffset() == diff.x && side.getYOffset() == diff.y && side.getZOffset() == diff.z) { return side; } } - return null; } @@ -284,6 +284,7 @@ public class Coord4D { * Gets the distance to a defined Coord4D. * * @param obj - the Coord4D to find the distance to + * * @return the distance to the defined Coord4D */ public int distanceTo(Coord4D obj) { @@ -294,8 +295,9 @@ public class Coord4D { } /** - * @param side - side to check + * @param side - side to check * @param world - world this Coord4D is in + * * @return Whether or not the defined side of this Coord4D is visible. */ public boolean sideVisible(EnumFacing side, IBlockAccess world) { @@ -306,6 +308,7 @@ public class Coord4D { * Gets a TargetPoint with the defined range from this Coord4D with the appropriate coordinates and dimension ID. * * @param range - the range the packet can be sent in of this Coord4D + * * @return TargetPoint relative to this Coord4D */ public TargetPoint getTargetPoint(double range) { @@ -316,6 +319,7 @@ public class Coord4D { * Steps this Coord4D in the defined side's offset without creating a new value. * * @param side - side to step towards + * * @return this Coord4D */ public Coord4D step(EnumFacing side) { @@ -326,17 +330,18 @@ public class Coord4D { * Whether or not the chunk this Coord4D is in exists and is loaded. * * @param world - world this Coord4D is in + * * @return the chunk of this Coord4D */ public boolean exists(World world) { - return world.isBlockLoaded(new BlockPos(x, y, - z));//world.getChunkProvider() == null || world.getChunkProvider().getLoadedChunk(x >> 4, z >> 4) != null; + return world.isBlockLoaded(new BlockPos(x, y, z));//world.getChunkProvider() == null || world.getChunkProvider().getLoadedChunk(x >> 4, z >> 4) != null; } /** * Gets the chunk this Coord4D is in. * * @param world - world this Coord4D is in + * * @return the chunk of this Coord4D */ public Chunk getChunk(World world) { @@ -356,6 +361,7 @@ public class Coord4D { * Whether or not the block this Coord4D represents is an air block. * * @param world - world this Coord4D is in + * * @return if this Coord4D is an air block */ public boolean isAirBlock(IBlockAccess world) { @@ -366,6 +372,7 @@ public class Coord4D { * Whether or not this block this Coord4D represents is replaceable. * * @param world - world this Coord4D is in + * * @return if this Coord4D is replaceable */ public boolean isReplaceable(World world) { @@ -393,11 +400,7 @@ public class Coord4D { @Override public boolean equals(Object obj) { - return obj instanceof Coord4D && - ((Coord4D) obj).x == x && - ((Coord4D) obj).y == y && - ((Coord4D) obj).z == z && - ((Coord4D) obj).dimensionId == dimensionId; + return obj instanceof Coord4D && ((Coord4D) obj).x == x && ((Coord4D) obj).y == y && ((Coord4D) obj).z == z && ((Coord4D) obj).dimensionId == dimensionId; } @Override @@ -409,4 +412,4 @@ public class Coord4D { code = 31 * code + dimensionId; return code; } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/EnumColor.java b/src/main/java/mekanism/api/EnumColor.java index 06fe34fcb..b596c095e 100644 --- a/src/main/java/mekanism/api/EnumColor.java +++ b/src/main/java/mekanism/api/EnumColor.java @@ -33,8 +33,8 @@ public enum EnumColor implements IStringSerializable { BROWN("\u00a76", "brown", "Brown", new int[]{150, 75, 0}, 3, TextFormatting.GOLD), BRIGHT_PINK("\u00a7d", "brightPink", "Pink", new int[]{255, 192, 203}, 9, TextFormatting.LIGHT_PURPLE); - public static EnumColor[] DYES = new EnumColor[]{BLACK, RED, DARK_GREEN, BROWN, DARK_BLUE, PURPLE, DARK_AQUA, GREY, - DARK_GREY, BRIGHT_PINK, BRIGHT_GREEN, YELLOW, INDIGO, PINK, ORANGE, WHITE}; + public static EnumColor[] DYES = new EnumColor[]{BLACK, RED, DARK_GREEN, BROWN, DARK_BLUE, PURPLE, DARK_AQUA, GREY, DARK_GREY, BRIGHT_PINK, BRIGHT_GREEN, YELLOW, + INDIGO, PINK, ORANGE, WHITE}; /** * The color code that will be displayed @@ -66,7 +66,6 @@ public enum EnumColor implements IStringSerializable { return c; } } - return null; } @@ -124,6 +123,7 @@ public enum EnumColor implements IStringSerializable { * Gets the 0-1 of this color's RGB value by dividing by 255 (used for OpenGL coloring). * * @param index - R:0, G:1, B:2 + * * @return the color value */ public float getColor(int index) { @@ -143,4 +143,4 @@ public enum EnumColor implements IStringSerializable { public String toString() { return code; } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IAlloyInteraction.java b/src/main/java/mekanism/api/IAlloyInteraction.java index c6e9b9eaf..7813a47dc 100644 --- a/src/main/java/mekanism/api/IAlloyInteraction.java +++ b/src/main/java/mekanism/api/IAlloyInteraction.java @@ -14,10 +14,10 @@ public interface IAlloyInteraction { /** * Called when a player right-clicks this block with an alloy. * - * @param player - the player right-clicking the block - * @param hand - the hand this alloy was right-clicked with - * @param stack - the stack of alloy being right-clicked + * @param player - the player right-clicking the block + * @param hand - the hand this alloy was right-clicked with + * @param stack - the stack of alloy being right-clicked * @param tierOrdinal - the ordinal tier of the alloy (1 = advanced, 2 = elite, 3 = ultimate) */ void onAlloyInteraction(EntityPlayer player, EnumHand hand, ItemStack stack, int tierOrdinal); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IClientTicker.java b/src/main/java/mekanism/api/IClientTicker.java index d53934e40..70b6d3aa3 100644 --- a/src/main/java/mekanism/api/IClientTicker.java +++ b/src/main/java/mekanism/api/IClientTicker.java @@ -5,4 +5,4 @@ public interface IClientTicker { void clientTick(); boolean needsTicks(); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IConfigCardAccess.java b/src/main/java/mekanism/api/IConfigCardAccess.java index 2d2c9a372..e5c7ec307 100644 --- a/src/main/java/mekanism/api/IConfigCardAccess.java +++ b/src/main/java/mekanism/api/IConfigCardAccess.java @@ -3,8 +3,7 @@ package mekanism.api; import net.minecraft.nbt.NBTTagCompound; /** - * Implement this in your TileEntity class if you wish for Mekanism filters to be able to store any of their - * information. + * Implement this in your TileEntity class if you wish for Mekanism filters to be able to store any of their information. * * @author aidancbrady */ @@ -16,12 +15,13 @@ public interface IConfigCardAccess { * Collects the TileEntity's filter card data into the parameterized NBTTagCompound. * * @param nbtTags - the NBTTagCompound of the filter card ItemStack + * * @return the NBTTagCompound that now contains the TileEntity's filter card data */ NBTTagCompound getConfigurationData(NBTTagCompound nbtTags); /** - * Retrieves the TileEntity's data contained in the filter card based on the given NBTTagCompopund. + * Retrieves the TileEntity's data contained in the filter card based on the given NBTTagCompound. * * @param nbtTags - the NBTTagCompound of the filter card ItemStack */ @@ -34,4 +34,4 @@ public interface IConfigCardAccess { */ String getDataType(); } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IConfigurable.java b/src/main/java/mekanism/api/IConfigurable.java index 57fbe5242..70f21d005 100644 --- a/src/main/java/mekanism/api/IConfigurable.java +++ b/src/main/java/mekanism/api/IConfigurable.java @@ -15,7 +15,8 @@ public interface IConfigurable { * Called when a player shift-right clicks this block with a Configurator. * * @param player - the player who clicked the block - * @param side - the side the block was clicked on + * @param side - the side the block was clicked on + * * @return action that was performed */ EnumActionResult onSneakRightClick(EntityPlayer player, EnumFacing side); @@ -24,8 +25,9 @@ public interface IConfigurable { * Called when a player right clicks this block with a Configurator. * * @param player - the player who clicked the block - * @param side - the side the block was clicked on + * @param side - the side the block was clicked on + * * @return action that was performed */ EnumActionResult onRightClick(EntityPlayer player, EnumFacing side); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IEvaporationSolar.java b/src/main/java/mekanism/api/IEvaporationSolar.java index 305ff7262..5f72a3d35 100644 --- a/src/main/java/mekanism/api/IEvaporationSolar.java +++ b/src/main/java/mekanism/api/IEvaporationSolar.java @@ -8,4 +8,4 @@ package mekanism.api; public interface IEvaporationSolar { boolean canSeeSun(); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IHeatTransfer.java b/src/main/java/mekanism/api/IHeatTransfer.java index 71938648a..1f7518385 100644 --- a/src/main/java/mekanism/api/IHeatTransfer.java +++ b/src/main/java/mekanism/api/IHeatTransfer.java @@ -29,4 +29,4 @@ public interface IHeatTransfer { boolean canConnectHeat(EnumFacing side); IHeatTransfer getAdjacent(EnumFacing side); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/IMekWrench.java b/src/main/java/mekanism/api/IMekWrench.java index 167f361c4..e36f10c2b 100644 --- a/src/main/java/mekanism/api/IMekWrench.java +++ b/src/main/java/mekanism/api/IMekWrench.java @@ -17,4 +17,4 @@ public interface IMekWrench { default void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace) { } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/MekanismAPI.java b/src/main/java/mekanism/api/MekanismAPI.java index 0660fd296..f5cff537d 100644 --- a/src/main/java/mekanism/api/MekanismAPI.java +++ b/src/main/java/mekanism/api/MekanismAPI.java @@ -34,9 +34,7 @@ public class MekanismAPI { if (cardboardBoxModIgnore.contains(Objects.requireNonNull(block.getRegistryName()).getNamespace())) { return false; } - - return cardboardBoxIgnore.stream() - .noneMatch(i -> i.block == block && (i.meta == OreDictionary.WILDCARD_VALUE || i.meta == meta)); + return cardboardBoxIgnore.stream().noneMatch(i -> i.block == block && (i.meta == OreDictionary.WILDCARD_VALUE || i.meta == meta)); } public static void addBoxBlacklist(@Nullable Block block, int meta) { @@ -118,4 +116,4 @@ public class MekanismAPI { removeBoxBlacklistMod(modid); } } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/MekanismRecipeHelper.java b/src/main/java/mekanism/api/MekanismRecipeHelper.java index 3882494fa..715136699 100644 --- a/src/main/java/mekanism/api/MekanismRecipeHelper.java +++ b/src/main/java/mekanism/api/MekanismRecipeHelper.java @@ -11,7 +11,7 @@ public interface MekanismRecipeHelper { /** * Add an Enrichment Chamber recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ void addEnrichmentChamberRecipe(ItemStack input, ItemStack output); @@ -19,7 +19,7 @@ public interface MekanismRecipeHelper { /** * Add an Osmium Compressor recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ void addOsmiumCompressorRecipe(ItemStack input, ItemStack output); @@ -27,7 +27,7 @@ public interface MekanismRecipeHelper { /** * Add a Combiner recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ @Deprecated @@ -36,8 +36,8 @@ public interface MekanismRecipeHelper { /** * Add a Combiner recipe. * - * @param input - input ItemStack - * @param extra - extra ItemStack + * @param input - input ItemStack + * @param extra - extra ItemStack * @param output - output ItemStack */ void addCombinerRecipe(ItemStack input, ItemStack extra, ItemStack output); @@ -45,7 +45,7 @@ public interface MekanismRecipeHelper { /** * Add a Crusher recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ void addCrusherRecipe(ItemStack input, ItemStack output); @@ -53,7 +53,7 @@ public interface MekanismRecipeHelper { /** * Add a Purification Chamber recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ void addPurificationChamberRecipe(ItemStack input, ItemStack output); @@ -63,7 +63,7 @@ public interface MekanismRecipeHelper { * * @param infuse - which Infuse to use * @param amount - how much of the Infuse to use - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ void addMetallurgicInfuserRecipe(InfuseType infuse, int amount, ItemStack input, ItemStack output); @@ -71,16 +71,16 @@ public interface MekanismRecipeHelper { /** * Add a Chemical Infuser recipe. * - * @param leftInput - left GasStack to input + * @param leftInput - left GasStack to input * @param rightInput - right GasStack to input - * @param output - output GasStack + * @param output - output GasStack */ void addChemicalInfuserRecipe(GasStack leftInput, GasStack rightInput, GasStack output); /** * Add a Chemical Oxidizer recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output GasStack */ void addChemicalOxidizerRecipe(ItemStack input, GasStack output); @@ -88,7 +88,7 @@ public interface MekanismRecipeHelper { /** * Add a Chemical Injection Chamber recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output ItemStack */ void addChemicalInjectionChamberRecipe(ItemStack input, Gas gas, ItemStack output); @@ -96,8 +96,8 @@ public interface MekanismRecipeHelper { /** * Add an Electrolytic Separator recipe. * - * @param fluid - FluidStack to electrolyze - * @param leftOutput - left gas to produce when the fluid is electrolyzed + * @param fluid - FluidStack to electrolyze + * @param leftOutput - left gas to produce when the fluid is electrolyzed * @param rightOutput - right gas to produce when the fluid is electrolyzed */ void addElectrolyticSeparatorRecipe(FluidStack fluid, double energy, GasStack leftOutput, GasStack rightOutput); @@ -105,17 +105,17 @@ public interface MekanismRecipeHelper { /** * Add a Precision Sawmill recipe. * - * @param input - input ItemStack - * @param primaryOutput - guaranteed output + * @param input - input ItemStack + * @param primaryOutput - guaranteed output * @param secondaryOutput - possible extra output - * @param chance - probability of obtaining extra output + * @param chance - probability of obtaining extra output */ void addPrecisionSawmillRecipe(ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, double chance); /** * Add a Precision Sawmill recipe with no chance output * - * @param input - input ItemStack + * @param input - input ItemStack * @param primaryOutput - guaranteed output */ void addPrecisionSawmillRecipe(ItemStack input, ItemStack primaryOutput); @@ -123,7 +123,7 @@ public interface MekanismRecipeHelper { /** * Add a Chemical Dissolution Chamber recipe. * - * @param input - input ItemStack + * @param input - input ItemStack * @param output - output GasStack */ void addChemicalDissolutionChamberRecipe(ItemStack input, GasStack output); @@ -131,7 +131,7 @@ public interface MekanismRecipeHelper { /** * Add a Chemical Washer recipe. * - * @param input - input GasStack + * @param input - input GasStack * @param output - output GasStack */ void addChemicalWasherRecipe(GasStack input, GasStack output); @@ -139,7 +139,7 @@ public interface MekanismRecipeHelper { /** * Add a Chemical Crystallizer recipe. * - * @param input - input GasStack + * @param input - input GasStack * @param output - output ItemStack */ void addChemicalCrystallizerRecipe(GasStack input, ItemStack output); @@ -147,13 +147,13 @@ public interface MekanismRecipeHelper { /** * Add a Pressurized Reaction Chamber recipe. * - * @param inputSolid - input ItemStack - * @param inputFluid - input FluidStack - * @param inputGas - input GasStack + * @param inputSolid - input ItemStack + * @param inputFluid - input FluidStack + * @param inputGas - input GasStack * @param outputSolid - output ItemStack - * @param outputGas - output GasStack + * @param outputGas - output GasStack * @param extraEnergy - extra energy needed by the recipe - * @param ticks - amount of ticks it takes for this recipe to complete + * @param ticks - amount of ticks it takes for this recipe to complete */ void addPRCRecipe(ItemStack inputSolid, FluidStack inputFluid, GasStack inputGas, ItemStack outputSolid, GasStack outputGas, double extraEnergy, int ticks); @@ -161,4 +161,4 @@ public interface MekanismRecipeHelper { void addThermalEvaporationRecipe(FluidStack inputFluid, FluidStack outputFluid); void addSolarNeutronRecipe(GasStack inputGas, GasStack outputGas); -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/Pos3D.java b/src/main/java/mekanism/api/Pos3D.java index 86817ff57..58ff51afc 100644 --- a/src/main/java/mekanism/api/Pos3D.java +++ b/src/main/java/mekanism/api/Pos3D.java @@ -65,6 +65,7 @@ public class Pos3D extends Vec3d { * Returns a new Pos3D from a tag compound. * * @param tag - tag compound to read from + * * @return the Pos3D from the tag compound */ public static Pos3D read(NBTTagCompound tag) { @@ -75,6 +76,7 @@ public class Pos3D extends Vec3d { * Creates a new Pos3D from the motion of an entity. * * @param entity Entitiy to get the motion from + * * @return Pos3D representing the motion of the given entity */ public static Pos3D fromMotion(Entity entity) { @@ -85,7 +87,6 @@ public class Pos3D extends Vec3d { double x = translation.x * matrix[0] + translation.y * matrix[1] + translation.z * matrix[2] + matrix[3]; double y = translation.x * matrix[4] + translation.y * matrix[5] + translation.z * matrix[6] + matrix[7]; double z = translation.x * matrix[8] + translation.y * matrix[9] + translation.z * matrix[10] + matrix[11]; - return new Pos3D(x, y, z); } @@ -112,21 +113,21 @@ public class Pos3D extends Vec3d { * Writes this Pos3D's data to an NBTTagCompound. * * @param nbtTags - tag compound to write to + * * @return the tag compound with this Pos3D's data */ public NBTTagCompound write(NBTTagCompound nbtTags) { nbtTags.setDouble("x", x); nbtTags.setDouble("y", y); nbtTags.setDouble("z", z); - return nbtTags; } /** - * Creates and returns a Pos3D with values representing the difference between this and the Pos3D in the - * parameters. + * Creates and returns a Pos3D with values representing the difference between this and the Pos3D in the parameters. * * @param vec - Vec3 to subtract + * * @return difference of the two Pos3Ds */ public Pos3D diff(Vec3d vec) { @@ -137,6 +138,7 @@ public class Pos3D extends Vec3d { * Creates a new Coord4D representing this Pos3D in the provided dimension. * * @param dimensionId - the dimension this Pos3D is in + * * @return Coord4D representing this Pos3D */ public Coord4D getCoord(int dimensionId) { @@ -156,6 +158,7 @@ public class Pos3D extends Vec3d { * @param x - amount to translate on the x axis * @param y - amount to translate on the y axis * @param z - amount to translate on the z axis + * * @return the translated Pos3D */ public Pos3D translate(double x, double y, double z) { @@ -166,6 +169,7 @@ public class Pos3D extends Vec3d { * Performs the same operation as translate(x, y, z), but with a Pos3D value instead. * * @param pos - Pos3D value to translate by + * * @return translated Pos3D */ public Pos3D translate(Vec3d pos) { @@ -176,8 +180,7 @@ public class Pos3D extends Vec3d { * Performs the same operation as translate(x, y, z), but by a set amount in a EnumFacing */ public Pos3D translate(EnumFacing direction, double amount) { - return translate(direction.getDirectionVec().getX() * amount, direction.getDirectionVec().getY() * amount, - direction.getDirectionVec().getZ() * amount); + return translate(direction.getDirectionVec().getX() * amount, direction.getDirectionVec().getY() * amount, direction.getDirectionVec().getZ() * amount); } /** @@ -194,7 +197,6 @@ public class Pos3D extends Vec3d { if (direction.getAxis() != Axis.Z) { zPos += amount; } - return new Pos3D(xPos, yPos, zPos); } @@ -202,6 +204,7 @@ public class Pos3D extends Vec3d { * Returns the distance between this and the defined Pos3D. * * @param pos - the Pos3D to find the distance to + * * @return the distance between this and the defined Pos3D */ public double distance(Vec3d pos) { @@ -215,21 +218,19 @@ public class Pos3D extends Vec3d { * Rotates this Pos3D by the defined yaw value. * * @param yaw - yaw to rotate by + * * @return rotated Pos3D */ @Nonnull @Override public Pos3D rotateYaw(float yaw) { double yawRadians = Math.toRadians(yaw); - double xPos = x; double zPos = z; - if (yaw != 0) { xPos = x * Math.cos(yawRadians) - z * Math.sin(yawRadians); zPos = z * Math.cos(yawRadians) + x * Math.sin(yawRadians); } - return new Pos3D(xPos, y, zPos); } @@ -237,15 +238,12 @@ public class Pos3D extends Vec3d { @Override public Pos3D rotatePitch(float pitch) { double pitchRadians = Math.toRadians(pitch); - double yPos = y; double zPos = z; - if (pitch != 0) { yPos = y * Math.cos(pitchRadians) - z * Math.sin(pitchRadians); zPos = z * Math.cos(pitchRadians) + y * Math.sin(pitchRadians); } - return new Pos3D(x, yPos, zPos); } @@ -259,16 +257,12 @@ public class Pos3D extends Vec3d { double rollRadians = Math.toRadians(roll); double xPos = x * Math.cos(yawRadians) * Math.cos(pitchRadians) + z * ( - Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) - Math.sin(yawRadians) * Math - .cos(rollRadians)) + y * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) - + Math.sin(yawRadians) * Math.sin(rollRadians)); + Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) - Math.sin(yawRadians) * Math.cos(rollRadians)) + + y * (Math.cos(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) + Math.sin(yawRadians) * Math.sin(rollRadians)); double zPos = x * Math.sin(yawRadians) * Math.cos(pitchRadians) + z * ( - Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) + Math.cos(yawRadians) * Math - .cos(rollRadians)) + y * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) - - Math.cos(yawRadians) * Math.sin(rollRadians)); - double yPos = -x * Math.sin(pitchRadians) + z * Math.cos(pitchRadians) * Math.sin(rollRadians) + y * Math - .cos(pitchRadians) * Math.cos(rollRadians); - + Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.sin(rollRadians) + Math.cos(yawRadians) * Math.cos(rollRadians)) + + y * (Math.sin(yawRadians) * Math.sin(pitchRadians) * Math.cos(rollRadians) - Math.cos(yawRadians) * Math.sin(rollRadians)); + double yPos = -x * Math.sin(pitchRadians) + z * Math.cos(pitchRadians) * Math.sin(rollRadians) + y * Math.cos(pitchRadians) * Math.cos(rollRadians); return new Pos3D(xPos, yPos, zPos); } @@ -282,6 +276,7 @@ public class Pos3D extends Vec3d { * @param x - x value to scale by * @param y - y value to scale by * @param z - z value to scale by + * * @return scaled Pos3D */ public Pos3D scale(double x, double y, double z) { @@ -312,17 +307,16 @@ public class Pos3D extends Vec3d { float ocos = 1.0F - cos; float sin = (float) Math.sin(angle); - matrix[0] = (x * x * ocos + cos); - matrix[1] = (y * x * ocos + z * sin); - matrix[2] = (x * z * ocos - y * sin); - matrix[4] = (x * y * ocos - z * sin); - matrix[5] = (y * y * ocos + cos); - matrix[6] = (y * z * ocos + x * sin); - matrix[8] = (x * z * ocos + y * sin); - matrix[9] = (y * z * ocos - x * sin); - matrix[10] = (z * z * ocos + cos); + matrix[0] = x * x * ocos + cos; + matrix[1] = y * x * ocos + z * sin; + matrix[2] = x * z * ocos - y * sin; + matrix[4] = x * y * ocos - z * sin; + matrix[5] = y * y * ocos + cos; + matrix[6] = y * z * ocos + x * sin; + matrix[8] = x * z * ocos + y * sin; + matrix[9] = y * z * ocos - x * sin; + matrix[10] = z * z * ocos + cos; matrix[15] = 1.0F; - return matrix; } @@ -345,11 +339,7 @@ public class Pos3D extends Vec3d { } public Pos3D getPerpendicular() { - if (z == 0) { - return zCrossProduct(); - } - - return xCrossProduct(); + return z == 0 ? zCrossProduct() : xCrossProduct(); } public Pos3D floor() { @@ -369,10 +359,7 @@ public class Pos3D extends Vec3d { @Override public boolean equals(Object obj) { - return obj instanceof Vec3d && - ((Vec3d) obj).x == x && - ((Vec3d) obj).y == y && - ((Vec3d) obj).z == z; + return obj instanceof Vec3d && ((Vec3d) obj).x == x && ((Vec3d) obj).y == y && ((Vec3d) obj).z == z; } @Override @@ -383,4 +370,4 @@ public class Pos3D extends Vec3d { code = 31 * code + new Double(z).hashCode(); return code; } -} +} \ No newline at end of file diff --git a/src/main/java/mekanism/api/Range4D.java b/src/main/java/mekanism/api/Range4D.java index f27c10cf1..350bfe457 100644 --- a/src/main/java/mekanism/api/Range4D.java +++ b/src/main/java/mekanism/api/Range4D.java @@ -8,7 +8,6 @@ import net.minecraftforge.fml.common.FMLCommonHandler; public class Range4D { public int dimensionId; - public int xMin; public int yMin; public int zMin; @@ -23,7 +22,6 @@ public class Range4D { xMax = maxX; yMax = maxY; zMax = maxZ; - dimensionId = dimension; } @@ -34,7 +32,6 @@ public class Range4D { xMax = xMin + 16; yMax = 255; zMax = zMin + 16; - dimensionId = chunk.dimensionId; } @@ -42,17 +39,14 @@ public class Range4D { xMin = coord.x; yMin = coord.y; zMin = coord.z; - xMax = coord.x + 1; yMax = coord.y + 1; zMax = coord.z + 1; - dimensionId = coord.dimensionId; } public static Range4D getChunkRange(EntityPlayer player) { int radius = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getViewDistance(); - return new Range4D(new Chunk3D(player)).expandChunks(radius); } @@ -61,7 +55,6 @@ public class Range4D { xMax += chunks * 16; zMin -= chunks * 16; zMax += chunks * 16; - return this; } @@ -70,26 +63,22 @@ public class Range4D { xMax += radius; zMin -= radius; zMax += radius; - return this; } public Set