Fix silk-touch spawners dropping xp and add config for minimal enchantment level (#454)

This commit is contained in:
Bierque Jason
2021-07-01 06:06:52 +02:00
committed by GitHub
parent 139f2f5d07
commit 247b99f433
112 changed files with 410 additions and 400 deletions

View File

@@ -393,10 +393,10 @@ index e98fc3c235f9160f1928a8afb0d7991a6d3430cb..db35f756b7adb6b113659ae13b08ab89
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 cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5ef2fa37ad 100644
index 070960881e097c69a9227893153ae352493e4f37..19fe72cb76aaf6ed87de8aae49f31aa9d5668c00 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -354,9 +354,12 @@ public class PurpurWorldConfig {
@@ -356,9 +356,12 @@ public class PurpurWorldConfig {
public boolean boatsDoFallDamage = true;
public boolean disableDropsOnCrammingDeath = false;
public boolean entitiesCanUsePortals = true;
@@ -409,7 +409,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
public double tridentLoyaltyVoidReturnHeight = 0.0D;
public double voidDamageHeight = -64.0D;
public double voidDamageDealt = 4.0D;
@@ -368,9 +371,12 @@ public class PurpurWorldConfig {
@@ -370,9 +373,12 @@ public class PurpurWorldConfig {
boatsDoFallDamage = getBoolean("gameplay-mechanics.boat.do-fall-damage", boatsDoFallDamage);
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
@@ -422,7 +422,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
voidDamageDealt = getDouble("gameplay-mechanics.void-damage-dealt", voidDamageDealt);
@@ -440,9 +446,11 @@ public class PurpurWorldConfig {
@@ -442,9 +448,11 @@ public class PurpurWorldConfig {
dispenserPlaceAnvils = getBoolean("blocks.dispenser.place-anvils", dispenserPlaceAnvils);
}
@@ -434,7 +434,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
farmlandAlpha = getBoolean("blocks.farmland.use-alpha-farmland", farmlandAlpha);
}
@@ -468,6 +476,11 @@ public class PurpurWorldConfig {
@@ -470,6 +478,11 @@ public class PurpurWorldConfig {
kelpMaxGrowthAge = getInt("blocks.kelp.max-growth-age", kelpMaxGrowthAge);
}
@@ -446,7 +446,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
public boolean respawnAnchorExplode = true;
public double respawnAnchorExplosionPower = 5.0D;
public boolean respawnAnchorExplosionFire = true;
@@ -501,6 +514,11 @@ public class PurpurWorldConfig {
@@ -503,6 +516,11 @@ public class PurpurWorldConfig {
stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
}
@@ -458,7 +458,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
public double twistingVinesGrowthModifier = 0.10D;
public int twistingVinesMaxGrowthAge = 25;
private void twistingVinesSettings() {
@@ -679,6 +697,7 @@ public class PurpurWorldConfig {
@@ -681,6 +699,7 @@ public class PurpurWorldConfig {
public double creeperMaxHealth = 20.0D;
public double creeperChargedChance = 0.0D;
public boolean creeperAllowGriefing = true;
@@ -466,7 +466,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void creeperSettings() {
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
@@ -690,6 +709,7 @@ public class PurpurWorldConfig {
@@ -692,6 +711,7 @@ public class PurpurWorldConfig {
creeperMaxHealth = getDouble("mobs.creeper.attributes.max_health", creeperMaxHealth);
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
@@ -474,7 +474,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean dolphinRidable = false;
@@ -777,6 +797,7 @@ public class PurpurWorldConfig {
@@ -779,6 +799,7 @@ public class PurpurWorldConfig {
public double enderDragonMaxY = 256D;
public double enderDragonMaxHealth = 200.0D;
public boolean enderDragonAlwaysDropsFullExp = false;
@@ -482,7 +482,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void enderDragonSettings() {
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
@@ -792,6 +813,7 @@ public class PurpurWorldConfig {
@@ -794,6 +815,7 @@ public class PurpurWorldConfig {
}
enderDragonMaxHealth = getDouble("mobs.ender_dragon.attributes.max_health", enderDragonMaxHealth);
enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
@@ -490,7 +490,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean endermanRidable = false;
@@ -799,6 +821,7 @@ public class PurpurWorldConfig {
@@ -801,6 +823,7 @@ public class PurpurWorldConfig {
public double endermanMaxHealth = 40.0D;
public boolean endermanAllowGriefing = true;
public boolean endermanDespawnEvenWithBlock = false;
@@ -498,7 +498,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void endermanSettings() {
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
@@ -810,6 +833,7 @@ public class PurpurWorldConfig {
@@ -812,6 +835,7 @@ public class PurpurWorldConfig {
endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth);
endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
endermanDespawnEvenWithBlock = getBoolean("mobs.enderman.can-despawn-with-held-block", endermanDespawnEvenWithBlock);
@@ -506,7 +506,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean endermiteRidable = false;
@@ -829,6 +853,7 @@ public class PurpurWorldConfig {
@@ -831,6 +855,7 @@ public class PurpurWorldConfig {
public boolean evokerRidable = false;
public boolean evokerRidableInWater = false;
public double evokerMaxHealth = 24.0D;
@@ -514,7 +514,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void evokerSettings() {
evokerRidable = getBoolean("mobs.evoker.ridable", evokerRidable);
evokerRidableInWater = getBoolean("mobs.evoker.ridable-in-water", evokerRidableInWater);
@@ -838,6 +863,7 @@ public class PurpurWorldConfig {
@@ -840,6 +865,7 @@ public class PurpurWorldConfig {
set("mobs.evoker.attributes.max_health", oldValue);
}
evokerMaxHealth = getDouble("mobs.evoker.attributes.max_health", evokerMaxHealth);
@@ -522,7 +522,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean foxRidable = false;
@@ -845,6 +871,7 @@ public class PurpurWorldConfig {
@@ -847,6 +873,7 @@ public class PurpurWorldConfig {
public double foxMaxHealth = 10.0D;
public boolean foxTypeChangesWithTulips = false;
public int foxBreedingTicks = 6000;
@@ -530,7 +530,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void foxSettings() {
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
@@ -856,6 +883,7 @@ public class PurpurWorldConfig {
@@ -858,6 +885,7 @@ public class PurpurWorldConfig {
foxMaxHealth = getDouble("mobs.fox.attributes.max_health", foxMaxHealth);
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
foxBreedingTicks = getInt("mobs.fox.breeding-delay-ticks", foxBreedingTicks);
@@ -538,7 +538,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean ghastRidable = false;
@@ -1251,6 +1279,7 @@ public class PurpurWorldConfig {
@@ -1253,6 +1281,7 @@ public class PurpurWorldConfig {
public boolean piglinRidable = false;
public boolean piglinRidableInWater = false;
public double piglinMaxHealth = 16.0D;
@@ -546,7 +546,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void piglinSettings() {
piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable);
piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater);
@@ -1260,6 +1289,7 @@ public class PurpurWorldConfig {
@@ -1262,6 +1291,7 @@ public class PurpurWorldConfig {
set("mobs.piglin.attributes.max_health", oldValue);
}
piglinMaxHealth = getDouble("mobs.piglin.attributes.max_health", piglinMaxHealth);
@@ -554,7 +554,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean piglinBruteRidable = false;
@@ -1279,6 +1309,7 @@ public class PurpurWorldConfig {
@@ -1281,6 +1311,7 @@ public class PurpurWorldConfig {
public boolean pillagerRidable = false;
public boolean pillagerRidableInWater = false;
public double pillagerMaxHealth = 24.0D;
@@ -562,7 +562,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void pillagerSettings() {
pillagerRidable = getBoolean("mobs.pillager.ridable", pillagerRidable);
pillagerRidableInWater = getBoolean("mobs.pillager.ridable-in-water", pillagerRidableInWater);
@@ -1288,6 +1319,7 @@ public class PurpurWorldConfig {
@@ -1290,6 +1321,7 @@ public class PurpurWorldConfig {
set("mobs.pillager.attributes.max_health", oldValue);
}
pillagerMaxHealth = getDouble("mobs.pillager.attributes.max_health", pillagerMaxHealth);
@@ -570,7 +570,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean polarBearRidable = false;
@@ -1329,6 +1361,7 @@ public class PurpurWorldConfig {
@@ -1331,6 +1363,7 @@ public class PurpurWorldConfig {
public double rabbitNaturalToast = 0.0D;
public double rabbitNaturalKiller = 0.0D;
public int rabbitBreedingTicks = 6000;
@@ -578,7 +578,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void rabbitSettings() {
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
@@ -1341,11 +1374,13 @@ public class PurpurWorldConfig {
@@ -1343,11 +1376,13 @@ public class PurpurWorldConfig {
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);
@@ -592,7 +592,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void ravagerSettings() {
ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable);
ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater);
@@ -1355,6 +1390,7 @@ public class PurpurWorldConfig {
@@ -1357,6 +1392,7 @@ public class PurpurWorldConfig {
set("mobs.ravager.attributes.max_health", oldValue);
}
ravagerMaxHealth = getDouble("mobs.ravager.attributes.max_health", ravagerMaxHealth);
@@ -600,7 +600,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean salmonRidable = false;
@@ -1373,6 +1409,7 @@ public class PurpurWorldConfig {
@@ -1375,6 +1411,7 @@ public class PurpurWorldConfig {
public boolean sheepRidableInWater = false;
public double sheepMaxHealth = 8.0D;
public int sheepBreedingTicks = 6000;
@@ -608,7 +608,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void sheepSettings() {
sheepRidable = getBoolean("mobs.sheep.ridable", sheepRidable);
sheepRidableInWater = getBoolean("mobs.sheep.ridable-in-water", sheepRidableInWater);
@@ -1383,6 +1420,7 @@ public class PurpurWorldConfig {
@@ -1385,6 +1422,7 @@ public class PurpurWorldConfig {
}
sheepMaxHealth = getDouble("mobs.sheep.attributes.max_health", sheepMaxHealth);
sheepBreedingTicks = getInt("mobs.sheep.breeding-delay-ticks", sheepBreedingTicks);
@@ -616,7 +616,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean shulkerRidable = false;
@@ -1402,6 +1440,7 @@ public class PurpurWorldConfig {
@@ -1404,6 +1442,7 @@ public class PurpurWorldConfig {
public boolean silverfishRidable = false;
public boolean silverfishRidableInWater = false;
public double silverfishMaxHealth = 8.0D;
@@ -624,7 +624,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void silverfishSettings() {
silverfishRidable = getBoolean("mobs.silverfish.ridable", silverfishRidable);
silverfishRidableInWater = getBoolean("mobs.silverfish.ridable-in-water", silverfishRidableInWater);
@@ -1411,6 +1450,7 @@ public class PurpurWorldConfig {
@@ -1413,6 +1452,7 @@ public class PurpurWorldConfig {
set("mobs.silverfish.attributes.max_health", oldValue);
}
silverfishMaxHealth = getDouble("mobs.silverfish.attributes.max_health", silverfishMaxHealth);
@@ -632,7 +632,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean skeletonRidable = false;
@@ -1478,6 +1518,7 @@ public class PurpurWorldConfig {
@@ -1480,6 +1520,7 @@ public class PurpurWorldConfig {
public int snowGolemSnowBallMax = 20;
public float snowGolemSnowBallModifier = 10.0F;
public double snowGolemAttackDistance = 1.25D;
@@ -640,7 +640,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void snowGolemSettings() {
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
@@ -1494,6 +1535,7 @@ public class PurpurWorldConfig {
@@ -1496,6 +1537,7 @@ public class PurpurWorldConfig {
snowGolemSnowBallMax = getInt("mobs.snow_golem.max-shoot-interval-ticks", snowGolemSnowBallMax);
snowGolemSnowBallModifier = (float) getDouble("mobs.snow_golem.snow-ball-modifier", snowGolemSnowBallModifier);
snowGolemAttackDistance = getDouble("mobs.snow_golem.attack-distance", snowGolemAttackDistance);
@@ -648,7 +648,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean squidRidable = false;
@@ -1653,6 +1695,7 @@ public class PurpurWorldConfig {
@@ -1655,6 +1697,7 @@ public class PurpurWorldConfig {
public int villagerLobotomizeCheck = 60;
public boolean villagerClericsFarmWarts = false;
public boolean villagerClericFarmersThrowWarts = true;
@@ -656,7 +656,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void villagerSettings() {
villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable);
villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater);
@@ -1679,6 +1722,7 @@ public class PurpurWorldConfig {
@@ -1681,6 +1724,7 @@ public class PurpurWorldConfig {
villagerLobotomizeCheck = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheck);
villagerClericsFarmWarts = getBoolean("mobs.villager.clerics-farm-warts", villagerClericsFarmWarts);
villagerClericFarmersThrowWarts = getBoolean("mobs.villager.cleric-wart-farmers-throw-warts-at-villagers", villagerClericFarmersThrowWarts);
@@ -664,7 +664,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean vindicatorRidable = false;
@@ -1735,6 +1779,7 @@ public class PurpurWorldConfig {
@@ -1737,6 +1781,7 @@ public class PurpurWorldConfig {
public double witherMaxHealth = 300.0D;
public float witherHealthRegenAmount = 1.0f;
public int witherHealthRegenDelay = 20;
@@ -672,7 +672,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
@@ -1751,6 +1796,7 @@ public class PurpurWorldConfig {
@@ -1753,6 +1798,7 @@ public class PurpurWorldConfig {
witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth);
witherHealthRegenAmount = (float) getDouble("mobs.wither.health-regen-amount", witherHealthRegenAmount);
witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay);
@@ -680,7 +680,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
}
public boolean witherSkeletonRidable = false;
@@ -1818,6 +1864,7 @@ public class PurpurWorldConfig {
@@ -1820,6 +1866,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyTryExistingChickens = true;
public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
public Difficulty zombieBreakDoorMinDifficulty = Difficulty.HARD;
@@ -688,7 +688,7 @@ index cfff7b76f993d5bf134d1de27052d6e33dd03a66..d23f0116e3836887a014e714effd8f5e
private void zombieSettings() {
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
@@ -1837,6 +1884,7 @@ public class PurpurWorldConfig {
@@ -1839,6 +1886,7 @@ public class PurpurWorldConfig {
} catch (IllegalArgumentException ignore) {
zombieBreakDoorMinDifficulty = Difficulty.HARD;
}