9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 10:29:20 +00:00

优化客户端材质

This commit is contained in:
XiaoMoMi
2025-06-13 03:50:32 +08:00
parent 0f6f5a5bef
commit fed23ef214
9 changed files with 46 additions and 19 deletions

View File

@@ -429,6 +429,11 @@ public class AbstractItem<W extends ItemWrapper<I>, I> implements Item<I> {
return new AbstractItem<>(this.factory, this.factory.transmuteCopy(this.item, another, count));
}
@Override
public Item<I> unsafeTransmuteCopy(Object another, int count) {
return new AbstractItem<>(this.factory, this.factory.unsafeTransmuteCopy(this.item, another, count));
}
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void merge(Item<I> another) {

View File

@@ -181,6 +181,8 @@ public interface Item<I> {
Item<I> transmuteCopy(Key another, int count);
Item<I> unsafeTransmuteCopy(Object another, int count);
void shrink(int amount);
default Item<I> transmuteCopy(Key another) {

View File

@@ -196,4 +196,6 @@ public abstract class ItemFactory<W extends ItemWrapper<I>, I> {
protected abstract void setNBTComponent(W item, Object type, Tag value);
protected abstract W transmuteCopy(W item, Key newItem, int amount);
protected abstract W unsafeTransmuteCopy(W item, Object newItem, int count);
}

View File

@@ -116,6 +116,7 @@ public abstract class AbstractPackManager implements PackManager {
loadInternalList("models", "block/", VANILLA_MODELS::add);
loadInternalList("models", "item/", VANILLA_MODELS::add);
VANILLA_MODELS.add(Key.of("minecraft", "builtin/entity"));
}
private void loadInternalData(String path, BiConsumer<Key, JsonObject> callback) {