3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-01 21:18:02 +02:00

Fix tipped arrow and area effect cloud color

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-05-08 20:28:55 +02:00
Ursprung cb5fc9fb08
Commit 31211c2214
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -444,7 +444,14 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
if (metaIndex == 9) {
// If the color is found first
final Metadata particleData = event.metaAtIndex(11);
addColor(particleData, meta.value());
if (particleData == null) {
// Add default particle with data
final Particle particle = new Particle(protocol.getMappingData().getParticleMappings().mappedId("entity_effect"));
particle.add(Type.INT, withAlpha(meta.value()));
event.createExtraMeta(new Metadata(10, Types1_20_5.META_TYPES.particleType, particle));
} else {
addColor(particleData, meta.value());
}
event.cancel();
return;
@ -463,6 +470,13 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
}
});
filter().type(EntityTypes1_20_5.ARROW).index(10).handler((event, meta) -> {
final int color = meta.value();
if (color != -1) {
meta.setValue(withAlpha(color));
}
});
filter().type(EntityTypes1_20_5.MINECART_ABSTRACT).index(11).handler((event, meta) -> {
final int blockState = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState));