From fba2cfcd8d0dbdc50fb33ccd95652f694a05cc5b Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Wed, 9 Oct 2013 12:25:34 -0400 Subject: [PATCH] Auto-Sync --- src/com/builtbroken/common/Group.java | 2 +- src/com/builtbroken/common/Pair.java | 2 +- src/com/builtbroken/common/User.java | 2 +- .../common/science/ChemElement.java | 2 +- .../common/science/FormulaHelper.java | 11 ++++---- .../common/science/units/ElectricUnit.java | 2 +- .../common/science/units/ForceUnit.java | 8 ++++-- .../common/science/units/ImperialUnits.java | 8 +++--- .../common/science/units/MetricUnit.java | 4 +-- .../common/science/units/PressureUnit.java | 2 +- .../common/science/units/TemperatureUnit.java | 12 +++++++-- .../common/science/units/UnitHelper.java | 2 +- src/dark/api/ISpecialAccess.java | 1 - src/dark/api/TerminalGroup.java | 5 +--- src/dark/api/TerminalUser.java | 2 +- src/dark/api/energy/ExtraBlockData.java | 2 +- .../core/common/machines/BlockHeater.java | 6 ++--- .../machines/TileEntityCoalGenerator.java | 6 +---- .../common/machines/TileEntityHeatCouple.java | 2 +- src/dark/core/prefab/helpers/FluidHelper.java | 25 +++++++++---------- 20 files changed, 54 insertions(+), 52 deletions(-) diff --git a/src/com/builtbroken/common/Group.java b/src/com/builtbroken/common/Group.java index b4e33874b..c291682cc 100644 --- a/src/com/builtbroken/common/Group.java +++ b/src/com/builtbroken/common/Group.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; /** Generic class for link objects of the same class type to each other. - * + * * @author Robert Seifert */ public class Group { diff --git a/src/com/builtbroken/common/Pair.java b/src/com/builtbroken/common/Pair.java index 00678d129..98282acb7 100644 --- a/src/com/builtbroken/common/Pair.java +++ b/src/com/builtbroken/common/Pair.java @@ -1,7 +1,7 @@ package com.builtbroken.common; /** Container for two objects - * + * * @author Robert Seifert */ public class Pair { diff --git a/src/com/builtbroken/common/User.java b/src/com/builtbroken/common/User.java index bf87fd94c..e6aa75486 100644 --- a/src/com/builtbroken/common/User.java +++ b/src/com/builtbroken/common/User.java @@ -1,7 +1,7 @@ package com.builtbroken.common; /** Class to track a user. Mainly used to create groups of users - * + * * @author Robert Seifert */ public class User { diff --git a/src/com/builtbroken/common/science/ChemElement.java b/src/com/builtbroken/common/science/ChemElement.java index 4dbd0b4f7..4c337bd1c 100644 --- a/src/com/builtbroken/common/science/ChemElement.java +++ b/src/com/builtbroken/common/science/ChemElement.java @@ -4,7 +4,7 @@ package com.builtbroken.common.science; * parts but each element should have a listed names, symbol, and atomic mass. Atomic number should * be the placement # in the list. Var ZERO should not be used as its designed to offset the * placement of all elements by one. As well is returned instead of null. - * + * * @Source http://www.periodictable.com/Properties/A/SpecificHeat.an.html * @source http://www.chemicalelements.com/ * @source http://www.lenntech.com/periodic/periodic-chart.htm diff --git a/src/com/builtbroken/common/science/FormulaHelper.java b/src/com/builtbroken/common/science/FormulaHelper.java index e2904b88e..ff928f58c 100644 --- a/src/com/builtbroken/common/science/FormulaHelper.java +++ b/src/com/builtbroken/common/science/FormulaHelper.java @@ -1,22 +1,21 @@ package com.builtbroken.common.science; /** Helper class that does the work of basic formulas. - * + * * @Note: Unless stated other wise the formulas don't care what the units are as long as the match * up. Eg pressure can be in any unit as long as all pressures for the method are the same unit - * + * * @Note: Some of these methods are very simple but they remove the confusion involved in rewriting * the code for each use - * + * * @author Robert Seifert */ public class FormulaHelper { public static final float ACCELERATION_EARTH = 9.80665f; public static final float ACCELERATION_MOON = 1.622f; - /** Gay-Lussac's Law (P1/T1 = P2/T2) - * + * * @param pressure - original pressure * @param temp - original tempature * @param newTemp - new tempature @@ -42,7 +41,7 @@ public class FormulaHelper } /** Calculates change from original value to new value - * + * * @param a - original value * @param b - new value * @return change in value from original to new */ diff --git a/src/com/builtbroken/common/science/units/ElectricUnit.java b/src/com/builtbroken/common/science/units/ElectricUnit.java index 2c6282d03..49c455d61 100644 --- a/src/com/builtbroken/common/science/units/ElectricUnit.java +++ b/src/com/builtbroken/common/science/units/ElectricUnit.java @@ -1,7 +1,7 @@ package com.builtbroken.common.science.units; /** Units of measure for work with electricity - * + * * @author Robert Seifert */ public enum ElectricUnit { diff --git a/src/com/builtbroken/common/science/units/ForceUnit.java b/src/com/builtbroken/common/science/units/ForceUnit.java index daf06b821..ed7509ecc 100644 --- a/src/com/builtbroken/common/science/units/ForceUnit.java +++ b/src/com/builtbroken/common/science/units/ForceUnit.java @@ -1,9 +1,13 @@ package com.builtbroken.common.science.units; /** Units of measure for force - * + * * @author Rsobert Seifert */ public enum ForceUnit { - N(), dyn(), kp(), Ib(), pdl(); + N(), + dyn(), + kp(), + Ib(), + pdl(); } diff --git a/src/com/builtbroken/common/science/units/ImperialUnits.java b/src/com/builtbroken/common/science/units/ImperialUnits.java index c0c7f76ba..0c30b81e8 100644 --- a/src/com/builtbroken/common/science/units/ImperialUnits.java +++ b/src/com/builtbroken/common/science/units/ImperialUnits.java @@ -4,8 +4,8 @@ package com.builtbroken.common.science.units; * @author Robert Seifert */ public enum ImperialUnits { - thou("thou", "th", (float) (1 / 12000)), - inch("inch", "in", (float) (1 / 12)), + thou("thou", "th", (1 / 12000)), + inch("inch", "in", (1 / 12)), foot("foot", "ft", 1), yard("yard", "yd", 3), chain("chain", "ch", 66), @@ -23,9 +23,9 @@ public enum ImperialUnits nautical("nautical mile", "", 6080), /** Gunter's sruvey unit */ - link("link", "", (float) (66 / 100)), + link("link", "", (66 / 100)), /** Gunter's sruvey unit */ - rod("rod", "", (float) (66 / 4)); + rod("rod", "", (66 / 4)); public String name, symbol; float toFeet; diff --git a/src/com/builtbroken/common/science/units/MetricUnit.java b/src/com/builtbroken/common/science/units/MetricUnit.java index 62b171b94..1bcbd1ede 100644 --- a/src/com/builtbroken/common/science/units/MetricUnit.java +++ b/src/com/builtbroken/common/science/units/MetricUnit.java @@ -1,7 +1,7 @@ package com.builtbroken.common.science.units; /** Metric measurement system units - * + * * @author Robert Seifert */ public enum MetricUnit { @@ -112,7 +112,7 @@ public enum MetricUnit } /** Rounds a number to a specific number place places - * + * * @param The number * @return The rounded number */ public static double roundDecimals(double d, int decimalPlaces) diff --git a/src/com/builtbroken/common/science/units/PressureUnit.java b/src/com/builtbroken/common/science/units/PressureUnit.java index adf5e6e48..bb86fd665 100644 --- a/src/com/builtbroken/common/science/units/PressureUnit.java +++ b/src/com/builtbroken/common/science/units/PressureUnit.java @@ -1,7 +1,7 @@ package com.builtbroken.common.science.units; /** Enum that stores common units used to measure pressure. - * + * * @source http://en.wikipedia.org/wiki/Atmosphere_(unit) * @source http://en.wikipedia.org/wiki/Dyne * @Source http://en.wikipedia.org/wiki/Kilogram-force diff --git a/src/com/builtbroken/common/science/units/TemperatureUnit.java b/src/com/builtbroken/common/science/units/TemperatureUnit.java index 0c28f53ec..1e99a257f 100644 --- a/src/com/builtbroken/common/science/units/TemperatureUnit.java +++ b/src/com/builtbroken/common/science/units/TemperatureUnit.java @@ -1,17 +1,19 @@ package com.builtbroken.common.science.units; /** Units of measure for temperature - * + * * @author Robert Seifert */ public enum TemperatureUnit { Fahrenheit("Fahrenheit", "F", new ITempConversion() { + @Override public float toKelvin(float temp) { return (float) ((temp + 459.67) * (5 / 9)); } + @Override public float fromKelvin(float temp) { return (float) ((temp * (9 / 5)) - 459.67); @@ -20,11 +22,13 @@ public enum TemperatureUnit }), Celsius("Celsius", "C", new ITempConversion() { + @Override public float toKelvin(float temp) { return (float) (temp + 273.15); } + @Override public float fromKelvin(float temp) { return (float) (temp - 273.15); @@ -33,11 +37,13 @@ public enum TemperatureUnit }), Rankine("Rankine", "R", new ITempConversion() { + @Override public float toKelvin(float temp) { - return (float) (temp * (5 / 9)); + return (temp * (5 / 9)); } + @Override public float fromKelvin(float temp) { return temp * (9 / 5); @@ -46,11 +52,13 @@ public enum TemperatureUnit }), Kelvin("Degrees", "F", new ITempConversion() { + @Override public float toKelvin(float temp) { return temp; } + @Override public float fromKelvin(float temp) { return temp; diff --git a/src/com/builtbroken/common/science/units/UnitHelper.java b/src/com/builtbroken/common/science/units/UnitHelper.java index afc85cb54..e02ed2b27 100644 --- a/src/com/builtbroken/common/science/units/UnitHelper.java +++ b/src/com/builtbroken/common/science/units/UnitHelper.java @@ -10,7 +10,7 @@ public class UnitHelper public static final float FEET_TO_METERS = 0.3048f; public static final float METERS_TO_FEET = 3.28084f; - public static List numbers = new ArrayList<>(); + public static List numbers = new ArrayList(); static { diff --git a/src/dark/api/ISpecialAccess.java b/src/dark/api/ISpecialAccess.java index 29dfdb8ad..921873b71 100644 --- a/src/dark/api/ISpecialAccess.java +++ b/src/dark/api/ISpecialAccess.java @@ -2,7 +2,6 @@ package dark.api; import java.util.List; - /** Used by any object that needs to restrict access to it by a set of usernames * * @author DarkGuardsman */ diff --git a/src/dark/api/TerminalGroup.java b/src/dark/api/TerminalGroup.java index e6450ecc7..f8e43bdfa 100644 --- a/src/dark/api/TerminalGroup.java +++ b/src/dark/api/TerminalGroup.java @@ -1,8 +1,5 @@ package dark.api; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -10,7 +7,7 @@ import com.builtbroken.common.Group; /** Used by a terminal to track what users are part of each group. As well used to setup access * points to the terminal. - * + * * @author DarkGuardsman */ public class TerminalGroup extends Group { diff --git a/src/dark/api/TerminalUser.java b/src/dark/api/TerminalUser.java index f1fca1e12..a5528aca8 100644 --- a/src/dark/api/TerminalUser.java +++ b/src/dark/api/TerminalUser.java @@ -6,7 +6,7 @@ import net.minecraft.nbt.NBTTagCompound; import com.builtbroken.common.User; /** Used to define a users access to a terminal based object. - * + * * @author DarkGuardsman */ public class TerminalUser extends User { diff --git a/src/dark/api/energy/ExtraBlockData.java b/src/dark/api/energy/ExtraBlockData.java index 70d786731..1b613b4d4 100644 --- a/src/dark/api/energy/ExtraBlockData.java +++ b/src/dark/api/energy/ExtraBlockData.java @@ -9,7 +9,7 @@ import com.builtbroken.common.Pair; /** Information about block not provided by minecraft such as density, mass, volume, tempature, etc * etc - * + * * @author DarkGuardsman */ public class ExtraBlockData { diff --git a/src/dark/core/common/machines/BlockHeater.java b/src/dark/core/common/machines/BlockHeater.java index 59e98d91f..c8dcbe419 100644 --- a/src/dark/core/common/machines/BlockHeater.java +++ b/src/dark/core/common/machines/BlockHeater.java @@ -3,8 +3,6 @@ package dark.core.common.machines; import java.util.List; import java.util.Set; -import com.builtbroken.common.Pair; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -13,6 +11,9 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.Configuration; + +import com.builtbroken.common.Pair; + import dark.core.common.CommonProxy; import dark.core.common.DarkMain; import dark.core.prefab.machine.BlockMachine; @@ -21,7 +22,6 @@ import dark.core.registration.ModObjectRegistry.BlockBuildData; public class BlockHeater extends BlockMachine { - public BlockHeater(BlockBuildData data) { super(data); diff --git a/src/dark/core/common/machines/TileEntityCoalGenerator.java b/src/dark/core/common/machines/TileEntityCoalGenerator.java index d37b0cd19..e445cfe2a 100644 --- a/src/dark/core/common/machines/TileEntityCoalGenerator.java +++ b/src/dark/core/common/machines/TileEntityCoalGenerator.java @@ -1,14 +1,10 @@ package dark.core.common.machines; import java.util.EnumSet; -import java.util.HashSet; -import java.util.Set; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.electricity.ElectricityPack; @@ -69,7 +65,7 @@ public class TileEntityCoalGenerator extends TileEntityEnergyMachine this.generateWatts = Math.max(this.generateWatts - BASE_DECCELERATION, 0); } - if(this.generateWatts >= MIN_GENERATE_WATTS) + if (this.generateWatts >= MIN_GENERATE_WATTS) { this.produceAllSides(); } diff --git a/src/dark/core/common/machines/TileEntityHeatCouple.java b/src/dark/core/common/machines/TileEntityHeatCouple.java index 9f561b3a1..11331403e 100644 --- a/src/dark/core/common/machines/TileEntityHeatCouple.java +++ b/src/dark/core/common/machines/TileEntityHeatCouple.java @@ -3,7 +3,7 @@ package dark.core.common.machines; import dark.core.prefab.machine.TileEntityEnergyMachine; /** Machine that turns heat into usable electrical energy - * + * * @author DarkGuardsman */ public class TileEntityHeatCouple extends TileEntityEnergyMachine { diff --git a/src/dark/core/prefab/helpers/FluidHelper.java b/src/dark/core/prefab/helpers/FluidHelper.java index 5a1f60b61..4b28b9973 100644 --- a/src/dark/core/prefab/helpers/FluidHelper.java +++ b/src/dark/core/prefab/helpers/FluidHelper.java @@ -62,7 +62,7 @@ public class FluidHelper } /** Gets the block's fluid if it has one - * + * * @param world - world we are working in * @param vector - 3D location in world * @return @Fluid that the block is */ @@ -101,10 +101,10 @@ public class FluidHelper } /** Drains a block of fluid - * + * * @Note sets the block with a client update only. Doesn't tick the block allowing for better * placement of fluid that can flow infinitely - * + * * @param doDrain - do the action * @return FluidStack drained from the block */ public static FluidStack drainBlock(World world, Vector3 node, boolean doDrain) @@ -113,7 +113,7 @@ public class FluidHelper } /** Drains a block of fluid - * + * * @param doDrain - do the action * @param update - block update flag to use * @return FluidStack drained from the block */ @@ -212,9 +212,9 @@ public class FluidHelper } /** Helper method to fill a location with a fluid - * + * * Note: This does not update the block to prevent the liquid from flowing - * + * * @return */ public static int fillBlock(World world, Vector3 node, FluidStack stack, boolean doFill) { @@ -248,7 +248,7 @@ public class FluidHelper } /** Fills all instances of IFluidHandler surrounding the origin - * + * * @param stack - FluidStack that will be filled into the tanks * @param doFill - Actually perform the action or simulate action * @param ignore - ForgeDirections to ignore @@ -281,7 +281,7 @@ public class FluidHelper } /** Fills an instance of IFluidHandler in the given direction - * + * * @param stack - FluidStack to fill the tank will * @param doFill - Actually perform the action or simulate action * @param direction - direction to fill in from the origin @@ -299,6 +299,7 @@ public class FluidHelper /** Does all the work needed to fill or drain an item of fluid when a player clicks on the block. */ public static boolean playerActivatedFluidItem(World world, int x, int y, int z, EntityPlayer entityplayer, int side) { + //TODO add double click support similar to the crates in assembly line ItemStack current = entityplayer.inventory.getCurrentItem(); if (current != null && world.getBlockTileEntity(x, y, z) instanceof IFluidHandler) { @@ -309,9 +310,7 @@ public class FluidHelper if (liquid != null) { - int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true); - - if (qty != 0 && !entityplayer.capabilities.isCreativeMode) + if (tank.fill(ForgeDirection.UNKNOWN, liquid, true) != 0 && !entityplayer.capabilities.isCreativeMode) { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, AutoCraftingManager.consumeItem(current, 1)); } @@ -360,7 +359,7 @@ public class FluidHelper } /** Drains an item of fluid and fills the tank with what was drained - * + * * @param consumeItem - should it consume the item. Used mainly for creative mode players. This * does effect the return of the method * @return Item stack that would be returned if the item was drain of its fluid. Water bucket -> @@ -382,7 +381,7 @@ public class FluidHelper } /** Fills an item with fluid from the tank - * + * * @param consumeItem - should it consume the item. Used mainly for creative mode players. This * does effect the return of the method * @return Item stack that would be returned if the item was filled with fluid. empty bucket ->