Minecraft 1.19

This commit is contained in:
LOOHP
2022-06-11 02:34:26 +08:00
parent 0f909c4c11
commit 8b37a26424
25 changed files with 211604 additions and 198129 deletions
@@ -57,7 +57,7 @@ public class DimensionRegistry {
this.reg = file;
try (InputStreamReader reader = new InputStreamReader(new FileInputStream(reg), StandardCharsets.UTF_8)) {
try (InputStreamReader reader = new InputStreamReader(Files.newInputStream(reg.toPath()), StandardCharsets.UTF_8)) {
JSONObject json = (JSONObject) new JSONParser().parse(reader);
CompoundTag tag = CustomNBTUtils.getCompoundTagFromJson((JSONObject) json.get("value"));
defaultTag = tag;
@@ -26,6 +26,7 @@ import java.io.InputStream;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
@@ -79,7 +80,7 @@ public class GeneratedBlockDataMappings {
for (Object entry : (JSONArray) data.get("states")) {
JSONObject jsonobj = (JSONObject) entry;
if (((JSONObject) jsonobj.get("properties")).keySet().stream().allMatch(key -> blockstate.get(key).equals((String) (((JSONObject) jsonobj.get("properties")).get(key))))) {
if (((JSONObject) jsonobj.get("properties")).keySet().stream().allMatch(key -> Objects.equals(blockstate.get(key), ((JSONObject) jsonobj.get("properties")).get(key)))) {
return (int) (long) jsonobj.get("id");
}
}