2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Sat, 28 Nov 2020 18:43:52 -0800
|
|
|
|
Subject: [PATCH] Added world settings for mobs picking up loot
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-06-17 10:37:27 +02:00
|
|
|
index 0079b4423c022a68aa9bee5b81910714ef3d1cd8..8d7acac29d5a8586f449e32f51c1213545e4d366 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-06-17 10:37:27 +02:00
|
|
|
@@ -430,6 +430,14 @@ public class PaperWorldConfig {
|
2021-06-11 14:02:28 +02:00
|
|
|
log("Creeper lingering effect: " + disableCreeperLingeringEffect);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public boolean zombiesAlwaysCanPickUpLoot;
|
|
|
|
+ public boolean skeletonsAlwaysCanPickUpLoot;
|
|
|
|
+ private void setMobsAlwaysCanPickUpLoot() {
|
|
|
|
+ zombiesAlwaysCanPickUpLoot = getBoolean("mobs-can-always-pick-up-loot.zombies", false);
|
|
|
|
+ skeletonsAlwaysCanPickUpLoot = getBoolean("mobs-can-always-pick-up-loot.skeletons", false);
|
|
|
|
+ log("Zombies can always pick up loot: " + zombiesAlwaysCanPickUpLoot + ". Skeletons can always pick up loot: " + skeletonsAlwaysCanPickUpLoot + ".");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
public int expMergeMaxValue;
|
|
|
|
private void expMergeMaxValue() {
|
|
|
|
expMergeMaxValue = getInt("experience-merge-max-value", -1);
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
2021-06-14 21:17:47 +02:00
|
|
|
index 3d8f3e22223e4effeaf52cb18c14c60276d4689c..6b4163f5601a0961055c8451ec7ef2204938cf69 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
2021-06-14 21:17:47 +02:00
|
|
|
@@ -148,7 +148,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
2021-06-11 14:02:28 +02:00
|
|
|
this.populateDefaultEquipmentSlots(difficulty);
|
|
|
|
this.populateDefaultEquipmentEnchantments(difficulty);
|
|
|
|
this.reassessWeaponGoal();
|
|
|
|
- this.setCanPickUpLoot(this.random.nextFloat() < 0.55F * difficulty.getSpecialMultiplier());
|
|
|
|
+ this.setCanPickUpLoot(this.level.paperConfig.skeletonsAlwaysCanPickUpLoot || this.random.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper
|
|
|
|
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
|
|
|
|
LocalDate localdate = LocalDate.now();
|
|
|
|
int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
2021-06-16 00:24:12 +02:00
|
|
|
index 15f445e7d7250f274351cc5e46cc952d3630de5a..6c4c5756def8eb368cbc6e9319ae6f7ddccf0499 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
2021-06-16 00:24:12 +02:00
|
|
|
@@ -496,7 +496,7 @@ public class Zombie extends Monster {
|
2021-06-14 21:17:47 +02:00
|
|
|
Object object = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
2021-06-11 14:02:28 +02:00
|
|
|
float f = difficulty.getSpecialMultiplier();
|
|
|
|
|
|
|
|
- this.setCanPickUpLoot(this.random.nextFloat() < 0.55F * f);
|
|
|
|
+ this.setCanPickUpLoot(this.level.paperConfig.zombiesAlwaysCanPickUpLoot || this.random.nextFloat() < 0.55F * f); // Paper
|
|
|
|
if (object == null) {
|
2021-06-14 21:17:47 +02:00
|
|
|
object = new Zombie.ZombieGroupData(Zombie.getSpawnAsBabyOdds(world.getRandom()), true);
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|