Resolve #286 - Add config and API for item immunity to lightning

This commit is contained in:
BillyGalbreath
2021-05-03 13:32:36 -05:00
parent a86555bb5d
commit 83665826a9
98 changed files with 362 additions and 359 deletions

View File

@@ -338,10 +338,10 @@ index 04504901b1933ed760b34b8abb994de8ec340a4e..e18be05c9a9230105ec54395d4391c86
return true;
// Purpur end
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d8b13b279 100644
index 318513f5612a694c2b240840b24a39210457c202..6943af6037c1b8832c2fa652b92b9a2badf8bac5 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -286,6 +286,7 @@ public class PurpurWorldConfig {
@@ -296,6 +296,7 @@ public class PurpurWorldConfig {
public boolean disableDropsOnCrammingDeath = false;
public boolean entitiesPickUpLootBypassMobGriefing = false;
public boolean entitiesCanUsePortals = true;
@@ -349,7 +349,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
public boolean milkCuresBadOmen = true;
public boolean persistentTileEntityDisplayNames = false;
public boolean persistentDroppableEntityDisplayNames = false;
@@ -301,6 +302,7 @@ public class PurpurWorldConfig {
@@ -311,6 +312,7 @@ public class PurpurWorldConfig {
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
@@ -357,7 +357,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
@@ -454,9 +456,11 @@ public class PurpurWorldConfig {
@@ -464,9 +466,11 @@ public class PurpurWorldConfig {
dispenserPlaceAnvils = getBoolean("blocks.dispenser.place-anvils", dispenserPlaceAnvils);
}
@@ -369,7 +369,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
farmlandAlpha = getBoolean("blocks.farmland.use-alpha-farmland", farmlandAlpha);
}
@@ -515,10 +519,12 @@ public class PurpurWorldConfig {
@@ -525,10 +529,12 @@ public class PurpurWorldConfig {
stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
}
@@ -382,7 +382,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
@@ -790,12 +796,14 @@ public class PurpurWorldConfig {
@@ -800,12 +806,14 @@ public class PurpurWorldConfig {
public boolean enderDragonRidableInWater = false;
public double enderDragonMaxY = 256D;
public boolean enderDragonAlwaysDropsFullExp = false;
@@ -397,7 +397,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
if (PurpurConfig.version < 8) {
double oldValue = getDouble("mobs.ender_dragon.max-health", enderDragonMaxHealth);
set("mobs.ender_dragon.max-health", null);
@@ -811,12 +819,14 @@ public class PurpurWorldConfig {
@@ -821,12 +829,14 @@ public class PurpurWorldConfig {
public boolean endermanRidable = false;
public boolean endermanRidableInWater = false;
public boolean endermanAllowGriefing = true;
@@ -412,7 +412,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
endermanDespawnEvenWithBlock = getBoolean("mobs.enderman.can-despawn-with-held-block", endermanDespawnEvenWithBlock);
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.enderman.attributes.max-health", endermanMaxHealth);
@@ -842,10 +852,12 @@ public class PurpurWorldConfig {
@@ -852,10 +862,12 @@ public class PurpurWorldConfig {
public boolean evokerRidable = false;
public boolean evokerRidableInWater = false;
@@ -425,7 +425,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.evoker.attributes.max-health", evokerMaxHealth);
set("mobs.evoker.attributes.max-health", null);
@@ -856,12 +868,14 @@ public class PurpurWorldConfig {
@@ -866,12 +878,14 @@ public class PurpurWorldConfig {
public boolean foxRidable = false;
public boolean foxRidableInWater = false;
@@ -440,7 +440,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
foxBreedingTicks = getInt("mobs.fox.breeding-delay-ticks", foxBreedingTicks);
if (PurpurConfig.version < 10) {
@@ -1298,10 +1312,12 @@ public class PurpurWorldConfig {
@@ -1308,10 +1322,12 @@ public class PurpurWorldConfig {
public boolean pillagerRidable = false;
public boolean pillagerRidableInWater = false;
@@ -453,7 +453,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.pillager.attributes.max-health", pillagerMaxHealth);
set("mobs.pillager.attributes.max-health", null);
@@ -1345,6 +1361,7 @@ public class PurpurWorldConfig {
@@ -1355,6 +1371,7 @@ public class PurpurWorldConfig {
public boolean rabbitRidable = false;
public boolean rabbitRidableInWater = false;
@@ -461,7 +461,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
public double rabbitNaturalToast = 0.0D;
public double rabbitNaturalKiller = 0.0D;
public int rabbitBreedingTicks = 6000;
@@ -1352,6 +1369,7 @@ public class PurpurWorldConfig {
@@ -1362,6 +1379,7 @@ public class PurpurWorldConfig {
private void rabbitSettings() {
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
@@ -469,7 +469,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
rabbitBreedingTicks = getInt("mobs.rabbit.breeding-delay-ticks", rabbitBreedingTicks);
@@ -1365,10 +1383,12 @@ public class PurpurWorldConfig {
@@ -1375,10 +1393,12 @@ public class PurpurWorldConfig {
public boolean ravagerRidable = false;
public boolean ravagerRidableInWater = false;
@@ -482,7 +482,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.ravager.attributes.max-health", ravagerMaxHealth);
set("mobs.ravager.attributes.max-health", null);
@@ -1392,11 +1412,13 @@ public class PurpurWorldConfig {
@@ -1402,11 +1422,13 @@ public class PurpurWorldConfig {
public boolean sheepRidable = false;
public boolean sheepRidableInWater = false;
public int sheepBreedingTicks = 6000;
@@ -496,7 +496,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.sheep.attributes.max-health", sheepMaxHealth);
set("mobs.sheep.attributes.max-health", null);
@@ -1421,10 +1443,12 @@ public class PurpurWorldConfig {
@@ -1431,10 +1453,12 @@ public class PurpurWorldConfig {
public boolean silverfishRidable = false;
public boolean silverfishRidableInWater = false;
@@ -509,7 +509,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.silverfish.attributes.max-health", silverfishMaxHealth);
set("mobs.silverfish.attributes.max-health", null);
@@ -1491,6 +1515,7 @@ public class PurpurWorldConfig {
@@ -1501,6 +1525,7 @@ public class PurpurWorldConfig {
public boolean snowGolemRidable = false;
public boolean snowGolemRidableInWater = false;
public boolean snowGolemLeaveTrailWhenRidden = false;
@@ -517,7 +517,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
public boolean snowGolemDropsPumpkin = true;
public boolean snowGolemPutPumpkinBack = false;
public int snowGolemSnowBallMin = 20;
@@ -1502,6 +1527,7 @@ public class PurpurWorldConfig {
@@ -1512,6 +1537,7 @@ public class PurpurWorldConfig {
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
snowGolemLeaveTrailWhenRidden = getBoolean("mobs.snow_golem.leave-trail-when-ridden", snowGolemLeaveTrailWhenRidden);
@@ -525,7 +525,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
snowGolemSnowBallMin = getInt("mobs.snow_golem.min-shoot-interval-ticks", snowGolemSnowBallMin);
@@ -1720,6 +1746,7 @@ public class PurpurWorldConfig {
@@ -1730,6 +1756,7 @@ public class PurpurWorldConfig {
public boolean witherRidable = false;
public boolean witherRidableInWater = false;
public double witherMaxY = 256D;
@@ -533,7 +533,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
public float witherHealthRegenAmount = 1.0f;
public int witherHealthRegenDelay = 20;
public double witherMaxHealth = 300.0D;
@@ -1727,6 +1754,7 @@ public class PurpurWorldConfig {
@@ -1737,6 +1764,7 @@ public class PurpurWorldConfig {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
witherMaxY = getDouble("mobs.wither.ridable-max-y", witherMaxY);
@@ -541,7 +541,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
witherHealthRegenAmount = (float) getDouble("mobs.wither.health-regen-amount", witherHealthRegenAmount);
witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay);
if (PurpurConfig.version < 8) {
@@ -1799,6 +1827,7 @@ public class PurpurWorldConfig {
@@ -1809,6 +1837,7 @@ public class PurpurWorldConfig {
public boolean zombieRidable = false;
public boolean zombieRidableInWater = false;
@@ -549,7 +549,7 @@ index 59a19ab449287226938852a06b88d20c2062a43c..bad517f152bf660d75e9c9ceaea31d0d
public boolean zombieJockeyOnlyBaby = true;
public double zombieJockeyChance = 0.05D;
public boolean zombieJockeyTryExistingChickens = true;
@@ -1809,6 +1838,7 @@ public class PurpurWorldConfig {
@@ -1819,6 +1848,7 @@ public class PurpurWorldConfig {
private void zombieSettings() {
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);