MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / setBoolean

Method setBoolean

src/main/java/gregapi/util/UT.java:1982–1989  ·  view source on GitHub ↗

Saves on Data Size by simply not adding "false" Booleans.

(NBTTagCompound aNBT, Object aTag, boolean aValue)

Source from the content-addressed store, hash-verified

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) {

Callers 15

displayMethod · 0.95
displayMethod · 0.95
onServerTickMethod · 0.80
initMethod · 0.80
getToolWithStatsMethod · 0.80
setRainproofMethod · 0.80
setStormproofMethod · 0.80
setDayActiveMethod · 0.80
setNightActiveMethod · 0.80
setOutsideActiveMethod · 0.80
setInsideActiveMethod · 0.80
updateItemStackMethod · 0.80

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected