Saves on Data Size by simply not adding "false" Booleans.
(NBTTagCompound aNBT, Object aTag, boolean aValue)
| 1980 | |
| 1981 | /** Saves on Data Size by simply not adding "false" Booleans. */ |
| 1982 | public static NBTTagCompound setBoolean(NBTTagCompound aNBT, Object aTag, boolean aValue) { |
| 1983 | if (aValue) { |
| 1984 | aNBT.setBoolean(aTag.toString(), aValue); |
| 1985 | } else { |
| 1986 | aNBT.removeTag(aTag.toString()); |
| 1987 | } |
| 1988 | return aNBT; |
| 1989 | } |
| 1990 | |
| 1991 | /** Saves on Data Size by choosing the smallest possible Data Type, and by also not adding zeros. The regular getLong() Function can also get the other Number Types. */ |
| 1992 | public static NBTTagCompound setNumber(NBTTagCompound aNBT, Object aTag, long aValue) { |
no test coverage detected