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

Method onServerSave

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

Source from the content-addressed store, hash-verified

1458
1459
1460 public static void onServerSave(File aSaveLocation) {
1461 File aTargetFile = new File(new File(aSaveLocation, "gregtech"), "endergarbage.items.dat");
1462 if (!aTargetFile.exists()) {try {aTargetFile.createNewFile();} catch (Throwable e) {e.printStackTrace(ERR);}}
1463 NBTTagCompound aNBT = UT.NBT.make();
1464 for (int i = 0; i < GARBAGE_ITEMS.size(); i++) ST.save(aNBT, ""+i, GARBAGE_ITEMS.get(i));
1465 try {CompressedStreamTools.write(aNBT, aTargetFile);} catch (Throwable e) {e.printStackTrace(ERR);}
1466
1467 aTargetFile = new File(new File(aSaveLocation, "gregtech"), "endergarbage.fluids.dat");
1468 if (!aTargetFile.exists()) {try {aTargetFile.createNewFile();} catch (Throwable e) {e.printStackTrace(ERR);}}
1469 aNBT = UT.NBT.make();
1470 for (int i = 0; i < GARBAGE_FLUIDS.size(); i++) GARBAGE_FLUIDS.get(i).writeToNBT(aNBT, ""+i);
1471 try {CompressedStreamTools.write(aNBT, aTargetFile);} catch (Throwable e) {e.printStackTrace(ERR);}
1472 }
1473
1474 public static void onServerLoad(File aSaveLocation) {
1475 GARBAGE_ITEMS.clear();

Callers 1

checkSaveLocationMethod · 0.95

Calls 7

saveMethod · 0.95
writeMethod · 0.80
existsMethod · 0.65
getMethod · 0.65
makeMethod · 0.45
sizeMethod · 0.45
writeToNBTMethod · 0.45

Tested by

no test coverage detected