aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/raid/Raider.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/raid/Raider.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/raid/Raider.java.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/raid/Raider.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/raid/Raider.java.patch
new file mode 100644
index 0000000000..01720c3ef4
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/raid/Raider.java.patch
@@ -0,0 +1,63 @@
+--- a/net/minecraft/world/entity/raid/Raider.java
++++ b/net/minecraft/world/entity/raid/Raider.java
+@@ -154,7 +165,7 @@
+ i = Mth.clamp(i, 0, 4);
+ MobEffectInstance mobEffectInstance = new MobEffectInstance(MobEffects.BAD_OMEN, 120000, i, false, false, true);
+ if (!this.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_RAIDS)) {
+- player.addEffect(mobEffectInstance);
++ entityhuman.addEffect(mobeffect1, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN); // CraftBukkit
+ }
+ }
+ }
+@@ -468,16 +511,17 @@
+ return this.raider.hasActiveRaid() && !this.raider.getCurrentRaid().isOver();
+ }
+
+- private boolean hasSuitablePoi() {
+- ServerLevel serverLevel = (ServerLevel)this.raider.level();
+- BlockPos blockPos = this.raider.blockPosition();
+- Optional<BlockPos> random = serverLevel.getPoiManager()
+- .getRandom(holder -> holder.is(PoiTypes.HOME), this::hasNotVisited, PoiManager.Occupancy.ANY, blockPos, 48, this.raider.random);
+- if (random.isEmpty()) {
+- return false;
+- } else {
+- this.poiPos = random.get().immutable();
+- return true;
++ @Override
++ public void start() {
++ super.start();
++ this.mob.getNavigation().stop();
++ List<Raider> list = this.mob.level().getNearbyEntities(Raider.class, this.shoutTargeting, this.mob, this.mob.getBoundingBox().inflate(8.0D, 8.0D, 8.0D));
++ Iterator iterator = list.iterator();
++
++ while (iterator.hasNext()) {
++ Raider entityraider = (Raider) iterator.next();
++
++ entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit
+ }
+ }
+
+@@ -491,8 +528,21 @@
+
+ @Override
+ public void stop() {
+- if (this.poiPos.closerToCenterThan(this.raider.position(), (double)this.distanceToPoi)) {
+- this.visited.add(this.poiPos);
++ super.stop();
++ LivingEntity entityliving = this.mob.getTarget();
++
++ if (entityliving != null) {
++ List<Raider> list = this.mob.level().getNearbyEntities(Raider.class, this.shoutTargeting, this.mob, this.mob.getBoundingBox().inflate(8.0D, 8.0D, 8.0D));
++ Iterator iterator = list.iterator();
++
++ while (iterator.hasNext()) {
++ Raider entityraider = (Raider) iterator.next();
++
++ entityraider.setTarget(this.mob.getTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER, true); // CraftBukkit
++ entityraider.setAggressive(true);
++ }
++
++ this.mob.setAggressive(true);
+ }
+ }
+