pala M-hunter-3: kills vanilla supplementaires + mergeDefaults config
This commit is contained in:
@@ -744,6 +744,12 @@ avant M4 (TODO:crafts-machines).
|
|||||||
(persistes pala-players.json, limite maxHomesBase=3 ECART base non publiee, grades
|
(persistes pala-players.json, limite maxHomesBase=3 ECART base non publiee, grades
|
||||||
payants SKIP). Lecon : markDirty() existait deja (doublon retire). VERIFIE : build
|
payants SKIP). Lecon : markDirty() existait deja (doublon retire). VERIFIE : build
|
||||||
SUCCESSFUL, boot Done, 0 erreur, maxHomesBase persiste. UNVERIFIED en jeu.
|
SUCCESSFUL, boot Done, 0 erreur, maxHomesBase persiste. UNVERIFIED en jeu.
|
||||||
|
- M-hunter-3 LIVRE 2026-10-19 ~08:05 : kills vanilla supplementaires (chevre 20@1,
|
||||||
|
perroquet 30@3, dauphin 35@5, tortue 40@8, panda 60@9 VERIFIES wiki ; moddees
|
||||||
|
SKIP M8, peche QTE SKIP). Fix structurel : mergeDefaults() fusionne les entrees
|
||||||
|
par defaut manquantes au chargement + resave (panda/goat VERIFIES en pala.json).
|
||||||
|
Lecon : killer l'ancien serveur AVANT de booter (session.lock orphelin), rm lock
|
||||||
|
si tue -9. VERIFIE : build SUCCESSFUL, boot Done, 0 erreur. UNVERIFIED en jeu.
|
||||||
- M-palaforge LIVRE 2026-10-19 ~03:55 : bloc + BE partagee (3e mode) + gate mineur 14 +
|
- M-palaforge LIVRE 2026-10-19 ~03:55 : bloc + BE partagee (3e mode) + gate mineur 14 +
|
||||||
table fonte wiki §3.2 (31 items, ratio floor usure) + fuels bois (+buche/planches/baton,
|
table fonte wiki §3.2 (31 items, ratio floor usure) + fuels bois (+buche/planches/baton,
|
||||||
lave exclue : seau non rendu) + craft (1 findium + 4 furnaces + 4 briques, positions
|
lave exclue : seau non rendu) + craft (1 findium + 4 furnaces + 4 briques, positions
|
||||||
|
|||||||
@@ -128,7 +128,15 @@ public final class PalaConfig {
|
|||||||
Map.entry("minecraft:squid", new double[]{10, 0}),
|
Map.entry("minecraft:squid", new double[]{10, 0}),
|
||||||
Map.entry("minecraft:glow_squid", new double[]{10, 0}),
|
Map.entry("minecraft:glow_squid", new double[]{10, 0}),
|
||||||
Map.entry("minecraft:creeper", new double[]{40, 0}),
|
Map.entry("minecraft:creeper", new double[]{40, 0}),
|
||||||
Map.entry("minecraft:wither", new double[]{1000, 0})));
|
Map.entry("minecraft:wither", new double[]{1000, 0}),
|
||||||
|
// M-hunter-3 (wiki evolution chasseur, VERIFIE) : passifs vanilla
|
||||||
|
// supplementaires (creatures moddees escargot/crabe/serpent/meduse/
|
||||||
|
// elephant SKIP M8, absentes ; peche "tres variable" + QTE SKIP).
|
||||||
|
Map.entry("minecraft:goat", new double[]{20, 1}),
|
||||||
|
Map.entry("minecraft:parrot", new double[]{30, 3}),
|
||||||
|
Map.entry("minecraft:dolphin", new double[]{35, 5}),
|
||||||
|
Map.entry("minecraft:turtle", new double[]{40, 8}),
|
||||||
|
Map.entry("minecraft:panda", new double[]{60, 9})));
|
||||||
|
|
||||||
// M5a (wiki VERIFIE) : fermier recolte = bloc -> [xp, niveau requis].
|
// M5a (wiki VERIFIE) : fermier recolte = bloc -> [xp, niveau requis].
|
||||||
// Ble 1.5@0 ("des le niveau 0"), patate 2@2, carotte 2.5@2 (table : Niveau 2 + ligne
|
// Ble 1.5@0 ("des le niveau 0"), patate 2@2, carotte 2.5@2 (table : Niveau 2 + ligne
|
||||||
@@ -182,6 +190,22 @@ public final class PalaConfig {
|
|||||||
private PalaConfig() {
|
private PalaConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// M-hunter-3 : fusionne les entrees par defaut manquantes dans une table
|
||||||
|
// chargee (nouvelles entrees ajoutees par update sans ecraser les customs admin).
|
||||||
|
private static <K, V> boolean mergeDefaults(java.util.Map<K, V> cible,
|
||||||
|
java.util.Map<K, V> defauts) {
|
||||||
|
boolean added = false;
|
||||||
|
for (java.util.Map.Entry<K, V> e : defauts.entrySet()) {
|
||||||
|
if (!cible.containsKey(e.getKey())) {
|
||||||
|
cible.put(e.getKey(), e.getValue());
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return added;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean mergedDefaultsApplied = false;
|
||||||
|
|
||||||
public static PalaConfig get() {
|
public static PalaConfig get() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@@ -221,14 +245,21 @@ public final class PalaConfig {
|
|||||||
if (loaded.rankNodes != null && !loaded.rankNodes.isEmpty()) {
|
if (loaded.rankNodes != null && !loaded.rankNodes.isEmpty()) {
|
||||||
instance.rankNodes = loaded.rankNodes;
|
instance.rankNodes = loaded.rankNodes;
|
||||||
}
|
}
|
||||||
|
mergedDefaultsApplied = false;
|
||||||
if (loaded.hunterKills != null && !loaded.hunterKills.isEmpty()) {
|
if (loaded.hunterKills != null && !loaded.hunterKills.isEmpty()) {
|
||||||
|
java.util.Map __def = new java.util.HashMap<>(instance.hunterKills);
|
||||||
instance.hunterKills = loaded.hunterKills;
|
instance.hunterKills = loaded.hunterKills;
|
||||||
|
mergedDefaultsApplied |= mergeDefaults(instance.hunterKills, __def);
|
||||||
}
|
}
|
||||||
if (loaded.farmerHarvest != null && !loaded.farmerHarvest.isEmpty()) {
|
if (loaded.farmerHarvest != null && !loaded.farmerHarvest.isEmpty()) {
|
||||||
|
java.util.Map __def = new java.util.HashMap<>(instance.farmerHarvest);
|
||||||
instance.farmerHarvest = loaded.farmerHarvest;
|
instance.farmerHarvest = loaded.farmerHarvest;
|
||||||
|
mergedDefaultsApplied |= mergeDefaults(instance.farmerHarvest, __def);
|
||||||
}
|
}
|
||||||
if (loaded.crusherResults != null && !loaded.crusherResults.isEmpty()) {
|
if (loaded.crusherResults != null && !loaded.crusherResults.isEmpty()) {
|
||||||
|
java.util.Map __def = new java.util.HashMap<>(instance.crusherResults);
|
||||||
instance.crusherResults = loaded.crusherResults;
|
instance.crusherResults = loaded.crusherResults;
|
||||||
|
mergedDefaultsApplied |= mergeDefaults(instance.crusherResults, __def);
|
||||||
}
|
}
|
||||||
if (loaded.crusherFuels != null && !loaded.crusherFuels.isEmpty()) {
|
if (loaded.crusherFuels != null && !loaded.crusherFuels.isEmpty()) {
|
||||||
instance.crusherFuels = loaded.crusherFuels;
|
instance.crusherFuels = loaded.crusherFuels;
|
||||||
@@ -237,7 +268,9 @@ public final class PalaConfig {
|
|||||||
instance.crusherInfiniteFuels = loaded.crusherInfiniteFuels;
|
instance.crusherInfiniteFuels = loaded.crusherInfiniteFuels;
|
||||||
}
|
}
|
||||||
if (loaded.furnaceSmelts != null && !loaded.furnaceSmelts.isEmpty()) {
|
if (loaded.furnaceSmelts != null && !loaded.furnaceSmelts.isEmpty()) {
|
||||||
|
java.util.Map __def = new java.util.HashMap<>(instance.furnaceSmelts);
|
||||||
instance.furnaceSmelts = loaded.furnaceSmelts;
|
instance.furnaceSmelts = loaded.furnaceSmelts;
|
||||||
|
mergedDefaultsApplied |= mergeDefaults(instance.furnaceSmelts, __def);
|
||||||
}
|
}
|
||||||
if (loaded.furnaceFuels != null && !loaded.furnaceFuels.isEmpty()) {
|
if (loaded.furnaceFuels != null && !loaded.furnaceFuels.isEmpty()) {
|
||||||
instance.furnaceFuels = loaded.furnaceFuels;
|
instance.furnaceFuels = loaded.furnaceFuels;
|
||||||
@@ -257,7 +290,7 @@ public final class PalaConfig {
|
|||||||
"afkKickMinutes", "rtpCooldownMinutes", "rtpRadius",
|
"afkKickMinutes", "rtpCooldownMinutes", "rtpRadius",
|
||||||
"factionMaxClaims", "marketExpiryDays",
|
"factionMaxClaims", "marketExpiryDays",
|
||||||
"miningZone", "farmlandZone", "maxHomesBase");
|
"miningZone", "farmlandZone", "maxHomesBase");
|
||||||
boolean complete = true;
|
boolean complete = !mergedDefaultsApplied;
|
||||||
try (Reader keysReader = Files.newBufferedReader(path)) {
|
try (Reader keysReader = Files.newBufferedReader(path)) {
|
||||||
com.google.gson.JsonObject obj =
|
com.google.gson.JsonObject obj =
|
||||||
GSON.fromJson(keysReader, com.google.gson.JsonObject.class);
|
GSON.fromJson(keysReader, com.google.gson.JsonObject.class);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user