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-06-06 00:17:27 +00:00
|
|
|
index 5fe4d2005e87a7b69e98dcd68e0fff3cc26a8c96..f4559f3bc7751da48a84d75a949c9df298ee48b4 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
|
2022-06-06 00:17:27 +00:00
|
|
|
@@ -787,6 +787,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
|
2022-06-08 07:30:41 +00:00
|
|
|
index 60064770f08cbee19eeb43bf7c144b6eefbc4888..5f679d5f148e59376669a5faa970961df219fe35 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
|
2022-06-08 07:30:41 +00:00
|
|
|
@@ -150,7 +150,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
|
|
|
this.populateDefaultEquipmentSlots(randomsource, difficulty);
|
|
|
|
this.populateDefaultEquipmentEnchantments(randomsource, difficulty);
|
2021-06-11 12:02:28 +00:00
|
|
|
this.reassessWeaponGoal();
|
2022-06-08 07:30:41 +00:00
|
|
|
- this.setCanPickUpLoot(randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier());
|
|
|
|
+ this.setCanPickUpLoot(this.level.paperConfig.skeletonsAlwaysCanPickUpLoot || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper
|
2021-06-11 12:02:28 +00:00
|
|
|
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-06-08 07:30:41 +00:00
|
|
|
index 847dbd6dae8e9a615ade642c598bc7bb45fb4722..6d0461a2cf3c06d85177ca4959f330c1ec7f6788 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
|
2022-06-08 07:30:41 +00:00
|
|
|
@@ -508,7 +508,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();
|
|
|
|
|
2022-06-08 07:30:41 +00:00
|
|
|
- this.setCanPickUpLoot(randomsource.nextFloat() < 0.55F * f);
|
|
|
|
+ this.setCanPickUpLoot(this.level.paperConfig.zombiesAlwaysCanPickUpLoot || randomsource.nextFloat() < 0.55F * f); // Paper
|
2021-06-11 12:02:28 +00:00
|
|
|
if (object == null) {
|
2022-06-08 07:30:41 +00:00
|
|
|
object = new Zombie.ZombieGroupData(Zombie.getSpawnAsBabyOdds(randomsource), true);
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|