aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/core')
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java26
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java9
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java6
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java59
-rw-r--r--src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java279
-rw-r--r--src/main/java/gtPlusPlus/core/common/CommonProxy.java6
-rw-r--r--src/main/java/gtPlusPlus/core/handler/CompatHandler.java10
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java7
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java13
-rw-r--r--src/main/java/gtPlusPlus/core/item/ModItems.java28
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java10
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java19
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java71
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java33
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java4
-rw-r--r--src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java42
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java5
-rw-r--r--src/main/java/gtPlusPlus/core/material/Material.java153
-rw-r--r--src/main/java/gtPlusPlus/core/material/MaterialGenerator.java4
-rw-r--r--src/main/java/gtPlusPlus/core/material/Particle.java7
-rw-r--r--src/main/java/gtPlusPlus/core/proxy/ClientProxy.java12
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java360
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java7
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java7
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java7
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java6
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java13
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java7
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/StringUtils.java13
-rw-r--r--src/main/java/gtPlusPlus/core/util/math/MathUtils.java10
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java5
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java12
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java30
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java6
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java13
35 files changed, 595 insertions, 704 deletions
diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
index bace2937fd..c546d2114e 100644
--- a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
+++ b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
@@ -27,7 +27,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.interfaces.ITileTooltip;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.CubicObject;
import gtPlusPlus.api.objects.minecraft.SafeTexture;
import gtPlusPlus.core.lib.GTPPCore;
@@ -41,13 +40,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
* Each mapped object holds the data for the six sides.
*/
@SideOnly(Side.CLIENT)
- private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray;
-
- /**
- * Holds the data for the six sides, each side holds an array of data for each respective meta.
- */
- @SideOnly(Side.CLIENT)
- private AutoMap<CubicObject<String>> mSidedTexturePathArray;
+ private ArrayList<CubicObject<SafeTexture>> mSidedTextureArray;
/**
* Does this block have any meta at all?
@@ -163,8 +156,11 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
Logger.INFO("[TeTexture] Building Texture Maps for " + getTileEntityName() + ".");
// Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
- mSidedTextureArray = new AutoMap<>();
- mSidedTexturePathArray = new AutoMap<>();
+ mSidedTextureArray = new ArrayList<>();
+ /**
+ * Holds the data for the six sides, each side holds an array of data for each respective meta.
+ */
+ ArrayList<CubicObject<String>> sidedTexturePathArray = new ArrayList<>();
// Store them in forge order
// DOWN, UP, NORTH, SOUTH, WEST, EAST
@@ -191,7 +187,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: " + aDataMap.length);
// Map each meta string data to the main map.
for (int i = 0; i < aDataMap.length; i++) {
- mSidedTexturePathArray.put(aDataMap[i]);
+ sidedTexturePathArray.add(aDataMap[i]);
Logger.INFO("Mapped value for meta " + i + ".");
}
} else {
@@ -231,17 +227,17 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
aStringFront,
aStringLeft,
aStringRight);
- mSidedTexturePathArray.put(aMetaBlob);
+ sidedTexturePathArray.add(aMetaBlob);
Logger.INFO("[TeTexture] Added Texture Path data to map for meta " + i);
}
}
- Logger.INFO("[TeTexture] Map size for pathing: " + mSidedTexturePathArray.size());
+ Logger.INFO("[TeTexture] Map size for pathing: " + sidedTexturePathArray.size());
// Iteration Index
int aIndex = 0;
// Iterate each CubicObject, holding the six texture paths for each meta.
- for (CubicObject<String> aMetaBlob : mSidedTexturePathArray) {
+ for (CubicObject<String> aMetaBlob : sidedTexturePathArray) {
// Make a Safe Texture for each side
SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN);
SafeTexture aTop = SafeTexture.register(aMetaBlob.UP);
@@ -254,7 +250,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
// Convenience Blob
CubicObject<SafeTexture> aMetaBlob2 = new CubicObject<>(aInjectBlob);
// Store this Blob into
- mSidedTextureArray.put(aMetaBlob2);
+ mSidedTextureArray.add(aMetaBlob2);
Logger.INFO("[TeTexture] Added SafeTexture data to map for meta " + (aIndex++));
}
Logger.INFO("[TeTexture] Map size for registration: " + mSidedTextureArray.size());
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
index 4110c02fe3..e12e829260 100644
--- a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
@@ -2,6 +2,8 @@ package gtPlusPlus.core.block.general;
import static gregtech.api.enums.Mods.GTPlusPlus;
+import java.util.ArrayList;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockContainer;
@@ -18,7 +20,6 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.block.ModBlocks;
@@ -143,7 +144,7 @@ public class BlockSuperLight extends BlockContainer {
aLitBlocks = new int[50][10][50][1];
int aLitCounter = 0;
- AutoMap<BlockPos> aBlocksToUpdate = new AutoMap<>();
+ ArrayList<BlockPos> aBlocksToUpdate = new ArrayList<>();
Logger.INFO("Trying to relight area.");
BlockPos aStartIterationPoint = new BlockPos(
@@ -169,14 +170,14 @@ public class BlockSuperLight extends BlockContainer {
}
// Turning Lights on
else if (enable && aLight == 0) {
- aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
+ aBlocksToUpdate.add(new BlockPos(xOff, yOff, zOff, this.worldObj));
this.worldObj
.setBlock(xOff, yOff, zOff, ModBlocks.MatterFabricatorEffectBlock, 0, 3);
aLitCounter++;
}
// Turning Lights off
else if (!enable && aLight > 0) {
- aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
+ aBlocksToUpdate.add(new BlockPos(xOff, yOff, zOff, this.worldObj));
if (aBlockGet instanceof BlockLightGlass) {
Logger.INFO("Dimmed air.");
this.worldObj.setBlock(xOff, yOff, zOff, Blocks.air, 0, 3);
diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java b/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java
index 4440d2920a..be55db80a0 100644
--- a/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java
+++ b/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java
@@ -1,5 +1,6 @@
package gtPlusPlus.core.block.machine;
+import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
@@ -25,7 +26,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.util.GTUtility;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.handler.GuiHandler;
import gtPlusPlus.core.inventories.InventorySuperJukebox;
import gtPlusPlus.core.util.math.MathUtils;
@@ -315,12 +315,12 @@ public class BlockSuperJukebox extends BlockJukebox {
// Determine which record to play
public boolean selectRecordToPlayFromInventoryAndSetViaVanillaHandler() {
- AutoMap<ItemStack> mValidRecords = new AutoMap<>();
+ ArrayList<ItemStack> mValidRecords = new ArrayList<>();
for (ItemStack g : this.getInventory()
.getInventory()) {
if (g != null) {
if (g.getItem() instanceof ItemRecord) {
- mValidRecords.put(g);
+ mValidRecords.add(g);
}
}
}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
index aa6bfa9288..78d4f367eb 100644
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
@@ -36,47 +36,24 @@ public class RenderDecayChest extends TileEntitySpecialRenderer {
public void renderTileEntityAt(TileEntityDecayablesChest p_147500_1_, double p_147500_2_, double p_147500_4_,
double p_147500_6_, float p_147500_8_) {
-
- int i = 0;
-
- if (true) {
- this.bindTexture(mChestTexture);
- GL11.glPushMatrix();
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F);
- GL11.glScalef(1.0F, -1.0F, -1.0F);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- short short1 = 0;
-
- if (i == 2) {
- short1 = 180;
- }
-
- if (i == 3) {
- short1 = 0;
- }
-
- if (i == 4) {
- short1 = 90;
- }
-
- if (i == 5) {
- short1 = -90;
- }
-
- GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_;
-
- f1 = 1.0F - f1;
- f1 = 1.0F - f1 * f1 * f1;
- mChestModel.chestLid.rotateAngleX = -(f1 * GTPPCore.PI / 2.0F);
- mChestModel.renderAll();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- GL11.glPopMatrix();
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- }
+ this.bindTexture(mChestTexture);
+ GL11.glPushMatrix();
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F);
+ GL11.glScalef(1.0F, -1.0F, -1.0F);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ GL11.glRotatef(0.0f, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_;
+
+ f1 = 1.0F - f1;
+ f1 = 1.0F - f1 * f1 * f1;
+ mChestModel.chestLid.rotateAngleX = -(f1 * GTPPCore.PI / 2.0F);
+ mChestModel.renderAll();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
@Override
diff --git a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
index 56ba05f21f..0001f825d8 100644
--- a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
+++ b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
@@ -17,7 +17,6 @@ import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
@@ -66,8 +65,7 @@ public class CommandEnableDebugWhileRunning implements ICommand {
int aMaxArgumentsAllowed = 2;
if ((argString == null || argString.length == 0 || argString.length > aMaxArgumentsAllowed)
- || argString[0].toLowerCase()
- .equals("?")) {
+ || argString[0].equalsIgnoreCase("?")) {
Logger.INFO("Listing commands and their uses.");
final EntityPlayer P = CommandUtils.getPlayer(S);
AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging;
@@ -79,143 +77,132 @@ public class CommandEnableDebugWhileRunning implements ICommand {
PlayerUtils.messagePlayer(
P,
"debug - Toggles GT++ Debug Mode. Only use when advised, may break everything. (OP)");
- } else if (argString[0].toLowerCase()
- .equals("debug")) {
- Logger.INFO("Toggling Debug Mode.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (PlayerUtils.isPlayerOP(P)) {
- PreloaderCore.DEBUG_MODE = !PreloaderCore.DEBUG_MODE;
- PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: " + PreloaderCore.DEBUG_MODE);
- }
- } else if (argString[0].toLowerCase()
- .equals("logging")) {
- Logger.INFO("Toggling Logging.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging;
- PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: " + (!AsmConfig.disableAllLogging));
- }
+ } else if (argString[0].equalsIgnoreCase("debug")) {
+ Logger.INFO("Toggling Debug Mode.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (PlayerUtils.isPlayerOP(P)) {
+ PreloaderCore.DEBUG_MODE = !PreloaderCore.DEBUG_MODE;
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: " + PreloaderCore.DEBUG_MODE);
+ }
+ } else if (argString[0].equalsIgnoreCase("logging")) {
+ Logger.INFO("Toggling Logging.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging;
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: " + (!AsmConfig.disableAllLogging));
+ }
/*
* else if (argString[0].toLowerCase().equals("test")) { ItemStack mSemiFluidgen =
* ItemUtils.simpleMetaStack("IC2:blockGenerator", 7, 1); final EntityPlayer P = CommandUtils.getPlayer(S);
* if(mSemiFluidgen != null) { PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen)); } }
*/
- else if (argString[0].toLowerCase()
- .equals("inv")) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (P != null && !P.worldObj.isRemote) {
- ItemStack[] aInv = P.inventory.mainInventory;
- for (ItemStack aItem : aInv) {
- if (aItem != null) {
- String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId;
- String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name;
- Logger.INFO(
- aModID + ":"
- + aRegistryName
- + ":"
- + aItem.getItemDamage()
- + " | "
- + aItem.getDisplayName());
- }
+ else if (argString[0].equalsIgnoreCase("inv")) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (P != null && !P.worldObj.isRemote) {
+ ItemStack[] aInv = P.inventory.mainInventory;
+ for (ItemStack aItem : aInv) {
+ if (aItem != null) {
+ String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId;
+ String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name;
+ Logger.INFO(
+ aModID + ":"
+ + aRegistryName
+ + ":"
+ + aItem.getItemDamage()
+ + " | "
+ + aItem.getDisplayName());
}
- PlayerUtils.messagePlayer(P, "Dumped Inventory.");
}
- } else if (argString[0].toLowerCase()
- .equals("hand")) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (P != null) {
- ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P);
- if (aHeldItem != null) {
- String aItemDisplayName = ItemUtils.getItemName(aHeldItem);
- String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem);
- String aNbtString = tryIterateNBTData(aHeldItem);
- AutoMap<String> aOreDictNames = new AutoMap<>();
+ PlayerUtils.messagePlayer(P, "Dumped Inventory.");
+ }
+ } else if (argString[0].equalsIgnoreCase("hand")) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ if (P != null) {
+ ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P);
+ if (aHeldItem != null) {
+ String aItemDisplayName = ItemUtils.getItemName(aHeldItem);
+ String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem);
+ String aNbtString = tryIterateNBTData(aHeldItem);
+ ArrayList<String> aOreDictNames = new ArrayList<>();
- int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem);
- for (int id : aOreIDs) {
- String aOreNameFromID = OreDictionary.getOreName(id);
- if (aOreNameFromID != null && aOreNameFromID.length() > 0
- && !aOreNameFromID.equals("Unknown")) {
- aOreDictNames.add(aOreNameFromID);
- }
- }
+ int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem);
+ for (int id : aOreIDs) {
+ String aOreNameFromID = OreDictionary.getOreName(id);
+ if (aOreNameFromID != null && aOreNameFromID.length() > 0
+ && !aOreNameFromID.equals("Unknown")) {
+ aOreDictNames.add(aOreNameFromID);
+ }
+ }
- String aOreDictData = "";
- if (!aOreDictNames.isEmpty()) {
- for (String tag : aOreDictNames) {
- aOreDictData += (tag + ", ");
- }
- if (aOreDictData.endsWith(", ")) {
- aOreDictData = aOreDictData.substring(0, aOreDictData.length() - 2);
- }
- }
+ String aOreDictData = "";
+ if (!aOreDictNames.isEmpty()) {
+ for (String tag : aOreDictNames) {
+ aOreDictData += (tag + ", ");
+ }
+ if (aOreDictData.endsWith(", ")) {
+ aOreDictData = aOreDictData.substring(0, aOreDictData.length() - 2);
+ }
+ }
- AutoMap<String> aFluidContainerData = new AutoMap<>();
- FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem);
- if (aHeldItemFluid != null) {
- aFluidContainerData
- .put("FluidStack Unlocal Name: " + aHeldItemFluid.getUnlocalizedName());
- aFluidContainerData.put("FluidStack Local Name: " + aHeldItemFluid.getLocalizedName());
- aFluidContainerData.put(
- "Fluid Unlocal Name: " + aHeldItemFluid.getFluid()
- .getUnlocalizedName());
- aFluidContainerData.put("Fluid Local Name: " + aHeldItemFluid.getLocalizedName());
- aFluidContainerData.put(
- "Fluid Name: " + aHeldItemFluid.getFluid()
- .getName());
- }
+ ArrayList<String> aFluidContainerData = new ArrayList<>();
+ FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem);
+ if (aHeldItemFluid != null) {
+ aFluidContainerData.add("FluidStack Unlocal Name: " + aHeldItemFluid.getUnlocalizedName());
+ aFluidContainerData.add("FluidStack Local Name: " + aHeldItemFluid.getLocalizedName());
+ aFluidContainerData.add(
+ "Fluid Unlocal Name: " + aHeldItemFluid.getFluid()
+ .getUnlocalizedName());
+ aFluidContainerData.add("Fluid Local Name: " + aHeldItemFluid.getLocalizedName());
+ aFluidContainerData.add(
+ "Fluid Name: " + aHeldItemFluid.getFluid()
+ .getName());
+ }
- PlayerUtils.messagePlayer(P, "[" + aItemUnlocalName + "]" + "[" + aItemDisplayName + "] ");
- if (aFluidContainerData.size() > 0) {
- for (String s : aFluidContainerData) {
- PlayerUtils.messagePlayer(P, "" + s);
- }
- }
- if (!aOreDictNames.isEmpty()) {
- PlayerUtils.messagePlayer(P, "" + aOreDictData);
- }
- if (aNbtString.length() > 0) {
- PlayerUtils.messagePlayer(P, "" + aNbtString);
- }
- } else {
- PlayerUtils.messagePlayer(P, "No item held.");
+ PlayerUtils.messagePlayer(P, "[" + aItemUnlocalName + "]" + "[" + aItemDisplayName + "] ");
+ if (!aFluidContainerData.isEmpty()) {
+ for (String s : aFluidContainerData) {
+ PlayerUtils.messagePlayer(P, s);
}
}
- } else if (argString[0].toLowerCase()
- .equals("fluid")) {
- if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1);
- if (P != null && aFluid != null) {
- PlayerUtils
- .messagePlayer(P, "Found fluid stack: " + FluidRegistry.getFluidName(aFluid));
- } else if (P != null && aFluid == null) {
- PlayerUtils.messagePlayer(P, "Could not find any fluids.");
- }
- }
- } else if (argString[0].toLowerCase()
- .equals("item")) {
- if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1);
- if (P != null && aTest != null) {
- PlayerUtils.messagePlayer(P, "Found fluid stack: " + ItemUtils.getItemName(aTest));
- } else if (P != null && aTest == null) {
- PlayerUtils.messagePlayer(P, "Could not find valid item.");
- }
- }
- } else {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'");
- }
+ if (!aOreDictNames.isEmpty()) {
+ PlayerUtils.messagePlayer(P, aOreDictData);
+ }
+ if (!aNbtString.isEmpty()) {
+ PlayerUtils.messagePlayer(P, aNbtString);
+ }
+ } else {
+ PlayerUtils.messagePlayer(P, "No item held.");
+ }
+ }
+ } else if (argString[0].equalsIgnoreCase("fluid")) {
+ if (argString.length > 1 && argString[1] != null && !argString[1].isEmpty()) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1);
+ if (P != null && aFluid != null) {
+ PlayerUtils.messagePlayer(P, "Found fluid stack: " + FluidRegistry.getFluidName(aFluid));
+ } else if (P != null) {
+ PlayerUtils.messagePlayer(P, "Could not find any fluids.");
+ }
+ }
+ } else if (argString[0].equalsIgnoreCase("item")) {
+ if (argString.length > 1 && argString[1] != null && !argString[1].isEmpty()) {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1);
+ if (P != null && aTest != null) {
+ PlayerUtils.messagePlayer(P, "Found fluid stack: " + ItemUtils.getItemName(aTest));
+ } else if (P != null) {
+ PlayerUtils.messagePlayer(P, "Could not find valid item.");
+ }
+ }
+ } else {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'");
+ }
}
@Override
public boolean canCommandSenderUseCommand(final ICommandSender var1) {
- if (var1 == null || CommandUtils.getPlayer(var1) == null) {
- return false;
- }
- return true;
+ return var1 != null && CommandUtils.getPlayer(var1) != null;
}
@Override
@@ -241,34 +228,34 @@ public class CommandEnableDebugWhileRunning implements ICommand {
public static String tryIterateNBTData(ItemStack aStack) {
try {
- AutoMap<String> aItemDataTags = new AutoMap<>();
+ ArrayList<String> aItemDataTags = new ArrayList<>();
NBTTagCompound aNBT = NBTUtils.getNBT(aStack);
- if (aNBT != null) {
- if (!aNBT.hasNoTags()) {
- Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
- if (mInternalMap != null) {
- for (Map.Entry<?, ?> e : mInternalMap.entrySet()) {
- aItemDataTags.add(
- e.getKey()
- .toString() + ":"
- + e.getValue());
- }
- int a = 0;
- String data = "";
- for (String tag : aItemDataTags) {
- data += (tag + ", ");
- }
- if (data.endsWith(", ")) {
- data = data.substring(0, data.length() - 2);
- }
- return data;
- } else {
- Logger.INFO("Data map reflected from NBTTagCompound was not valid.");
- return "Bad NBT";
+ if (!aNBT.hasNoTags()) {
+ Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap");
+ if (mInte