Class GameRules


  • public class GameRules
    extends java.lang.Object
    + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  GameRules.ValueType  
    • Constructor Summary

      Constructors 
      Constructor Description
      GameRules()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGameRule​(java.lang.String key, java.lang.String value, GameRules.ValueType type)  
      boolean areSameType​(java.lang.String key, GameRules.ValueType otherValue)  
      boolean getBoolean​(java.lang.String name)
      + Gets the boolean Game Rule value.
      int getInt​(java.lang.String name)  
      java.lang.String[] getRules()
      + Return the defined game rules.
      java.lang.String getString​(java.lang.String name)
      + Gets the string Game Rule value.
      boolean hasRule​(java.lang.String name)
      + Return whether the specified game rule is defined.
      void readFromNBT​(NBTTagCompound nbt)
      + Set defined game rules from NBT.
      void setOrCreateGameRule​(java.lang.String key, java.lang.String ruleValue)  
      NBTTagCompound writeToNBT()
      + Return the defined game rules as NBT.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GameRules

        public GameRules()
    • Method Detail

      • addGameRule

        public void addGameRule​(java.lang.String key,
                                java.lang.String value,
                                GameRules.ValueType type)
      • setOrCreateGameRule

        public void setOrCreateGameRule​(java.lang.String key,
                                        java.lang.String ruleValue)
      • getString

        public java.lang.String getString​(java.lang.String name)
        + Gets the string Game Rule value.
      • getBoolean

        public boolean getBoolean​(java.lang.String name)
        + Gets the boolean Game Rule value.
      • getInt

        public int getInt​(java.lang.String name)
      • writeToNBT

        public NBTTagCompound writeToNBT()
        + Return the defined game rules as NBT.
      • readFromNBT

        public void readFromNBT​(NBTTagCompound nbt)
        + Set defined game rules from NBT.
      • getRules

        public java.lang.String[] getRules()
        + Return the defined game rules.
      • hasRule

        public boolean hasRule​(java.lang.String name)
        + Return whether the specified game rule is defined.
      • areSameType

        public boolean areSameType​(java.lang.String key,
                                   GameRules.ValueType otherValue)