3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-04 23:30:24 +01:00

New config option for disabling piston animation for 1.11 clients #570

Dieser Commit ist enthalten in:
Myles 2016-12-15 15:32:54 +00:00
Ursprung 81d4deaea7
Commit a35408d14f
6 geänderte Dateien mit 49 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -52,6 +52,11 @@ public class BukkitConfigAPI extends Config implements ViaVersionConfig {
return getBoolean("hologram-patch", false); return getBoolean("hologram-patch", false);
} }
@Override
public boolean isPistonAnimationPatch() {
return getBoolean("piston-animation-patch", false);
}
@Override @Override
public boolean isBossbarPatch() { public boolean isBossbarPatch() {
return getBoolean("bossbar-patch", true); return getBoolean("bossbar-patch", true);

Datei anzeigen

@ -86,6 +86,11 @@ public class BungeeConfigAPI extends Config implements ViaVersionConfig {
return getBoolean("hologram-patch", false); return getBoolean("hologram-patch", false);
} }
@Override
public boolean isPistonAnimationPatch() {
return getBoolean("piston-animation-patch", false);
}
@Override @Override
public boolean isBossbarPatch() { public boolean isBossbarPatch() {
return getBoolean("bossbar-patch", true); return getBoolean("bossbar-patch", true);

Datei anzeigen

@ -53,6 +53,13 @@ public interface ViaVersionConfig {
*/ */
boolean isHologramPatch(); boolean isHologramPatch();
/**
* Get if the 1.11 piston animation patch is enabled
*
* @return true if the piston patch is enabled.
*/
boolean isPistonAnimationPatch();
/** /**
* Get if boss bars are fixed for 1.9 & 1.10 clients * Get if boss bars are fixed for 1.9 & 1.10 clients
* *

Datei anzeigen

@ -219,6 +219,30 @@ public class Protocol1_11To1_10 extends Protocol {
} }
}); });
// Block action packet
registerOutgoing(State.PLAY, 0x0A, 0x0A, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Position
map(Type.UNSIGNED_BYTE); // 1 - Action ID
map(Type.UNSIGNED_BYTE); // 2 - Action Param
map(Type.VAR_INT); // 3 - Block Type
// Cheap hack to ensure it's always right block
handler(new PacketHandler() {
@Override
public void handle(final PacketWrapper actionWrapper) throws Exception {
if (Via.getConfig().isPistonAnimationPatch()) {
int id = actionWrapper.get(Type.VAR_INT, 0);
if (id == 33 || id == 29) {
actionWrapper.cancel();
}
}
}
});
}
});
/* /*
INCOMING PACKETS INCOMING PACKETS
*/ */

Datei anzeigen

@ -79,6 +79,9 @@ tracking-max-kick-msg: "You are sending too many packets, :("
hologram-patch: false hologram-patch: false
# This is the offset, should work as default when enabled. # This is the offset, should work as default when enabled.
hologram-y: -0.96 hologram-y: -0.96
# Should we disable piston animation for 1.11/1.11.1 clients?
# In some cases when firing lots of pistons it crashes them.
piston-animation-patch: false
# #
#----------------------------------------------------------# #----------------------------------------------------------#
# 1.9 & 1.10 CLIENTS ON 1.8 SERVERS OPTIONS # # 1.9 & 1.10 CLIENTS ON 1.8 SERVERS OPTIONS #

Datei anzeigen

@ -59,6 +59,11 @@ public class SpongeConfigAPI extends Config implements ViaVersionConfig {
return getBoolean("hologram-patch", false); return getBoolean("hologram-patch", false);
} }
@Override
public boolean isPistonAnimationPatch() {
return getBoolean("piston-animation-patch", false);
}
@Override @Override
public boolean isBossbarPatch() { public boolean isBossbarPatch() {
return getBoolean("bossbar-patch", true); return getBoolean("bossbar-patch", true);