Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2578bd212 | ||
|
|
a1347dd669 | ||
|
|
3228ba65ae | ||
|
|
08b2d5b7e8 | ||
|
|
2b89dbce0e | ||
|
|
f256309487 | ||
|
|
462abb1ef9 | ||
|
|
a35408d14f | ||
|
|
81d4deaea7 | ||
|
|
9103f89aff |
No files matched your search
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
+12
-9
@@ -37,16 +37,19 @@ public class DeathListener extends ViaBukkitListener {
|
||||
Via.getPlatform().runSync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PacketWrapper wrapper = new PacketWrapper(0x2C, null, getUserConnection(p));
|
||||
try {
|
||||
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
|
||||
wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID
|
||||
wrapper.write(Type.INT, p.getEntityId()); // Entity ID
|
||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, msg); // Message
|
||||
// If online
|
||||
if(getUserConnection(p) != null) {
|
||||
PacketWrapper wrapper = new PacketWrapper(0x2C, null, getUserConnection(p));
|
||||
try {
|
||||
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
|
||||
wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID
|
||||
wrapper.write(Type.INT, p.getEntityId()); // Entity ID
|
||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, msg); // Message
|
||||
|
||||
wrapper.send(Protocol1_9TO1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
wrapper.send(Protocol1_9TO1_8.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -52,6 +52,11 @@ public class BukkitConfigAPI extends Config implements ViaVersionConfig {
|
||||
return getBoolean("hologram-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPistonAnimationPatch() {
|
||||
return getBoolean("piston-animation-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBossbarPatch() {
|
||||
return getBoolean("bossbar-patch", true);
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<dependency>
|
||||
<groupId>us.myles</groupId>
|
||||
<artifactId>viaversion-common</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -29,16 +29,20 @@ public class MainHandPatch implements Listener {
|
||||
@EventHandler
|
||||
public void onServerConnect(ServerConnectEvent event) {
|
||||
// Ignore if it doesn't exist (Like BungeeCord 1.8)
|
||||
if (setMainHand == null)
|
||||
if (setMainHand == null || getSettings == null)
|
||||
return;
|
||||
|
||||
UserConnection user = Via.getManager().getConnection(event.getPlayer().getUniqueId());
|
||||
if(user == null) return;
|
||||
|
||||
if (user == null) return;
|
||||
|
||||
try {
|
||||
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9TO1_8.class)) {
|
||||
Object settings = getSettings.invoke(event.getPlayer());
|
||||
setMainHand.invoke(settings, user.get(EntityTracker.class).getMainHand());
|
||||
if (settings != null) {
|
||||
if (user.has(EntityTracker.class)) {
|
||||
setMainHand.invoke(settings, user.get(EntityTracker.class).getMainHand());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -86,6 +86,11 @@ public class BungeeConfigAPI extends Config implements ViaVersionConfig {
|
||||
return getBoolean("hologram-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPistonAnimationPatch() {
|
||||
return getBoolean("piston-animation-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBossbarPatch() {
|
||||
return getBoolean("bossbar-patch", true);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -53,6 +53,13 @@ public interface ViaVersionConfig {
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
||||
@@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.Pair;
|
||||
import us.myles.ViaVersion.api.Via;
|
||||
import us.myles.ViaVersion.protocols.base.BaseProtocol;
|
||||
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.Protocol1_10To1_9_3_4;
|
||||
import us.myles.ViaVersion.protocols.protocol1_11_1to1_11.Protocol1_11_1To1_11;
|
||||
import us.myles.ViaVersion.protocols.protocol1_11to1_10.Protocol1_11To1_10;
|
||||
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2TO1_9_3_4;
|
||||
import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1TO1_9;
|
||||
@@ -37,7 +38,8 @@ public class ProtocolRegistry {
|
||||
registerProtocol(new Protocol1_9_1_2TO1_9_3_4(), Arrays.asList(ProtocolVersion.v1_9_1.getId(), ProtocolVersion.v1_9_2.getId()), ProtocolVersion.v1_9_3.getId());
|
||||
registerProtocol(new Protocol1_10To1_9_3_4(), Collections.singletonList(ProtocolVersion.v1_10.getId()), ProtocolVersion.v1_9_3.getId());
|
||||
|
||||
registerProtocol(new Protocol1_11To1_10(), Collections.singletonList(ProtocolVersion.v1_11.getId()), ProtocolVersion.v1_10.getId());
|
||||
registerProtocol(new Protocol1_11To1_10(), Arrays.asList(ProtocolVersion.v1_11.getId()), ProtocolVersion.v1_10.getId());
|
||||
registerProtocol(new Protocol1_11_1To1_11(), Arrays.asList(ProtocolVersion.v1_11_1.getId()), ProtocolVersion.v1_11.getId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class ProtocolVersion {
|
||||
public static final ProtocolVersion v1_9_3;
|
||||
public static final ProtocolVersion v1_10;
|
||||
public static final ProtocolVersion v1_11;
|
||||
public static final ProtocolVersion v1_11_1;
|
||||
public static final ProtocolVersion unknown;
|
||||
|
||||
private final int id;
|
||||
@@ -52,6 +53,7 @@ public class ProtocolVersion {
|
||||
register(v1_9_3 = new ProtocolVersion(110, "1.9.3/4"));
|
||||
register(v1_10 = new ProtocolVersion(210, "1.10"));
|
||||
register(v1_11 = new ProtocolVersion(315, "1.11"));
|
||||
register(v1_11_1 = new ProtocolVersion(316, "1.11.1"));
|
||||
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
|
||||
}
|
||||
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package us.myles.ViaVersion.protocols.protocol1_11_1to1_11;
|
||||
|
||||
import us.myles.ViaVersion.api.data.UserConnection;
|
||||
import us.myles.ViaVersion.api.protocol.Protocol;
|
||||
|
||||
public class Protocol1_11_1To1_11 extends Protocol {
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
// Only had metadata changes, see wiki.vg for full info.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(UserConnection userConnection) {
|
||||
|
||||
}
|
||||
}
|
||||
+24
@@ -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
|
||||
*/
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class MetadataRewriter {
|
||||
id = (Short) value;
|
||||
}
|
||||
if (id != -1 && data != -1) {
|
||||
int combined = id << 4 | data;
|
||||
int combined = id | (data & 0xF);
|
||||
data = -1;
|
||||
id = -1;
|
||||
entry.setValue(combined);
|
||||
|
||||
@@ -79,6 +79,9 @@ tracking-max-kick-msg: "You are sending too many packets, :("
|
||||
hologram-patch: false
|
||||
# This is the offset, should work as default when enabled.
|
||||
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
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<name>viaversion-jar</name>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>us.myles</groupId>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>viaversion-parent</name>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>viaversion-parent</artifactId>
|
||||
<groupId>us.myles</groupId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -59,6 +59,11 @@ public class SpongeConfigAPI extends Config implements ViaVersionConfig {
|
||||
return getBoolean("hologram-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPistonAnimationPatch() {
|
||||
return getBoolean("piston-animation-patch", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBossbarPatch() {
|
||||
return getBoolean("bossbar-patch", true);
|
||||
|
||||
Reference in new issue
Block a user