aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/api/objects/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/api/objects/minecraft')
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java9
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java2
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java8
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java13
4 files changed, 13 insertions, 19 deletions
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
index cd6edf5411..686c0e7667 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java
@@ -87,10 +87,9 @@ public class BlockPos implements Serializable {
if (other == this) {
return true;
}
- if (!(other instanceof BlockPos)) {
+ if (!(other instanceof BlockPos otherPoint)) {
return false;
}
- BlockPos otherPoint = (BlockPos) other;
return this.xPos == otherPoint.xPos && this.yPos == otherPoint.yPos
&& this.zPos == otherPoint.zPos
&& this.dim == otherPoint.dim;
@@ -153,7 +152,7 @@ public class BlockPos implements Serializable {
}
public AutoMap<BlockPos> getSurroundingBlocks() {
- AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
+ AutoMap<BlockPos> sides = new AutoMap<>();
sides.put(getUp());
sides.put(getDown());
sides.put(getXPos());
@@ -219,7 +218,7 @@ public class BlockPos implements Serializable {
* @return - Does this block have a neighbour that is the same?
*/
public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) {
- AutoMap<BlockPos> sides = new AutoMap<BlockPos>();
+ AutoMap<BlockPos> sides = new AutoMap<>();
for (BlockPos g : getSurroundingBlocks().values()) {
if (getBlockAtPos(g) == getBlockAtPos()) {
if (!strict) {
@@ -237,7 +236,7 @@ public class BlockPos implements Serializable {
public Set<BlockPos> getValidNeighboursAndSelf() {
AutoMap<BlockPos> h = getSimilarNeighbour(true);
h.put(this);
- Set<BlockPos> result = new HashSet<BlockPos>();
+ Set<BlockPos> result = new HashSet<>();
for (BlockPos f : h.values()) {
result.add(f);
}
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
index 6fe2f9ddb5..d68ef1a93f 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java
@@ -33,7 +33,7 @@ public abstract class ItemPackage implements RunnableWithInfo<String> {
public abstract boolean generateRecipes();
- private final void init() {
+ private void init() {
items();
blocks();
fluids();
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java b/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
index 84f5fe5fba..58a7affa90 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/SafeTexture.java
@@ -18,18 +18,18 @@ import gtPlusPlus.core.util.Utils;
public class SafeTexture implements Runnable {
@SideOnly(Side.CLIENT)
- private static final HashMap<Integer, IIcon> mHashToIconCache = new HashMap<Integer, IIcon>();
+ private static final HashMap<Integer, IIcon> mHashToIconCache = new HashMap<>();
@SideOnly(Side.CLIENT)
- private static final HashMap<String, Integer> mPathToHashCash = new HashMap<String, Integer>();
+ private static final HashMap<String, Integer> mPathToHashCash = new HashMap<>();
- private static final HashMap<String, SafeTexture> mTextureObjectCache = new HashMap<String, SafeTexture>();
+ private static final HashMap<String, SafeTexture> mTextureObjectCache = new HashMap<>();
private final int mHash;
private final String mTextureName;
- private static final String getKey(String aTexPath) {
+ private static String getKey(String aTexPath) {
String aNameKey = Utils.sanitizeString(aTexPath);
aNameKey = aNameKey.replace('/', ' ');
aNameKey = aNameKey.toLowerCase();
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
index 12916af64b..db9599e130 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java
@@ -72,15 +72,10 @@ public class ShapedRecipe {
+ " has incorrect number of inputs. Size: "
+ aInputs.length
+ ".");
- // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(1));
- // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(2));
- // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(3));
- // Logger.RECIPE("[1234abcd] Reciped exists at location: "+ReflectionUtils.getMethodName(4));
- // Logger.RECIPE("Reciped exists at location: "+ReflectionUtils.getMethodName(1));
}
// Build a Pair for each slot
- AutoMap<Pair<Character, Object>> aRecipePairs = new AutoMap<Pair<Character, Object>>();
+ AutoMap<Pair<Character, Object>> aRecipePairs = new AutoMap<>();
int aCharSlot = 0;
int aMemSlot = 0;
int aInfoSlot = 0;
@@ -95,7 +90,7 @@ public class ShapedRecipe {
}
mInfo = ((ItemStack) stack).getDisplayName();
}
- aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack));
+ aRecipePairs.put(new Pair<>(CHARS.charAt(aCharSlot), stack));
Logger.RECIPE(
"Storing '" + CHARS.charAt(aCharSlot)
+ "' with an object of type "
@@ -106,7 +101,7 @@ public class ShapedRecipe {
aCharSlot++;
aLoggingInfo[aInfoSlot++] = mInfo;
} else {
- aRecipePairs.put(new Pair<Character, Object>(' ', (ItemStack) null));
+ aRecipePairs.put(new Pair<>(' ', (ItemStack) null));
Logger.RECIPE("Storing ' ' with an object of type null");
aChar[aMemSlot++] = ' ';
aLoggingInfo[aInfoSlot++] = "Empty";
@@ -158,7 +153,7 @@ public class ShapedRecipe {
}
mInfo = ((ItemStack) stack).getDisplayName();
}
- aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack));
+ aRecipePairs.put(new Pair<>(CHARS.charAt(aCharSlot), stack));
Logger.RECIPE(
"Registering Pair of '" + CHARS.charAt(aCharSlot)
+ "' and a "