aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/commands/CommandMath.java
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
commitae21012d216df71f31aed6fbc9d76215fc24ceed (patch)
treecc89accbe6ce5c04b72ed3c5e46b2a185f88be6a /src/Java/gtPlusPlus/core/commands/CommandMath.java
parentba89972a22a316030f8c3bd99974f915b1d7aefc (diff)
downloadGT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.gz
GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.bz2
GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.zip
+ New texture for the slow builders ring.
+ Added the Alkalus Disk. $ Fixed Frame Box Assembler Recipes. $ Fixed Missing 7Li material. $ Fixed Tiered Tanks not showing their capacity in the tooltip. $ Fixed tooltips for alloys containing Bronze or Steel. $ Fixed Clay Pipe Extruder Recipes. - Removed a handful of Plasma cells for misc. materials. % Changed the Industrial Coke Oven's tooltip, to better describe the input/output requirements. % Cleaned up The Entire Project.
Diffstat (limited to 'src/Java/gtPlusPlus/core/commands/CommandMath.java')
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandMath.java150
1 files changed, 75 insertions, 75 deletions
diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java
index b41745c660..966f73c589 100644
--- a/src/Java/gtPlusPlus/core/commands/CommandMath.java
+++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.commands;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.player.PlayerUtils;
-
import java.util.ArrayList;
import java.util.List;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.player.PlayerUtils;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
@@ -16,74 +15,75 @@ import net.minecraft.world.World;
public class CommandMath implements ICommand
-{
+{
private final List<String> aliases;
- protected String fullEntityName;
- protected Entity conjuredEntity;
+ protected String fullEntityName;
+ protected Entity conjuredEntity;
- public CommandMath()
- {
- aliases = new ArrayList<String>();
+ public CommandMath()
+ {
+ this.aliases = new ArrayList<>();
- aliases.add("hometele");
+ this.aliases.add("hometele");
- aliases.add("warphome");
+ this.aliases.add("warphome");
- }
+ }
- @Override
- public int compareTo(Object o)
- {
- return 0;
+ @Override
+ public int compareTo(final Object o)
+ {
+ return 0;
- }
+ }
- @Override
- public String getCommandName()
- {
- return "bed";
+ @Override
+ public String getCommandName()
+ {
+ return "bed";
- }
+ }
- @Override
- public String getCommandUsage(ICommandSender var1)
- {
- return "/bed [Teleports you to your bed for XP]";
+ @Override
+ public String getCommandUsage(final ICommandSender var1)
+ {
+ return "/bed [Teleports you to your bed for XP]";
- }
+ }
- @Override
- public List<String> getCommandAliases()
- {
+ @Override
+ public List<String> getCommandAliases()
+ {
return this.aliases;
- }
+ }
- public void processCommand(ICommandSender S, String[] argString)
- {
- World W = S.getEntityWorld();
- CommandUtils C = new CommandUtils();
- EntityPlayer P = C.getPlayer(S);
+ @Override
+ public void processCommand(final ICommandSender S, final String[] argString)
+ {
+ final World W = S.getEntityWorld();
+ final CommandUtils C = new CommandUtils();
+ final EntityPlayer P = C.getPlayer(S);
//System.out.println(P.getCommandSenderName());
//System.out.println(P.getDisplayName());
- if (W.isRemote)
+ if (W.isRemote)
- {
+ {
- System.out.println("Not processing on Client side");
+ System.out.println("Not processing on Client side");
- }
+ }
- else
+ else
- {
+ {
- System.out.println("Processing on Server side - Home Teleport engaged by: "+P.getDisplayName());
+ System.out.println("Processing on Server side - Home Teleport engaged by: "+P.getDisplayName());
- int XP_TOTAL = P.experienceTotal;
+ final int XP_TOTAL = P.experienceTotal;
Utils.LOG_WARNING("Total Xp:" + XP_TOTAL);
- ChunkCoordinates X = P.getPlayerCoordinates();
+ final ChunkCoordinates X = P.getPlayerCoordinates();
Utils.LOG_WARNING("Player Location: "+X);
ChunkCoordinates Y = null;
Utils.LOG_WARNING("Bed Location: "+Y);
@@ -91,7 +91,7 @@ public class CommandMath implements ICommand
if (P.getBedLocation(0) == null){
Y = W.getSpawnPoint();
Utils.LOG_WARNING("Spawn Location: "+Y);
- }
+ }
else if (P.getBedLocation(0) != null){
Y = P.getBedLocation(0);
Utils.LOG_WARNING("Bed Location: "+Y);
@@ -101,30 +101,30 @@ public class CommandMath implements ICommand
Utils.LOG_WARNING("Spawn Location: "+Y);
}
}
- catch(NullPointerException e) {
- PlayerUtils.messagePlayer(P, "You do not have a spawn, so...");
+ catch(final NullPointerException e) {
+ PlayerUtils.messagePlayer(P, "You do not have a spawn, so...");
}
if (Y == null) {
Y = W.getSpawnPoint();
Utils.LOG_WARNING("Spawn Location: "+Y);
}
- int x1 = X.posX;
+ final int x1 = X.posX;
Utils.LOG_WARNING("X1: "+x1);
- int x2 = Y.posX;
+ final int x2 = Y.posX;
Utils.LOG_WARNING("X2: "+x2);
- int y1 = X.posY;
+ final int y1 = X.posY;
Utils.LOG_WARNING("Y1: "+y1);
- int y2 = Y.posY;
+ final int y2 = Y.posY;
Utils.LOG_WARNING("Y2: "+y2);
- int z1 = X.posZ;
+ final int z1 = X.posZ;
Utils.LOG_WARNING("Z1: "+z1);
- int z2 = Y.posZ;
+ final int z2 = Y.posZ;
Utils.LOG_WARNING("Z2: "+z2);
- double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1));
- String xpCost = String.valueOf((int)(d*0.15));
+ final double d = Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1))+((z2-z1)*(z2-z1)));
+ final String xpCost = String.valueOf((int)(d*0.15));
Utils.LOG_WARNING("d:" + d);
Utils.LOG_WARNING("-----------------------------------------");
@@ -141,9 +141,9 @@ public class CommandMath implements ICommand
if ((XP_TOTAL-Float.valueOf(xpCost)) > 0){
- EntityXPOrb E = new EntityXPOrb(W, P.posX, P.posY + 1.62D - (double) P.yOffset, P.posZ, 1);
+ final EntityXPOrb E = new EntityXPOrb(W, P.posX, (P.posY + 1.62D) - P.yOffset, P.posZ, 1);
//E.moveTowards((double) Y.posX + 0.5D, (int) Y.posY + 3, (double) Y.posZ + 0.5D);
- E.setVelocity((double) Y.posX + 0.5D, (int) Y.posY + 0.1, (double) Y.posZ + 0.5D);
+ E.setVelocity(Y.posX + 0.5D, Y.posY + 0.1, Y.posZ + 0.5D);
W.spawnEntityInWorld(E);
W.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) P.posX, (int) P.posY, (int) P.posZ, 0);
P.setPositionAndUpdate(x2, y2+1, z2);
@@ -152,7 +152,7 @@ public class CommandMath implements ICommand
gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Distance Traveled | "+String.valueOf((int)(d)) + " Blocks & " + xpCost + "xp");
gregtech.api.util.GT_Utility.sendChatToPlayer(P, "You suddenly feel at home.");
P.experienceTotal = (int) (XP_TOTAL-Float.valueOf(xpCost));
- if (!xpCost.equals("0") && Float.valueOf(xpCost) > 0){
+ if (!xpCost.equals("0") && (Float.valueOf(xpCost) > 0)){
gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of "+xpCost+" xp.");
}
else if (xpCost.equals("0")){
@@ -168,34 +168,34 @@ public class CommandMath implements ICommand
}
}
- }
+ }
- @Override
- public boolean canCommandSenderUseCommand(ICommandSender var1)
- {
+ @Override
+ public boolean canCommandSenderUseCommand(final ICommandSender var1)
+ {
return true;
- }
+ }
- @Override
- public List<?> addTabCompletionOptions(ICommandSender var1, String[] var2)
- {
- // TODO Auto-generated method stub
+ @Override
+ public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2)
+ {
+ // TODO Auto-generated method stub
- return null;
+ return null;
- }
+ }
- @Override
- public boolean isUsernameIndex(String[] var1, int var2)
- {
- // TODO Auto-generated method stub
+ @Override
+ public boolean isUsernameIndex(final String[] var1, final int var2)
+ {
+ // TODO Auto-generated method stub
return false;
}
- public boolean playerUsesCommand(World W, EntityPlayer P, int cost)
+ public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost)
{