Fix support for 1.7 scoreboard objectives

This commit is contained in:
Shane Freeder 2018-07-20 06:17:40 +01:00
parent ccfdc92c9a
commit 6031511c81
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -1,4 +1,4 @@
From b91bff82ac6a3902a3f8a27987da26d926cd2aa5 Mon Sep 17 00:00:00 2001
From 9c0293a309e204e93ec5e41702ff5bab4f59f53d Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Tue, 15 Nov 2016 10:31:04 -0500
Subject: [PATCH] 1.7.x Protocol Patch
@ -1646,10 +1646,29 @@ index ef12a019..4a1c3638 100644
{
this.compressionThreshold = compressionThreshold;
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
index 287a42bd..89eb3ba4 100644
index 287a42bd..43617375 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
@@ -251,16 +251,28 @@ public class DownstreamBridge extends PacketHandler
@@ -144,8 +144,7 @@ public class DownstreamBridge extends PacketHandler
switch ( objective.getAction() )
{
case 0:
- serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType().toString() ) );
- break;
+ serverScoreboard.addObjective( new Objective( objective.getName(), objective.getValue(), objective.getType() != null ? objective.getType().toString() : null) ); // Travertine - 1.7 protocol support
case 1:
serverScoreboard.removeObjective( objective.getName() );
break;
@@ -154,7 +153,7 @@ public class DownstreamBridge extends PacketHandler
if ( oldObjective != null )
{
oldObjective.setValue( objective.getValue() );
- oldObjective.setType( objective.getType().toString() );
+ oldObjective.setType( objective.getType() != null ? objective.getType().toString() : null ); // Travertine - 1.7 protocol support
}
break;
default:
@@ -251,16 +250,28 @@ public class DownstreamBridge extends PacketHandler
if ( pluginMessage.getTag().equals( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand" ) )
{