2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/GameRules.java
|
|
|
|
+++ b/net/minecraft/world/level/GameRules.java
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -142,7 +142,7 @@
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public <T extends GameRules.GameRuleValue<T>> T getRule(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
2021-06-11 07:00:00 +02:00
|
|
|
- return (GameRules.GameRuleValue) this.rules.get(gamerules_gamerulekey);
|
|
|
|
+ return (T) this.rules.get(gamerules_gamerulekey); // CraftBukkit - decompile error
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public NBTTagCompound createTag() {
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -156,7 +156,7 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private void loadFromTag(DynamicLike<?> dynamiclike) {
|
2021-06-11 07:00:00 +02:00
|
|
|
this.rules.forEach((gamerules_gamerulekey, gamerules_gamerulevalue) -> {
|
|
|
|
- Optional optional = dynamiclike.get(gamerules_gamerulekey.id).asString().result();
|
|
|
|
+ Optional<String> optional = dynamiclike.get(gamerules_gamerulekey.id).asString().result(); // CraftBukkit - decompile error
|
|
|
|
|
|
|
|
Objects.requireNonNull(gamerules_gamerulevalue);
|
2021-11-21 23:00:00 +01:00
|
|
|
optional.ifPresent(gamerules_gamerulevalue::deserialize);
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -176,8 +176,8 @@
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private static <T extends GameRules.GameRuleValue<T>> void callVisitorCap(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<?> gamerules_gamerulekey, GameRules.GameRuleDefinition<?> gamerules_gameruledefinition) {
|
|
|
|
- gamerules_gamerulevisitor.visit(gamerules_gamerulekey, gamerules_gameruledefinition);
|
|
|
|
- gamerules_gameruledefinition.callVisitor(gamerules_gamerulevisitor, gamerules_gamerulekey);
|
|
|
|
+ gamerules_gamerulevisitor.visit((GameRules.GameRuleKey<T>) gamerules_gamerulekey, (GameRules.GameRuleDefinition<T>) gamerules_gameruledefinition); // CraftBukkit - decompile error
|
|
|
|
+ ((GameRules.GameRuleDefinition<T>) gamerules_gameruledefinition).callVisitor(gamerules_gamerulevisitor, (GameRules.GameRuleKey<T>) gamerules_gamerulekey); // CraftBukkit - decompile error
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public void assignFrom(GameRules gamerules, @Nullable MinecraftServer minecraftserver) {
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -269,7 +269,7 @@
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public T createRule() {
|
2021-06-11 07:00:00 +02:00
|
|
|
- return (GameRules.GameRuleValue) this.constructor.apply(this);
|
|
|
|
+ return this.constructor.apply(this); // CraftBukkit - decompile error
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public void callVisitor(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -299,7 +299,7 @@
|
2019-06-21 12:35:22 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- protected abstract void deserialize(String s);
|
|
|
|
+ public abstract void deserialize(String s); // PAIL - private->public
|
2019-06-21 12:35:22 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
public abstract String serialize();
|
2019-06-21 12:35:22 +02:00
|
|
|
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -365,7 +365,7 @@
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
- protected void deserialize(String s) {
|
|
|
|
+ public void deserialize(String s) { // PAIL - protected->public
|
2021-06-11 07:00:00 +02:00
|
|
|
this.value = Boolean.parseBoolean(s);
|
|
|
|
}
|
|
|
|
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -430,7 +430,7 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
- protected void deserialize(String s) {
|
|
|
|
+ public void deserialize(String s) { // PAIL - protected->public
|
|
|
|
this.value = safeParse(s);
|
2019-06-21 12:35:22 +02:00
|
|
|
}
|
|
|
|
|