ItemMetaBuilder doesnt need to be cloneable

This commit is contained in:
TheMode 2021-04-09 23:23:33 +02:00
parent e19af0377c
commit 4f5fd125c4

View File

@ -11,7 +11,7 @@ import org.jglrxavpok.hephaistos.nbt.NBTCompound;
import java.util.*;
import java.util.function.Supplier;
public abstract class ItemMetaBuilder implements Cloneable {
public abstract class ItemMetaBuilder {
protected int damage;
protected boolean unbreakable;
@ -132,21 +132,6 @@ public abstract class ItemMetaBuilder implements Cloneable {
return dest;
}
@Override
protected ItemMetaBuilder clone() {
try {
NBTCompound nbtCompound = new NBTCompound();
write(nbtCompound);
var builder = (ItemMetaBuilder) super.clone();
builder.read(nbtCompound);
return builder;
} catch (CloneNotSupportedException e) {
// Should never happen, because ItemMetaBuilder implements Cloneable
e.printStackTrace();
throw new UnsupportedOperationException("Weird thing happened");
}
}
public interface Provider<T> {
}