Convert to the far superior config system

This commit is contained in:
KingRainbow44
2022-05-11 00:30:07 -04:00
parent c274907e9a
commit 11161227ab
39 changed files with 504 additions and 373 deletions

View File

@@ -21,6 +21,8 @@ import java.io.FileReader;
import java.util.Collection;
import java.util.List;
import static emu.grasscutter.Configuration.*;
public class DropManager {
public GameServer getGameServer() {
return gameServer;
@@ -41,7 +43,7 @@ public class DropManager {
}
public synchronized void load() {
try (FileReader fileReader = new FileReader(Grasscutter.getConfig().DATA_FOLDER + "Drop.json")) {
try (FileReader fileReader = new FileReader(DATA("Drop.json"))) {
getDropData().clear();
List<DropInfo> banners = Grasscutter.getGsonFactory().fromJson(fileReader, TypeToken.getParameterized(Collection.class, DropInfo.class).getType());
if(banners.size() > 0) {
@@ -69,9 +71,7 @@ public class DropManager {
} else {
// target is null if items will be added are shared. no one could pick it up because of the combination(give + shared)
// so it will be sent to all players' inventories directly.
dropScene.getPlayers().forEach(x -> {
x.getInventory().addItem(new GameItem(itemData, num), ActionReason.SubfieldDrop, true);
});
dropScene.getPlayers().forEach(x -> x.getInventory().addItem(new GameItem(itemData, num), ActionReason.SubfieldDrop, true));
}
}
}