mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix ridable slimes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From daf74a3955b25b460a652eca689a80614f1f57e7 Mon Sep 17 00:00:00 2001
|
||||
From b1a2d7c1ba4db2363fb795da44c55dcd68e8b682 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 6 Feb 2020 19:53:59 -0600
|
||||
Subject: [PATCH] Ridables
|
||||
@@ -67,7 +67,7 @@ Subject: [PATCH] Ridables
|
||||
.../server/EntitySkeletonAbstract.java | 2 +
|
||||
.../minecraft/server/EntitySkeletonStray.java | 17 +
|
||||
.../server/EntitySkeletonWither.java | 17 +
|
||||
.../net/minecraft/server/EntitySlime.java | 19 +
|
||||
.../net/minecraft/server/EntitySlime.java | 44 +-
|
||||
.../net/minecraft/server/EntitySnowman.java | 24 +-
|
||||
.../net/minecraft/server/EntitySpider.java | 19 +
|
||||
.../net/minecraft/server/EntitySquid.java | 68 +-
|
||||
@@ -103,7 +103,7 @@ Subject: [PATCH] Ridables
|
||||
.../net/pl3x/purpur/entity/PhantomFlames.java | 126 ++++
|
||||
.../pathfinder/PathfinderGoalHasRider.java | 21 +
|
||||
.../craftbukkit/entity/CraftEntity.java | 27 +
|
||||
99 files changed, 3601 insertions(+), 204 deletions(-)
|
||||
99 files changed, 3620 insertions(+), 210 deletions(-)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java
|
||||
@@ -3987,7 +3987,7 @@ index 98e042424c..8aa0a6699f 100644
|
||||
protected SoundEffect getSoundAmbient() {
|
||||
return SoundEffects.ENTITY_WITHER_SKELETON_AMBIENT;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
|
||||
index 2efc18df94..c15f7d9b24 100644
|
||||
index 2efc18df94..1469e3b23c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySlime.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
|
||||
@@ -32,12 +32,31 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
@@ -4022,6 +4022,47 @@ index 2efc18df94..c15f7d9b24 100644
|
||||
this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> {
|
||||
return Math.abs(entityliving.locY() - this.locY()) <= 4.0D;
|
||||
}));
|
||||
@@ -496,10 +515,10 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
// Paper end
|
||||
}
|
||||
|
||||
- static class ControllerMoveSlime extends ControllerMove {
|
||||
+ static class ControllerMoveSlime extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur
|
||||
|
||||
private float i;
|
||||
- private int j;
|
||||
+ private int j; private int getJumpDelay() { return j; } private void setJumpDelay(int delay) { j = delay; } // Purpur - OBFHELPER
|
||||
private final EntitySlime k;
|
||||
private boolean l;
|
||||
|
||||
@@ -521,10 +540,23 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
|
||||
@Override
|
||||
public void a() {
|
||||
- this.a.yaw = this.a(this.a.yaw, this.i, 90.0F);
|
||||
- this.a.aK = this.a.yaw;
|
||||
- this.a.aI = this.a.yaw;
|
||||
- if (this.h != ControllerMove.Operation.MOVE_TO) {
|
||||
+ // Purpur start
|
||||
+ if (entity.hasRider()) {
|
||||
+ tick(entity.getRider());
|
||||
+ if (entity.getForward() != 0 || entity.getStrafe() != 0) {
|
||||
+ if (getJumpDelay() > 10) {
|
||||
+ setJumpDelay(6);
|
||||
+ }
|
||||
+ } else {
|
||||
+ setJumpDelay(20);
|
||||
+ }
|
||||
+ } else {
|
||||
+ this.a.yaw = this.a(this.a.yaw, this.i, 90.0F);
|
||||
+ this.a.aK = this.a.yaw;
|
||||
+ this.a.aI = this.a.yaw;
|
||||
+ }
|
||||
+ if (!entity.hasRider() && this.h != ControllerMove.Operation.MOVE_TO) {
|
||||
+ // Purpur end
|
||||
this.a.r(0.0F);
|
||||
} else {
|
||||
this.h = ControllerMove.Operation.WAIT;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
index 07ca1a4987..941873513f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
|
||||
Reference in New Issue
Block a user