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

Method onServerLoad

src/main/java/gregapi/data/CS.java:1474–1501  ·  view source on GitHub ↗
(File aSaveLocation)

Source from the content-addressed store, hash-verified

1472 }
1473
1474 public static void onServerLoad(File aSaveLocation) {
1475 GARBAGE_ITEMS.clear();
1476 File aTargetFile = new File(new File(aSaveLocation, "gregtech"), "endergarbage.items.dat");
1477 if (aTargetFile.exists()) {
1478 NBTTagCompound aNBT = UT.NBT.make();
1479 try {aNBT = CompressedStreamTools.read(aTargetFile);} catch (Throwable e) {e.printStackTrace(ERR);}
1480 for (int i = 0; i < Integer.MAX_VALUE; i++) {
1481 if (!aNBT.hasKey(""+i)) break;
1482 ItemStack aStack = ST.load(aNBT, ""+i);
1483 if (aStack == null || aStack.stackSize <= 0 || BLACKLIST.contains(aStack, T)) continue;
1484 GARBAGE_ITEMS.add(aStack);
1485 }
1486 }
1487
1488 GARBAGE_FLUIDS.clear();
1489 aTargetFile = new File(new File(aSaveLocation, "gregtech"), "endergarbage.fluids.dat");
1490 if (aTargetFile.exists()) {
1491 NBTTagCompound aNBT = UT.NBT.make();
1492 try {aNBT = CompressedStreamTools.read(aTargetFile);} catch (Throwable e) {e.printStackTrace(ERR);}
1493 for (int i = 0; i < Integer.MAX_VALUE; i++) {
1494 if (!aNBT.hasKey(""+i)) break;
1495 FluidTankGT tTank = new FluidTankGT().setPreventDraining().setVoidExcess();
1496 tTank.readFromNBT(aNBT, ""+i);
1497 if (!tTank.has()) continue;
1498 GARBAGE_FLUIDS.add(tTank);
1499 }
1500 }
1501 }
1502 }
1503
1504 public static class DrinksGT {

Callers 1

checkSaveLocationMethod · 0.95

Calls 10

loadMethod · 0.95
readFromNBTMethod · 0.95
hasMethod · 0.95
setVoidExcessMethod · 0.80
setPreventDrainingMethod · 0.80
existsMethod · 0.65
containsMethod · 0.65
addMethod · 0.65
clearMethod · 0.45
makeMethod · 0.45

Tested by

no test coverage detected