Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public BlockItemPacketRewriter1_9(Protocol1_9To1_8 protocol) {

@Override
protected void registerPackets() {
registerLevelParticles(ClientboundPackets1_9.LEVEL_PARTICLES);

protocol.registerClientbound(ClientboundPackets1_9.BLOCK_UPDATE, wrapper -> {
final BlockPosition position = wrapper.passthrough(Types.BLOCK_POSITION1_8);
final int blockState = wrapper.passthrough(Types.VAR_INT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,26 +242,20 @@ public void register() {
}
});

protocol.registerClientbound(ClientboundPackets1_9.LEVEL_PARTICLES, new PacketHandlers() {
@Override
public void register() {
map(Types.INT); // Particle id
handler(wrapper -> {
int id = wrapper.get(Types.INT, 0);
if (id > 41 && !ViaRewind.getConfig().isReplaceParticles()) {
wrapper.cancel();
return;
}
if (id == 42) { // Dragon Breath
wrapper.set(Types.INT, 0, 24); // Portal
} else if (id == 43) { // End Rod
wrapper.set(Types.INT, 0, 3); // Firework Spark
} else if (id == 44) { // Damage Indicator
wrapper.set(Types.INT, 0, 34); // Heart
} else if (id == 45) { // Sweep Attack
wrapper.set(Types.INT, 0, 1); // Large Explosion
}
});
protocol.appendClientbound(ClientboundPackets1_9.LEVEL_PARTICLES, wrapper -> {
final int id = wrapper.get(Types.INT, 0);
if (id > 41 && !ViaRewind.getConfig().isReplaceParticles()) {
wrapper.cancel();
return;
}
if (id == 42) { // Dragon Breath
wrapper.set(Types.INT, 0, 24); // Portal
} else if (id == 43) { // End Rod
wrapper.set(Types.INT, 0, 3); // Firework Spark
} else if (id == 44) { // Damage Indicator
wrapper.set(Types.INT, 0, 34); // Heart
} else if (id == 45) { // Sweep Attack
wrapper.set(Types.INT, 0, 1); // Large Explosion
}
});

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
viaversion = "5.12.0"
viaversion = "5.12.3"
velocity = "3.4.0"

[libraries]
Expand Down