mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-06-22 18:27:46 +02:00
apply mc source feature patches
This commit is contained in:
5254
purpur-server/minecraft-patches/features/0001-Ridables.patch
Normal file
5254
purpur-server/minecraft-patches/features/0001-Ridables.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,245 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 21:50:37 -0500
|
||||
Subject: [PATCH] Barrels and enderchests 6 rows
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 3e18c6ca8f5a732a110277f817a3e8dcd742f193..b471145ff65e07c39689e466387715698b55481e 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -886,6 +886,27 @@ public abstract class PlayerList {
|
||||
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
|
||||
this.server.getCommands().sendCommands(player);
|
||||
} // Paper - Add sendOpLevel API
|
||||
+
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.enderChestSixRows && org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
|
||||
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkit = player.getBukkitEntity();
|
||||
+ if (bukkit.hasPermission("purpur.enderchest.rows.six")) {
|
||||
+ player.sixRowEnderchestSlotCount = 54;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.five")) {
|
||||
+ player.sixRowEnderchestSlotCount = 45;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.four")) {
|
||||
+ player.sixRowEnderchestSlotCount = 36;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.three")) {
|
||||
+ player.sixRowEnderchestSlotCount = 27;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.two")) {
|
||||
+ player.sixRowEnderchestSlotCount = 18;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.one")) {
|
||||
+ player.sixRowEnderchestSlotCount = 9;
|
||||
+ }
|
||||
+ } else {
|
||||
+ player.sixRowEnderchestSlotCount = -1;
|
||||
+ }
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
// Paper start - whitelist verify event / login event
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index def90b5105edb0303eecc4424ff7d6e2cb050791..99db58c431252f87eda5d741b54a5e4e87addae5 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -176,6 +176,7 @@ public abstract class Player extends Avatar implements ContainerUser {
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
public int burpDelay = 0; // Purpur - Burp delay
|
||||
public boolean canPortalInstant = false; // Purpur - Add portal permission bypass
|
||||
+ public int sixRowEnderchestSlotCount = -1; // Purpur - Barrels and enderchests 6 rows
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
diff --git a/net/minecraft/world/inventory/ChestMenu.java b/net/minecraft/world/inventory/ChestMenu.java
|
||||
index e77bfcd31cdcfd5836dc5db561e3fe2bc552a4b1..afa2ead0548766669201526d83f351c227c97e87 100644
|
||||
--- a/net/minecraft/world/inventory/ChestMenu.java
|
||||
+++ b/net/minecraft/world/inventory/ChestMenu.java
|
||||
@@ -66,10 +66,30 @@ public class ChestMenu extends AbstractContainerMenu {
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, containerId, inventory, 6);
|
||||
}
|
||||
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ public static ChestMenu oneRow(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x1, syncId, playerInventory, inventory, 1);
|
||||
+ }
|
||||
+
|
||||
+ public static ChestMenu twoRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x2, syncId, playerInventory, inventory, 2);
|
||||
+ }
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public static ChestMenu threeRows(final int containerId, final Inventory inventory, final Container container) {
|
||||
return new ChestMenu(MenuType.GENERIC_9x3, containerId, inventory, container, 3);
|
||||
}
|
||||
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ public static ChestMenu fourRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x4, syncId, playerInventory, inventory, 4);
|
||||
+ }
|
||||
+
|
||||
+ public static ChestMenu fiveRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x5, syncId, playerInventory, inventory, 5);
|
||||
+ }
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public static ChestMenu sixRows(final int containerId, final Inventory inventory, final Container container) {
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, containerId, inventory, container, 6);
|
||||
}
|
||||
diff --git a/net/minecraft/world/inventory/PlayerEnderChestContainer.java b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
index 4df3a32faf85595372f4b250482d852c985ea3ab..33c4c2cc8b488df5276d21e0f4e29cc0072a7682 100644
|
||||
--- a/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
+++ b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
@@ -26,11 +26,18 @@ public class PlayerEnderChestContainer extends SimpleContainer {
|
||||
}
|
||||
|
||||
public PlayerEnderChestContainer(Player owner) {
|
||||
- super(27);
|
||||
+ super(org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? 54 : 27); // Purpur - Barrels and enderchests 6 rows
|
||||
this.owner = owner;
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ @Override
|
||||
+ public int getContainerSize() {
|
||||
+ return owner == null || owner.sixRowEnderchestSlotCount < 0 ? super.getContainerSize() : owner.sixRowEnderchestSlotCount;
|
||||
+ }
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
public void setActiveChest(final EnderChestBlockEntity activeChest) {
|
||||
this.activeChest = activeChest;
|
||||
}
|
||||
@@ -40,19 +47,25 @@ public class PlayerEnderChestContainer extends SimpleContainer {
|
||||
}
|
||||
|
||||
public void fromSlots(final ValueInput.TypedInputList<ItemStackWithSlot> list) {
|
||||
- for (int i = 0; i < this.getContainerSize(); i++) {
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ int storageSlotCount = org.purpurmc.purpur.PurpurConfig.enderChestSixRows && org.purpurmc.purpur.PurpurConfig.enderChestPersistHiddenRows ? 54 : this.getContainerSize();
|
||||
+ for (int i = 0; i < storageSlotCount; i++) {
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
this.setItem(i, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
for (ItemStackWithSlot item : list) {
|
||||
- if (item.isValidInContainer(this.getContainerSize())) {
|
||||
+ if (item.isValidInContainer(storageSlotCount)) { // Purpur - Barrels and enderchests 6 rows
|
||||
this.setItem(item.slot(), item.stack());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void storeAsSlots(final ValueOutput.TypedOutputList<ItemStackWithSlot> output) {
|
||||
- for (int i = 0; i < this.getContainerSize(); i++) {
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ int storageSlotCount = org.purpurmc.purpur.PurpurConfig.enderChestSixRows && org.purpurmc.purpur.PurpurConfig.enderChestPersistHiddenRows ? 54 : this.getContainerSize(); // Purpur - Barrels and enderchests 6 rows
|
||||
+ for (int i = 0; i < storageSlotCount; i++) {
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
ItemStack itemStack = this.getItem(i);
|
||||
if (!itemStack.isEmpty()) {
|
||||
output.add(new ItemStackWithSlot(i, itemStack));
|
||||
diff --git a/net/minecraft/world/level/block/EnderChestBlock.java b/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
index f1a5b9670dd04b800a8d755f32364458a16d924a..899f422494396dd0b797c03de209e7a2ec4d274b 100644
|
||||
--- a/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
+++ b/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
@@ -90,7 +90,7 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
||||
// Paper start - Fix InventoryOpenEvent cancellation - moved up;
|
||||
container.setActiveChest(enderChest); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
|
||||
if (level instanceof ServerLevel serverLevel && player.openMenu(
|
||||
- new SimpleMenuProvider((containerId, inventory, p) -> ChestMenu.threeRows(containerId, inventory, container), CONTAINER_TITLE)
|
||||
+ new SimpleMenuProvider((containerId, inventory, p) -> org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? getEnderChestSixRows(containerId, inventory, player, container) : ChestMenu.threeRows(containerId, inventory, container), CONTAINER_TITLE) // Purpur - Barrels and enderchests 6 rows
|
||||
).isPresent()) {
|
||||
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
|
||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||
@@ -103,6 +103,35 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ private ChestMenu getEnderChestSixRows(int syncId, net.minecraft.world.entity.player.Inventory inventory, Player player, PlayerEnderChestContainer playerEnderChestContainer) {
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
|
||||
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkitPlayer = player.getBukkitEntity();
|
||||
+ if (bukkitPlayer.hasPermission("purpur.enderchest.rows.six")) {
|
||||
+ player.sixRowEnderchestSlotCount = 54;
|
||||
+ return ChestMenu.sixRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.five")) {
|
||||
+ player.sixRowEnderchestSlotCount = 45;
|
||||
+ return ChestMenu.fiveRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.four")) {
|
||||
+ player.sixRowEnderchestSlotCount = 36;
|
||||
+ return ChestMenu.fourRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.three")) {
|
||||
+ player.sixRowEnderchestSlotCount = 27;
|
||||
+ return ChestMenu.threeRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.two")) {
|
||||
+ player.sixRowEnderchestSlotCount = 18;
|
||||
+ return ChestMenu.twoRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.one")) {
|
||||
+ player.sixRowEnderchestSlotCount = 9;
|
||||
+ return ChestMenu.oneRow(syncId, inventory, playerEnderChestContainer);
|
||||
+ }
|
||||
+ }
|
||||
+ player.sixRowEnderchestSlotCount = -1;
|
||||
+ return ChestMenu.sixRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ }
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
+
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(final BlockPos worldPosition, final BlockState blockState) {
|
||||
return new EnderChestBlockEntity(worldPosition, blockState);
|
||||
diff --git a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index 5bfd25f22808794f5e24d5425ea32e8c1b927182..e489da795bfc3f6fded36608761068ba7f333e4b 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -59,7 +59,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
private static final Component DEFAULT_NAME = Component.translatable("container.barrel");
|
||||
- private NonNullList<ItemStack> items = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ private NonNullList<ItemStack> items = NonNullList.withSize(switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
+ case 4 -> 36;
|
||||
+ case 2 -> 18;
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ }, ItemStack.EMPTY);
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
public final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() {
|
||||
// Paper start - delay open/close callbacks
|
||||
@Override
|
||||
@@ -118,7 +127,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
- return 27;
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ return switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
+ case 4 -> 36;
|
||||
+ case 2 -> 18;
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ };
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,7 +156,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
|
||||
@Override
|
||||
protected AbstractContainerMenu createMenu(final int containerId, final Inventory inventory) {
|
||||
- return ChestMenu.threeRows(containerId, inventory, this);
|
||||
+ // Purpur start - Barrels and enderchests 6 rows
|
||||
+ return switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> ChestMenu.sixRows(containerId, inventory, this);
|
||||
+ case 5 -> ChestMenu.fiveRows(containerId, inventory, this);
|
||||
+ case 4 -> ChestMenu.fourRows(containerId, inventory, this);
|
||||
+ case 2 -> ChestMenu.twoRows(containerId, inventory, this);
|
||||
+ case 1 -> ChestMenu.oneRow(containerId, inventory, this);
|
||||
+ default -> ChestMenu.threeRows(containerId, inventory, this);
|
||||
+ };
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,76 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Giants AI settings
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Giant.java b/net/minecraft/world/entity/monster/Giant.java
|
||||
index 7b6952f13e18548d0e71035d6cd6cfb24c03e6ee..c39031e8fdfb0dff7867d9525dbddde110242647 100644
|
||||
--- a/net/minecraft/world/entity/monster/Giant.java
|
||||
+++ b/net/minecraft/world/entity/monster/Giant.java
|
||||
@@ -30,8 +30,25 @@ public class Giant extends Monster {
|
||||
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
- this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
- this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ // Purpur start - Giants AI settings
|
||||
+ if (level().purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.FloatGoal(this));
|
||||
+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ this.goalSelector.addGoal(7, new net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
+ this.goalSelector.addGoal(8, new net.minecraft.world.entity.ai.goal.LookAtPlayerGoal(this, net.minecraft.world.entity.player.Player.class, 16.0F));
|
||||
+ this.goalSelector.addGoal(8, new net.minecraft.world.entity.ai.goal.RandomLookAroundGoal(this));
|
||||
+ this.goalSelector.addGoal(5, new net.minecraft.world.entity.ai.goal.MoveTowardsRestrictionGoal(this, 1.0D));
|
||||
+ if (level().purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.0D, false));
|
||||
+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ this.targetSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal(this).setAlertOthers(net.minecraft.world.entity.monster.zombie.ZombifiedPiglin.class));
|
||||
+ this.targetSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, net.minecraft.world.entity.player.Player.class, true));
|
||||
+ this.targetSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, net.minecraft.world.entity.npc.villager.Villager.class, false));
|
||||
+ this.targetSelector.addGoal(4, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, net.minecraft.world.entity.animal.golem.IronGolem.class, true));
|
||||
+ this.targetSelector.addGoal(5, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, net.minecraft.world.entity.animal.turtle.Turtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Giants AI settings
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
@@ -53,8 +70,36 @@ public class Giant extends Monster {
|
||||
.add(Attributes.CAMERA_DISTANCE, 16.0);
|
||||
}
|
||||
|
||||
+ // Purpur - Giants AI settings
|
||||
+ @Override
|
||||
+ public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.EntitySpawnReason spawnReason, @org.jetbrains.annotations.Nullable net.minecraft.world.entity.SpawnGroupData entityData) {
|
||||
+ net.minecraft.world.entity.SpawnGroupData groupData = super.finalizeSpawn(world, difficulty, spawnReason, entityData);
|
||||
+ if (groupData == null) {
|
||||
+ populateDefaultEquipmentSlots(this.random, difficulty);
|
||||
+ populateDefaultEquipmentEnchantments(world, this.random, difficulty);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void populateDefaultEquipmentSlots(net.minecraft.util.RandomSource random, net.minecraft.world.DifficultyInstance difficulty) {
|
||||
+ super.populateDefaultEquipmentSlots(this.random, difficulty);
|
||||
+ // TODO make configurable
|
||||
+ if (random.nextFloat() < (level().getDifficulty() == net.minecraft.world.Difficulty.HARD ? 0.1F : 0.05F)) {
|
||||
+ this.setItemSlot(net.minecraft.world.entity.EquipmentSlot.MAINHAND, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getJumpPower() {
|
||||
+ // make giants jump as high as everything else relative to their size
|
||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
+ return level().purpurConfig.giantJumpHeight;
|
||||
+ }
|
||||
+ // Purpur end - Giants AI settings
|
||||
+
|
||||
@Override
|
||||
public float getWalkTargetValue(final BlockPos pos, final LevelReader level) {
|
||||
- return level.getPathfindingCostFromLightLevels(pos);
|
||||
+ return super.getWalkTargetValue(pos, level); // Purpur - Giants AI settings - fix light requirements for natural spawns
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 Apr 2020 13:19:34 -0500
|
||||
Subject: [PATCH] Chickens can retaliate
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/animal/chicken/Chicken.java b/net/minecraft/world/entity/animal/chicken/Chicken.java
|
||||
index f5d2a74c81d9ba8aeaf6c3f50069f529dde68e72..122ebcf1a7fb7e7856a8f73d4a0355672d5c9655 100644
|
||||
--- a/net/minecraft/world/entity/animal/chicken/Chicken.java
|
||||
+++ b/net/minecraft/world/entity/animal/chicken/Chicken.java
|
||||
@@ -103,6 +103,11 @@ public class Chicken extends Animal {
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.chickenMaxHealth);
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.chickenScale);
|
||||
+ // Purpur start - Chickens can retaliate
|
||||
+ if (level().purpurConfig.chickenRetaliate) {
|
||||
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(2.0D);
|
||||
+ }
|
||||
+ // Purpur end - Chickens can retaliate
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
@@ -110,13 +115,21 @@ public class Chicken extends Animal {
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
- this.goalSelector.addGoal(1, new PanicGoal(this, 1.4));
|
||||
+ //this.goalSelector.addGoal(1, new PanicGoal(this, 1.4)); // Purpur - Chickens can retaliate - moved down
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.0, i -> i.is(ItemTags.CHICKEN_FOOD), false));
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||
+ // Purpur start - Chickens can retaliate
|
||||
+ if (level().purpurConfig.chickenRetaliate) {
|
||||
+ this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.0D, false));
|
||||
+ this.targetSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal(this));
|
||||
+ } else {
|
||||
+ this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D));
|
||||
+ }
|
||||
+ // Purpur end - Chickens can retaliate
|
||||
}
|
||||
|
||||
public Holder<ChickenSoundVariant> getSoundVariant() {
|
||||
@@ -137,7 +150,7 @@ public class Chicken extends Animal {
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
- return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0).add(Attributes.MOVEMENT_SPEED, 0.25);
|
||||
+ return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0).add(Attributes.MOVEMENT_SPEED, 0.25).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur - Chickens can retaliate
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,142 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 29 Jun 2019 02:32:40 -0500
|
||||
Subject: [PATCH] Minecart settings and WASD controls
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 119530367e7bd7f99160d8a8b8b6c1f757c3bd01..2ff355757f3637186ed9f9c81323b799a98f3128 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1288,6 +1288,11 @@ public class ServerPlayer extends Player {
|
||||
|
||||
// Purpur start - Add boat fall damage config
|
||||
if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {
|
||||
+ // Purpur start - Minecart settings and WASD controls
|
||||
+ if (getRootVehicle() instanceof AbstractMinecart && level().purpurConfig.minecartControllable && !level().purpurConfig.minecartControllableFallDamage) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end - Minecart settings and WASD controls
|
||||
if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.boat.Boat && !level().purpurConfig.boatsDoFallDamage) {
|
||||
return false;
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java b/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java
|
||||
index 5ad77636d0681d1f0341cff4482ba6ad52f3583b..c635999ec8d5e0508cd66e0c4982692450963235 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/minecart/AbstractMinecart.java
|
||||
@@ -105,6 +105,10 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
private double flyingY = this.getAirDrag();
|
||||
private double flyingZ = this.getAirDrag();
|
||||
public @Nullable Double maxSpeed;
|
||||
+ // Purpur start - Minecart settings and WASD controls
|
||||
+ public double storedMaxSpeed;
|
||||
+ public boolean isNewBehavior;
|
||||
+ // Purpur end - Minecart settings and WASD controls
|
||||
public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -113,8 +117,13 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
this.blocksBuilding = true;
|
||||
if (useExperimentalMovement(level)) {
|
||||
this.behavior = new NewMinecartBehavior(this);
|
||||
+ this.isNewBehavior = true; // Purpur - Minecart settings and WASD controls
|
||||
} else {
|
||||
this.behavior = new OldMinecartBehavior(this);
|
||||
+ // Purpur start - Minecart settings and WASD controls
|
||||
+ this.isNewBehavior = false;
|
||||
+ maxSpeed = storedMaxSpeed = level.purpurConfig.minecartMaxSpeed;
|
||||
+ // Purpur end - Minecart settings and WASD controls
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,6 +298,14 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Purpur start - Minecart settings and WASD controls
|
||||
+ if (!this.isNewBehavior) {
|
||||
+ if (storedMaxSpeed != level().purpurConfig.minecartMaxSpeed) {
|
||||
+ maxSpeed = storedMaxSpeed = level().purpurConfig.minecartMaxSpeed;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Minecart settings and WASD controls
|
||||
+
|
||||
// CraftBukkit start
|
||||
double prevX = this.getX();
|
||||
double prevY = this.getY();
|
||||
@@ -405,15 +422,61 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
this.behavior.moveAlongTrack(level);
|
||||
}
|
||||
|
||||
+ // Purpur start - Minecart settings and WASD controls
|
||||
+ private Double lastSpeed;
|
||||
+
|
||||
+ public double getControllableSpeed() {
|
||||
+ BlockState blockState = level().getBlockState(this.blockPosition());
|
||||
+ if (!blockState.isSolid()) {
|
||||
+ blockState = level().getBlockState(this.blockPosition().relative(Direction.DOWN));
|
||||
+ }
|
||||
+ Double speed = level().purpurConfig.minecartControllableBlockSpeeds.get(blockState.getBlock());
|
||||
+ if (!blockState.isSolid()) {
|
||||
+ speed = lastSpeed;
|
||||
+ }
|
||||
+ if (speed == null) {
|
||||
+ speed = level().purpurConfig.minecartControllableBaseSpeed;
|
||||
+ }
|
||||
+ return lastSpeed = speed;
|
||||
+ }
|
||||
+ // Purpur end - Minecart settings and WASD controls
|
||||
+
|
||||
protected void comeOffTrack(final ServerLevel level) {
|
||||
double maxSpeed = this.getMaxSpeed(level);
|
||||
Vec3 movement = this.getDeltaMovement();
|
||||
this.setDeltaMovement(Mth.clamp(movement.x, -maxSpeed, maxSpeed), movement.y, Mth.clamp(movement.z, -maxSpeed, maxSpeed));
|
||||
+
|
||||
+ // Purpur start - Minecart settings and WASD controls
|
||||
+ if (level().purpurConfig.minecartControllable && !isInWater() && !isInLava() && !passengers.isEmpty()) {
|
||||
+ Entity passenger = passengers.get(0);
|
||||
+ if (passenger instanceof net.minecraft.server.level.ServerPlayer player) {
|
||||
+ net.minecraft.world.entity.player.Input lastClientInput = player.getLastClientInput();
|
||||
+ float forward = (lastClientInput.forward() == lastClientInput.backward() ? 0.0F : lastClientInput.forward() ? 1.0F : -1.0F);
|
||||
+ if (lastClientInput.jump() && this.onGround) {
|
||||
+ setDeltaMovement(new Vec3(getDeltaMovement().x, level().purpurConfig.minecartControllableHopBoost, getDeltaMovement().z));
|
||||
+ }
|
||||
+ if (forward != 0.0F) {
|
||||
+ org.bukkit.util.Vector velocity = player.getBukkitEntity().getEyeLocation().getDirection().normalize().multiply(getControllableSpeed());
|
||||
+ if (forward < 0.0) {
|
||||
+ velocity.multiply(-0.5);
|
||||
+ }
|
||||
+ setDeltaMovement(new Vec3(velocity.getX(), getDeltaMovement().y, velocity.getZ()));
|
||||
+ }
|
||||
+ this.setYRot(passenger.getYRot() - 90);
|
||||
+ maxUpStep = level().purpurConfig.minecartControllableStepHeight;
|
||||
+ } else {
|
||||
+ maxUpStep = 0.0F;
|
||||
+ }
|
||||
+ } else {
|
||||
+ maxUpStep = 0.0F;
|
||||
+ }
|
||||
+ // Purpur end - Minecart settings and WASD controls
|
||||
if (this.onGround()) {
|
||||
// CraftBukkit start - replace magic numbers with our variables
|
||||
this.setDeltaMovement(new Vec3(this.getDeltaMovement().x * this.derailedX, this.getDeltaMovement().y * this.derailedY, this.getDeltaMovement().z * this.derailedZ));
|
||||
// CraftBukkit end
|
||||
}
|
||||
+ else if (level().purpurConfig.minecartControllable) setDeltaMovement(new Vec3(getDeltaMovement().x * derailedX, getDeltaMovement().y, getDeltaMovement().z * derailedZ)); // Purpur - Minecart settings and WASD controls
|
||||
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
if (!this.onGround()) {
|
||||
diff --git a/net/minecraft/world/item/MinecartItem.java b/net/minecraft/world/item/MinecartItem.java
|
||||
index 2ce6aecf5e34528c9601ce2f071bebd6c2f47243..a817247544186e51d3748af0ecfd78164e37e012 100644
|
||||
--- a/net/minecraft/world/item/MinecartItem.java
|
||||
+++ b/net/minecraft/world/item/MinecartItem.java
|
||||
@@ -30,7 +30,8 @@ public class MinecartItem extends Item {
|
||||
BlockPos pos = context.getClickedPos();
|
||||
BlockState blockState = level.getBlockState(pos);
|
||||
if (!blockState.is(BlockTags.RAILS)) {
|
||||
- return InteractionResult.FAIL;
|
||||
+ if (!level.purpurConfig.minecartPlaceAnywhere) return InteractionResult.FAIL; // Purpur - Minecart settings and WASD controls
|
||||
+ if (blockState.isSolid()) pos = pos.relative(context.getClickedFace());
|
||||
}
|
||||
|
||||
ItemStack itemStack = context.getItemInHand();
|
||||
@@ -0,0 +1,102 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 29 Nov 2019 22:10:12 -0600
|
||||
Subject: [PATCH] Villagers follow emerald blocks
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
|
||||
index b828332b3e5db2722ca2193721da996fb84ce55e..f875fdb10d16598f9f5b6fbb597c88ad42e88996 100644
|
||||
--- a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
|
||||
@@ -176,7 +176,7 @@ public class DefaultAttributes {
|
||||
.put(EntityTypes.VILLAGER, Villager.createAttributes().build())
|
||||
.put(EntityTypes.VINDICATOR, Vindicator.createAttributes().build())
|
||||
.put(EntityTypes.WARDEN, Warden.createAttributes().build())
|
||||
- .put(EntityTypes.WANDERING_TRADER, Mob.createMobAttributes().build())
|
||||
+ .put(EntityTypes.WANDERING_TRADER, net.minecraft.world.entity.npc.wanderingtrader.WanderingTrader.createAttributes().build()) // Purpur - Villagers follow emerald blocks
|
||||
.put(EntityTypes.WITCH, Witch.createAttributes().build())
|
||||
.put(EntityTypes.WITHER, WitherBoss.createAttributes().build())
|
||||
.put(EntityTypes.WITHER_SKELETON, AbstractSkeleton.createAttributes().build())
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/TemptGoal.java b/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
index af2bd8a5cf760792a63dfb9c2370360f288beab6..016167a6ff90dfe5a2e66596eaab2c8f2775c016 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
@@ -70,7 +70,7 @@ public class TemptGoal extends Goal {
|
||||
}
|
||||
|
||||
private boolean shouldFollow(final LivingEntity player) {
|
||||
- return this.items.test(player.getMainHandItem()) || this.items.test(player.getOffhandItem());
|
||||
+ return (this.items.test(player.getMainHandItem()) || this.items.test(player.getOffhandItem())) && (!(this.mob instanceof net.minecraft.world.entity.npc.villager.Villager villager) || !villager.isSleeping()); // Purpur - Villagers follow emerald blocks
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/AbstractVillager.java b/net/minecraft/world/entity/npc/villager/AbstractVillager.java
|
||||
index 07aa7fae79edff4c92b8f153659f16b9769c80ff..8c55eb2cc6f48643d29b50a12a44be19fd29b4bc 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/AbstractVillager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/AbstractVillager.java
|
||||
@@ -53,6 +53,7 @@ import org.jspecify.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public abstract class AbstractVillager extends AgeableMob implements Npc, Merchant, InventoryCarrier {
|
||||
+ public static final net.minecraft.world.item.crafting.Ingredient TEMPT_ITEMS = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.level.block.Blocks.EMERALD_BLOCK.asItem()); // Purpur - Villagers follow emerald blocks
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
private static final EntityDataAccessor<Integer> DATA_UNHAPPY_COUNTER = SynchedEntityData.defineId(AbstractVillager.class, EntityDataSerializers.INT);
|
||||
private @Nullable Player tradingPlayer;
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
index c6dd2c42acb44715018402bbee9ec5742a2c1613..f0ebe6f376a13df2fa34f41ecdcc9bded72dc756 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
@@ -262,6 +262,7 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ if (level().purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, TEMPT_ITEMS, false)); // Purpur - Villagers follow emerald blocks
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
@@ -270,6 +271,7 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.villagerMaxHealth);
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.villagerScale);
|
||||
+ this.getAttribute(Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.villagerTemptRange); // Purpur - Villagers follow emerald blocks
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
@@ -311,7 +313,7 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
- return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.5);
|
||||
+ return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.5).add(Attributes.TEMPT_RANGE, 10.0D); // Purpur - Villagers follow emerald blocks
|
||||
}
|
||||
|
||||
public boolean assignProfessionWhenSpawned() {
|
||||
diff --git a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java
|
||||
index 9aefc3ecb98cd0333eb2adab82cd5846b76bfd2a..d0c9643d3f64d0e17cd8c3a62ec389430d9d7c87 100644
|
||||
--- a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java
|
||||
+++ b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java
|
||||
@@ -88,9 +88,16 @@ public class WanderingTrader extends AbstractVillager implements Consumable.Over
|
||||
@Override
|
||||
public void initAttributes() {
|
||||
this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.wanderingTraderMaxHealth);
|
||||
+ this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.wanderingTraderTemptRange); // Purpur - Villagers follow emerald blocks
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Villagers follow emerald blocks
|
||||
+ public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder createAttributes() {
|
||||
+ return Mob.createMobAttributes().add(net.minecraft.world.entity.ai.attributes.Attributes.TEMPT_RANGE, 10.0D);
|
||||
+ }
|
||||
+ // Purpur end - Villagers follow emerald blocks
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
@@ -122,6 +129,7 @@ public class WanderingTrader extends AbstractVillager implements Consumable.Over
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 0.5));
|
||||
this.goalSelector.addGoal(1, new LookAtTradingPlayerGoal(this));
|
||||
this.goalSelector.addGoal(2, new WanderingTrader.WanderToPositionGoal(this, 2.0, 0.35));
|
||||
+ if (level().purpurConfig.wanderingTraderFollowEmeraldBlock) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, TEMPT_ITEMS, false)); // Purpur - Villagers follow emerald blocks
|
||||
this.goalSelector.addGoal(4, new MoveTowardsRestrictionGoal(this, 0.35));
|
||||
this.goalSelector.addGoal(8, new WaterAvoidingRandomStrollGoal(this, 0.35));
|
||||
this.goalSelector.addGoal(9, new InteractGoal(this, Player.class, 3.0F, 1.0F));
|
||||
@@ -0,0 +1,90 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 25 Jul 2019 18:07:37 -0500
|
||||
Subject: [PATCH] Implement elytra settings
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 55f7761ad757cc4eebbf1271e0d284bc31db753e..991ded4e26c00ffb25a933a8cc175849e1e579b2 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -4011,7 +4011,16 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
if (freeFallInterval % 2 == 0) {
|
||||
List<EquipmentSlot> slotsWithGliders = EquipmentSlot.VALUES.stream().filter(slot -> canGlideUsing(this.getItemBySlot(slot), slot)).toList();
|
||||
EquipmentSlot slotToDamage = Util.getRandom(slotsWithGliders, this.random);
|
||||
- this.getItemBySlot(slotToDamage).hurtAndBreak(1, this, slotToDamage);
|
||||
+ // Purpur start - Implement elytra settings
|
||||
+ int damage = level().purpurConfig.elytraDamagePerSecond;
|
||||
+ if (level().purpurConfig.elytraDamageMultiplyBySpeed > 0) {
|
||||
+ double speed = getDeltaMovement().lengthSqr();
|
||||
+ if (speed > level().purpurConfig.elytraDamageMultiplyBySpeed) {
|
||||
+ damage *= (int) speed;
|
||||
+ }
|
||||
+ }
|
||||
+ this.getItemBySlot(slotToDamage).hurtAndBreak(damage, this, slotToDamage);
|
||||
+ // Purpur end - Implement elytra settings
|
||||
}
|
||||
|
||||
this.gameEvent(GameEvent.ELYTRA_GLIDE);
|
||||
diff --git a/net/minecraft/world/item/FireworkRocketItem.java b/net/minecraft/world/item/FireworkRocketItem.java
|
||||
index b3443ff2d06af328493046e723efc11d299a2824..3c001b3810097d5cb60ad64e0727d8d9907f6a38 100644
|
||||
--- a/net/minecraft/world/item/FireworkRocketItem.java
|
||||
+++ b/net/minecraft/world/item/FireworkRocketItem.java
|
||||
@@ -73,6 +73,17 @@ public class FireworkRocketItem extends Item implements ProjectileItem {
|
||||
if (player.dropAllLeashConnections(player, hand)) { // Paper - PlayerUnleashEntityEvent
|
||||
level.playSound(null, player, SoundEvents.LEAD_BREAK, SoundSource.NEUTRAL, 1.0F, 1.0F);
|
||||
}
|
||||
+ // Purpur start - Implement elytra settings
|
||||
+ if (level.purpurConfig.elytraDamagePerFireworkBoost > 0) {
|
||||
+ java.util.List<net.minecraft.world.entity.EquipmentSlot> list = net.minecraft.world.entity.EquipmentSlot.VALUES.stream().filter((enumitemslot) -> net.minecraft.world.entity.LivingEntity.canGlideUsing(player.getItemBySlot(enumitemslot), enumitemslot)).toList();
|
||||
+ net.minecraft.world.entity.EquipmentSlot enumitemslot = net.minecraft.util.Util.getRandom(list, player.random);
|
||||
+
|
||||
+ ItemStack glideItem = player.getItemBySlot(enumitemslot);
|
||||
+ if (player.canGlide()) {
|
||||
+ glideItem.hurtAndBreak(level.purpurConfig.elytraDamagePerFireworkBoost, player, enumitemslot);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Implement elytra settings
|
||||
if (event.shouldConsume() && !player.hasInfiniteMaterials()) {
|
||||
itemStack.shrink(1); // Moved up from below
|
||||
} else {
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index b415581057f20e3aba5b249ec35b9069aa873038..a528429259f5981ac4e1c89953c217bfd165517f 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -682,6 +682,14 @@ public final class ItemStack implements DataComponentHolder, ItemInstance {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent
|
||||
}
|
||||
// CraftBukkit end
|
||||
+
|
||||
+ // Purpur start - Implement elytra settings
|
||||
+ if (this.has(DataComponents.GLIDER)) {
|
||||
+ setDamageValue(this.getMaxDamage() - 1);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end - Implement elytra settings
|
||||
+
|
||||
this.shrink(1);
|
||||
onBreak.accept(item);
|
||||
}
|
||||
diff --git a/net/minecraft/world/item/TridentItem.java b/net/minecraft/world/item/TridentItem.java
|
||||
index 0321dffbbea8bf35640680eedd21cd9f9daa6c04..91f81dbf4e1fbf029c8f70ad3a80a489e1188a54 100644
|
||||
--- a/net/minecraft/world/item/TridentItem.java
|
||||
+++ b/net/minecraft/world/item/TridentItem.java
|
||||
@@ -127,6 +127,16 @@ public class TridentItem extends Item implements ProjectileItem {
|
||||
yd *= riptideStrength / dist;
|
||||
zd *= riptideStrength / dist;
|
||||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerRiptideEvent(player, itemStack, xd, yd, zd)) return false; // Paper - Add player riptide event
|
||||
+ // Purpur start - Implement elytra settings
|
||||
+ List<net.minecraft.world.entity.EquipmentSlot> list = net.minecraft.world.entity.EquipmentSlot.VALUES.stream().filter((enumitemslot) -> LivingEntity.canGlideUsing(entity.getItemBySlot(enumitemslot), enumitemslot)).toList();
|
||||
+ if (!list.isEmpty()) {
|
||||
+ net.minecraft.world.entity.EquipmentSlot enumitemslot = net.minecraft.util.Util.getRandom(list, entity.random);
|
||||
+ ItemStack glideItem = entity.getItemBySlot(enumitemslot);
|
||||
+ if (glideItem.has(net.minecraft.core.component.DataComponents.GLIDER) && level.purpurConfig.elytraDamagePerTridentBoost > 0) {
|
||||
+ glideItem.hurtAndBreak(level.purpurConfig.elytraDamagePerTridentBoost, entity, enumitemslot);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Implement elytra settings
|
||||
player.push(xd, yd, zd);
|
||||
player.startAutoSpinAttack(20, 8.0F, itemStack);
|
||||
if (player.onGround()) {
|
||||
@@ -0,0 +1,177 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 26 Mar 2020 21:39:32 -0500
|
||||
Subject: [PATCH] Configurable jockey options
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Drowned.java b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
index 04b31af8a16eeec19c1c26e8794416a0c23b5c10..1234c13b4290f45997eab79f6ef18933dcf3b04f 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
@@ -117,6 +117,23 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Configurable jockey options
|
||||
+ @Override
|
||||
+ public boolean jockeyOnlyBaby() {
|
||||
+ return level().purpurConfig.drownedJockeyOnlyBaby;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double jockeyChance() {
|
||||
+ return level().purpurConfig.drownedJockeyChance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean jockeyTryExistingChickens() {
|
||||
+ return level().purpurConfig.drownedJockeyTryExistingChickens;
|
||||
+ }
|
||||
+ // Purpur end - Configurable jockey options
|
||||
+
|
||||
@Override
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(1, new Drowned.DrownedGoToWaterGoal(this, 1.0));
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Husk.java b/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
index 7a3747d67f1ce93e0703965144e32d134adbdee8..91800961ba5b724aac905ccd4fd1d0f915c93803 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
@@ -67,6 +67,23 @@ public class Husk extends Zombie {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Configurable jockey options
|
||||
+ @Override
|
||||
+ public boolean jockeyOnlyBaby() {
|
||||
+ return level().purpurConfig.huskJockeyOnlyBaby;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double jockeyChance() {
|
||||
+ return level().purpurConfig.huskJockeyChance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean jockeyTryExistingChickens() {
|
||||
+ return level().purpurConfig.huskJockeyTryExistingChickens;
|
||||
+ }
|
||||
+ // Purpur end - Configurable jockey options
|
||||
+
|
||||
@Override
|
||||
public boolean isSunSensitive() {
|
||||
return false;
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
index 51e9175cf7f0c487d063247dca4e700012283431..f47f4a3f8e0f4f5a40f520a25e87e0068a564b4c 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
@@ -138,6 +138,20 @@ public class Zombie extends Monster {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Configurable jockey options
|
||||
+ public boolean jockeyOnlyBaby() {
|
||||
+ return level().purpurConfig.zombieJockeyOnlyBaby;
|
||||
+ }
|
||||
+
|
||||
+ public double jockeyChance() {
|
||||
+ return level().purpurConfig.zombieJockeyChance;
|
||||
+ }
|
||||
+
|
||||
+ public boolean jockeyTryExistingChickens() {
|
||||
+ return level().purpurConfig.zombieJockeyTryExistingChickens;
|
||||
+ }
|
||||
+ // Purpur end - Configurable jockey options
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
@@ -549,19 +563,18 @@ public class Zombie extends Monster {
|
||||
}
|
||||
|
||||
if (groupData instanceof Zombie.ZombieGroupData zombieData) {
|
||||
- if (zombieData.isBaby) {
|
||||
- this.setBaby(true);
|
||||
+ if (!jockeyOnlyBaby() || zombieData.isBaby) { // Purpur - Configurable jockey options
|
||||
+ this.setBaby(zombieData.isBaby); // Purpur - Configurable jockey options
|
||||
if (zombieData.canSpawnJockey) {
|
||||
- if (random.nextFloat() < 0.05) {
|
||||
- List<Chicken> chickens = level.getEntitiesOfClass(
|
||||
+ if (random.nextFloat() < jockeyChance()) { // Purpur - Configurable jockey options
|
||||
+ List<Chicken> chickens = jockeyTryExistingChickens() ? level.getEntitiesOfClass( // Purpur - Configurable jockey options
|
||||
Chicken.class, this.getBoundingBox().inflate(5.0, 3.0, 5.0), EntitySelector.ENTITY_NOT_BEING_RIDDEN
|
||||
- );
|
||||
+ ) : java.util.Collections.emptyList(); // Purpur - Configurable jockey options
|
||||
if (!chickens.isEmpty()) {
|
||||
Chicken chicken = chickens.get(0);
|
||||
chicken.setChickenJockey(true);
|
||||
this.startRiding(chicken, false, false);
|
||||
- }
|
||||
- } else if (random.nextFloat() < 0.05) {
|
||||
+ } else { // Purpur - Configurable jockey options
|
||||
Chicken chicken = EntityTypes.CHICKEN.create(this.level(), EntitySpawnReason.JOCKEY);
|
||||
if (chicken != null) {
|
||||
chicken.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
|
||||
@@ -570,6 +583,7 @@ public class Zombie extends Monster {
|
||||
this.startRiding(chicken, false, false);
|
||||
level.addFreshEntity(chicken, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit
|
||||
}
|
||||
+ } // Purpur - Configurable jockey options
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/ZombieVillager.java b/net/minecraft/world/entity/monster/zombie/ZombieVillager.java
|
||||
index 2323ef6faec7bc62b28240e6dcc9f350de427c8e..155ba4d03e7864b21e7a3dab854315b62d3b9e5b 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/ZombieVillager.java
|
||||
@@ -116,6 +116,23 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Configurable jockey options
|
||||
+ @Override
|
||||
+ public boolean jockeyOnlyBaby() {
|
||||
+ return level().purpurConfig.zombieVillagerJockeyOnlyBaby;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double jockeyChance() {
|
||||
+ return level().purpurConfig.zombieVillagerJockeyChance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean jockeyTryExistingChickens() {
|
||||
+ return level().purpurConfig.zombieVillagerJockeyTryExistingChickens;
|
||||
+ }
|
||||
+ // Purpur end - Configurable jockey options
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java
|
||||
index 8022a5ce1efedf5b9485c366d0a525077583712c..7a59980a38abb8ed9500def97fc7e3e8952a439d 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java
|
||||
@@ -93,6 +93,23 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Configurable jockey options
|
||||
+ @Override
|
||||
+ public boolean jockeyOnlyBaby() {
|
||||
+ return level().purpurConfig.zombifiedPiglinJockeyOnlyBaby;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double jockeyChance() {
|
||||
+ return level().purpurConfig.zombifiedPiglinJockeyChance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean jockeyTryExistingChickens() {
|
||||
+ return level().purpurConfig.zombifiedPiglinJockeyTryExistingChickens;
|
||||
+ }
|
||||
+ // Purpur end - Configurable jockey options
|
||||
+
|
||||
@Override
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(1, new SpearUseGoal<>(this, 1.0, 1.0, 10.0F, 2.0F));
|
||||
@@ -0,0 +1,255 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 9 May 2019 18:26:06 -0500
|
||||
Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||
index f083705efb92a57dc770a1bdb7c3e8dd6d51c1d5..6704a3b50d23db92ed2fb9811712f19688d00ba7 100644
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||
@@ -28,6 +28,12 @@ public class EndCrystal extends Entity {
|
||||
private static final boolean DEFAULT_SHOW_BOTTOM = true;
|
||||
public int time;
|
||||
public boolean generatedByDragonFight = false; // Paper - Fix invulnerable end crystals
|
||||
+ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ private net.minecraft.world.entity.monster.Phantom targetPhantom;
|
||||
+ private int phantomBeamTicks = 0;
|
||||
+ private int phantomDamageCooldown = 0;
|
||||
+ private int idleCooldown = 0;
|
||||
+ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
|
||||
public EndCrystal(final EntityType<? extends EndCrystal> type, final Level level) {
|
||||
super(type, level);
|
||||
@@ -96,6 +102,49 @@ public class EndCrystal extends Entity {
|
||||
// Paper end - Fix invulnerable end crystals
|
||||
if (this.level().purpurConfig.endCrystalCramming > 0 && this.level().getEntitiesOfClass(EndCrystal.class, getBoundingBox()).size() > this.level().purpurConfig.endCrystalCramming) this.hurt(this.damageSources().cramming(), 6.0F); // Purpur - End Crystal Cramming
|
||||
|
||||
+ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ if (level().purpurConfig.phantomAttackedByCrystalRadius <= 0 || --idleCooldown > 0) {
|
||||
+ return; // on cooldown
|
||||
+ }
|
||||
+
|
||||
+ if (targetPhantom == null) {
|
||||
+ for (net.minecraft.world.entity.monster.Phantom phantom : level().getEntitiesOfClass(net.minecraft.world.entity.monster.Phantom.class, getBoundingBox().inflate(level().purpurConfig.phantomAttackedByCrystalRadius))) {
|
||||
+ if (phantom.hasLineOfSight(this)) {
|
||||
+ attackPhantom(phantom);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ setBeamTarget(new BlockPos(targetPhantom).offset(0, -2, 0));
|
||||
+ if (--phantomBeamTicks > 0 && targetPhantom.isAlive()) {
|
||||
+ phantomDamageCooldown--;
|
||||
+ if (targetPhantom.hasLineOfSight(this)) {
|
||||
+ if (phantomDamageCooldown <= 0) {
|
||||
+ phantomDamageCooldown = 20;
|
||||
+ targetPhantom.hurt(targetPhantom.damageSources().indirectMagic(this, this), level().purpurConfig.phantomAttackedByCrystalDamage);
|
||||
+ }
|
||||
+ } else {
|
||||
+ forgetPhantom(); // no longer in sight
|
||||
+ }
|
||||
+ } else {
|
||||
+ forgetPhantom(); // attacked long enough
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void attackPhantom(net.minecraft.world.entity.monster.Phantom phantom) {
|
||||
+ phantomDamageCooldown = 0;
|
||||
+ phantomBeamTicks = 60;
|
||||
+ targetPhantom = phantom;
|
||||
+ }
|
||||
+
|
||||
+ private void forgetPhantom() {
|
||||
+ targetPhantom = null;
|
||||
+ setBeamTarget(null);
|
||||
+ phantomBeamTicks = 0;
|
||||
+ phantomDamageCooldown = 0;
|
||||
+ idleCooldown = 60;
|
||||
+ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index b42f67dff1ae0fd9b549f584e789285a15cb690c..d3c9948ee52c0f209481e273bc94b551519a7d71 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -49,6 +49,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
private Vec3 moveTargetPoint = Vec3.ZERO;
|
||||
public @Nullable BlockPos anchorPoint;
|
||||
private Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
|
||||
+ Vec3 crystalPosition; // Purpur - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
// Paper start
|
||||
public java.util.@Nullable UUID spawningEntity;
|
||||
public boolean shouldBurnInDay = true;
|
||||
@@ -107,6 +108,25 @@ public class Phantom extends Mob implements Enemy {
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ @Override
|
||||
+ protected void dropFromLootTable(ServerLevel world, DamageSource damageSource, boolean causedByPlayer) {
|
||||
+ boolean dropped = false;
|
||||
+ if (lastHurtByPlayer == null && damageSource.getEntity() instanceof net.minecraft.world.entity.boss.enderdragon.EndCrystal) {
|
||||
+ if (random.nextInt(5) < 1) {
|
||||
+ dropped = spawnAtLocation(world, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.PHANTOM_MEMBRANE)) != null;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!dropped) {
|
||||
+ super.dropFromLootTable(world, damageSource, causedByPlayer);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public boolean isCirclingCrystal() {
|
||||
+ return crystalPosition != null;
|
||||
+ }
|
||||
+ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+
|
||||
@Override
|
||||
public boolean isFlapping() {
|
||||
return (this.getUniqueFlapTickOffset() + this.tickCount) % TICKS_PER_FLAP == 0;
|
||||
@@ -120,9 +140,15 @@ public class Phantom extends Mob implements Enemy {
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
- this.goalSelector.addGoal(1, new Phantom.PhantomAttackStrategyGoal());
|
||||
- this.goalSelector.addGoal(2, new Phantom.PhantomSweepAttackGoal());
|
||||
- this.goalSelector.addGoal(3, new Phantom.PhantomCircleAroundAnchorGoal());
|
||||
+ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ if (level().purpurConfig.phantomOrbitCrystalRadius > 0) {
|
||||
+ this.goalSelector.addGoal(1, new Phantom.PhantomFindCrystalGoal(this));
|
||||
+ this.goalSelector.addGoal(2, new Phantom.PhantomOrbitCrystalGoal(this));
|
||||
+ }
|
||||
+ this.goalSelector.addGoal(3, new Phantom.PhantomAttackStrategyGoal());
|
||||
+ this.goalSelector.addGoal(4, new Phantom.PhantomSweepAttackGoal());
|
||||
+ this.goalSelector.addGoal(5, new Phantom.PhantomCircleAroundAnchorGoal());
|
||||
+ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
this.targetSelector.addGoal(1, new Phantom.PhantomAttackPlayerTargetGoal());
|
||||
}
|
||||
@@ -494,6 +520,124 @@ public class Phantom extends Mob implements Enemy {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+ private class PhantomFindCrystalGoal extends Goal {
|
||||
+ private final Phantom phantom;
|
||||
+ private net.minecraft.world.entity.boss.enderdragon.EndCrystal crystal;
|
||||
+ private Comparator<net.minecraft.world.entity.boss.enderdragon.EndCrystal> comparator;
|
||||
+
|
||||
+ PhantomFindCrystalGoal(Phantom phantom) {
|
||||
+ this.phantom = phantom;
|
||||
+ this.comparator = Comparator.comparingDouble(phantom::distanceToSqr);
|
||||
+ this.setFlags(EnumSet.of(Flag.LOOK));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canUse() {
|
||||
+ double range = maxTargetRange();
|
||||
+ List<net.minecraft.world.entity.boss.enderdragon.EndCrystal> crystals = level().getEntitiesOfClass(net.minecraft.world.entity.boss.enderdragon.EndCrystal.class, phantom.getBoundingBox().inflate(range));
|
||||
+ if (crystals.isEmpty()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ crystals.sort(comparator);
|
||||
+ crystal = crystals.get(0);
|
||||
+ if (phantom.distanceToSqr(crystal) > range * range) {
|
||||
+ crystal = null;
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canContinueToUse() {
|
||||
+ if (crystal == null || !crystal.isAlive()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ double range = maxTargetRange();
|
||||
+ return phantom.distanceToSqr(crystal) <= (range * range) * 2;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void start() {
|
||||
+ phantom.crystalPosition = new Vec3(crystal.getX(), crystal.getY() + (phantom.random.nextInt(10) + 10), crystal.getZ());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void stop() {
|
||||
+ crystal = null;
|
||||
+ phantom.crystalPosition = null;
|
||||
+ super.stop();
|
||||
+ }
|
||||
+
|
||||
+ private double maxTargetRange() {
|
||||
+ return phantom.level().purpurConfig.phantomOrbitCrystalRadius;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private class PhantomOrbitCrystalGoal extends Goal {
|
||||
+ private final Phantom phantom;
|
||||
+ private float offset;
|
||||
+ private float radius;
|
||||
+ private float verticalChange;
|
||||
+ private float direction;
|
||||
+
|
||||
+ PhantomOrbitCrystalGoal(Phantom phantom) {
|
||||
+ this.phantom = phantom;
|
||||
+ this.setFlags(EnumSet.of(Flag.MOVE));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canUse() {
|
||||
+ return phantom.isCirclingCrystal();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void start() {
|
||||
+ this.radius = 5.0F + phantom.random.nextFloat() * 10.0F;
|
||||
+ this.verticalChange = -4.0F + phantom.random.nextFloat() * 9.0F;
|
||||
+ this.direction = phantom.random.nextBoolean() ? 1.0F : -1.0F;
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void tick() {
|
||||
+ if (phantom.random.nextInt(350) == 0) {
|
||||
+ this.verticalChange = -4.0F + phantom.random.nextFloat() * 9.0F;
|
||||
+ }
|
||||
+ if (phantom.random.nextInt(250) == 0) {
|
||||
+ ++this.radius;
|
||||
+ if (this.radius > 15.0F) {
|
||||
+ this.radius = 5.0F;
|
||||
+ this.direction = -this.direction;
|
||||
+ }
|
||||
+ }
|
||||
+ if (phantom.random.nextInt(450) == 0) {
|
||||
+ this.offset = phantom.random.nextFloat() * 2.0F * 3.1415927F;
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ if (phantom.moveTargetPoint.distanceToSqr(phantom.getX(), phantom.getY(), phantom.getZ()) < 4.0D) {
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ if (phantom.moveTargetPoint.y < phantom.getY() && !phantom.level().isEmptyBlock(new BlockPos(phantom).below(1))) {
|
||||
+ this.verticalChange = Math.max(1.0F, this.verticalChange);
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ if (phantom.moveTargetPoint.y > phantom.getY() && !phantom.level().isEmptyBlock(new BlockPos(phantom).above(1))) {
|
||||
+ this.verticalChange = Math.min(-1.0F, this.verticalChange);
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void updateOffset() {
|
||||
+ this.offset += this.direction * 15.0F * 0.017453292F;
|
||||
+ phantom.moveTargetPoint = phantom.crystalPosition.add(
|
||||
+ this.radius * Mth.cos(this.offset),
|
||||
+ -4.0F + this.verticalChange,
|
||||
+ this.radius * Mth.sin(this.offset));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
+
|
||||
private class PhantomMoveControl<T extends Mob> extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD<T> { // Purpur - Ridables
|
||||
private float speed = 0.1F;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: draycia <lonelyyordle@gmail.com>
|
||||
Date: Sun, 12 Apr 2020 20:41:59 -0700
|
||||
Subject: [PATCH] Phantoms burn in light
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index d3c9948ee52c0f209481e273bc94b551519a7d71..f2665ff68020cddf921675f4eaa4c0e99c9d9563 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -54,6 +54,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
public java.util.@Nullable UUID spawningEntity;
|
||||
public boolean shouldBurnInDay = true;
|
||||
// Paper end
|
||||
+ private static final net.minecraft.world.item.crafting.Ingredient TORCH = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.item.Items.TORCH, net.minecraft.world.item.Items.SOUL_TORCH); // Purpur - Phantoms burn in light
|
||||
|
||||
public Phantom(final EntityType<? extends Phantom> type, final Level level) {
|
||||
super(type, level);
|
||||
@@ -238,7 +239,11 @@ public class Phantom extends Mob implements Enemy {
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean isSunBurnTick() {
|
||||
- return this.shouldBurnInDay && super.isSunBurnTick();
|
||||
+ // Purpur start - API for any mob to burn daylight
|
||||
+ boolean burnFromDaylight = this.shouldBurnInDay && super.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight;
|
||||
+ boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
|
||||
+ return burnFromDaylight || burnFromLightSource;
|
||||
+ // Purpur end - API for any mob to burn daylight
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -355,7 +360,8 @@ public class Phantom extends Mob implements Enemy {
|
||||
this.nextScanTick = reducedTickDelay(60);
|
||||
ServerLevel level = getServerLevel(Phantom.this.level());
|
||||
List<Player> players = level.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0, 64.0, 16.0));
|
||||
- if (!players.isEmpty()) {
|
||||
+ if (level().purpurConfig.phantomIgnorePlayersWithTorch) players.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND))); // Purpur - Phantoms burn in light
|
||||
+ if (!players.isEmpty()) {
|
||||
players.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed());
|
||||
|
||||
for (Player player : players) {
|
||||
@@ -724,6 +730,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
return false;
|
||||
} else if (!target.isAlive()) {
|
||||
return false;
|
||||
+ // Purpur start - Phantoms burn in light
|
||||
+ } else if (level().purpurConfig.phantomBurnInLight > 0 && level().getLightEmission(new BlockPos(Phantom.this)) >= level().purpurConfig.phantomBurnInLight) {
|
||||
+ return false;
|
||||
+ } else if (level().purpurConfig.phantomIgnorePlayersWithTorch && (TORCH.test(target.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(target.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)))) {
|
||||
+ return false;
|
||||
+ // Purpur end - Phantoms burn in light
|
||||
} else if (target instanceof Player player && (target.isSpectator() || player.isCreative())) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -0,0 +1,668 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
Date: Sun, 15 Nov 2020 02:18:15 -0800
|
||||
Subject: [PATCH] Make entity breeding times configurable
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java b/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java
|
||||
index 979b537bb459898a501af86280fa313ac58510b2..9aefa11fcc336c5c98c63301b7f9a51b397bdc71 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java
|
||||
@@ -119,8 +119,10 @@ public class VillagerMakeLove extends Behavior<Villager> {
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(child, source, target, null, null, 0).isCancelled()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
- source.setAge(6000);
|
||||
- target.setAge(6000);
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ source.setAge(level.purpurConfig.villagerBreedingTicks);
|
||||
+ target.setAge(level.purpurConfig.villagerBreedingTicks);
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
level.addFreshEntityWithPassengers(child, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING);
|
||||
// CraftBukkit end - call EntityBreedEvent
|
||||
level.broadcastEntityEvent(child, EntityEvent.LOVE_HEARTS);
|
||||
diff --git a/net/minecraft/world/entity/animal/Animal.java b/net/minecraft/world/entity/animal/Animal.java
|
||||
index 44f34214b53a8ea754e3c62f5db652ea944a95f6..79de24884cb5862a4af6dd9a9067434d72a91fa8 100644
|
||||
--- a/net/minecraft/world/entity/animal/Animal.java
|
||||
+++ b/net/minecraft/world/entity/animal/Animal.java
|
||||
@@ -46,6 +46,7 @@ public abstract class Animal extends AgeableMob {
|
||||
public int inLove = 0;
|
||||
public @Nullable EntityReference<ServerPlayer> loveCause;
|
||||
public @Nullable ItemStack breedItem; // CraftBukkit - Add breedItem variable
|
||||
+ public abstract int getPurpurBreedTime(); // Purpur - Make entity breeding times configurable
|
||||
|
||||
protected Animal(final EntityType<? extends Animal> type, final Level level) {
|
||||
super(type, level);
|
||||
@@ -271,8 +272,10 @@ public abstract class Animal extends AgeableMob {
|
||||
player.awardStat(Stats.ANIMALS_BRED);
|
||||
CriteriaTriggers.BRED_ANIMALS.trigger(player, this, partner, offspring);
|
||||
} // Paper - Call EntityBreedEvent
|
||||
- this.setAge(6000);
|
||||
- partner.setAge(6000);
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ this.setAge(this.getPurpurBreedTime());
|
||||
+ partner.setAge(partner.getPurpurBreedTime());
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
this.resetLove();
|
||||
partner.resetLove();
|
||||
level.broadcastEntityEvent(this, EntityEvent.IN_LOVE_HEARTS);
|
||||
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
index 9f0e074df58d8b8484aa8be5cb0bc8941cee0f96..4296d0caec2583f1b0135719ba6f218b3df7a3a8 100644
|
||||
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
@@ -118,6 +118,13 @@ public class Armadillo extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.armadilloBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
index 2752e906f2a98540d6fd33cd5f080f376e6e3f86..11b3d0706a89b21251b5a045fbb34b1c3e3d77b8 100644
|
||||
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
@@ -147,6 +147,13 @@ public class Axolotl extends Animal implements Bucketable {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.axolotlBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public float getWalkTargetValue(final BlockPos pos, final LevelReader level) {
|
||||
return 0.0F;
|
||||
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
index 6022df0a91e46b0a7a0102b959a1eb2b18c1de63..c871d6e0140fae4e15bf07ba86ed7c67615e9ce6 100644
|
||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
@@ -485,6 +485,13 @@ public class Bee extends Animal implements NeutralMob {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.beeBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public long getPersistentAngerEndTime() {
|
||||
return this.entityData.get(DATA_ANGER_END_TIME);
|
||||
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 431f296bf651942cd390b7f383295eae3f4d2bce..a683afa61a69a9ea2d372dc7a00dc76f9fabd0d4 100644
|
||||
--- a/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -107,6 +107,13 @@ public class Camel extends AbstractHorse {
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.camelBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void addAdditionalSaveData(final ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
diff --git a/net/minecraft/world/entity/animal/chicken/Chicken.java b/net/minecraft/world/entity/animal/chicken/Chicken.java
|
||||
index 122ebcf1a7fb7e7856a8f73d4a0355672d5c9655..b27e52819fa244d93f70177b19898ab6399e2d3f 100644
|
||||
--- a/net/minecraft/world/entity/animal/chicken/Chicken.java
|
||||
+++ b/net/minecraft/world/entity/animal/chicken/Chicken.java
|
||||
@@ -111,6 +111,13 @@ public class Chicken extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.chickenBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/animal/cow/Cow.java b/net/minecraft/world/entity/animal/cow/Cow.java
|
||||
index 65c41435e06120c875a82ba8d5427e082bbeb9eb..da88b2b3ed1c27100bff546cb80837da6e30e20b 100644
|
||||
--- a/net/minecraft/world/entity/animal/cow/Cow.java
|
||||
+++ b/net/minecraft/world/entity/animal/cow/Cow.java
|
||||
@@ -67,6 +67,13 @@ public class Cow extends AbstractCow {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.cowBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/animal/cow/MushroomCow.java b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
||||
index 0c1baeb2fe56099a68043b8366507f29e41792f5..ab57ef2e091d95adc8d13d1b33033b190b7f68d6 100644
|
||||
--- a/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
||||
+++ b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
||||
@@ -93,6 +93,13 @@ public class MushroomCow extends AbstractCow implements Shearable {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.mooshroomBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public float getWalkTargetValue(final BlockPos pos, final LevelReader level) {
|
||||
return level.getBlockState(pos.below()).is(Blocks.MYCELIUM) ? 10.0F : level.getPathfindingCostFromLightLevels(pos);
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/Donkey.java b/net/minecraft/world/entity/animal/equine/Donkey.java
|
||||
index 0a91e245c992c26ac715bcaedd369e96ac6e70cd..ee024d5f00b5a2845eeb296172c593b1040be1a8 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/Donkey.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/Donkey.java
|
||||
@@ -41,6 +41,13 @@ public class Donkey extends AbstractChestedHorse {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.donkeyBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public SoundEvent getAmbientSound() {
|
||||
return SoundEvents.DONKEY_AMBIENT;
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/Horse.java b/net/minecraft/world/entity/animal/equine/Horse.java
|
||||
index 2a89a4a3123a9645e3c532e51f9811af29867f76..e69ae448ed73949a11ee3284f93a535a9f0b3d1c 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/Horse.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/Horse.java
|
||||
@@ -73,6 +73,13 @@ public class Horse extends AbstractHorse {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.horseBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void randomizeAttributes(final RandomSource random) {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(generateMaxHealth(random::nextInt));
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/Llama.java b/net/minecraft/world/entity/animal/equine/Llama.java
|
||||
index 4b607b42f7258da62968cdd3081b207da02cf5e3..0678e622e90fc13f758c582286f872b358f46243 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/Llama.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/Llama.java
|
||||
@@ -152,6 +152,13 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.llamaBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public boolean isTraderLlama() {
|
||||
return false;
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/Mule.java b/net/minecraft/world/entity/animal/equine/Mule.java
|
||||
index 226acd03320c235db4051e5274364e7579e584aa..24daee9922a270c9cdfb26899c9eda74370a5dea 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/Mule.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/Mule.java
|
||||
@@ -40,6 +40,13 @@ public class Mule extends AbstractChestedHorse {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.muleBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public SoundEvent getAmbientSound() {
|
||||
return SoundEvents.MULE_AMBIENT;
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/SkeletonHorse.java b/net/minecraft/world/entity/animal/equine/SkeletonHorse.java
|
||||
index d8a774d65e29e19bb982bc40ff8249882e9ce96d..f1657977511160e4f35172bff89f503887b13e25 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/SkeletonHorse.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/SkeletonHorse.java
|
||||
@@ -68,6 +68,13 @@ public class SkeletonHorse extends AbstractHorse {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return 6000;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return createBaseHorseAttributes().add(Attributes.MAX_HEALTH, 15.0).add(Attributes.MOVEMENT_SPEED, 0.2F);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/TraderLlama.java b/net/minecraft/world/entity/animal/equine/TraderLlama.java
|
||||
index 4b92a5345d6ac96551aba8ecdd75aa0e4003dbee..544777353802146de13f3365935bd1f7dda41af3 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/TraderLlama.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/TraderLlama.java
|
||||
@@ -71,6 +71,13 @@ public class TraderLlama extends Llama {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.traderLlamaBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public boolean isTraderLlama() {
|
||||
return true;
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/ZombieHorse.java b/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
||||
index 061b6483beaffe62a901b3ab4665288eaf09950f..aca379a8af847b5551d950cf2880a242d9ec1768 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
||||
@@ -79,6 +79,13 @@ public class ZombieHorse extends AbstractHorse {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return 6000;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return createBaseHorseAttributes().add(Attributes.MAX_HEALTH, 25.0);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/feline/Cat.java b/net/minecraft/world/entity/animal/feline/Cat.java
|
||||
index 026157f6f533e0034ad569593929532fc69729c3..bcc7eeaaba22fbc5ec21028d1b6b400ea6fcbec1 100644
|
||||
--- a/net/minecraft/world/entity/animal/feline/Cat.java
|
||||
+++ b/net/minecraft/world/entity/animal/feline/Cat.java
|
||||
@@ -135,6 +135,13 @@ public class Cat extends TamableAnimal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.catBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.temptGoal = new Cat.CatTemptGoal(this, 0.6, i -> i.is(ItemTags.CAT_FOOD), true);
|
||||
diff --git a/net/minecraft/world/entity/animal/feline/Ocelot.java b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
||||
index a225a5bc7209cdaf328b252fd712cde2605fb039..b04d9caff464a5e690bafcdce4b1b46b9571d238 100644
|
||||
--- a/net/minecraft/world/entity/animal/feline/Ocelot.java
|
||||
+++ b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
||||
@@ -98,6 +98,13 @@ public class Ocelot extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.ocelotBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public boolean isTrusting() {
|
||||
return this.entityData.get(DATA_TRUSTING);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/fox/Fox.java b/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
index cf9fc2afb3b2fac97930289411f0a22fdb8ea61d..f63f304ec9375ffca0a7b22c9598a38452a3b739 100644
|
||||
--- a/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
+++ b/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
@@ -207,6 +207,13 @@ public class Fox extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.foxBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
@@ -1010,8 +1017,10 @@ public class Fox extends Animal {
|
||||
CriteriaTriggers.BRED_ANIMALS.trigger(loveCause, this.animal, this.partner, offspring);
|
||||
}
|
||||
|
||||
- this.animal.setAge(6000);
|
||||
- this.partner.setAge(6000);
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ this.animal.setAge(this.animal.getPurpurBreedTime());
|
||||
+ this.partner.setAge(this.partner.getPurpurBreedTime());
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
this.animal.resetLove();
|
||||
this.partner.resetLove();
|
||||
this.level.addFreshEntityWithPassengers(offspring, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
|
||||
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 1d9689489d67098148960d49540db77532d3adeb..79e1e1a0664cb08c1263f43b8abc3dae2828863f 100644
|
||||
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -141,6 +141,13 @@ public class Frog extends Animal {
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.frogBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected Brain<Frog> makeBrain(final Brain.Packed packedBrain) {
|
||||
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
||||
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
index 6d81790bf42f7a580b95644f0f19c3ddfc7d1764..49cfa8f360aac209106052e15ae0a6d88b3cc3ff 100644
|
||||
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -123,6 +123,13 @@ public class Goat extends Animal {
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.goatBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected Brain<Goat> makeBrain(final Brain.Packed packedBrain) {
|
||||
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
||||
diff --git a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
|
||||
index 2a0e5edf26e1b53ed9f6e341a89670fe3cd4dbd3..a70806026e1c664bd45f9992a2c28dc7bbfb01eb 100644
|
||||
--- a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
|
||||
+++ b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
|
||||
@@ -157,6 +157,13 @@ public class HappyGhast extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return 6000;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void ageBoundaryReached() {
|
||||
if (this.isBaby()) {
|
||||
diff --git a/net/minecraft/world/entity/animal/nautilus/Nautilus.java b/net/minecraft/world/entity/animal/nautilus/Nautilus.java
|
||||
index 49f3dc14c85a8ed391afdc7355e8c6ac34ab9ae5..d173ceba9629f7a0dca31aefc9df0bfa70d75738 100644
|
||||
--- a/net/minecraft/world/entity/animal/nautilus/Nautilus.java
|
||||
+++ b/net/minecraft/world/entity/animal/nautilus/Nautilus.java
|
||||
@@ -48,6 +48,13 @@ public class Nautilus extends AbstractNautilus {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.nautilusBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected Brain<Nautilus> makeBrain(final Brain.Packed packedBrain) {
|
||||
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
||||
diff --git a/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java b/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
||||
index 1ceeaad8411f06de37a0ea5aff8fc48d9211eed2..55b4a41867799dcb2999f0c324bde8b2341b2e9d 100644
|
||||
--- a/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
||||
+++ b/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
||||
@@ -59,6 +59,13 @@ public class ZombieNautilus extends AbstractNautilus {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return 6000;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return AbstractNautilus.createAttributes().add(Attributes.MOVEMENT_SPEED, 1.1F);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/panda/Panda.java b/net/minecraft/world/entity/animal/panda/Panda.java
|
||||
index bd8936c6ef9d2285858b784873e85d52812b3f14..9328cb71c88efc13afc203da1c0bff7cd305fb3c 100644
|
||||
--- a/net/minecraft/world/entity/animal/panda/Panda.java
|
||||
+++ b/net/minecraft/world/entity/animal/panda/Panda.java
|
||||
@@ -147,6 +147,13 @@ public class Panda extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.pandaBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected boolean canDispenserEquipIntoSlot(final EquipmentSlot slot) {
|
||||
return slot == EquipmentSlot.MAINHAND && this.canPickUpLoot();
|
||||
diff --git a/net/minecraft/world/entity/animal/parrot/Parrot.java b/net/minecraft/world/entity/animal/parrot/Parrot.java
|
||||
index 441919a0a99c4d87c13611999e1e24e9cfb6e0e9..22962f57daf5c274fa0ec46170f36dcaa1c8bed3 100644
|
||||
--- a/net/minecraft/world/entity/animal/parrot/Parrot.java
|
||||
+++ b/net/minecraft/world/entity/animal/parrot/Parrot.java
|
||||
@@ -207,6 +207,13 @@ public class Parrot extends ShoulderRidingEntity {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return 6000;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public @Nullable SpawnGroupData finalizeSpawn(
|
||||
final ServerLevelAccessor level, final DifficultyInstance difficulty, final EntitySpawnReason spawnReason, @Nullable SpawnGroupData groupData
|
||||
diff --git a/net/minecraft/world/entity/animal/pig/Pig.java b/net/minecraft/world/entity/animal/pig/Pig.java
|
||||
index 376e60ef2125e00432aad380ea7a6087abc76a0c..0deeb7ed21c3b6d4a29951ac84771a6439728698 100644
|
||||
--- a/net/minecraft/world/entity/animal/pig/Pig.java
|
||||
+++ b/net/minecraft/world/entity/animal/pig/Pig.java
|
||||
@@ -101,6 +101,13 @@ public class Pig extends Animal implements ItemSteerable {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.pigBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/animal/polarbear/PolarBear.java b/net/minecraft/world/entity/animal/polarbear/PolarBear.java
|
||||
index 85c6b17bbf490315b76612c4a8ab50b03e9d14a3..8041beeb5bb039f0aec0b59ba45806cf6eb57582 100644
|
||||
--- a/net/minecraft/world/entity/animal/polarbear/PolarBear.java
|
||||
+++ b/net/minecraft/world/entity/animal/polarbear/PolarBear.java
|
||||
@@ -132,6 +132,13 @@ public class PolarBear extends Animal implements NeutralMob {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.polarBearBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public @Nullable AgeableMob getBreedOffspring(final ServerLevel level, final AgeableMob partner) {
|
||||
return EntityTypes.POLAR_BEAR.create(level, EntitySpawnReason.BREEDING);
|
||||
diff --git a/net/minecraft/world/entity/animal/rabbit/Rabbit.java b/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
||||
index 38fa1c0b79e3dc11e830af95be4bed1e74910108..f0c4ad3715322bf1a5a60edd870b34a15949a77f 100644
|
||||
--- a/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
||||
+++ b/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
||||
@@ -171,6 +171,13 @@ public class Rabbit extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.rabbitBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
public void registerGoals() {
|
||||
this.goalSelector.addGoal(1, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/animal/sheep/Sheep.java b/net/minecraft/world/entity/animal/sheep/Sheep.java
|
||||
index 6ba9cd9090ef264660361e28198886f96c95dfba..cd53e9540856c53b9aae961ee0303b592a513684 100644
|
||||
--- a/net/minecraft/world/entity/animal/sheep/Sheep.java
|
||||
+++ b/net/minecraft/world/entity/animal/sheep/Sheep.java
|
||||
@@ -96,6 +96,13 @@ public class Sheep extends Animal implements Shearable {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.sheepBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.eatBlockGoal = new EatBlockGoal(this);
|
||||
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 9246c76131c02832d96eeb6d3899e0050abce938..33eb3e6b312ef32c6ae94a7ef5333ab60bb4c4ad 100644
|
||||
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -120,6 +120,13 @@ public class Sniffer extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.snifferBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/animal/turtle/Turtle.java b/net/minecraft/world/entity/animal/turtle/Turtle.java
|
||||
index 806da779ee6ea7ab6fe572d2ca6cf35c03d302b3..bbee5d60204cf7c6e77cf337044e608d79d8462e 100644
|
||||
--- a/net/minecraft/world/entity/animal/turtle/Turtle.java
|
||||
+++ b/net/minecraft/world/entity/animal/turtle/Turtle.java
|
||||
@@ -113,6 +113,13 @@ public class Turtle extends Animal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.turtleBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public void setHomePos(final BlockPos pos) {
|
||||
this.homePos = pos;
|
||||
}
|
||||
@@ -348,8 +355,10 @@ public class Turtle extends Animal {
|
||||
}
|
||||
|
||||
this.turtle.setHasEgg(true);
|
||||
- this.animal.setAge(6000);
|
||||
- this.partner.setAge(6000);
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ this.animal.setAge(this.animal.getPurpurBreedTime());
|
||||
+ this.partner.setAge(this.partner.getPurpurBreedTime());
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
this.animal.resetLove();
|
||||
this.partner.resetLove();
|
||||
RandomSource random = this.animal.getRandom();
|
||||
diff --git a/net/minecraft/world/entity/animal/wolf/Wolf.java b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
index acf623ba0ab1f1d6c98af1a83cddd634443aee58..66e58482f8422e5478b29f82271489d0449ceddb 100644
|
||||
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
||||
@@ -220,6 +220,13 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.wolfBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(1, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
||||
index 4f4f01941e66880113dd80626030a635203365b9..6017c3865c685c55ecf304af34b07e64563c5969 100644
|
||||
--- a/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -124,6 +124,13 @@ public class Strider extends Animal implements ItemSteerable {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.striderBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
public static boolean checkStriderSpawnRules(
|
||||
final EntityType<Strider> ignoredType,
|
||||
final LevelAccessor level,
|
||||
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
index 2d8023023ae121dd6ad623766c50e0b236e6a25e..c8b60fd516340de7245d3d23303c44bef4239a9c 100644
|
||||
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
@@ -106,6 +106,13 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Make entity breeding times configurable
|
||||
+ @Override
|
||||
+ public int getPurpurBreedTime() {
|
||||
+ return this.level().purpurConfig.hoglinBreedingTicks;
|
||||
+ }
|
||||
+ // Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
@VisibleForTesting
|
||||
public void setTimeInOverworld(final int timeInOverworld) {
|
||||
this.timeInOverworld = timeInOverworld;
|
||||
@@ -0,0 +1,112 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
Date: Tue, 17 Nov 2020 03:23:48 -0800
|
||||
Subject: [PATCH] Apply display names from item forms of entities to entities
|
||||
and vice versa
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index 385d6bdf435320b4779a27512447e7cc64e05ddf..ec65ca3fd54c8da3768851ee53195735d24d4895 100644
|
||||
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -476,6 +476,7 @@ public class ArmorStand extends LivingEntity {
|
||||
|
||||
private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(final ServerLevel level, final DamageSource source) { // Paper
|
||||
ItemStack result = new ItemStack(Items.ARMOR_STAND);
|
||||
+ if (level.purpurConfig.persistentDroppableEntityDisplayNames) // Purpur - Apply display names from item forms of entities to entities and vice versa
|
||||
result.set(DataComponents.CUSTOM_NAME, this.getCustomName());
|
||||
this.drops.add(new DefaultDrop(result, stack -> Block.popResource(this.level(), this.blockPosition(), stack))); // CraftBukkit - add to drops // Paper - Restore vanilla drops behavior
|
||||
return this.brokenByAnything(level, source); // Paper
|
||||
diff --git a/net/minecraft/world/entity/decoration/ItemFrame.java b/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index 7fa894e6052dd35a87b19f6bac6031bfd0243deb..19bd80e860a520f6a07baa3e66cc40c8a419c79f 100644
|
||||
--- a/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -249,7 +249,11 @@ public class ItemFrame extends HangingEntity {
|
||||
this.removeFramedMap(itemStack);
|
||||
} else {
|
||||
if (withFrame) {
|
||||
- this.spawnAtLocation(level, this.getFrameItemStack());
|
||||
+ // Purpur start - Apply display names from item forms of entities to entities and vice versa
|
||||
+ final ItemStack itemFrame = this.getFrameItemStack();
|
||||
+ if (!level.purpurConfig.persistentDroppableEntityDisplayNames) itemFrame.set(DataComponents.CUSTOM_NAME, null);
|
||||
+ this.spawnAtLocation(level, itemFrame);
|
||||
+ // Purpur end - Apply display names from item forms of entities to entities and vice versa
|
||||
}
|
||||
|
||||
if (!itemStack.isEmpty()) {
|
||||
diff --git a/net/minecraft/world/entity/decoration/painting/Painting.java b/net/minecraft/world/entity/decoration/painting/Painting.java
|
||||
index ed20a97ca9253c5c6626f3fddef45c54490fc285..338992872b24a46babd24eb364044e1449e27f17 100644
|
||||
--- a/net/minecraft/world/entity/decoration/painting/Painting.java
|
||||
+++ b/net/minecraft/world/entity/decoration/painting/Painting.java
|
||||
@@ -183,7 +183,11 @@ public class Painting extends HangingEntity {
|
||||
if (level.getGameRules().get(GameRules.ENTITY_DROPS)) {
|
||||
this.playSound(SoundEvents.PAINTING_BREAK, 1.0F, 1.0F);
|
||||
if (!(causedBy instanceof Player player && player.hasInfiniteMaterials())) {
|
||||
- this.spawnAtLocation(level, Items.PAINTING);
|
||||
+ // Purpur start - Apply display names from item forms of entities to entities and vice versa
|
||||
+ final ItemStack painting = new ItemStack(Items.PAINTING);
|
||||
+ if (!this.level().purpurConfig.persistentDroppableEntityDisplayNames) painting.set(net.minecraft.core.component.DataComponents.CUSTOM_NAME, null);
|
||||
+ this.spawnAtLocation(level, painting);
|
||||
+ // Purpur end - Apply display names from item forms of entities to entities and vice versa
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java b/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java
|
||||
index 2a6c5faa18da0f008e34eb4f2e2c3dc14e49186a..2e4ee279e4a9afacdfdfb6e1ed99a66c08aee4c9 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java
|
||||
@@ -825,7 +825,13 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
||||
|
||||
@Override
|
||||
public final ItemStack getPickResult() {
|
||||
- return new ItemStack(this.dropItem.get());
|
||||
+ // Purpur start - Apply display names from item forms of entities to entities and vice versa
|
||||
+ final ItemStack boat = new ItemStack(this.dropItem.get());
|
||||
+ if (!this.level().purpurConfig.persistentDroppableEntityDisplayNames) {
|
||||
+ boat.set(net.minecraft.core.component.DataComponents.CUSTOM_NAME, null);
|
||||
+ }
|
||||
+ return boat;
|
||||
+ // Purpur end - Apply display names from item forms of entities to entities and vice versa
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/item/ArmorStandItem.java b/net/minecraft/world/item/ArmorStandItem.java
|
||||
index 9ed039c323cccf163e7b3f39d73fcc7e3b5c663c..e640c97e26308988f0c8bd0c57d05365e8a41d9f 100644
|
||||
--- a/net/minecraft/world/item/ArmorStandItem.java
|
||||
+++ b/net/minecraft/world/item/ArmorStandItem.java
|
||||
@@ -53,6 +53,10 @@ public class ArmorStandItem extends Item {
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
// CraftBukkit end
|
||||
+ // Purpur start - Apply display names from item forms of entities to entities and vice versa
|
||||
+ if (!serverLevel.purpurConfig.persistentDroppableEntityDisplayNames) entity.setCustomName(null);
|
||||
+ if (serverLevel.purpurConfig.armorstandSetNameVisible && entity.getCustomName() != null) entity.setCustomNameVisible(true);
|
||||
+ // Purpur end - Apply display names from item forms of entities to entities and vice versa
|
||||
serverLevel.addFreshEntityWithPassengers(entity);
|
||||
level.playSound(null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.ARMOR_STAND_PLACE, SoundSource.BLOCKS, 0.75F, 0.8F);
|
||||
entity.gameEvent(GameEvent.ENTITY_PLACE, context.getPlayer());
|
||||
diff --git a/net/minecraft/world/item/BoatItem.java b/net/minecraft/world/item/BoatItem.java
|
||||
index 416feeb88dd0c473e596a8bb217fab52a24d23be..597f14af31e1a1253e5d412af390e200632ba279 100644
|
||||
--- a/net/minecraft/world/item/BoatItem.java
|
||||
+++ b/net/minecraft/world/item/BoatItem.java
|
||||
@@ -65,6 +65,7 @@ public class BoatItem extends Item {
|
||||
}
|
||||
|
||||
boat.setYRot(player.getYRot());
|
||||
+ if (!level.purpurConfig.persistentDroppableEntityDisplayNames) boat.setCustomName(null); // Purpur - Apply display names from item forms of entities to entities and vice versa
|
||||
if (!level.noCollision(boat, boat.getBoundingBox())) {
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
diff --git a/net/minecraft/world/item/HangingEntityItem.java b/net/minecraft/world/item/HangingEntityItem.java
|
||||
index 56a048740794db66917c2975a65d9d8fc5a8dc36..e3d81dc449545d6ce25c2f2cb46d521cc6a2a422 100644
|
||||
--- a/net/minecraft/world/item/HangingEntityItem.java
|
||||
+++ b/net/minecraft/world/item/HangingEntityItem.java
|
||||
@@ -61,7 +61,7 @@ public class HangingEntityItem extends Item {
|
||||
entity = new GlowItemFrame(level, blockPos, clickedFace);
|
||||
}
|
||||
|
||||
- EntityType.<HangingEntity>createDefaultStackConfig(level, itemInHand, player).apply(entity);
|
||||
+ EntityType.<HangingEntity>appendDefaultStackConfig(entity1 -> {if (!level.purpurConfig.persistentDroppableEntityDisplayNames) entity1.setCustomName(null);}, level, itemInHand, player).apply(entity); // Purpur - Apply display names from item forms of entities to entities and vice versa
|
||||
if (entity.survives()) {
|
||||
if (!level.isClientSide()) {
|
||||
// CraftBukkit start - fire HangingPlaceEvent
|
||||
@@ -0,0 +1,172 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
Date: Sat, 5 Dec 2020 01:20:16 -0800
|
||||
Subject: [PATCH] Option for Villager Clerics to farm Nether Wart
|
||||
|
||||
Adds an option so that Villagers with the Cleric profession are able to
|
||||
farm Nether Wart. Reimplemented based on a feature of the carpet-extra
|
||||
mod.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
index 5a0d0d1c145c303930769ea27f81d91337a3f1bf..29458d4dc1764b5b7ede94853190a5dd84c1fc36 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
@@ -31,6 +31,7 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
private long nextOkStartTime;
|
||||
private int timeWorkedSoFar;
|
||||
private final List<BlockPos> validFarmlandAroundVillager = Lists.newArrayList();
|
||||
+ private boolean clericWartFarmer = false; // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
|
||||
public HarvestFarmland() {
|
||||
super(
|
||||
@@ -51,10 +52,11 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (!body.getVillagerData().profession().is(VillagerProfession.FARMER)) {
|
||||
+ if (!body.getVillagerData().profession().is(VillagerProfession.FARMER) && !(level.purpurConfig.villagerClericsFarmWarts && body.getVillagerData().profession().is(VillagerProfession.CLERIC))) { // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (!this.clericWartFarmer && body.getVillagerData().profession().is(VillagerProfession.CLERIC)) this.clericWartFarmer = true; // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
BlockPos.MutableBlockPos mutPos = body.blockPosition().mutable();
|
||||
this.validFarmlandAroundVillager.clear();
|
||||
|
||||
@@ -83,6 +85,7 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
BlockState state = level.getBlockState(blockPos);
|
||||
Block block = state.getBlock();
|
||||
Block blockBelow = level.getBlockState(blockPos.below()).getBlock();
|
||||
+ if (this.clericWartFarmer) return block == net.minecraft.world.level.block.Blocks.NETHER_WART && state.getValue(net.minecraft.world.level.block.NetherWartBlock.AGE) == 3 || state.isAir() && block == net.minecraft.world.level.block.Blocks.SOUL_SAND; // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
return block instanceof CropBlock cropBlock && cropBlock.isMaxAge(state) || state.isAir() && blockBelow instanceof FarmlandBlock;
|
||||
}
|
||||
|
||||
@@ -109,19 +112,19 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
BlockState blockState = level.getBlockState(this.aboveFarmlandPos);
|
||||
Block block = blockState.getBlock();
|
||||
Block blockBelow = level.getBlockState(this.aboveFarmlandPos.below()).getBlock();
|
||||
- if (block instanceof CropBlock cropBlock && cropBlock.isMaxAge(blockState)) {
|
||||
+ if (block instanceof CropBlock cropBlock && cropBlock.isMaxAge(blockState) && !this.clericWartFarmer || this.clericWartFarmer && block == net.minecraft.world.level.block.Blocks.NETHER_WART && blockState.getValue(net.minecraft.world.level.block.NetherWartBlock.AGE) == 3) { // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(body, this.aboveFarmlandPos, blockState.getFluidState().createLegacyBlock())) { // CraftBukkit // Paper - fix wrong block state
|
||||
level.destroyBlock(this.aboveFarmlandPos, true, body);
|
||||
} // CraftBukkit
|
||||
}
|
||||
|
||||
- if (blockState.isAir() && blockBelow instanceof FarmlandBlock && body.hasFarmSeeds()) {
|
||||
+ if (blockState.isAir() && blockBelow instanceof FarmlandBlock && !this.clericWartFarmer || this.clericWartFarmer && blockBelow == net.minecraft.world.level.block.Blocks.SOUL_SAND && body.hasFarmSeeds()) { // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
SimpleContainer inventory = body.getInventory();
|
||||
|
||||
for (int i = 0; i < inventory.getContainerSize(); i++) {
|
||||
ItemStack itemStack = inventory.getItem(i);
|
||||
boolean ok = false;
|
||||
- if (!itemStack.isEmpty() && itemStack.is(ItemTags.VILLAGER_PLANTABLE_SEEDS) && itemStack.getItem() instanceof BlockItem blockItem) {
|
||||
+ if (!itemStack.isEmpty() && (itemStack.is(ItemTags.VILLAGER_PLANTABLE_SEEDS) || this.clericWartFarmer && itemStack.getItem() == net.minecraft.world.item.Items.NETHER_WART) && itemStack.getItem() instanceof BlockItem blockItem) { // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
BlockState place = blockItem.getBlock().defaultBlockState();
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(body, this.aboveFarmlandPos, place)) { // CraftBukkit
|
||||
level.setBlockAndUpdate(this.aboveFarmlandPos, place);
|
||||
@@ -136,7 +139,7 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
this.aboveFarmlandPos.getX(),
|
||||
this.aboveFarmlandPos.getY(),
|
||||
this.aboveFarmlandPos.getZ(),
|
||||
- SoundEvents.CROP_PLANTED,
|
||||
+ this.clericWartFarmer ? SoundEvents.NETHER_WART_PLANTED : SoundEvents.CROP_PLANTED, // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
SoundSource.BLOCKS,
|
||||
1.0F,
|
||||
1.0F
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java b/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
|
||||
index 736ad21b73a19113c6f0f3bce6aa1cc0a41485a8..ec3541d4f2d39a3fd482063efabeab6478311214 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
|
||||
@@ -59,6 +59,12 @@ public class TradeWithVillager extends Behavior<Villager> {
|
||||
throwHalfStack(body, ImmutableSet.of(Items.WHEAT), target);
|
||||
}
|
||||
|
||||
+ // Purpur start - Option for Villager Clerics to farm Nether Wart
|
||||
+ if (level.purpurConfig.villagerClericsFarmWarts && level.purpurConfig.villagerClericFarmersThrowWarts && body.getVillagerData().profession().is(VillagerProfession.CLERIC) && body.getInventory().countItem(Items.NETHER_WART) > Items.NETHER_WART.getDefaultMaxStackSize() / 2) {
|
||||
+ throwHalfStack(body, ImmutableSet.of(Items.NETHER_WART), target);
|
||||
+ }
|
||||
+ // Purpur end - Option for Villager Clerics to farm Nether Wart
|
||||
+
|
||||
if (!this.trades.isEmpty() && body.getInventory().hasAnyOf(this.trades)) {
|
||||
throwHalfStack(body, this.trades, target);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java b/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
|
||||
index fa9163d1f73eacd110227b6cf95f578c678aa803..bcae1ac0f5acccd4e58fe1cc2a54b3d30b488414 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
|
||||
@@ -74,8 +74,13 @@ public class VillagerGoalPackages {
|
||||
public static ImmutableList<Pair<Integer, ? extends BehaviorControl<? super Villager>>> getWorkPackage(
|
||||
final Holder<VillagerProfession> profession, final float speedModifier
|
||||
) {
|
||||
+ // Purpur start - Option for Villager Clerics to farm Nether Wart
|
||||
+ return getWorkPackage(profession, speedModifier, false);
|
||||
+ }
|
||||
+ public static ImmutableList<Pair<Integer, ? extends BehaviorControl<? super Villager>>> getWorkPackage(Holder<VillagerProfession> profession, float speedModifier, boolean clericsFarmWarts) {
|
||||
+ // Purpur end - Option for Villager Clerics to farm Nether Wart
|
||||
WorkAtPoi workAtPoi;
|
||||
- if (profession.is(VillagerProfession.FARMER)) {
|
||||
+ if (profession.is(VillagerProfession.FARMER) || (clericsFarmWarts && profession.is(VillagerProfession.CLERIC))) { // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
workAtPoi = new WorkAtComposter();
|
||||
} else {
|
||||
workAtPoi = new WorkAtPoi();
|
||||
diff --git a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
index ec12508c112b1e7748a5d197b73a0d540bed10fc..f2daabad51d565cae11e8bfce8b1bf40a7e56a78 100644
|
||||
--- a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
+++ b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
@@ -22,6 +22,13 @@ public class SecondaryPoiSensor extends Sensor<Villager> {
|
||||
|
||||
@Override
|
||||
protected void doTick(final ServerLevel level, final Villager body) {
|
||||
+ // Purpur start - Option for Villager Clerics to farm Nether Wart - make sure clerics don't wander to soul sand when the option is off
|
||||
+ Brain<?> brain = body.getBrain();
|
||||
+ if (!level.purpurConfig.villagerClericsFarmWarts && body.getVillagerData().profession().is(net.minecraft.world.entity.npc.villager.VillagerProfession.CLERIC)) {
|
||||
+ brain.eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end - Option for Villager Clerics to farm Nether Wart
|
||||
ResourceKey<Level> dimensionType = level.dimension();
|
||||
BlockPos center = body.blockPosition();
|
||||
List<GlobalPos> jobSites = Lists.newArrayList();
|
||||
@@ -38,7 +45,7 @@ public class SecondaryPoiSensor extends Sensor<Villager> {
|
||||
}
|
||||
}
|
||||
|
||||
- Brain<?> brain = body.getBrain();
|
||||
+ //Brain<?> brain = body.getBrain(); // Purpur - Option for Villager Clerics to farm Nether Wart - moved up
|
||||
if (!jobSites.isEmpty()) {
|
||||
brain.setMemory(MemoryModuleType.SECONDARY_JOB_SITE, jobSites);
|
||||
} else {
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
index f0ebe6f376a13df2fa34f41ecdcc9bded72dc756..bd9f39efb01f9153db56e6e58b56b76dec3d8cc3 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
@@ -148,7 +148,7 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re
|
||||
activities.add(
|
||||
ActivityData.create(
|
||||
Activity.WORK,
|
||||
- VillagerGoalPackages.getWorkPackage(profession, 0.5F),
|
||||
+ VillagerGoalPackages.getWorkPackage(profession, 0.5F, body.level().purpurConfig.villagerClericsFarmWarts), // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))
|
||||
)
|
||||
);
|
||||
@@ -947,7 +947,7 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re
|
||||
}
|
||||
|
||||
public boolean hasFarmSeeds() {
|
||||
- return this.getInventory().hasAnyMatching(item -> item.is(ItemTags.VILLAGER_PLANTABLE_SEEDS));
|
||||
+ return this.getInventory().hasAnyMatching(item -> this.level().purpurConfig.villagerClericsFarmWarts && this.getVillagerData().profession().is(VillagerProfession.CLERIC) ? item.is(Items.NETHER_WART) : item.is(ItemTags.VILLAGER_PLANTABLE_SEEDS));
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/VillagerProfession.java b/net/minecraft/world/entity/npc/villager/VillagerProfession.java
|
||||
index 1d779d7a51437581fa3d8da38449916362b25ce9..9d71db9db42e38338afe10b24699dae9cc90fcfa 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/VillagerProfession.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/VillagerProfession.java
|
||||
@@ -165,6 +165,8 @@ public record VillagerProfession(
|
||||
registry,
|
||||
CLERIC,
|
||||
PoiTypes.CLERIC,
|
||||
+ ImmutableSet.of(Items.NETHER_WART), // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
+ ImmutableSet.of(Blocks.SOUL_SAND), // Purpur - Option for Villager Clerics to farm Nether Wart
|
||||
SoundEvents.VILLAGER_WORK_CLERIC,
|
||||
Int2ObjectMap.ofEntries(
|
||||
Int2ObjectMap.entry(1, TradeSets.CLERIC_LEVEL_1),
|
||||
@@ -0,0 +1,378 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Tue, 5 Jan 2021 22:21:56 -0500
|
||||
Subject: [PATCH] Add mobGriefing override to everything affected
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 991ded4e26c00ffb25a933a8cc175849e1e579b2..a9e93d55de28964169988e2b276fdfc8acd29fdb 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1982,7 +1982,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
boolean var6 = false;
|
||||
if (this.dead && killer instanceof WitherBoss) { // Paper
|
||||
- if (serverLevel.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.witherMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
BlockPos pos = this.blockPosition();
|
||||
BlockState state = Blocks.WITHER_ROSE.defaultBlockState();
|
||||
if (this.level().getBlockState(pos).isAir() && state.canSurvive(this.level(), pos)) {
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index c707a18175920b12b4d554d8041c7afe10a0efd1..6e6ba45c93209bd9e7a8565bf166b4cc9843b80a 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -577,7 +577,7 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs
|
||||
&& this.canPickUpLoot()
|
||||
&& this.isAlive()
|
||||
&& !this.dead
|
||||
- && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.entitiesPickUpLootMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
Vec3i pickupReach = this.getPickupReach();
|
||||
|
||||
for (ItemEntity entity : this.level()
|
||||
diff --git a/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
index 29458d4dc1764b5b7ede94853190a5dd84c1fc36..139f7d44333aa50367739487f6154fe8deaf9685 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
@@ -48,7 +48,7 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
|
||||
@Override
|
||||
protected boolean checkExtraStartConditions(final ServerLevel level, final Villager body) {
|
||||
- if (!level.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.villagerMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java b/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
|
||||
index e33598c3ea748f81c7efcaa06d9d0597624a852b..80a42d030969e264a93108ca3f2c296dd295ad1d 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
|
||||
@@ -31,7 +31,7 @@ public class BreakDoorGoal extends DoorInteractGoal {
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
return super.canUse()
|
||||
- && getServerLevel(this.mob).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
+ && getServerLevel(this.mob).getGameRules().get(GameRules.MOB_GRIEFING, this.mob.level().purpurConfig.zombieMobGriefingOverride) // Purpur - Add mobGriefing override to everything affected
|
||||
&& this.isValidDifficulty(this.mob.level().getDifficulty())
|
||||
&& !this.isOpen();
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
|
||||
index c2a1b2b79c4b55dc09558cf6d998f09308196cb2..96cc2c94fe5bfde6a04b83b9bdb925e1454d109c 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
|
||||
@@ -64,7 +64,7 @@ public class EatBlockGoal extends Goal {
|
||||
BlockPos pos = this.mob.blockPosition();
|
||||
final BlockState blockState = this.level.getBlockState(pos); // Paper - fix wrong block state
|
||||
if (IS_EDIBLE.test(blockState)) { // Paper - fix wrong block state
|
||||
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.mob, pos, blockState.getFluidState().createLegacyBlock(), !getServerLevel(this.level).getGameRules().get(GameRules.MOB_GRIEFING))) { // CraftBukkit // Paper - fix wrong block state
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.mob, pos, blockState.getFluidState().createLegacyBlock(), !getServerLevel(this.level).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(this.level).purpurConfig.sheepMobGriefingOverride))) { // CraftBukkit // Paper - fix wrong block state // Purpur - Add mobGriefing override to everything affected
|
||||
this.level.destroyBlock(pos, false);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class EatBlockGoal extends Goal {
|
||||
} else {
|
||||
BlockPos below = pos.below();
|
||||
if (this.level.getBlockState(below).is(Blocks.GRASS_BLOCK)) {
|
||||
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.mob, below, Blocks.DIRT.defaultBlockState(), !getServerLevel(this.level).getGameRules().get(GameRules.MOB_GRIEFING))) { // CraftBukkit // Paper - Fix wrong block state
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.mob, below, Blocks.DIRT.defaultBlockState(), !getServerLevel(this.level).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(this.level).purpurConfig.sheepMobGriefingOverride))) { // CraftBukkit // Paper - Fix wrong block state // Purpur - Add mobGriefing override to everything affected
|
||||
this.level.levelEvent(LevelEvent.PARTICLES_DESTROY_BLOCK, below, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
|
||||
this.level.setBlock(below, Blocks.DIRT.defaultBlockState(), Block.UPDATE_CLIENTS);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
||||
index ff0f99d4b560a1c0721885b0eba5bd5ab2087bd7..51c72524c14c078d1bb0539f0b54fc4af1c1412d 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
|
||||
@@ -34,7 +34,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
- if (!getServerLevel(this.removerMob).getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!getServerLevel(this.removerMob).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(this.removerMob).purpurConfig.zombieMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
return false;
|
||||
} else if (this.nextStartTick > 0) {
|
||||
this.nextStartTick--;
|
||||
diff --git a/net/minecraft/world/entity/animal/fox/Fox.java b/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
index f63f304ec9375ffca0a7b22c9598a38452a3b739..bf9ff90916733110a249912d7aeabc2e45f63b01 100644
|
||||
--- a/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
+++ b/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
@@ -1075,7 +1075,7 @@ public class Fox extends Animal {
|
||||
}
|
||||
|
||||
protected void onReachedTarget() {
|
||||
- if (getServerLevel(Fox.this.level()).getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (getServerLevel(Fox.this.level()).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(Fox.this.level()).purpurConfig.foxMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
BlockState state = Fox.this.level().getBlockState(this.blockPos);
|
||||
if (state.is(Blocks.SWEET_BERRY_BUSH)) {
|
||||
this.pickSweetBerries(state);
|
||||
diff --git a/net/minecraft/world/entity/animal/golem/SnowGolem.java b/net/minecraft/world/entity/animal/golem/SnowGolem.java
|
||||
index 3fe90a55e0b681c3c689db081abe28e6931e711f..ad300631146959f158cbabddac12fda4deb33360 100644
|
||||
--- a/net/minecraft/world/entity/animal/golem/SnowGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/golem/SnowGolem.java
|
||||
@@ -135,7 +135,7 @@ public class SnowGolem extends AbstractGolem implements RangedAttackMob, Shearab
|
||||
this.hurtServer(serverLevel, this.damageSources().onFire().knownCause(org.bukkit.event.entity.EntityDamageEvent.DamageCause.MELTING), 1.0F); // CraftBukkit
|
||||
}
|
||||
|
||||
- if (!serverLevel.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.snowGolemMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/animal/rabbit/Rabbit.java b/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
||||
index f0c4ad3715322bf1a5a60edd870b34a15949a77f..80a65dba81ab82cdb9bd43d1878e74550e61d634 100644
|
||||
--- a/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
||||
+++ b/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
||||
@@ -695,7 +695,7 @@ public class Rabbit extends Animal {
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
if (this.nextStartTick <= 0) {
|
||||
- if (!getServerLevel(this.rabbit).getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!getServerLevel(this.rabbit).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(this.rabbit).purpurConfig.rabbitMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
index 6883bd42f9d124c6421d1eb332f04514aa7bc3f8..1294dc666be270b4c7b335b7f2786b9b68bededc 100644
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -536,7 +536,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
BlockPos blockPos = new BlockPos(x, y, z);
|
||||
BlockState state = level.getBlockState(blockPos);
|
||||
if (!state.isAir() && !state.is(BlockTags.DRAGON_TRANSPARENT)) {
|
||||
- if (level.getGameRules().get(GameRules.MOB_GRIEFING) && !state.is(BlockTags.DRAGON_IMMUNE)) {
|
||||
+ if (level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.enderDragonMobGriefingOverride) && !state.is(BlockTags.DRAGON_IMMUNE)) { // Purpur - Add mobGriefing override to everything affected
|
||||
// CraftBukkit start - Add blocks to list rather than destroying them
|
||||
//flag1 = level.removeBlock(blockPos, false) || flag1;
|
||||
destroyedBlock = true;
|
||||
diff --git a/net/minecraft/world/entity/boss/wither/WitherBoss.java b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 7a80afbe7d1c5ff2ea0e26eb1c59123705dc1aef..543ea15e63316564aa6c699863d952570d7e0df7 100644
|
||||
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -492,7 +492,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
|
||||
if (this.destroyBlocksTick > 0) {
|
||||
this.destroyBlocksTick--;
|
||||
- if (this.destroyBlocksTick == 0 && level.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (this.destroyBlocksTick == 0 && level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.witherMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
boolean destroyed = false;
|
||||
int width = Mth.floor(this.getBbWidth() / 2.0F + 1.0F);
|
||||
int height = Mth.floor(this.getBbHeight());
|
||||
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index e9b28ab9af835e8394855f08edb3cc463022d6f9..3f233ad5cf2514813ec8d3d36a59f716615a8b18 100644
|
||||
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -504,7 +504,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
public boolean canUse() {
|
||||
if (!enderman.level().purpurConfig.endermanAllowGriefing) return false; // Purpur - Add enderman and creeper griefing controls
|
||||
return this.enderman.getCarriedBlock() != null
|
||||
- && getServerLevel(this.enderman).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
+ && getServerLevel(this.enderman).getGameRules().get(GameRules.MOB_GRIEFING, this.enderman.level().purpurConfig.endermanMobGriefingOverride) // Purpur - Add mobGriefing override to everything affected
|
||||
&& this.enderman.getRandom().nextInt(reducedTickDelay(2000)) == 0;
|
||||
}
|
||||
|
||||
@@ -648,7 +648,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
public boolean canUse() {
|
||||
if (!enderman.level().purpurConfig.endermanAllowGriefing) return false; // Purpur - Add enderman and creeper griefing controls
|
||||
return this.enderman.getCarriedBlock() == null
|
||||
- && getServerLevel(this.enderman).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
+ && getServerLevel(this.enderman).getGameRules().get(GameRules.MOB_GRIEFING, this.enderman.level().purpurConfig.endermanMobGriefingOverride) // Purpur - Add mobGriefing override to everything affected
|
||||
&& this.enderman.getRandom().nextInt(reducedTickDelay(20)) == 0;
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Ravager.java b/net/minecraft/world/entity/monster/Ravager.java
|
||||
index d8c97a5ec3f121ce92dedfeba4babb564714eca4..22722b7cec888fa1c28fa17baeb37f38c55a72e4 100644
|
||||
--- a/net/minecraft/world/entity/monster/Ravager.java
|
||||
+++ b/net/minecraft/world/entity/monster/Ravager.java
|
||||
@@ -178,7 +178,7 @@ public class Ravager extends Raider {
|
||||
this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(Mth.lerp(0.1, baseValue, maxSpeed));
|
||||
}
|
||||
|
||||
- if (this.level() instanceof ServerLevel serverLevel && this.horizontalCollision && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (this.level() instanceof ServerLevel serverLevel && this.horizontalCollision && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.ravagerMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
boolean destroyedBlock = false;
|
||||
AABB bb = this.getBoundingBox().inflate(0.2);
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Silverfish.java b/net/minecraft/world/entity/monster/Silverfish.java
|
||||
index a789aa75d88658236524d83fee02cf303e898809..1119feee838deb454ceef5d6c9998773c7169daf 100644
|
||||
--- a/net/minecraft/world/entity/monster/Silverfish.java
|
||||
+++ b/net/minecraft/world/entity/monster/Silverfish.java
|
||||
@@ -173,7 +173,7 @@ public class Silverfish extends Monster {
|
||||
}
|
||||
|
||||
RandomSource random = this.mob.getRandom();
|
||||
- if (getServerLevel(this.mob).getGameRules().get(GameRules.MOB_GRIEFING) && random.nextInt(reducedTickDelay(10)) == 0) {
|
||||
+ if (getServerLevel(this.mob).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(this.mob).purpurConfig.silverfishMobGriefingOverride) && random.nextInt(reducedTickDelay(10)) == 0) { // Purpur - Add mobGriefing override to everything affected
|
||||
this.selectedDirection = Direction.getRandom(random);
|
||||
BlockPos pos = BlockPos.containing(this.mob.getX(), this.mob.getY() + 0.5, this.mob.getZ()).relative(this.selectedDirection);
|
||||
BlockState blockState = this.mob.level().getBlockState(pos);
|
||||
@@ -248,7 +248,7 @@ public class Silverfish extends Monster {
|
||||
BlockState blockState = level.getBlockState(testPos);
|
||||
if (blockState.getBlock() instanceof InfestedBlock infestedBlock) {
|
||||
// CraftBukkit start
|
||||
- BlockState afterState = getServerLevel(level).getGameRules().get(GameRules.MOB_GRIEFING) ? blockState.getFluidState().createLegacyBlock() : infestedBlock.hostStateByInfested(level.getBlockState(testPos)); // Paper - fix wrong block state
|
||||
+ BlockState afterState = getServerLevel(level).getGameRules().get(GameRules.MOB_GRIEFING, getServerLevel(level).purpurConfig.silverfishMobGriefingOverride) ? blockState.getFluidState().createLegacyBlock() : infestedBlock.hostStateByInfested(level.getBlockState(testPos)); // Paper - fix wrong block state // Purpur - Add mobGriefing override to everything affected
|
||||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, testPos, afterState)) { // Paper - fix wrong block state
|
||||
continue;
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/monster/illager/Evoker.java b/net/minecraft/world/entity/monster/illager/Evoker.java
|
||||
index 73ebf1ac5d814399887e4e8e717ee8fb41404969..4b077693e8749b6d2440b12f0aa1d7d6ac899593 100644
|
||||
--- a/net/minecraft/world/entity/monster/illager/Evoker.java
|
||||
+++ b/net/minecraft/world/entity/monster/illager/Evoker.java
|
||||
@@ -332,7 +332,7 @@ public class Evoker extends SpellcasterIllager {
|
||||
}
|
||||
|
||||
ServerLevel level = getServerLevel(Evoker.this.level());
|
||||
- if (!level.getGameRules().get(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.evokerMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
index 95751fd884c70ff6a3ff95fb2d442627a7867996..013550c72a194977b1874f30aeda60d27b682853 100644
|
||||
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
@@ -416,7 +416,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
||||
|
||||
@Override
|
||||
public boolean wantsToPickUp(final ServerLevel level, final ItemStack itemStack) {
|
||||
- return level.getGameRules().get(GameRules.MOB_GRIEFING) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, itemStack);
|
||||
+ return level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.piglinMobGriefingOverride) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, itemStack); // Purpur - Add mobGriefing override to everything affected
|
||||
}
|
||||
|
||||
protected boolean canReplaceCurrentItem(final ItemStack newItemStack) {
|
||||
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 9af4bf76974f05d9f752bbd4e8037560ec481cdf..7f3673a44b0200d18dbf7f1fac8d377bfc994232 100644
|
||||
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -460,7 +460,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@Override
|
||||
public boolean mayInteract(final ServerLevel level, final BlockPos pos) {
|
||||
Entity owner = this.getOwner();
|
||||
- return owner instanceof Player ? owner.mayInteract(level, pos) : owner == null || level.getGameRules().get(GameRules.MOB_GRIEFING);
|
||||
+ return owner instanceof Player ? owner.mayInteract(level, pos) : owner == null || level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.projectilesMobGriefingOverride); // Purpur - Add mobGriefing override to everything affected
|
||||
}
|
||||
|
||||
public boolean mayBreak(final ServerLevel level) {
|
||||
diff --git a/net/minecraft/world/entity/projectile/hurtingprojectile/LargeFireball.java b/net/minecraft/world/entity/projectile/hurtingprojectile/LargeFireball.java
|
||||
index 8195ab561d12abb33f4359a68b3c1579ce284242..1991148d1bd440a453363c5df21fd161308f656f 100644
|
||||
--- a/net/minecraft/world/entity/projectile/hurtingprojectile/LargeFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/hurtingprojectile/LargeFireball.java
|
||||
@@ -21,20 +21,20 @@ public class LargeFireball extends Fireball {
|
||||
|
||||
public LargeFireball(final EntityType<? extends LargeFireball> type, final Level level) {
|
||||
super(type, level);
|
||||
- this.isIncendiary = (level instanceof ServerLevel serverLevel) && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING); // CraftBukkit
|
||||
+ this.isIncendiary = (level instanceof ServerLevel serverLevel) && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.fireballsMobGriefingOverride); // CraftBukkit // Purpur - Add mobGriefing override to everything affected
|
||||
}
|
||||
|
||||
public LargeFireball(final Level level, final LivingEntity mob, final Vec3 direction, final int explosionPower) {
|
||||
super(EntityTypes.FIREBALL, mob, direction, level);
|
||||
this.explosionPower = explosionPower;
|
||||
- this.isIncendiary = (level instanceof ServerLevel serverLevel) && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING); // CraftBukkit
|
||||
+ this.isIncendiary = (level instanceof ServerLevel serverLevel) && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.fireballsMobGriefingOverride); // CraftBukkit // Purpur - Add mobGriefing override to everything affected
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHit(final HitResult hitResult) {
|
||||
super.onHit(hitResult);
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
- // boolean grief = serverLevel.getGameRules().get(GameRules.MOB_GRIEFING); // CraftBukkit - baked into fields (see constructor)
|
||||
+ // boolean grief = serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.fireballsMobGriefingOverride); // CraftBukkit - baked into fields (see constructor) // Purpur - Add mobGriefing override to everything affected
|
||||
// CraftBukkit start - fire ExplosionPrimeEvent
|
||||
org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
||||
if (event.callEvent()) {
|
||||
diff --git a/net/minecraft/world/entity/projectile/hurtingprojectile/SmallFireball.java b/net/minecraft/world/entity/projectile/hurtingprojectile/SmallFireball.java
|
||||
index a2aab8db9826e0b4607f54914af43918a7e35512..e5cf3ec08e134e24fbcc31d90321913077988b43 100644
|
||||
--- a/net/minecraft/world/entity/projectile/hurtingprojectile/SmallFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/hurtingprojectile/SmallFireball.java
|
||||
@@ -26,7 +26,7 @@ public class SmallFireball extends Fireball {
|
||||
super(EntityTypes.SMALL_FIREBALL, mob, direction, level);
|
||||
// CraftBukkit start
|
||||
if (this.getOwner() != null && this.getOwner() instanceof Mob) {
|
||||
- this.isIncendiary = (level instanceof ServerLevel serverLevel) && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING);
|
||||
+ this.isIncendiary = (level instanceof ServerLevel serverLevel) && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.fireballsMobGriefingOverride); // Purpur - Add mobGriefing override to everything affected
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index ac5808a7019e7131b2e7f6710537d63ad5340703..f37710c48aafb11d65b99e4d37ef1382a8a36417 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -398,7 +398,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
}
|
||||
|
||||
private boolean cannotPickUpBanner() {
|
||||
- if (!getServerLevel(this.mob).getGameRules().get(net.minecraft.world.level.gamerules.GameRules.MOB_GRIEFING)) return true; // Paper - respect game and entity rules for picking up items
|
||||
+ if (!getServerLevel(this.mob).getGameRules().get(net.minecraft.world.level.gamerules.GameRules.MOB_GRIEFING, this.mob.level().purpurConfig.pillagerMobGriefingOverride)) return true; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing override to everything affected
|
||||
if (!this.mob.hasActiveRaid()) {
|
||||
return true;
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/CropBlock.java b/net/minecraft/world/level/block/CropBlock.java
|
||||
index a47e5e38ef5c13da3827174121c1ec4b9ffbbce2..0dfb632b339b24564744b1f5c0d52d7fed66d265 100644
|
||||
--- a/net/minecraft/world/level/block/CropBlock.java
|
||||
+++ b/net/minecraft/world/level/block/CropBlock.java
|
||||
@@ -177,7 +177,7 @@ public class CropBlock extends VegetationBlock implements BonemealableBlock {
|
||||
final boolean isPrecise
|
||||
) {
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
||||
- if (level instanceof ServerLevel serverLevel && entity instanceof Ravager && serverLevel.purpurConfig.ravagerGriefableBlocks.contains(serverLevel.getBlockState(pos).getBlock()) && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !serverLevel.getGameRules().get(GameRules.MOB_GRIEFING))) { // CraftBukkit // Purpur - Configurable ravager griefable blocks list
|
||||
+ if (level instanceof ServerLevel serverLevel && entity instanceof Ravager && serverLevel.purpurConfig.ravagerGriefableBlocks.contains(serverLevel.getBlockState(pos).getBlock()) && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.ravagerMobGriefingOverride))) { // CraftBukkit // Purpur - Configurable ravager griefable blocks list // Purpur - Add mobGriefing override to everything affected
|
||||
serverLevel.destroyBlock(pos, true, entity);
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/FarmlandBlock.java b/net/minecraft/world/level/block/FarmlandBlock.java
|
||||
index d4a7099782965fe2c24c4e5fc48aab07a3f1ec45..830067a48d60d8fe85e0878cff2a7ad41cc7aed2 100644
|
||||
--- a/net/minecraft/world/level/block/FarmlandBlock.java
|
||||
+++ b/net/minecraft/world/level/block/FarmlandBlock.java
|
||||
@@ -113,7 +113,7 @@ public class FarmlandBlock extends Block {
|
||||
if (level instanceof ServerLevel serverLevel
|
||||
&& (serverLevel.purpurConfig.farmlandTrampleHeight >= 0D ? fallDistance >= serverLevel.purpurConfig.farmlandTrampleHeight : level.getRandom().nextFloat() < fallDistance - 0.5) // Purpur - Configurable farmland trample height
|
||||
&& entity instanceof LivingEntity
|
||||
- && (entity instanceof Player || serverLevel.getGameRules().get(GameRules.MOB_GRIEFING))
|
||||
+ && (entity instanceof Player || serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.farmlandMobGriefingOverride)) // Purpur - Add mobGriefing override to everything affected
|
||||
&& entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) {
|
||||
// CraftBukkit start - Interact soil
|
||||
org.bukkit.event.Cancellable cancellable;
|
||||
diff --git a/net/minecraft/world/level/block/PowderSnowBlock.java b/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
index e62a9b0ffe7ba44fc5edd5d584b7c114699d8e58..564376c2da94257db2c7251def664fb990f708b5 100644
|
||||
--- a/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
+++ b/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
@@ -103,7 +103,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
|
||||
// CraftBukkit - move down
|
||||
&& e.mayInteract(serverLevel, position)) {
|
||||
// CraftBukkit start
|
||||
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(e, pos, Blocks.AIR.defaultBlockState(), !(serverLevel.getGameRules().get(GameRules.MOB_GRIEFING) || e instanceof Player))) {
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(e, pos, Blocks.AIR.defaultBlockState(), !(serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.powderSnowMobGriefingOverride) || e instanceof Player))) { // Purpur - Add mobGriefing override to everything affected
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/net/minecraft/world/level/block/TurtleEggBlock.java b/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
index 789d977862da31a39dff96bcfd5e0c3c32c5770c..ed57b65f0c94d56477863dfb4435d8674d3d6ce2 100644
|
||||
--- a/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
+++ b/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
@@ -221,7 +221,7 @@ public class TurtleEggBlock extends Block {
|
||||
// Purpur end - Option to disable turtle egg trampling with feather falling
|
||||
if (entity instanceof Player) return true;
|
||||
|
||||
- return level.getGameRules().get(GameRules.MOB_GRIEFING);
|
||||
+ return level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.turtleEggsMobGriefingOverride); // Purpur - Add mobGriefing override to everything affected
|
||||
// Purpur end - Add turtle egg block options
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/gamerules/GameRules.java b/net/minecraft/world/level/gamerules/GameRules.java
|
||||
index 49801f8b037913de5896d4e31a1e36d7ce597875..c333f0ca9c478f8a431fc85c50d6f97435c6d5ea 100644
|
||||
--- a/net/minecraft/world/level/gamerules/GameRules.java
|
||||
+++ b/net/minecraft/world/level/gamerules/GameRules.java
|
||||
@@ -121,6 +121,13 @@ public class GameRules {
|
||||
return this.rules.keySet().stream();
|
||||
}
|
||||
|
||||
+ public <T> boolean get(GameRule<T> rule, Boolean gameRuleOverride) {
|
||||
+ if (gameRuleOverride != null) {
|
||||
+ return gameRuleOverride;
|
||||
+ }
|
||||
+ return (Boolean) this.get(rule);
|
||||
+ }
|
||||
+
|
||||
public <T> T get(final GameRule<T> gameRule) {
|
||||
T value = this.rules.get(gameRule);
|
||||
if (value == null) {
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,310 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <ben@omega24.dev>
|
||||
Date: Tue, 25 May 2021 16:31:09 -0400
|
||||
Subject: [PATCH] API for any mob to burn daylight
|
||||
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 6b51feb4e41f10dae9e5fcd303d260d5f511ae91..2f2b5794cc37aedb5dc09925dd77b6e700934a95 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -453,6 +453,21 @@ public abstract class Entity
|
||||
}
|
||||
// Purpur end - Add canSaveToDisk to Entity
|
||||
|
||||
+ // Purpur start - copied from Mob - API for any mob to burn daylight
|
||||
+ public boolean isSunBurnTick() {
|
||||
+ if (!this.level().isClientSide() && this.level().environmentAttributes().getValue(EnvironmentAttributes.MONSTERS_BURN, this.position())) {
|
||||
+ float br = this.getLightLevelDependentMagicValue();
|
||||
+ BlockPos roundedPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
+ boolean isInNonBurnableBlock = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
+ if (br > 0.5F && this.random.nextFloat() * 30.0F < (br - 0.4F) * 2.0F && !isInNonBurnableBlock && this.level().canSeeSky(roundedPos)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end - copied from Mob - API for any mob to burn daylight
|
||||
+
|
||||
public Entity(final EntityType<?> type, final Level level) {
|
||||
this.type = type;
|
||||
this.level = level;
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index a9e93d55de28964169988e2b276fdfc8acd29fdb..77a5742fe3aab5acde6dff9664fea66f66262f3c 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -305,6 +305,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
|
||||
public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
|
||||
public int invulnerableDuration = LivingEntity.INVULNERABLE_DURATION; // Paper - configurable invulnerable duration
|
||||
+ protected boolean shouldBurnInDay = false; public boolean shouldBurnInDay() { return this.shouldBurnInDay; } public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } // Purpur - API for any mob to burn daylight
|
||||
// CraftBukkit end
|
||||
|
||||
protected LivingEntity(final EntityType<? extends LivingEntity> type, final Level level) {
|
||||
@@ -810,6 +811,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
output.putBoolean("FallFlying", this.isFallFlying());
|
||||
this.getSleepingPos().ifPresent(sleepingPos -> output.store("sleeping_pos", BlockPos.CODEC, sleepingPos));
|
||||
output.store("Brain", Brain.Packed.CODEC, this.brain.pack());
|
||||
+ output.putBoolean("Purpur.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - API for any mob to burn daylight
|
||||
if (this.lastHurtByPlayer != null) {
|
||||
this.lastHurtByPlayer.store(output, "last_hurt_by_player");
|
||||
output.putInt("last_hurt_by_player_memory_time", this.lastHurtByPlayerMemoryTime);
|
||||
@@ -935,6 +937,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
} // Paper - The sleeping pos will always also set the actual pos, so a desync suggests something is wrong
|
||||
}, this::clearSleepingPos);
|
||||
input.read("Brain", Brain.Packed.CODEC).ifPresent(packedBrain -> this.brain = this.makeBrain(packedBrain));
|
||||
+ this.shouldBurnInDay = input.getBooleanOr("Purpur.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - API for any mob to burn daylight
|
||||
this.lastHurtByPlayer = EntityReference.read(input, "last_hurt_by_player");
|
||||
this.lastHurtByPlayerMemoryTime = input.getIntOr("last_hurt_by_player_memory_time", 0);
|
||||
this.lastHurtByMob = EntityReference.read(input, "last_hurt_by_mob");
|
||||
@@ -3981,6 +3984,37 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
if (this.level() instanceof ServerLevel serverLevel && this.isSensitiveToWater() && this.isInWaterOrRain()) {
|
||||
this.hurtServer(serverLevel, this.damageSources().drown(), 1.0F);
|
||||
}
|
||||
+
|
||||
+ // Purpur start - copied from Mob - API for any mob to burn daylight
|
||||
+ if (this.isAlive()) {
|
||||
+ boolean flag = this.shouldBurnInDay() && this.isSunBurnTick(); // Paper - shouldBurnInDay API // Purpur - use shouldBurnInDay() method to handle Phantoms properly - API for any mob to burn daylight
|
||||
+ if (flag) {
|
||||
+ EquipmentSlot equipmentSlot = this.sunProtectionSlot();
|
||||
+ ItemStack itemBySlot = this.getItemBySlot(equipmentSlot);
|
||||
+ if (!itemBySlot.isEmpty()) {
|
||||
+ if (itemBySlot.isDamageableItem()) {
|
||||
+ Item item = itemBySlot.getItem();
|
||||
+ itemBySlot.setDamageValue(itemBySlot.getDamageValue() + this.random.nextInt(2));
|
||||
+ if (itemBySlot.getDamageValue() >= itemBySlot.getMaxDamage()) {
|
||||
+ this.onEquippedItemBroken(item, equipmentSlot);
|
||||
+ this.setItemSlot(equipmentSlot, ItemStack.EMPTY);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ flag = false;
|
||||
+ }
|
||||
+
|
||||
+ if (flag) {
|
||||
+ if (getRider() == null || !this.isControllable()) // Purpur - ignore mobs which are uncontrollable or without rider - API for any mob to burn daylight
|
||||
+ this.igniteForSeconds(8.0F);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected EquipmentSlot sunProtectionSlot() {
|
||||
+ return net.minecraft.world.entity.EquipmentSlot.HEAD;
|
||||
+ // Purpur end - copied from Mob - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
protected void applyInput() {
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 6e6ba45c93209bd9e7a8565bf166b4cc9843b80a..b5c2b64c581c30cdf6f379ccd76a863b81513f8b 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -567,9 +567,9 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs
|
||||
@Override
|
||||
public void aiStep() {
|
||||
super.aiStep();
|
||||
- if (this.is(EntityTypeTags.BURN_IN_DAYLIGHT)) {
|
||||
+ /*if (this.is(EntityTypeTags.BURN_IN_DAYLIGHT)) { // Purpur start - implemented in LivingEntity - API for any mob to burn daylight
|
||||
this.burnUndead();
|
||||
- }
|
||||
+ }*/ // Purpur end - implemented in LivingEntity - API for any mob to burn daylight
|
||||
|
||||
ProfilerFiller profiler = Profiler.get();
|
||||
profiler.push("looting");
|
||||
@@ -621,16 +621,8 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs
|
||||
}
|
||||
|
||||
public boolean isSunBurnTick() {
|
||||
- if (!this.level().isClientSide() && this.level().environmentAttributes().getValue(EnvironmentAttributes.MONSTERS_BURN, this.position())) {
|
||||
- float br = this.getLightLevelDependentMagicValue();
|
||||
- BlockPos roundedPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
- boolean isInNonBurnableBlock = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
- if (br > 0.5F && this.random.nextFloat() * 30.0F < (br - 0.4F) * 2.0F && !isInNonBurnableBlock && this.level().canSeeSky(roundedPos)) {
|
||||
- return true;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return false;
|
||||
+ // Purpur - implemented in Entity - API for any mob to burn daylight
|
||||
+ return super.isSunBurnTick();
|
||||
}
|
||||
|
||||
protected Vec3i getPickupReach() {
|
||||
diff --git a/net/minecraft/world/entity/animal/equine/ZombieHorse.java b/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
||||
index 9deb8e249830aea4bbc230f26eb192479eec0c4e..9c8ce7eee6bf462478a0755b074e229133eee1c3 100644
|
||||
--- a/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
||||
+++ b/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
||||
@@ -48,6 +48,7 @@ public class ZombieHorse extends AbstractHorse {
|
||||
|
||||
public ZombieHorse(final EntityType<? extends ZombieHorse> type, final Level level) {
|
||||
super(type, level);
|
||||
+ this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
// Purpur start - Ridables
|
||||
diff --git a/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java b/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
||||
index 55b4a41867799dcb2999f0c324bde8b2341b2e9d..da60906faaca79efbfd29ed05b01a0c07978bab2 100644
|
||||
--- a/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
||||
+++ b/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
||||
@@ -46,6 +46,7 @@ public class ZombieNautilus extends AbstractNautilus {
|
||||
|
||||
public ZombieNautilus(final EntityType<? extends ZombieNautilus> type, final Level level) {
|
||||
super(type, level);
|
||||
+ this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
// Purpur start - Configurable entity base attributes
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index 7c1aad8b5f9625d757039cb636783cb760aa87e0..9d646f3d924d3c2fdb2b396e4501111912fba043 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -52,7 +52,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
Vec3 crystalPosition; // Purpur - Phantoms attracted to crystals and crystals shoot phantoms
|
||||
// Paper start
|
||||
public java.util.@Nullable UUID spawningEntity;
|
||||
- public boolean shouldBurnInDay = true;
|
||||
+ //public boolean shouldBurnInDay = true; // Purpur - API for any mob to burn daylight
|
||||
// Paper end
|
||||
private static final net.minecraft.world.item.crafting.Ingredient TORCH = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.item.Items.TORCH, net.minecraft.world.item.Items.SOUL_TORCH); // Purpur - Phantoms burn in light
|
||||
|
||||
@@ -61,6 +61,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
this.xpReward = 5;
|
||||
this.moveControl = new Phantom.PhantomMoveControl<>(this);
|
||||
this.lookControl = new Phantom.PhantomLookControl(this);
|
||||
+ this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
// Purpur start - Ridables
|
||||
@@ -297,7 +298,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
this.setPhantomSize(input.getIntOr("size", 0));
|
||||
// Paper start
|
||||
this.spawningEntity = input.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
|
||||
- this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true);
|
||||
+ //this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -308,7 +309,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
output.putInt("size", this.getPhantomSize());
|
||||
// Paper start
|
||||
output.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
|
||||
- output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
|
||||
+ //output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
// Paper end
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java b/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java
|
||||
index 3294aca7cb32d5cf9bbc7c2c99a538eb00fc3dcc..8f30f9f0f12e5fd6ddcb1809195f0823ea3ebd51 100644
|
||||
--- a/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java
|
||||
+++ b/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java
|
||||
@@ -66,11 +66,12 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
AbstractSkeleton.this.setAggressive(true);
|
||||
}
|
||||
};
|
||||
- private boolean shouldBurnInDay = true; // Paper - shouldBurnInDay API
|
||||
+ //private boolean shouldBurnInDay = true; // Paper - shouldBurnInDay API // Purpur - moved to LivingEntity; keep methods for ABI compatibility - API for any mob to burn daylight
|
||||
|
||||
protected AbstractSkeleton(final EntityType<? extends AbstractSkeleton> type, final Level level) {
|
||||
super(type, level);
|
||||
this.reassessWeaponGoal();
|
||||
+ this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -223,7 +224,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
protected void readAdditionalSaveData(final ValueInput input) {
|
||||
super.readAdditionalSaveData(input);
|
||||
this.reassessWeaponGoal();
|
||||
- this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - shouldBurnInDay API
|
||||
+ //this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - shouldBurnInDay API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
// Paper start - silent equipping
|
||||
@@ -249,7 +250,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@Override
|
||||
protected void addAdditionalSaveData(final net.minecraft.world.level.storage.ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
- output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
|
||||
+ //output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
}
|
||||
// Paper end - shouldBurnInDay API
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/monster/skeleton/Parched.java b/net/minecraft/world/entity/monster/skeleton/Parched.java
|
||||
index 986caff5325830c6d3eb0f6927c3294ae8b9ebe0..ed121e0b32a791ade0126edc627a96f713bc30d4 100644
|
||||
--- a/net/minecraft/world/entity/monster/skeleton/Parched.java
|
||||
+++ b/net/minecraft/world/entity/monster/skeleton/Parched.java
|
||||
@@ -17,6 +17,7 @@ import org.jspecify.annotations.Nullable;
|
||||
public class Parched extends AbstractSkeleton {
|
||||
public Parched(final EntityType<? extends AbstractSkeleton> type, final Level level) {
|
||||
super(type, level);
|
||||
+ this.setShouldBurnInDay(false); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Husk.java b/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
index 83c2d21587fc490eb7eb60c43a21da73f144140c..afca08cfa58a25a7fa257eebf66dd888ccc1c734 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
@@ -36,6 +36,7 @@ public class Husk extends Zombie {
|
||||
|
||||
public Husk(final EntityType<? extends Husk> type, final Level level) {
|
||||
super(type, level);
|
||||
+ this.setShouldBurnInDay(false); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
// Purpur start - Ridables
|
||||
@@ -93,7 +94,7 @@ public class Husk extends Zombie {
|
||||
|
||||
@Override
|
||||
public boolean isSunSensitive() {
|
||||
- return false;
|
||||
+ return this.shouldBurnInDay; // Purpur - moved to LivingEntity; keep methods for ABI compatibility - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
index 26f0ac03eaa3d33fa593ce65bc944872864a66a9..f104394d49989fe80462602cb06b2f58c4282fbb 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
@@ -102,11 +102,12 @@ public class Zombie extends Monster {
|
||||
private boolean canBreakDoors = false;
|
||||
private int inWaterTime = 0;
|
||||
public int conversionTime;
|
||||
- private boolean shouldBurnInDay = true; // Paper - Add more Zombie API
|
||||
+ //private boolean shouldBurnInDay = true; // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
|
||||
public Zombie(final EntityType<? extends Zombie> type, final Level level) {
|
||||
super(type, level);
|
||||
this.breakDoorGoal = new BreakDoorGoal(this, com.google.common.base.Predicates.in(level.paperConfig().entities.behavior.doorBreakingDifficulty.getOrDefault(type, level.paperConfig().entities.behavior.doorBreakingDifficulty.get(EntityTypes.ZOMBIE)))); // Paper - Configurable door breaking difficulty
|
||||
+ this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
public Zombie(final Level level) {
|
||||
@@ -365,6 +366,7 @@ public class Zombie extends Monster {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
+ public boolean shouldBurnInDay() { return this.isSunSensitive(); } // Purpur - for ABI compatibility - API for any mob to burn daylight
|
||||
public boolean isSunSensitive() {
|
||||
return this.shouldBurnInDay; // Paper - Add more Zombie API
|
||||
}
|
||||
@@ -504,7 +506,7 @@ public class Zombie extends Monster {
|
||||
output.putBoolean("CanBreakDoors", this.canBreakDoors());
|
||||
output.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
|
||||
output.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
|
||||
- output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper - Add more Zombie API
|
||||
+ //output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -519,7 +521,7 @@ public class Zombie extends Monster {
|
||||
} else {
|
||||
this.getEntityData().set(DATA_DROWNED_CONVERSION_ID, false);
|
||||
}
|
||||
- this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - Add more Zombie API
|
||||
+ //this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,79 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 30 Aug 2021 22:49:53 -0500
|
||||
Subject: [PATCH] Cows naturally aggressive to players chance
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
|
||||
index f875fdb10d16598f9f5b6fbb597c88ad42e88996..36e0aef3aeb1f9542aa34fafdfc014af37ce909e 100644
|
||||
--- a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
|
||||
@@ -138,7 +138,7 @@ public class DefaultAttributes {
|
||||
.put(EntityTypes.MAGMA_CUBE, MagmaCube.createAttributes().build())
|
||||
.put(EntityTypes.SULFUR_CUBE, SulfurCube.createSulfurCubeAttributes().build())
|
||||
.put(EntityTypes.MANNEQUIN, LivingEntity.createLivingAttributes().build())
|
||||
- .put(EntityTypes.MOOSHROOM, Cow.createAttributes().build())
|
||||
+ .put(EntityTypes.MOOSHROOM, net.minecraft.world.entity.animal.cow.AbstractCow.createAttributes().build()) // Purpur - Cows naturally aggressive to players chance
|
||||
.put(EntityTypes.MULE, AbstractChestedHorse.createBaseChestedHorseAttributes().build())
|
||||
.put(EntityTypes.NAUTILUS, Nautilus.createAttributes().build())
|
||||
.put(EntityTypes.OCELOT, Ocelot.createAttributes().build())
|
||||
diff --git a/net/minecraft/world/entity/animal/cow/Cow.java b/net/minecraft/world/entity/animal/cow/Cow.java
|
||||
index 103b4cd879e059fc34f8e42a5d25fc6cbb146837..70edf30006f3042974a90f6f737d249675b47d16 100644
|
||||
--- a/net/minecraft/world/entity/animal/cow/Cow.java
|
||||
+++ b/net/minecraft/world/entity/animal/cow/Cow.java
|
||||
@@ -30,6 +30,8 @@ import net.minecraft.world.level.storage.ValueOutput;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
public class Cow extends AbstractCow {
|
||||
+ private boolean isNaturallyAggressiveToPlayers; // Purpur - Cows naturally aggressive to players chance
|
||||
+
|
||||
private static final EntityDataAccessor<Holder<CowVariant>> DATA_VARIANT_ID = SynchedEntityData.defineId(Cow.class, EntityDataSerializers.COW_VARIANT);
|
||||
private static final EntityDataAccessor<Holder<CowSoundVariant>> DATA_SOUND_VARIANT_ID = SynchedEntityData.defineId(
|
||||
Cow.class, EntityDataSerializers.COW_SOUND_VARIANT
|
||||
@@ -62,8 +64,9 @@ public class Cow extends AbstractCow {
|
||||
// Purpur start - Configurable entity base attributes
|
||||
@Override
|
||||
public void initAttributes() {
|
||||
- this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.cowMaxHealth);
|
||||
- this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.cowScale);
|
||||
+ this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.cowMaxHealth);
|
||||
+ this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.SCALE).setBaseValue(this.level().purpurConfig.cowScale);
|
||||
+ this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.ATTACK_DAMAGE).setBaseValue(this.level().purpurConfig.cowNaturallyAggressiveToPlayersDamage); // Purpur - Cows naturally aggressive to players chance
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
@@ -81,6 +84,13 @@ public class Cow extends AbstractCow {
|
||||
}
|
||||
// Purpur end - Toggle for water sensitive mob damage
|
||||
|
||||
+ @Override
|
||||
+ protected void registerGoals() {
|
||||
+ super.registerGoals();
|
||||
+ this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur - Cows naturally aggressive to players chance
|
||||
+ this.targetSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, net.minecraft.world.entity.player.Player.class, 10, true, false, (ignored, ignored2) -> isNaturallyAggressiveToPlayers)); // Purpur - Cows naturally aggressive to players chance
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
@@ -101,6 +111,12 @@ public class Cow extends AbstractCow {
|
||||
);
|
||||
}
|
||||
|
||||
+ // Purpur start - Cows naturally aggressive to players chance
|
||||
+ public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder createAttributes() {
|
||||
+ return AbstractCow.createAttributes().add(net.minecraft.world.entity.ai.attributes.Attributes.ATTACK_DAMAGE, 0.0D);
|
||||
+ }
|
||||
+ // Purpur end - Cows naturally aggressive to players chance
|
||||
+
|
||||
@Override
|
||||
protected void readAdditionalSaveData(final ValueInput input) {
|
||||
super.readAdditionalSaveData(input);
|
||||
@@ -124,6 +140,7 @@ public class Cow extends AbstractCow {
|
||||
public SpawnGroupData finalizeSpawn(
|
||||
final ServerLevelAccessor level, final DifficultyInstance difficulty, final EntitySpawnReason spawnReason, final @Nullable SpawnGroupData groupData
|
||||
) {
|
||||
+ this.isNaturallyAggressiveToPlayers = level.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= level.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance; // Purpur - Cows naturally aggressive to players chance
|
||||
VariantUtils.selectVariantToSpawn(SpawnContext.create(level, this.blockPosition()), Registries.COW_VARIANT).ifPresent(this::setVariant);
|
||||
this.setSoundVariant(CowSoundVariants.pickRandomSoundVariant(this.registryAccess(), level.getRandom()));
|
||||
return super.finalizeSpawn(level, difficulty, spawnReason, groupData);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: granny <contact@granny.dev>
|
||||
Date: Mon, 8 Dec 2025 17:02:40 -0800
|
||||
Subject: [PATCH] Setting to reintroduce end void rings
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index fcade65785db82fc64eeb9b337900a405f05d196..09d05ed938d0dd4cd5d7adb68f4229519cf4f61b 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1239,6 +1239,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
// Purpur end - config for startup commands
|
||||
+ // Purpur start - Migrate Setting to reintroduce end void rings
|
||||
+ if (org.purpurmc.purpur.configuration.transformation.FarEndTerrainGenerationMigration.HAS_BEEN_REGISTERED) {
|
||||
+ try {
|
||||
+ org.purpurmc.purpur.PurpurConfig.config.save((java.io.File) this.options.valueOf("purpur-settings"));
|
||||
+ } catch (IOException ex) {
|
||||
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.SEVERE, "Could not save " + this.options.valueOf("purpur-settings"), ex);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Migrate Setting to reintroduce end void rings
|
||||
|
||||
while (this.running) {
|
||||
final long tickStart = System.nanoTime(); // Paper - improve tick loop
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 97f4c88aedefa02ae01471a75a16647b5e23e198..8df237acbbd52c88d618e2365f064be08ea5c200 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -235,6 +235,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings"));
|
||||
org.spigotmc.SpigotConfig.registerCommands();
|
||||
// Spigot end
|
||||
+ // Purpur start - Migrate Setting to reintroduce end void rings
|
||||
+ try {
|
||||
+ org.purpurmc.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings"));
|
||||
+ } catch (Exception e) {
|
||||
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||
+ return false;
|
||||
+ }
|
||||
+ org.purpurmc.purpur.PurpurConfig.registerCommands();
|
||||
+ // Purpur end - Migrate Setting to reintroduce end void rings
|
||||
// Paper start - initialize global and world-defaults configuration
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
@@ -251,7 +260,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
- // Purpur start - Purpur config files
|
||||
+ /*// Purpur start - Purpur config files // Purpur start - Migrate Setting to reintroduce end void rings
|
||||
try {
|
||||
org.purpurmc.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings"));
|
||||
} catch (Exception e) {
|
||||
@@ -259,7 +268,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
return false;
|
||||
}
|
||||
org.purpurmc.purpur.PurpurConfig.registerCommands();
|
||||
- // Purpur end - Purpur config files
|
||||
+ */// Purpur end - Purpur config files // Purpur end - Migrate Setting to reintroduce end void rings
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
// this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading
|
||||
@@ -0,0 +1,342 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Peashooter101 <Peashooter101@yahoo.com>
|
||||
Date: Sat, 13 Dec 2025 13:59:23 -0600
|
||||
Subject: [PATCH] Per mob mob_griefing loot pickup override
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index b5c2b64c581c30cdf6f379ccd76a863b81513f8b..7aaabbde2aaa58d2ae412bc6910cb95dee3b9fe5 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -577,7 +577,7 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs
|
||||
&& this.canPickUpLoot()
|
||||
&& this.isAlive()
|
||||
&& !this.dead
|
||||
- && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, serverLevel.purpurConfig.entitiesPickUpLootMobGriefingOverride)) { // Purpur - Add mobGriefing override to everything affected
|
||||
+ && serverLevel.getGameRules().get(GameRules.MOB_GRIEFING, checkEntityPickUpLootOverride())) { // Purpur - Check mobGriefing Overrides
|
||||
Vec3i pickupReach = this.getPickupReach();
|
||||
|
||||
for (ItemEntity entity : this.level()
|
||||
@@ -596,6 +596,12 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs
|
||||
profiler.pop();
|
||||
}
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ protected @Nullable Boolean checkEntityPickUpLootOverride() {
|
||||
+ return null;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
protected EquipmentSlot sunProtectionSlot() {
|
||||
return EquipmentSlot.HEAD;
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index 9206c45b9789ff2834f14efb65dc85113c7bd7d7..d3074e1ce8d7d13bcb5b23e7602e94d6b7558f03 100644
|
||||
--- a/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -163,6 +163,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.allayCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected Brain<Allay> makeBrain(final Brain.Packed packedBrain) {
|
||||
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
||||
diff --git a/net/minecraft/world/entity/animal/fox/Fox.java b/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
index ca5b0b8081c4943bfbfba4f0f9284f0fdda3cf9f..91a001af54b9ba53c9c2a7cfd797d9ff2f53c0db 100644
|
||||
--- a/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
+++ b/net/minecraft/world/entity/animal/fox/Fox.java
|
||||
@@ -821,6 +821,13 @@ public class Fox extends Animal {
|
||||
}
|
||||
// Purpur end - Tulips change fox type
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.foxCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
// Paper start - Cancellable death event
|
||||
protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(final ServerLevel level, final DamageSource source) {
|
||||
diff --git a/net/minecraft/world/entity/monster/illager/Pillager.java b/net/minecraft/world/entity/monster/illager/Pillager.java
|
||||
index 9d6629c29dc471ef1db672cce4260a983d452cbd..55b7fc1c375edaf8c86294884da55d5d97e09e93 100644
|
||||
--- a/net/minecraft/world/entity/monster/illager/Pillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/illager/Pillager.java
|
||||
@@ -104,6 +104,13 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.pillagerCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
super.registerGoals();
|
||||
diff --git a/net/minecraft/world/entity/monster/illager/Vindicator.java b/net/minecraft/world/entity/monster/illager/Vindicator.java
|
||||
index d42afe275f7a917d5784da2838972dff73f1476a..68b252bfd6bacc3952ffc610032cd8a0ec1169e3 100644
|
||||
--- a/net/minecraft/world/entity/monster/illager/Vindicator.java
|
||||
+++ b/net/minecraft/world/entity/monster/illager/Vindicator.java
|
||||
@@ -96,6 +96,13 @@ public class Vindicator extends AbstractIllager {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.vindicatorCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
super.registerGoals();
|
||||
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
index 9246caa06976c258c15c95b52a156aebf63d89d7..ac96afede920fcc19a3a136ed75b1c66c0cfdea5 100644
|
||||
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
@@ -148,6 +148,13 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.piglinCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void addAdditionalSaveData(final ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
@@ -430,7 +437,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
||||
|
||||
@Override
|
||||
public boolean wantsToPickUp(final ServerLevel level, final ItemStack itemStack) {
|
||||
- return level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.piglinMobGriefingOverride) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, itemStack); // Purpur - Add mobGriefing override to everything affected
|
||||
+ return level.getGameRules().get(GameRules.MOB_GRIEFING, level.purpurConfig.piglinCanPickUpLoot) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, itemStack); // Purpur - Check mobGriefing Overrides
|
||||
}
|
||||
|
||||
protected boolean canReplaceCurrentItem(final ItemStack newItemStack) {
|
||||
diff --git a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
index ee1a87f7811d22b5b33b3ae6b22fc5332b57322b..34cd7f5b209e466a4bef506a9d796e04fcfe425d 100644
|
||||
--- a/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
+++ b/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
@@ -89,6 +89,13 @@ public class PiglinBrute extends AbstractPiglin {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.piglinBruteCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
return Monster.createMonsterAttributes()
|
||||
.add(Attributes.MAX_HEALTH, 50.0)
|
||||
diff --git a/net/minecraft/world/entity/monster/skeleton/Bogged.java b/net/minecraft/world/entity/monster/skeleton/Bogged.java
|
||||
index 617f61f4f7559a42e27d935ab9837ed99a8e9c1e..4022813e5cb9188f310fa5b633567cf854f4d627 100644
|
||||
--- a/net/minecraft/world/entity/monster/skeleton/Bogged.java
|
||||
+++ b/net/minecraft/world/entity/monster/skeleton/Bogged.java
|
||||
@@ -66,6 +66,13 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.boggedCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/monster/skeleton/Skeleton.java b/net/minecraft/world/entity/monster/skeleton/Skeleton.java
|
||||
index 675faf3f02447fd73f48acc08c4b224114a0dc2e..8610e59cdebe6ae6fc4ba0fb654e990b1e3f34ee 100644
|
||||
--- a/net/minecraft/world/entity/monster/skeleton/Skeleton.java
|
||||
+++ b/net/minecraft/world/entity/monster/skeleton/Skeleton.java
|
||||
@@ -65,6 +65,13 @@ public class Skeleton extends AbstractSkeleton {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.skeletonCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/monster/skeleton/Stray.java b/net/minecraft/world/entity/monster/skeleton/Stray.java
|
||||
index 19ed23a4fc07f3a47f64ceefe1081b3641dfdccb..8188c9e34e0df679e3799bd184790d57f38635be 100644
|
||||
--- a/net/minecraft/world/entity/monster/skeleton/Stray.java
|
||||
+++ b/net/minecraft/world/entity/monster/skeleton/Stray.java
|
||||
@@ -61,6 +61,13 @@ public class Stray extends AbstractSkeleton {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.strayCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
public static boolean checkStraySpawnRules(
|
||||
final EntityType<Stray> type, final ServerLevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random
|
||||
) {
|
||||
diff --git a/net/minecraft/world/entity/monster/skeleton/WitherSkeleton.java b/net/minecraft/world/entity/monster/skeleton/WitherSkeleton.java
|
||||
index 5b057a367198f1b39e3e5ade7d48eb04a2a4b324..d8eb5f2b681dab360a9a425e4cfef026799ffae4 100644
|
||||
--- a/net/minecraft/world/entity/monster/skeleton/WitherSkeleton.java
|
||||
+++ b/net/minecraft/world/entity/monster/skeleton/WitherSkeleton.java
|
||||
@@ -73,6 +73,13 @@ public class WitherSkeleton extends AbstractSkeleton {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.witherSkeletonCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractPiglin.class, true));
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Drowned.java b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
index a823cca07465fa5804eb01759174cbef9becbcca..936369cc110899ac074221be0972bbf6dc7c5847 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
@@ -148,6 +148,13 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.drownedCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(1, new Drowned.DrownedGoToWaterGoal(this, 1.0));
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Husk.java b/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
index 75b57de8caf55d795ce10e115d657998fb86b401..de736df453541a2c4a71de97765581575caba0b7 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Husk.java
|
||||
@@ -99,6 +99,13 @@ public class Husk extends Zombie {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.huskCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
public boolean isSunSensitive() {
|
||||
return this.shouldBurnInDay; // Purpur - moved to LivingEntity; keep methods for ABI compatibility - API for any mob to burn daylight
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
index 0671b7c2a77d1173d58812abcfcad2461a42d240..7ec2345a45dc62cab2fa363ed24bae4bca02db72 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
|
||||
@@ -167,6 +167,13 @@ public class Zombie extends Monster {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.zombieCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/ZombieVillager.java b/net/minecraft/world/entity/monster/zombie/ZombieVillager.java
|
||||
index e4be264d71c7980047194a86c5681020e822a67a..23a5cee36253c222d383cc8e9d5e492231da131e 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/ZombieVillager.java
|
||||
@@ -147,6 +147,13 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.zombieVillagerCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void defineSynchedData(final SynchedEntityData.Builder entityData) {
|
||||
super.defineSynchedData(entityData);
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java
|
||||
index 2c0f08308430356a44a61d9b7a94609f340b454d..8245dcf59c17d98a01ee509350bd79efca2b1bb3 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java
|
||||
@@ -124,6 +124,13 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.zombifiedPiglinCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(1, new SpearUseGoal<>(this, 1.0, 1.0, 10.0F, 2.0F));
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
index 64a6f4517f581f64a71382bdb302b71c68dc5396..a1ff5e589516bb46236ef1408f0f4f2f1387e72a 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
@@ -289,6 +289,13 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re
|
||||
}
|
||||
// Purpur end - Mobs always drop experience
|
||||
|
||||
+ // Purpur start - Check mobGriefing Overrides
|
||||
+ @Override
|
||||
+ protected Boolean checkEntityPickUpLootOverride() {
|
||||
+ return this.level().purpurConfig.villagerCanPickUpLoot;
|
||||
+ }
|
||||
+ // Purpur end - Check mobGriefing Overrides
|
||||
+
|
||||
@Override
|
||||
public Brain<Villager> getBrain() {
|
||||
return (Brain<Villager>)super.getBrain();
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index f37710c48aafb11d65b99e4d37ef1382a8a36417..23a541f8d740d19df59b9e024156f497326a41cb 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -398,7 +398,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
}
|
||||
|
||||
private boolean cannotPickUpBanner() {
|
||||
- if (!getServerLevel(this.mob).getGameRules().get(net.minecraft.world.level.gamerules.GameRules.MOB_GRIEFING, this.mob.level().purpurConfig.pillagerMobGriefingOverride)) return true; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing override to everything affected
|
||||
+ if (!getServerLevel(this.mob).getGameRules().get(net.minecraft.world.level.gamerules.GameRules.MOB_GRIEFING, this.mob.level().purpurConfig.pillagerCanPickUpLoot)) return true; // Paper - respect game and entity rules for picking up items // Purpur - Check mobGriefing Overrides
|
||||
if (!this.mob.hasActiveRaid()) {
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user