aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/item
diff options
context:
space:
mode:
authorBlueHero233 <87818077+BlueHero233@users.noreply.github.com>2024-09-23 17:00:25 -0300
committerGitHub <noreply@github.com>2024-09-23 20:00:25 +0000
commit1abc736829841c8700b24b33d1936771a1956191 (patch)
tree855c3ed6ea08d0a5ba2f601f8cf40fe57e09abb8 /src/main/java/gtPlusPlus/core/item
parentb896e7db7db418e08dc5c3d39da9ab42126398ee (diff)
downloadGT5-Unofficial-1abc736829841c8700b24b33d1936771a1956191.tar.gz
GT5-Unofficial-1abc736829841c8700b24b33d1936771a1956191.tar.bz2
GT5-Unofficial-1abc736829841c8700b24b33d1936771a1956191.zip
GT++ Code Sanitize (#3235)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtPlusPlus/core/item')
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java16
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java45
2 files changed, 10 insertions, 51 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
index cf50da52a3..9da305cbd2 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java
@@ -21,28 +21,26 @@ public class ItemBlockBasicTile extends ItemBlock {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.mID == 0) { // Fish trap
+ if (this.mID == 1) { // Fish trap
list.add("This trap catches fish faster if surrounded by more water blocks");
- list.add("Can also be placed beside upto 4 other fish traps");
+ list.add("Can also be placed beside up to 4 other fish traps");
list.add("Requires at least two faces touching water");
list.add("1/1000 chance to produce triple loot.");
- } else if (this.mID == 4) { // Circuit Table
+ } else if (this.mID == 2) { // Circuit Table
list.add("Easy Circuit Configuration");
list.add("Change default setting with a Screwdriver");
list.add("Default is used to select slot for auto-insertion");
- } else if (this.mID == 5) { // Decayables Chest
+ } else if (this.mID == 3) { // Decayables Chest
list.add("Chest which holds radioactive materials");
list.add("Items which decay will tick while inside");
- list.add("Place with right click");
- } else if (this.mID == 6) { // Butterfly Killer
+ list.add("Place with right-click");
+ } else if (this.mID == 4) { // Butterfly Killer
list.add("Kills Forestry Butterflies, Bats and other pests");
list.add("Use either Formaldehyde or Hydrogen cyanide");
list.add("Be weary of your neighbours");
- } else if (this.mID == 8) { // Volumetric Flask Setter
+ } else if (this.mID == 5) { // Volumetric Flask Setter
list.add("Easy Flask Configuration");
list.add("Configure default input slot with a screwdriver");
- } else if (this.mID == 9) {
-
} else {
list.add("Bad Tooltip ID - " + mID);
}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
index 92876663f0..a69d9eab34 100644
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
+++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.HashMap;
import java.util.List;
import net.minecraft.block.Block;
@@ -11,6 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import gregtech.api.util.GTLog;
import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.block.base.BlockBaseOre;
@@ -22,8 +22,6 @@ import gtPlusPlus.core.util.sys.KeyboardUtils;
public class ItemBlockGtBlock extends ItemBlock {
- public static HashMap<String, String> sNameCache = new HashMap<>();
-
protected final int blockColour;
private int sRadiation;
@@ -50,7 +48,6 @@ public class ItemBlockGtBlock extends ItemBlock {
} else {
this.blockColour = block.getBlockColor();
}
-
if (block instanceof BlockBaseModular g) {
this.mMaterial = g.getMaterialEx();
this.thisBlockType = g.thisBlock;
@@ -60,55 +57,23 @@ public class ItemBlockGtBlock extends ItemBlock {
}
}
- public int getBlockTypeMeta() {
- if (this.thisBlockType.equals(BlockTypes.STANDARD)) {
- return 0;
- } else if (this.thisBlockType.equals(BlockTypes.FRAME)) {
- return 1;
- } else if (this.thisBlockType.equals(BlockTypes.ORE)) {
- return 2;
- }
- return 0;
- }
-
- public String getUnlocalizedBlockName() {
- return "block." + mMaterial.getUnlocalizedName()
- + "."
- + this.thisBlockType.name()
- .toLowerCase();
- }
-
- public String GetProperName() {
- String tempIngot = sNameCache.get(getUnlocalizedBlockName());
- if (tempIngot == null) {
- tempIngot = "BAD.UNLOCAL.NAME";
- }
- return tempIngot;
- }
-
@Override
public String getItemStackDisplayName(ItemStack stack) {
return this.thisBlock.getLocalizedName();
}
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
-
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
if (this.mMaterial != null) {
list.add(this.mMaterial.vChemicalFormula);
} else {
-
try {
BlockBaseModular g = (BlockBaseModular) thisBlock;
this.mMaterial = g.getMaterialEx();
- } catch (Throwable t) {
-
+ } catch (Exception e) {
+ e.printStackTrace(GTLog.err);
}
-
// list.add("Material is Null.");
}
@@ -116,10 +81,7 @@ public class ItemBlockGtBlock extends ItemBlock {
if (KeyboardUtils.isCtrlKeyDown()) {
Block b = Block.getBlockFromItem(stack.getItem());
if (b != null) {
-
- String aTool = b.getHarvestTool(stack.getItemDamage());
int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
-
if (this.mMaterial != null) {
list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
list.add("Contains: ");
@@ -141,7 +103,6 @@ public class ItemBlockGtBlock extends ItemBlock {
} else {
Block b = Block.getBlockFromItem(stack.getItem());
if (b != null) {
- String aTool = b.getHarvestTool(stack.getItemDamage());
int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5));
}