mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-30 19:52:06 -07:00
Make GameRule a FeatureDependant (#12429)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.bukkit;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import io.papermc.paper.world.flag.FeatureDependant;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -15,7 +16,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
*
|
||||
* @param <T> type of rule (Boolean or Integer)
|
||||
*/
|
||||
public final class GameRule<T> implements net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
|
||||
public final class GameRule<T> implements net.kyori.adventure.translation.Translatable, FeatureDependant {
|
||||
|
||||
private static Map<String, GameRule<?>> gameRules = new HashMap<>();
|
||||
// Boolean rules
|
||||
@@ -377,10 +378,9 @@ public final class GameRule<T> implements net.kyori.adventure.translation.Transl
|
||||
return gameRules.values().toArray(new GameRule<?>[gameRules.size()]);
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public @NotNull String translationKey() {
|
||||
return "gamerule." + this.name;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user