Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Handle barrier/light particles in entity meta
Dieser Commit ist enthalten in:
Ursprung
d8d65ea989
Commit
516f746061
@ -23,6 +23,7 @@ import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
|||||||
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_18;
|
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_18;
|
||||||
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
|
||||||
import com.viaversion.viaversion.api.type.Type;
|
import com.viaversion.viaversion.api.type.Type;
|
||||||
|
import com.viaversion.viaversion.api.type.types.Particle;
|
||||||
import com.viaversion.viaversion.api.type.types.version.Types1_17;
|
import com.viaversion.viaversion.api.type.types.version.Types1_17;
|
||||||
import com.viaversion.viaversion.api.type.types.version.Types1_18;
|
import com.viaversion.viaversion.api.type.types.version.Types1_18;
|
||||||
import com.viaversion.viaversion.protocols.protocol1_17_1to1_17.ClientboundPackets1_17_1;
|
import com.viaversion.viaversion.protocols.protocol1_17_1to1_17.ClientboundPackets1_17_1;
|
||||||
@ -86,8 +87,22 @@ public final class EntityPackets extends EntityRewriter<Protocol1_18To1_17_1> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerRewrites() {
|
protected void registerRewrites() {
|
||||||
filter().handler((event, meta) -> meta.setMetaType(MetaType1_18.byId(meta.metaType().typeId())));
|
filter().handler((event, meta) -> {
|
||||||
registerMetaTypeHandler(MetaType1_18.ITEM, null, MetaType1_18.PARTICLE);
|
meta.setMetaType(MetaType1_18.byId(meta.metaType().typeId()));
|
||||||
|
if (meta.metaType() == MetaType1_18.PARTICLE) {
|
||||||
|
Particle particle = (Particle) meta.getValue();
|
||||||
|
if (particle.getId() == 2) { // Barrier
|
||||||
|
particle.setId(3); // Block marker
|
||||||
|
particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, 7754)); // Barrier state
|
||||||
|
} else if (particle.getId() == 3) { // Light block
|
||||||
|
particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, 7786)); // Light block state
|
||||||
|
} else {
|
||||||
|
rewriteParticle(particle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
registerMetaTypeHandler(MetaType1_18.ITEM, null, null);
|
||||||
|
|
||||||
/*filter().filterFamily(Entity1_17Types.MINECART_ABSTRACT).index(11).handler((event, meta) -> { //TODO check id
|
/*filter().filterFamily(Entity1_17Types.MINECART_ABSTRACT).index(11).handler((event, meta) -> { //TODO check id
|
||||||
// Convert to new block id
|
// Convert to new block id
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren