On master: Team disguises options
This commit is contained in:
@@ -56,6 +56,7 @@ public class DisguiseConfig {
|
||||
private static String updateNotificationPermission;
|
||||
private static boolean viewSelfDisguise;
|
||||
private static boolean witherSkullEnabled;
|
||||
private static boolean disablePushing;
|
||||
|
||||
public static Entry<String, Disguise> getCustomDisguise(String disguise) {
|
||||
for (Entry<String, Disguise> entry : customDisguises.entrySet()) {
|
||||
@@ -68,6 +69,10 @@ public class DisguiseConfig {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isPushingDisabled() {
|
||||
return disablePushing;
|
||||
}
|
||||
|
||||
public static HashMap<String, Disguise> getCustomDisguises() {
|
||||
return customDisguises;
|
||||
}
|
||||
@@ -136,6 +141,7 @@ public class DisguiseConfig {
|
||||
setHideDisguisedPlayers(config.getBoolean("HideDisguisedPlayersFromTab"));
|
||||
setShowDisguisedPlayersInTab(config.getBoolean("ShowPlayerDisguisesInTab"));
|
||||
setDisabledInvisibility(config.getBoolean("DisableInvisibility"));
|
||||
disablePushing = config.getBoolean("DisablePushing");
|
||||
|
||||
customDisguises.clear();
|
||||
|
||||
|
@@ -988,12 +988,14 @@ public class DisguiseUtilities {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
// Code to stop player pushing in 1.9
|
||||
Scoreboard scoreboard = player.getScoreboard();
|
||||
Team t;
|
||||
if (DisguiseConfig.isPushingDisabled()) {
|
||||
// Code to stop player pushing in 1.9
|
||||
Scoreboard scoreboard = player.getScoreboard();
|
||||
Team t;
|
||||
|
||||
if ((t = scoreboard.getTeam("LDPushing")) != null) {
|
||||
t.removeEntry(player.getName());
|
||||
if ((t = scoreboard.getTeam("LDPushing")) != null) {
|
||||
t.removeEntry(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// player.spigot().setCollidesWithEntities(true);
|
||||
@@ -1071,22 +1073,24 @@ public class DisguiseUtilities {
|
||||
return;
|
||||
}
|
||||
|
||||
// Code to stop player pushing
|
||||
Scoreboard scoreboard = player.getScoreboard();
|
||||
Team t;
|
||||
if (DisguiseConfig.isPushingDisabled()) {
|
||||
// Code to stop player pushing
|
||||
Scoreboard scoreboard = player.getScoreboard();
|
||||
Team t;
|
||||
|
||||
if ((t = scoreboard.getTeam("LDPushing")) == null) {
|
||||
t = scoreboard.registerNewTeam("LDPushing");
|
||||
if ((t = scoreboard.getTeam("LDPushing")) == null) {
|
||||
t = scoreboard.registerNewTeam("LDPushing");
|
||||
}
|
||||
|
||||
if (t.getOption(Option.COLLISION_RULE) != OptionStatus.NEVER) {
|
||||
t.setOption(Option.COLLISION_RULE, OptionStatus.NEVER);
|
||||
t.setCanSeeFriendlyInvisibles(false);
|
||||
}
|
||||
|
||||
if (!t.hasEntry(player.getName()))
|
||||
t.addEntry(player.getName());
|
||||
}
|
||||
|
||||
if (t.getOption(Option.COLLISION_RULE) != OptionStatus.NEVER) {
|
||||
t.setOption(Option.COLLISION_RULE, OptionStatus.NEVER);
|
||||
t.setCanSeeFriendlyInvisibles(false);
|
||||
}
|
||||
|
||||
if (!t.hasEntry(player.getName()))
|
||||
t.addEntry(player.getName());
|
||||
|
||||
// Add himself to his own entity tracker
|
||||
Object trackedPlayersObj = ReflectionManager.getNmsField("EntityTrackerEntry", "trackedPlayers")
|
||||
.get(entityTrackerEntry);
|
||||
|
Reference in New Issue
Block a user