ofBlocksTiered(ITierConver
* given tier, then player will be allowed to use multiple kinds of blocks, but their tier is guaranteed to be the
* same.
*
- *
WARNING
You SHOULD NOT return notSet from your tierExtractor. If you do so, we will have this
+ * WARNING
You SHOULD NOT return notSet from your tierExtractor. If you do so, we will have this
* chain of events:
*
* - at check start, tier is reset to notSet
@@ -651,7 +650,7 @@ public static IStructureElementCheckOnly ofBlocksTiered(ITierConver
* doing its business
*
- Player enjoy a (probably) hilariously shaped multi and (probably) reduced build cost.
*
- * Example Implementation
+ * Example Implementation
*
* Assume you have 16 tier, each map to one particular block's 16 different meta. You will usually want something
* like this
@@ -770,8 +769,7 @@ public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigge
public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
Pair hint = getHint(trigger);
if (hint == null) return false;
- if (hint.getKey() instanceof ICustomBlockSetting) {
- ICustomBlockSetting block = (ICustomBlockSetting) hint.getKey();
+ if (hint.getKey() instanceof ICustomBlockSetting block) {
block.setBlock(world, x, y, z, hint.getValue());
} else {
world.setBlock(x, y, z, hint.getKey(), hint.getValue(), 2);
@@ -2811,7 +2809,7 @@ public static IStructureElementDeferred partitionBy(Function key
if (keyExtractor == null || map == null) {
throw new IllegalArgumentException();
}
- return defer(keyExtractorCheck.andThen(map::get), keyExtractor.>andThen(map::get));
+ return defer(keyExtractorCheck.andThen(map::get), keyExtractor.andThen(map::get));
}
/**
diff --git a/src/main/java/com/gtnewhorizon/structurelib/util/InventoryUtility.java b/src/main/java/com/gtnewhorizon/structurelib/util/InventoryUtility.java
index 5d37bc57..a067df89 100644
--- a/src/main/java/com/gtnewhorizon/structurelib/util/InventoryUtility.java
+++ b/src/main/java/com/gtnewhorizon/structurelib/util/InventoryUtility.java
@@ -1,17 +1,3 @@
-/**
- * Copyright (c) 2022, glee8e This file is part of StructureLib.
- *
- * StructureLib is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
- * Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any
- * later version.
- *
- * StructureLib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with Foobar; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
package com.gtnewhorizon.structurelib.util;
import java.util.Arrays;
diff --git a/src/main/java/com/gtnewhorizon/structurelib/util/ItemStackArrayIterable.java b/src/main/java/com/gtnewhorizon/structurelib/util/ItemStackArrayIterable.java
deleted file mode 100644
index fb30a1cc..00000000
--- a/src/main/java/com/gtnewhorizon/structurelib/util/ItemStackArrayIterable.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.gtnewhorizon.structurelib.util;
-
-import java.util.Iterator;
-
-import net.minecraft.item.ItemStack;
-
-public class ItemStackArrayIterable implements Iterable {
-
- private final ItemStack[] stacks;
-
- public ItemStackArrayIterable(ItemStack[] stacks) {
- this.stacks = stacks;
- }
-
- public ItemStack[] getStacks() {
- return stacks;
- }
-
- @Override
- public Iterator iterator() {
- return new Iterator() {
-
- private int ptr = 0;
-
- @Override
- public boolean hasNext() {
- return ptr < stacks.length;
- }
-
- @Override
- public ItemStack next() {
- return stacks[ptr++];
- }
-
- @Override
- public void remove() {
- stacks[ptr - 1] = null;
- }
- };
- }
-}
diff --git a/src/main/java/com/gtnewhorizon/structurelib/util/MiscUtils.java b/src/main/java/com/gtnewhorizon/structurelib/util/MiscUtils.java
index 6740e8e0..ffc80cf6 100644
--- a/src/main/java/com/gtnewhorizon/structurelib/util/MiscUtils.java
+++ b/src/main/java/com/gtnewhorizon/structurelib/util/MiscUtils.java
@@ -11,7 +11,6 @@ public class MiscUtils {
private MiscUtils() {}
- @SuppressWarnings("unchecked")
public static Set getTagKeys(NBTTagCompound tag) {
return tag.func_150296_c();
}
diff --git a/src/main/java/com/gtnewhorizon/structurelib/util/Vec3Impl.java b/src/main/java/com/gtnewhorizon/structurelib/util/Vec3Impl.java
index a7edf155..0d9dca4f 100644
--- a/src/main/java/com/gtnewhorizon/structurelib/util/Vec3Impl.java
+++ b/src/main/java/com/gtnewhorizon/structurelib/util/Vec3Impl.java
@@ -141,8 +141,7 @@ public Vec3Impl abs() {
public boolean equals(Object o) {
if (this == o) {
return true;
- } else if (o instanceof Vec3Impl) {
- Vec3Impl vec3i = (Vec3Impl) o;
+ } else if (o instanceof Vec3Impl vec3i) {
return val0 == vec3i.val0 && val1 == vec3i.val1 && val2 == vec3i.val2;
}
return false;