Simple Cleanups (#61)

Cleans up the code a tiny bit, moving comments around, removing some
`@SuppressWarnings` and some unused code, and using modern Java
features.

These changes should require no modifications to any outside mods.

---------

Co-authored-by: Glease <[email protected]>
This commit is contained in:
Nikolay S.andGlease authored and GitHub committed 2026-06-19 15:31:17 +02:00
1 parent 287e8317c9
commit 2c5fa02a9e
20 files changed
+746 -153

No files matched your search

@@ -1,17 +1,3 @@
/**
* Copyright (c) 2022, glee8e This file is part of StructureLib.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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;
@@ -1,41 +0,0 @@
package com.gtnewhorizon.structurelib.util;
import java.util.Iterator;
import net.minecraft.item.ItemStack;
public class ItemStackArrayIterable implements Iterable<ItemStack> {
private final ItemStack[] stacks;
public ItemStackArrayIterable(ItemStack[] stacks) {
this.stacks = stacks;
}
public ItemStack[] getStacks() {
return stacks;
}
@Override
public Iterator<ItemStack> iterator() {
return new Iterator<ItemStack>() {
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;
}
};
}
}
@@ -11,7 +11,6 @@ public class MiscUtils {
private MiscUtils() {}
@SuppressWarnings("unchecked")
public static Set<String> getTagKeys(NBTTagCompound tag) {
return tag.func_150296_c();
}
@@ -141,8 +141,7 @@ public class Vec3Impl implements Comparable<Vec3Impl> {
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;