Fix paper problems

This commit is contained in:
libraryaddict 2021-07-22 15:10:11 +12:00
parent b9bd724502
commit b83bc0605c

View File

@ -1854,7 +1854,7 @@ public class DisguiseUtilities {
// TODO Store reflection fields // TODO Store reflection fields
// If the tracker exists. Remove himself from his tracker // If the tracker exists. Remove himself from his tracker
if (!runningPaper) { if (!isRunningPaper() || NmsVersion.v1_16.isSupported()) {
Object trackedPlayersObj = ReflectionManager.getNmsField("EntityTrackerEntry", "trackedPlayers").get(entityTrackerEntry); Object trackedPlayersObj = ReflectionManager.getNmsField("EntityTrackerEntry", "trackedPlayers").get(entityTrackerEntry);
((Set<Object>) trackedPlayersObj).remove(ReflectionManager.getPlayerConnectionOrPlayer(player)); ((Set<Object>) trackedPlayersObj).remove(ReflectionManager.getPlayerConnectionOrPlayer(player));
@ -2393,7 +2393,7 @@ public class DisguiseUtilities {
// TODO Store reflection fields // TODO Store reflection fields
// Check for code differences in PaperSpigot vs Spigot // Check for code differences in PaperSpigot vs Spigot
if (!runningPaper) { if (!isRunningPaper() || NmsVersion.v1_16.isSupported()) {
// Add himself to his own entity tracker // Add himself to his own entity tracker
Object trackedPlayersObj = ReflectionManager.getNmsField("EntityTrackerEntry", "trackedPlayers").get(entityTrackerEntry); Object trackedPlayersObj = ReflectionManager.getNmsField("EntityTrackerEntry", "trackedPlayers").get(entityTrackerEntry);