Handle item/block/particle metadata

This commit is contained in:
Nassim Jahnke 2023-02-18 10:00:57 +01:00
parent 1376312449
commit d74f91d606
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 9 additions and 1 deletions

View File

@ -148,6 +148,8 @@ public final class EntityPackets extends EntityRewriter<ClientboundPackets1_19_3
}
meta.setMetaType(Types1_19_4.META_TYPES.byId(id));
});
registerMetaTypeHandler(Types1_19_4.META_TYPES.itemType, Types1_19_4.META_TYPES.blockStateType, Types1_19_4.META_TYPES.particleType);
filter().filterFamily(Entity1_19_4Types.ABSTRACT_HORSE).removeIndex(18); // Owner UUID
}

View File

@ -48,7 +48,7 @@ public class RecipeRewriter<C extends ClientboundPacketType> {
// Added in 1.19.4
recipeHandlers.put("smithing_transform", this::handleSmithingTransform);
recipeHandlers.put("smithing_trim", this::handleSmithingTransform);
recipeHandlers.put("smithing_trim", this::handleSmithingTrim);
recipeHandlers.put("crafting_decorated_pot", this::handleSimpleRecipe);
}
@ -121,6 +121,12 @@ public class RecipeRewriter<C extends ClientboundPacketType> {
rewrite(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // Result
}
public void handleSmithingTrim(final PacketWrapper wrapper) throws Exception {
handleIngredient(wrapper); // Template
handleIngredient(wrapper); // Base
handleIngredient(wrapper); // Additions
}
protected void rewrite(@Nullable Item item) {
if (protocol.getItemRewriter() != null) {
protocol.getItemRewriter().handleItemToClient(item);