Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Fix particle mapping
Dieser Commit ist enthalten in:
Ursprung
7f5e53782b
Commit
177b0fbf33
@ -7,8 +7,10 @@ import us.myles.ViaVersion.api.minecraft.item.Item;
|
|||||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||||
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_14;
|
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_14;
|
||||||
import us.myles.ViaVersion.api.rewriters.MetadataRewriter;
|
import us.myles.ViaVersion.api.rewriters.MetadataRewriter;
|
||||||
|
import us.myles.ViaVersion.api.type.types.Particle;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.Protocol1_16To1_15_2;
|
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.Protocol1_16To1_15_2;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.packets.InventoryPackets;
|
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.packets.InventoryPackets;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.packets.WorldPackets;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.storage.EntityTracker1_16;
|
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.storage.EntityTracker1_16;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -27,6 +29,15 @@ public class MetadataRewriter1_16To1_15_2 extends MetadataRewriter {
|
|||||||
int data = (int) metadata.getValue();
|
int data = (int) metadata.getValue();
|
||||||
metadata.setValue(Protocol1_16To1_15_2.getNewBlockStateId(data));
|
metadata.setValue(Protocol1_16To1_15_2.getNewBlockStateId(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == null) return;
|
||||||
|
|
||||||
|
if (type.is(Entity1_16Types.EntityType.AREA_EFFECT_CLOUD)) {
|
||||||
|
if (metadata.getId() == 10) {
|
||||||
|
Particle particle = (Particle) metadata.getValue();
|
||||||
|
particle.setId(WorldPackets.getNewParticleId(particle.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,6 +52,13 @@ public class WorldPackets {
|
|||||||
|
|
||||||
// Spawn Particle
|
// Spawn Particle
|
||||||
blockRewriter.registerSpawnParticle(Type.DOUBLE, 0x24, 0x24, 3, 23, 32,
|
blockRewriter.registerSpawnParticle(Type.DOUBLE, 0x24, 0x24, 3, 23, 32,
|
||||||
Protocol1_16To1_15_2::getNewBlockStateId, InventoryPackets::toClient, Type.FLAT_VAR_INT_ITEM);
|
WorldPackets::getNewParticleId, InventoryPackets::toClient, Type.FLAT_VAR_INT_ITEM);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getNewParticleId(int id) {
|
||||||
|
if (id >= 27) {
|
||||||
|
id += 1; // soul flame
|
||||||
|
}
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren