2021-06-13 01:45:00 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Fri, 24 Aug 2018 08:18:42 -0500
|
|
|
|
Subject: [PATCH] Slime Pathfinder Events
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bcb0d9b1a9 100644
|
2021-06-13 01:45:00 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -116,6 +116,7 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
@Override
|
|
|
|
public void addAdditionalSaveData(CompoundTag nbt) {
|
|
|
|
super.addAdditionalSaveData(nbt);
|
|
|
|
+ nbt.putBoolean("Paper.canWander", this.canWander); // Paper
|
|
|
|
nbt.putInt("Size", this.getSize() - 1);
|
|
|
|
nbt.putBoolean("wasOnGround", this.wasOnGround);
|
|
|
|
}
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -124,6 +125,11 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
|
|
|
this.setSize(nbt.getInt("Size") + 1, false);
|
|
|
|
super.readAdditionalSaveData(nbt);
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper start
|
2021-06-13 01:45:00 +02:00
|
|
|
+ if (nbt.contains("Paper.canWander")) {
|
|
|
|
+ this.canWander = nbt.getBoolean("Paper.canWander");
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
this.wasOnGround = nbt.getBoolean("wasOnGround");
|
|
|
|
}
|
|
|
|
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -479,7 +485,7 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canUse() {
|
|
|
|
- return (this.slime.isInWater() || this.slime.isInLava()) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl;
|
2024-01-21 17:39:05 +01:00
|
|
|
+ return (this.slime.isInWater() || this.slime.isInLava()) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeSwimEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity()).callEvent(); // Paper - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -518,7 +524,15 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
public boolean canUse() {
|
|
|
|
LivingEntity entityliving = this.slime.getTarget();
|
|
|
|
|
|
|
|
- return entityliving == null ? false : (!this.slime.canAttack(entityliving) ? false : this.slime.getMoveControl() instanceof Slime.SlimeMoveControl);
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper start - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
+ if (entityliving == null || !entityliving.isAlive()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!this.slime.canAttack(entityliving)) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
2023-09-22 00:01:00 +02:00
|
|
|
+ return this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity()).callEvent();
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper end - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -531,7 +545,15 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
public boolean canContinueToUse() {
|
|
|
|
LivingEntity entityliving = this.slime.getTarget();
|
|
|
|
|
|
|
|
- return entityliving == null ? false : (!this.slime.canAttack(entityliving) ? false : --this.growTiredTimer > 0);
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper start - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
+ if (entityliving == null || !entityliving.isAlive()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!this.slime.canAttack(entityliving)) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
2023-09-22 00:01:00 +02:00
|
|
|
+ return --this.growTiredTimer > 0 && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity()).callEvent();
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper end - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -556,6 +578,13 @@ public class Slime extends Mob implements Enemy {
|
2023-03-14 19:59:51 +01:00
|
|
|
}
|
2021-11-23 16:50:18 +01:00
|
|
|
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
+
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper start - Slime pathfinder events; clear timer and target when goal resets
|
2021-06-13 01:45:00 +02:00
|
|
|
+ public void stop() {
|
|
|
|
+ this.growTiredTimer = 0;
|
|
|
|
+ this.slime.setTarget(null);
|
|
|
|
+ }
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper end - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private static class SlimeRandomDirectionGoal extends Goal {
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -571,7 +600,7 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canUse() {
|
2023-06-07 22:19:14 +02:00
|
|
|
- return this.slime.getTarget() == null && (this.slime.onGround() || this.slime.isInWater() || this.slime.isInLava() || this.slime.hasEffect(MobEffects.LEVITATION)) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl;
|
2024-01-21 17:39:05 +01:00
|
|
|
+ return this.slime.getTarget() == null && (this.slime.onGround() || this.slime.isInWater() || this.slime.isInLava() || this.slime.hasEffect(MobEffects.LEVITATION)) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander; // Paper - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -579,6 +608,11 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
if (--this.nextRandomizeTime <= 0) {
|
2021-11-23 16:50:18 +01:00
|
|
|
this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60));
|
|
|
|
this.chosenDegrees = (float) this.slime.getRandom().nextInt(360);
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper start - Slime pathfinder events
|
2023-09-22 00:01:00 +02:00
|
|
|
+ com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent event = new com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), this.chosenDegrees);
|
2021-06-13 01:45:00 +02:00
|
|
|
+ if (!this.slime.canWander || !event.callEvent()) return;
|
|
|
|
+ this.chosenDegrees = event.getNewYaw();
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper end - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
2023-03-14 19:59:51 +01:00
|
|
|
MoveControl controllermove = this.slime.getMoveControl();
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -603,7 +637,7 @@ public class Slime extends Mob implements Enemy {
|
2021-06-13 01:45:00 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canUse() {
|
|
|
|
- return !this.slime.isPassenger();
|
2024-01-21 17:39:05 +01:00
|
|
|
+ return !this.slime.isPassenger() && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeWanderEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity()).callEvent(); // Paper - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -618,4 +652,15 @@ public class Slime extends Mob implements Enemy {
|
2023-03-14 19:59:51 +01:00
|
|
|
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper start - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
+ private boolean canWander = true;
|
|
|
|
+ public boolean canWander() {
|
|
|
|
+ return canWander;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setWander(boolean canWander) {
|
|
|
|
+ this.canWander = canWander;
|
|
|
|
+ }
|
2024-01-21 17:39:05 +01:00
|
|
|
+ // Paper end - Slime pathfinder events
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
2023-12-05 18:20:55 +01:00
|
|
|
index 3d991d9d9388108ec6d137950913209d61d132e7..3d9b7c0e128ea05bec5600c774e9685998b71cac 100644
|
2021-06-13 01:45:00 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
2023-08-14 01:32:51 +02:00
|
|
|
@@ -28,4 +28,16 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy {
|
|
|
|
public String toString() {
|
|
|
|
return "CraftSlime";
|
2021-06-13 01:45:00 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public boolean canWander() {
|
|
|
|
+ return getHandle().canWander();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setWander(boolean canWander) {
|
|
|
|
+ getHandle().setWander(canWander);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|