Per mob mob_griefing loot pickup override (#1740)

This commit is contained in:
Jared Seville
2026-01-04 16:16:13 -06:00
committed by GitHub
parent 6238ebf386
commit 5b4cbcc16c
3 changed files with 406 additions and 7 deletions

View File

@@ -74,8 +74,8 @@ public class PurpurConfig {
commands = new HashMap<>();
commands.put("purpur", new PurpurCommand("purpur"));
version = getInt("config-version", 46);
set("config-version", 46);
version = getInt("config-version", 47);
set("config-version", 47);
readConfig(PurpurConfig.class, null);

View File

@@ -184,7 +184,26 @@ public class PurpurWorldConfig {
set("gameplay-mechanics.projectiles-bypass-mob-griefing", null);
set("gameplay-mechanics.projectiles-mob-griefing-override", oldVal3 ? true : "default");
}
entitiesPickUpLootMobGriefingOverride = getBooleanOrDefault("gameplay-mechanics.entities-pick-up-loot-mob-griefing-override", entitiesPickUpLootMobGriefingOverride);
if (PurpurConfig.version < 47) {
boolean oldVal = getBoolean("gameplay-mechanics.entities-pick-up-loot-mob-griefing-override", false);
set("gameplay-mechanics.entities-pick-up-loot-mob-griefing-override", null);
set("mobs.allay.can-pick-up-loot", oldVal ? true : "default");
set("mobs.bogged.can-pick-up-loot", oldVal ? true : "default");
set("mobs.drowned.can-pick-up-loot", oldVal ? true : "default");
set("mobs.fox.can-pick-up-loot", oldVal ? true : "default");
set("mobs.husk.can-pick-up-loot", oldVal ? true : "default");
// mobs.piglin.can-pick-up-loot replaces mobs.piglin.mob-griefing-override
set("mobs.piglin_brute.can-pick-up-loot", oldVal ? true : "default");
// mobs.pillager.can-pick-up-loot replaces mobs.pillager.mob-griefing-override
set("mobs.skeleton.can-pick-up-loot", oldVal ? true : "default");
set("mobs.stray.can-pick-up-loot", oldVal ? true : "default");
set("mobs.villager.can-pick-up-loot", oldVal ? true : "default");
set("mobs.vindicator.can-pick-up-loot", oldVal ? true : "default");
set("mobs.wither_skeleton.can-pick-up-loot", oldVal ? true : "default");
set("mobs.zombie.can-pick-up-loot", oldVal ? true : "default");
set("mobs.zombie_villager.can-pick-up-loot", oldVal ? true : "default");
set("mobs.zombified_piglin.can-pick-up-loot", oldVal ? true : "default");
}
fireballsMobGriefingOverride = getBooleanOrDefault("gameplay-mechanics.fireballs-mob-griefing-override", fireballsMobGriefingOverride);
projectilesMobGriefingOverride = getBooleanOrDefault("gameplay-mechanics.projectiles-mob-griefing-override", projectilesMobGriefingOverride);
noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove);
@@ -1269,12 +1288,14 @@ public class PurpurWorldConfig {
public boolean allayControllable = true;
public double allayMaxHealth = 20.0D;
public double allayScale = 1.0D;
public Boolean allayCanPickUpLoot = null;
private void allaySettings() {
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
allayMaxHealth = getDouble("mobs.allay.attributes.max_health", allayMaxHealth);
allayScale = Mth.clamp(getDouble("mobs.allay.attributes.scale", allayScale), 0.0625D, 16.0D);
allayCanPickUpLoot = getBooleanOrDefault("mobs.allay.can-pick-up-loot", allayCanPickUpLoot);
}
public boolean armadilloRidable = false;
@@ -1413,12 +1434,14 @@ public class PurpurWorldConfig {
public boolean boggedControllable = true;
public double boggedMaxHealth = 16.0D;
public double boggedScale = 1.0D;
public Boolean boggedCanPickUpLoot = null;
private void boggedSettings() {
boggedRidable = getBoolean("mobs.bogged.ridable", boggedRidable);
boggedRidableInWater = getBoolean("mobs.bogged.ridable-in-water", boggedRidableInWater);
boggedControllable = getBoolean("mobs.bogged.controllable", boggedControllable);
boggedMaxHealth = getDouble("mobs.bogged.attributes.max_health", boggedMaxHealth);
boggedScale = Mth.clamp(getDouble("mobs.bogged.attributes.scale", boggedScale), 0.0625D, 16.0D);
boggedCanPickUpLoot = getBooleanOrDefault("mobs.bogged.can-pick-up-loot", boggedCanPickUpLoot);
}
public boolean camelRidableInWater = false;
@@ -1732,6 +1755,7 @@ public class PurpurWorldConfig {
public boolean drownedTakeDamageFromWater = false;
public boolean drownedBreakDoors = false;
public boolean drownedAlwaysDropExp = false;
public Boolean drownedCanPickUpLoot = null;
private void drownedSettings() {
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
@@ -1750,6 +1774,7 @@ public class PurpurWorldConfig {
drownedTakeDamageFromWater = getBoolean("mobs.drowned.takes-damage-from-water", drownedTakeDamageFromWater);
drownedBreakDoors = getBoolean("mobs.drowned.can-break-doors", drownedBreakDoors);
drownedAlwaysDropExp = getBoolean("mobs.drowned.always-drop-exp", drownedAlwaysDropExp);
drownedCanPickUpLoot = getBooleanOrDefault("mobs.drowned.can-pick-up-loot", drownedCanPickUpLoot);
}
public boolean elderGuardianRidable = false;
@@ -1918,6 +1943,7 @@ public class PurpurWorldConfig {
public Boolean foxMobGriefingOverride = null;
public boolean foxTakeDamageFromWater = false;
public boolean foxAlwaysDropExp = false;
public Boolean foxCanPickUpLoot = null;
private void foxSettings() {
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
@@ -1939,6 +1965,7 @@ public class PurpurWorldConfig {
foxMobGriefingOverride = getBooleanOrDefault("mobs.fox.mob-griefing-override", foxMobGriefingOverride);
foxTakeDamageFromWater = getBoolean("mobs.fox.takes-damage-from-water", foxTakeDamageFromWater);
foxAlwaysDropExp = getBoolean("mobs.fox.always-drop-exp", foxAlwaysDropExp);
foxCanPickUpLoot = getBooleanOrDefault("mobs.fox.can-pick-up-loot", foxCanPickUpLoot);
}
public boolean frogRidable = false;
@@ -2167,6 +2194,7 @@ public class PurpurWorldConfig {
public boolean huskJockeyTryExistingChickens = true;
public boolean huskTakeDamageFromWater = false;
public boolean huskAlwaysDropExp = false;
public Boolean huskCanPickUpLoot = null;
private void huskSettings() {
huskRidable = getBoolean("mobs.husk.ridable", huskRidable);
huskRidableInWater = getBoolean("mobs.husk.ridable-in-water", huskRidableInWater);
@@ -2184,6 +2212,7 @@ public class PurpurWorldConfig {
huskJockeyTryExistingChickens = getBoolean("mobs.husk.jockey.try-existing-chickens", huskJockeyTryExistingChickens);
huskTakeDamageFromWater = getBoolean("mobs.husk.takes-damage-from-water", huskTakeDamageFromWater);
huskAlwaysDropExp = getBoolean("mobs.husk.always-drop-exp", huskAlwaysDropExp);
huskCanPickUpLoot = getBooleanOrDefault("mobs.husk.can-pick-up-loot", huskCanPickUpLoot);
}
public boolean illusionerRidable = false;
@@ -2557,12 +2586,12 @@ public class PurpurWorldConfig {
public boolean piglinControllable = true;
public double piglinMaxHealth = 16.0D;
public double piglinScale = 1.0D;
public Boolean piglinMobGriefingOverride = null;
public boolean piglinTakeDamageFromWater = false;
public int piglinPortalSpawnModifier = 2000;
public boolean piglinAlwaysDropExp = false;
public double piglinHeadVisibilityPercent = 0.5D;
public boolean piglinIgnoresArmorWithGoldTrim = false;
public Boolean piglinCanPickUpLoot = null;
private void piglinSettings() {
piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable);
piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater);
@@ -2579,12 +2608,17 @@ public class PurpurWorldConfig {
set("mobs.piglin.bypass-mob-griefing", null);
set("mobs.piglin.mob-griefing-override", oldVal ? true : "default");
}
piglinMobGriefingOverride = getBooleanOrDefault("mobs.piglin.mob-griefing-override", piglinMobGriefingOverride);
piglinTakeDamageFromWater = getBoolean("mobs.piglin.takes-damage-from-water", piglinTakeDamageFromWater);
piglinPortalSpawnModifier = getInt("mobs.piglin.portal-spawn-modifier", piglinPortalSpawnModifier);
piglinAlwaysDropExp = getBoolean("mobs.piglin.always-drop-exp", piglinAlwaysDropExp);
piglinHeadVisibilityPercent = getDouble("mobs.piglin.head-visibility-percent", piglinHeadVisibilityPercent);
piglinIgnoresArmorWithGoldTrim = getBoolean("mobs.piglin.ignores-armor-with-gold-trim", piglinIgnoresArmorWithGoldTrim);
if (PurpurConfig.version < 47) {
boolean oldVal = getBoolean("mobs.piglin.mob-griefing-override", false);
set("mobs.piglin.mob-griefing-override", null);
set("mobs.piglin.can-pick-up-loot", oldVal ? true : "default");
}
piglinCanPickUpLoot = getBooleanOrDefault("mobs.piglin.can-pick-up-loot", piglinCanPickUpLoot);
}
public boolean piglinBruteRidable = false;
@@ -2594,6 +2628,7 @@ public class PurpurWorldConfig {
public double piglinBruteScale = 1.0D;
public boolean piglinBruteTakeDamageFromWater = false;
public boolean piglinBruteAlwaysDropExp = false;
public Boolean piglinBruteCanPickUpLoot = null;
private void piglinBruteSettings() {
piglinBruteRidable = getBoolean("mobs.piglin_brute.ridable", piglinBruteRidable);
piglinBruteRidableInWater = getBoolean("mobs.piglin_brute.ridable-in-water", piglinBruteRidableInWater);
@@ -2607,6 +2642,7 @@ public class PurpurWorldConfig {
piglinBruteScale = Mth.clamp(getDouble("mobs.piglin_brute.attributes.scale", piglinBruteScale), 0.0625D, 16.0D);
piglinBruteTakeDamageFromWater = getBoolean("mobs.piglin_brute.takes-damage-from-water", piglinBruteTakeDamageFromWater);
piglinBruteAlwaysDropExp = getBoolean("mobs.piglin_brute.always-drop-exp", piglinBruteAlwaysDropExp);
piglinBruteCanPickUpLoot = getBooleanOrDefault("mobs.piglin_brute.can-pick-up-loot", piglinBruteCanPickUpLoot);
}
public boolean pillagerRidable = false;
@@ -2614,9 +2650,9 @@ public class PurpurWorldConfig {
public boolean pillagerControllable = true;
public double pillagerMaxHealth = 24.0D;
public double pillagerScale = 1.0D;
public Boolean pillagerMobGriefingOverride = null;
public boolean pillagerTakeDamageFromWater = false;
public boolean pillagerAlwaysDropExp = false;
public Boolean pillagerCanPickUpLoot = null;
private void pillagerSettings() {
pillagerRidable = getBoolean("mobs.pillager.ridable", pillagerRidable);
pillagerRidableInWater = getBoolean("mobs.pillager.ridable-in-water", pillagerRidableInWater);
@@ -2633,9 +2669,14 @@ public class PurpurWorldConfig {
set("mobs.pillager.bypass-mob-griefing", null);
set("mobs.pillager.mob-griefing-override", oldVal ? true : "default");
}
pillagerMobGriefingOverride = getBooleanOrDefault("mobs.pillager.mob-griefing-override", pillagerMobGriefingOverride);
pillagerTakeDamageFromWater = getBoolean("mobs.pillager.takes-damage-from-water", pillagerTakeDamageFromWater);
pillagerAlwaysDropExp = getBoolean("mobs.pillager.always-drop-exp", pillagerAlwaysDropExp);
if (PurpurConfig.version < 47) {
boolean oldVal = getBoolean("mobs.pillager.mob-griefing-override", false);
set("mobs.pillager.mob-griefing-override", null);
set("mobs.pillager.can-pick-up-loot", oldVal ? true : "default");
}
pillagerCanPickUpLoot = getBooleanOrDefault("mobs.pillager.can-pick-up-loot", pillagerCanPickUpLoot);
}
public boolean polarBearRidable = false;
@@ -2921,6 +2962,7 @@ public class PurpurWorldConfig {
public int skeletonFeedWitherRoses = 0;
public String skeletonBowAccuracy = "14 - difficulty * 4";
public Map<Integer, Float> skeletonBowAccuracyMap = new HashMap<>();
public Boolean skeletonCanPickUpLoot = null;
private void skeletonSettings() {
skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable);
skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater);
@@ -2948,6 +2990,7 @@ public class PurpurWorldConfig {
}
skeletonBowAccuracyMap.put(i, divergence);
}
skeletonCanPickUpLoot = getBooleanOrDefault("mobs.skeleton.can-pick-up-loot", skeletonCanPickUpLoot);
}
public boolean skeletonHorseRidable = false;
@@ -3118,6 +3161,7 @@ public class PurpurWorldConfig {
public double strayScale = 1.0D;
public boolean strayTakeDamageFromWater = false;
public boolean strayAlwaysDropExp = false;
public Boolean strayCanPickUpLoot = null;
private void straySettings() {
strayRidable = getBoolean("mobs.stray.ridable", strayRidable);
strayRidableInWater = getBoolean("mobs.stray.ridable-in-water", strayRidableInWater);
@@ -3131,6 +3175,7 @@ public class PurpurWorldConfig {
strayScale = Mth.clamp(getDouble("mobs.stray.attributes.scale", strayScale), 0.0625D, 16.0D);
strayTakeDamageFromWater = getBoolean("mobs.stray.takes-damage-from-water", strayTakeDamageFromWater);
strayAlwaysDropExp = getBoolean("mobs.stray.always-drop-exp", strayAlwaysDropExp);
strayCanPickUpLoot = getBooleanOrDefault("mobs.stray.can-pick-up-loot", strayCanPickUpLoot);
}
public boolean striderRidable = false;
@@ -3295,6 +3340,7 @@ public class PurpurWorldConfig {
public int villagerSpawnIronGolemLimit = 0;
public int villagerAcquirePoiSearchRadius = 48;
public int villagerNearestBedSensorSearchRadius = 48;
public Boolean villagerCanPickUpLoot = null;
private void villagerSettings() {
villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable);
villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater);
@@ -3340,6 +3386,7 @@ public class PurpurWorldConfig {
villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit);
villagerAcquirePoiSearchRadius = getInt("mobs.villager.search-radius.acquire-poi", villagerAcquirePoiSearchRadius);
villagerNearestBedSensorSearchRadius = getInt("mobs.villager.search-radius.nearest-bed-sensor", villagerNearestBedSensorSearchRadius);
villagerCanPickUpLoot = getBooleanOrDefault("mobs.villager.can-pick-up-loot", villagerCanPickUpLoot);
}
public boolean vindicatorRidable = false;
@@ -3350,6 +3397,7 @@ public class PurpurWorldConfig {
public double vindicatorJohnnySpawnChance = 0D;
public boolean vindicatorTakeDamageFromWater = false;
public boolean vindicatorAlwaysDropExp = false;
public Boolean vindicatorCanPickUpLoot = null;
private void vindicatorSettings() {
vindicatorRidable = getBoolean("mobs.vindicator.ridable", vindicatorRidable);
vindicatorRidableInWater = getBoolean("mobs.vindicator.ridable-in-water", vindicatorRidableInWater);
@@ -3364,6 +3412,7 @@ public class PurpurWorldConfig {
vindicatorJohnnySpawnChance = getDouble("mobs.vindicator.johnny.spawn-chance", vindicatorJohnnySpawnChance);
vindicatorTakeDamageFromWater = getBoolean("mobs.vindicator.takes-damage-from-water", vindicatorTakeDamageFromWater);
vindicatorAlwaysDropExp = getBoolean("mobs.vindicator.always-drop-exp", vindicatorAlwaysDropExp);
vindicatorCanPickUpLoot = getBooleanOrDefault("mobs.vindicator.can-pick-up-loot", vindicatorCanPickUpLoot);
}
public boolean wanderingTraderRidable = false;
@@ -3481,6 +3530,7 @@ public class PurpurWorldConfig {
public double witherSkeletonScale = 1.0D;
public boolean witherSkeletonTakeDamageFromWater = false;
public boolean witherSkeletonAlwaysDropExp = false;
public Boolean witherSkeletonCanPickUpLoot = null;
private void witherSkeletonSettings() {
witherSkeletonRidable = getBoolean("mobs.wither_skeleton.ridable", witherSkeletonRidable);
witherSkeletonRidableInWater = getBoolean("mobs.wither_skeleton.ridable-in-water", witherSkeletonRidableInWater);
@@ -3494,6 +3544,7 @@ public class PurpurWorldConfig {
witherSkeletonScale = Mth.clamp(getDouble("mobs.wither_skeleton.attributes.scale", witherSkeletonScale), 0.0625D, 16.0D);
witherSkeletonTakeDamageFromWater = getBoolean("mobs.wither_skeleton.takes-damage-from-water", witherSkeletonTakeDamageFromWater);
witherSkeletonAlwaysDropExp = getBoolean("mobs.wither_skeleton.always-drop-exp", witherSkeletonAlwaysDropExp);
witherSkeletonCanPickUpLoot = getBooleanOrDefault("mobs.wither_skeleton.can-pick-up-loot", witherSkeletonCanPickUpLoot);
}
public boolean wolfRidable = false;
@@ -3566,6 +3617,7 @@ public class PurpurWorldConfig {
public boolean zombieTakeDamageFromWater = false;
public boolean zombieAlwaysDropExp = false;
public double zombieHeadVisibilityPercent = 0.5D;
public Boolean zombieCanPickUpLoot = null;
private void zombieSettings() {
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
@@ -3591,6 +3643,7 @@ public class PurpurWorldConfig {
zombieTakeDamageFromWater = getBoolean("mobs.zombie.takes-damage-from-water", zombieTakeDamageFromWater);
zombieAlwaysDropExp = getBoolean("mobs.zombie.always-drop-exp", zombieAlwaysDropExp);
zombieHeadVisibilityPercent = getDouble("mobs.zombie.head-visibility-percent", zombieHeadVisibilityPercent);
zombieCanPickUpLoot = getBooleanOrDefault("mobs.zombie.can-pick-up-loot", zombieCanPickUpLoot);
}
public boolean zombieHorseRidable = false;
@@ -3655,6 +3708,7 @@ public class PurpurWorldConfig {
public int zombieVillagerCuringTimeMax = 6000;
public boolean zombieVillagerCureEnabled = true;
public boolean zombieVillagerAlwaysDropExp = false;
public Boolean zombieVillagerCanPickUpLoot = null;
private void zombieVillagerSettings() {
zombieVillagerRidable = getBoolean("mobs.zombie_villager.ridable", zombieVillagerRidable);
zombieVillagerRidableInWater = getBoolean("mobs.zombie_villager.ridable-in-water", zombieVillagerRidableInWater);
@@ -3675,6 +3729,7 @@ public class PurpurWorldConfig {
zombieVillagerCuringTimeMax = getInt("mobs.zombie_villager.curing_time.max", zombieVillagerCuringTimeMax);
zombieVillagerCureEnabled = getBoolean("mobs.zombie_villager.cure.enabled", zombieVillagerCureEnabled);
zombieVillagerAlwaysDropExp = getBoolean("mobs.zombie_villager.always-drop-exp", zombieVillagerAlwaysDropExp);
zombieVillagerCanPickUpLoot = getBooleanOrDefault("mobs.zombie_villager.can-pick-up-loot", zombieVillagerCanPickUpLoot);
}
public boolean zombifiedPiglinRidable = false;
@@ -3689,6 +3744,7 @@ public class PurpurWorldConfig {
public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = false;
public boolean zombifiedPiglinTakeDamageFromWater = false;
public boolean zombifiedPiglinAlwaysDropExp = false;
public Boolean zombifiedPiglinCanPickUpLoot = null;
private void zombifiedPiglinSettings() {
zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable);
zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater);
@@ -3710,6 +3766,7 @@ public class PurpurWorldConfig {
zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry);
zombifiedPiglinTakeDamageFromWater = getBoolean("mobs.zombified_piglin.takes-damage-from-water", zombifiedPiglinTakeDamageFromWater);
zombifiedPiglinAlwaysDropExp = getBoolean("mobs.zombified_piglin.always-drop-exp", zombifiedPiglinAlwaysDropExp);
zombifiedPiglinCanPickUpLoot = getBooleanOrDefault("mobs.zombified_piglin.can-pick-up-loot", zombifiedPiglinCanPickUpLoot);
}
public float hungerStarvationDamage = 1.0F;