[Fix/Refactoring] Fixed SCRIPTS_OVERWRITES_PATH and remove some old code from Player and PlayerCodex

This commit is contained in:
hartie95 2024-04-30 22:30:27 +02:00
parent 2fa8867db5
commit 07df4a1315
3 changed files with 1 additions and 30 deletions

View File

@ -1339,20 +1339,6 @@ public class Player {
}
public void onLogin() {
// Quest - Commented out because a problem is caused if you log out while this quest is active
/*
if (getQuestManager().getMainQuestById(351) == null) {
GameQuest quest = getQuestManager().addQuest(35104);
if (quest != null) {
quest.finish();
}
getQuestManager().addQuest(35101);
this.setSceneId(3);
this.getPos().set(GameConstants.START_POSITION);
}
*/
// Create world
World world = new World(this);
world.addPlayer(this);

View File

@ -45,7 +45,6 @@ public class PlayerCodex {
public void setPlayer(Player player) {
this.player = player;
this.fixReliquaries();
}
public void checkAddedItem(GameItem item) {
@ -113,18 +112,4 @@ public class PlayerCodex {
this.player.sendPacket(new PacketCodexDataUpdateNotify(8, id));
});
}
@Deprecated // Maybe remove this if we ever stop caring about older dbs
private void fixReliquaries() {
// Migrate older database entries which were using non-canonical forms of itemIds
val newReliquaries = new HashSet<Integer>();
this.unlockedReliquary.forEach(i -> newReliquaries.add((i/10)*10));
this.unlockedReliquary = newReliquaries;
GameData.getCodexReliquaryArrayList().stream()
.filter(x -> !this.getUnlockedReliquarySuitCodex().contains(x.getId()))
.filter(x -> this.getUnlockedReliquary().containsAll(x.getIds()))
.forEach(x -> this.getUnlockedReliquarySuitCodex().add(x.getId()));
this.player.save();
}
}

View File

@ -160,7 +160,7 @@ public final class FileUtils {
return SCRIPTS_PATH.resolve(path);
}
public static Path getScriptOverwritePath(String path) {
return SCRIPTS_PATH.resolve(path);
return SCRIPTS_OVERWRITES_PATH.resolve(path);
}
public static void write(String dest, byte[] bytes) {