2021-06-11 12:02:28 +00: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
|
2022-01-19 19:18:24 +00:00
|
|
|
index f61e0c14db835a6b79f7c4b1f68a1005d5b3e913..ab52e655d16dc565cfb890ec8fdb07ce7f68e4cf 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2021-12-01 01:31:13 +00:00
|
|
|
@@ -720,6 +720,14 @@ public class PaperWorldConfig {
|
2021-11-24 17:58:26 +00:00
|
|
|
phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs);
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ 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-11-24 17:58:26 +00:00
|
|
|
index 609380af4de4118a543b6ec94feb176e6f6870ed..ecf12ed5014202181e78af051e4a9ca88a275794 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
2021-11-24 17:58:26 +00:00
|
|
|
@@ -147,7 +147,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
2021-06-11 12:02:28 +00: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
|
2022-03-01 03:25:13 +00:00
|
|
|
index 7f779d724f8682cdfb777375f7e0af48f53708d3..dffb315cf21472f306bcc1d9fdcfba441a87b18f 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
2021-11-24 17:58:26 +00:00
|
|
|
@@ -498,7 +498,7 @@ public class Zombie extends Monster {
|
2021-06-14 19:17:47 +00:00
|
|
|
Object object = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
2021-06-11 12:02:28 +00: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 19:17:47 +00:00
|
|
|
object = new Zombie.ZombieGroupData(Zombie.getSpawnAsBabyOdds(world.getRandom()), true);
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|