From 90b43758533b07b87bed187c1038b189e5c7cd61 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 4 May 2022 10:48:46 -0400 Subject: [PATCH] 1.4.3 beta 3 --- .../hideAndSeek/configuration/ConfigManager.java | 7 +++---- .../net/tylermurphy/hideAndSeek/game/EventListener.java | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java index 71c9e02..4b24cb9 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java @@ -208,7 +208,7 @@ public class ConfigManager { while((c = reader.read()) != -1){ textBuilder.append((char) c); } - String yamlString = new String(textBuilder.toString().getBytes(), StandardCharsets.UTF_8); + String yamlString = textBuilder.toString(); Map temp = config.getValues(true); for(Map.Entry entry: temp.entrySet()){ if(entry.getValue() instanceof Integer || entry.getValue() instanceof Double || entry.getValue() instanceof String || entry.getValue() instanceof Boolean || entry.getValue() instanceof List){ @@ -238,16 +238,15 @@ public class ConfigManager { } replace = replace.substring(0, replace.length()-2); replace = replace + "]"; - replace = new String(replace.getBytes(), StandardCharsets.UTF_8); } else { - replace = new String(entry.getValue().toString().getBytes(), StandardCharsets.UTF_8); + replace = entry.getValue().toString(); } if(entry.getValue() instanceof String){ replace = "\"" + replace + "\""; } StringBuilder builder = new StringBuilder(yamlString); builder.replace(start+1, end, replace); - yamlString = new String(builder.toString().getBytes(), StandardCharsets.UTF_8); + yamlString = builder.toString(); } } OutputStream os = new FileOutputStream(file); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java index 668a446..0c750fa 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java @@ -189,6 +189,10 @@ public class EventListener implements Listener { } if(event.isCancelled()) return; if (player.getHealth() - event.getFinalDamage() < 0.5 || !pvpEnabled) { + if(!pvpEnabled && !Board.isSeeker(player)){ + event.setCancelled(true); + return; + } if (spawnPosition == null) return; event.setCancelled(true); if(Version.atLeast("1.9")) {