1.4.3 beta 3

This commit is contained in:
Tyler Murphy 2022-05-04 10:48:46 -04:00
parent 664c0d9ad5
commit 90b4375853
2 changed files with 7 additions and 4 deletions

View file

@ -208,7 +208,7 @@ public class ConfigManager {
while((c = reader.read()) != -1){ while((c = reader.read()) != -1){
textBuilder.append((char) c); textBuilder.append((char) c);
} }
String yamlString = new String(textBuilder.toString().getBytes(), StandardCharsets.UTF_8); String yamlString = textBuilder.toString();
Map<String, Object> temp = config.getValues(true); Map<String, Object> temp = config.getValues(true);
for(Map.Entry<String, Object> entry: temp.entrySet()){ for(Map.Entry<String, Object> entry: temp.entrySet()){
if(entry.getValue() instanceof Integer || entry.getValue() instanceof Double || entry.getValue() instanceof String || entry.getValue() instanceof Boolean || entry.getValue() instanceof List){ 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.substring(0, replace.length()-2);
replace = replace + "]"; replace = replace + "]";
replace = new String(replace.getBytes(), StandardCharsets.UTF_8);
} else { } else {
replace = new String(entry.getValue().toString().getBytes(), StandardCharsets.UTF_8); replace = entry.getValue().toString();
} }
if(entry.getValue() instanceof String){ if(entry.getValue() instanceof String){
replace = "\"" + replace + "\""; replace = "\"" + replace + "\"";
} }
StringBuilder builder = new StringBuilder(yamlString); StringBuilder builder = new StringBuilder(yamlString);
builder.replace(start+1, end, replace); builder.replace(start+1, end, replace);
yamlString = new String(builder.toString().getBytes(), StandardCharsets.UTF_8); yamlString = builder.toString();
} }
} }
OutputStream os = new FileOutputStream(file); OutputStream os = new FileOutputStream(file);

View file

@ -189,6 +189,10 @@ public class EventListener implements Listener {
} }
if(event.isCancelled()) return; if(event.isCancelled()) return;
if (player.getHealth() - event.getFinalDamage() < 0.5 || !pvpEnabled) { if (player.getHealth() - event.getFinalDamage() < 0.5 || !pvpEnabled) {
if(!pvpEnabled && !Board.isSeeker(player)){
event.setCancelled(true);
return;
}
if (spawnPosition == null) return; if (spawnPosition == null) return;
event.setCancelled(true); event.setCancelled(true);
if(Version.atLeast("1.9")) { if(Version.atLeast("1.9")) {