mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
8b26bb8f3e
By: md_5 <git@md-5.net>
67 lines
2.9 KiB
Diff
67 lines
2.9 KiB
Diff
--- a/net/minecraft/world/level/GameRules.java
|
|
+++ b/net/minecraft/world/level/GameRules.java
|
|
@@ -126,7 +126,7 @@
|
|
}
|
|
|
|
public <T extends GameRules.GameRuleValue<T>> T getRule(GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
|
- return (GameRules.GameRuleValue) this.rules.get(gamerules_gamerulekey);
|
|
+ return (T) this.rules.get(gamerules_gamerulekey); // CraftBukkit - decompile error
|
|
}
|
|
|
|
public NBTTagCompound createTag() {
|
|
@@ -140,7 +140,7 @@
|
|
|
|
private void loadFromTag(DynamicLike<?> dynamiclike) {
|
|
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);
|
|
optional.ifPresent(gamerules_gamerulevalue::deserialize);
|
|
@@ -160,8 +160,8 @@
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
public void assignFrom(GameRules gamerules, @Nullable MinecraftServer minecraftserver) {
|
|
@@ -253,7 +253,7 @@
|
|
}
|
|
|
|
public T createRule() {
|
|
- return (GameRules.GameRuleValue) this.constructor.apply(this);
|
|
+ return this.constructor.apply(this); // CraftBukkit - decompile error
|
|
}
|
|
|
|
public void callVisitor(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
|
|
@@ -283,7 +283,7 @@
|
|
|
|
}
|
|
|
|
- protected abstract void deserialize(String s);
|
|
+ public abstract void deserialize(String s); // PAIL - private->public
|
|
|
|
public abstract String serialize();
|
|
|
|
@@ -349,7 +349,7 @@
|
|
}
|
|
|
|
@Override
|
|
- protected void deserialize(String s) {
|
|
+ public void deserialize(String s) { // PAIL - protected->public
|
|
this.value = Boolean.parseBoolean(s);
|
|
}
|
|
|
|
@@ -414,7 +414,7 @@
|
|
}
|
|
|
|
@Override
|
|
- protected void deserialize(String s) {
|
|
+ public void deserialize(String s) { // PAIL - protected->public
|
|
this.value = safeParse(s);
|
|
}
|
|
|