-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Better Storage for ITEMs #42
Comments
It is ineffectient about filtering the pdc from itemstack. I will add an option about filter,and AF will get its first magics.
|
I found where we should patch. At public FriendlyByteBuf writeItem(ItemStack stack) {
if (stack.isEmpty() || stack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
this.writeBoolean(false);
} else {
this.writeBoolean(true);
Item item = stack.getItem();
this.writeVarInt(Item.getId(item));
this.writeByte(stack.getCount());
CompoundTag nbttagcompound = null;
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
// Spigot start - filter
stack = stack.copy();
// CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack)); // Paper - This is no longer needed due to NBT being supported
// Spigot end
nbttagcompound = stack.getTag();
// Paper start
if (nbttagcompound != null && nbttagcompound.contains("SkullOwner", 10)) {
CompoundTag owner = nbttagcompound.getCompound("SkullOwner");
if (owner.hasUUID("Id")) {
nbttagcompound.putUUID("SkullOwnerOrig", owner.getUUID("Id"));
net.minecraft.world.level.block.entity.SkullBlockEntity.sanitizeUUID(owner);
}
}
// Paper end
}
this.writeNbt(nbttagcompound);
}
return this;
} Inserting hooks above |
So here're our tasks:
|
This Optimization (nbt filter) will be separated into another module and introduce as an option. |
This Optimization (nbt filter) will be separated into another module. |
This depends on #79 |
a reliable and compat storage for items.
And there are my ideas
The first way seems easiest and most benefit. By this way we can dispose unused items and reduce our work to design such a structure.
The second way might be effective by pushing file index into uuid. However it is not compat because it will produce tons of unused spaces by the time.
We should combine their advantage to solve these following problems.
The text was updated successfully, but these errors were encountered: