mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-08-03 04:55:27 +02:00
Various
Fixes #1177 Additional check for left click with milk on adult entity Add setting for enabling persistent meta Only set fly persistent meta if it differs from the current gamemode fly mode.
This commit is contained in:
@@ -72,6 +72,17 @@ public class PlotListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
Optional<Boolean> flyFlag = plot.getFlag(Flags.FLY);
|
||||
if (flyFlag.isPresent()) {
|
||||
boolean flight = player.getFlight();
|
||||
if (flyFlag.get() != player.getFlight()) {
|
||||
PlotGameMode gamemode = player.getGameMode();
|
||||
if (flight != (gamemode == PlotGameMode.CREATIVE || gamemode == PlotGameMode.SPECTATOR)) {
|
||||
player.setPersistentMeta("flight", ByteArrayUtilities.booleanToBytes(player.getFlight()));
|
||||
}
|
||||
player.setFlight(flyFlag.get());
|
||||
}
|
||||
}
|
||||
Optional<PlotGameMode> gamemodeFlag = plot.getFlag(Flags.GAMEMODE);
|
||||
if (gamemodeFlag.isPresent()) {
|
||||
if (player.getGameMode() != gamemodeFlag.get()) {
|
||||
@@ -83,13 +94,6 @@ public class PlotListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
Optional<Boolean> flyFlag = plot.getFlag(Flags.FLY);
|
||||
if (flyFlag.isPresent()) {
|
||||
if (flyFlag.get() != player.getFlight()) {
|
||||
player.setPersistentMeta("flight", ByteArrayUtilities.booleanToBytes(player.getFlight()));
|
||||
player.setFlight(flyFlag.get());
|
||||
}
|
||||
}
|
||||
Optional<Long> timeFlag = plot.getFlag(Flags.TIME);
|
||||
if (timeFlag.isPresent()) {
|
||||
try {
|
||||
@@ -200,6 +204,7 @@ public class PlotListener {
|
||||
if (plot.getFlag(Flags.FLY).isPresent()) {
|
||||
if (player.hasPersistentMeta("flight")) {
|
||||
player.setFlight(ByteArrayUtilities.bytesToBoolean(player.getPersistentMeta("flight")));
|
||||
player.removePersistentMeta("flight");
|
||||
} else {
|
||||
PlotGameMode gameMode = player.getGameMode();
|
||||
if (gameMode == PlotGameMode.SURVIVAL || gameMode == PlotGameMode.ADVENTURE) {
|
||||
|
Reference in New Issue
Block a user