mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 14:51:27 +01:00
Fixes issues in the suppress dismount cancellation patch (#10735)
This commit is contained in:
parent
5bd61ce801
commit
f14fe2e4f4
@ -19,6 +19,27 @@ this is going to be the best soultion all around.
|
|||||||
|
|
||||||
Improvements/suggestions welcome!
|
Improvements/suggestions welcome!
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopRiding() {
|
||||||
|
+ // Paper start - Force entity dismount during teleportation
|
||||||
|
+ this.stopRiding(false);
|
||||||
|
+ }
|
||||||
|
+ @Override
|
||||||
|
+ public void stopRiding(boolean suppressCancellation) {
|
||||||
|
+ // Paper end - Force entity dismount during teleportation
|
||||||
|
Entity entity = this.getVehicle();
|
||||||
|
|
||||||
|
- super.stopRiding();
|
||||||
|
+ super.stopRiding(suppressCancellation); // Paper - Force entity dismount during teleportation
|
||||||
|
if (entity instanceof LivingEntity entityliving) {
|
||||||
|
Iterator iterator = entityliving.getActiveEffects().iterator();
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@ -28,9 +49,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
public void removeVehicle() {
|
public void removeVehicle() {
|
||||||
+ // Paper start - Force entity dismount during teleportation
|
+ // Paper start - Force entity dismount during teleportation
|
||||||
+ stopRiding(false);
|
+ this.removeVehicle(false);
|
||||||
+ }
|
+ }
|
||||||
+ public void stopRiding(boolean suppressCancellation) {
|
+ public void removeVehicle(boolean suppressCancellation) {
|
||||||
+ // Paper end - Force entity dismount during teleportation
|
+ // Paper end - Force entity dismount during teleportation
|
||||||
if (this.vehicle != null) {
|
if (this.vehicle != null) {
|
||||||
Entity entity = this.vehicle;
|
Entity entity = this.vehicle;
|
||||||
@ -41,6 +62,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopRiding() {
|
||||||
|
- this.removeVehicle();
|
||||||
|
+ // Paper start - Force entity dismount during teleportation
|
||||||
|
+ this.stopRiding(false);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void stopRiding(boolean suppressCancellation) {
|
||||||
|
+ this.removeVehicle(suppressCancellation);
|
||||||
|
+ // Paper end - Force entity dismount during teleportation
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addPassenger(Entity passenger) {
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +114,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@Override
|
@Override
|
||||||
public void stopRiding() {
|
public void stopRiding() {
|
||||||
+ // Paper start - Force entity dismount during teleportation
|
+ // Paper start - Force entity dismount during teleportation
|
||||||
+ stopRiding(false);
|
+ this.stopRiding(false);
|
||||||
+ }
|
+ }
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void stopRiding(boolean suppressCancellation) {
|
+ public void stopRiding(boolean suppressCancellation) {
|
||||||
@ -92,6 +126,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
if (entity != null && entity != this.getVehicle() && !this.level().isClientSide) {
|
if (entity != null && entity != this.getVehicle() && !this.level().isClientSide) {
|
||||||
this.dismountVehicle(entity);
|
this.dismountVehicle(entity);
|
||||||
}
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java
|
||||||
|
@@ -0,0 +0,0 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopRiding() {
|
||||||
|
- super.stopRiding();
|
||||||
|
+ // Paper start - Force entity dismount during teleportation
|
||||||
|
+ this.stopRiding(false);
|
||||||
|
+ }
|
||||||
|
+ @Override
|
||||||
|
+ public void stopRiding(boolean suppressCancellation) {
|
||||||
|
+ super.stopRiding(suppressCancellation);
|
||||||
|
+ // Paper end - Force entity dismount during teleportation
|
||||||
|
if (this.level().isClientSide) {
|
||||||
|
this.clientOldAttachPosition = this.blockPosition();
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||||
@ -102,11 +155,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public void removeVehicle() {
|
public void removeVehicle() {
|
||||||
- super.removeVehicle();
|
- super.removeVehicle();
|
||||||
+ // Paper start - Force entity dismount during teleportation
|
+ // Paper start - Force entity dismount during teleportation
|
||||||
+ stopRiding(false);
|
+ this.removeVehicle(false);
|
||||||
+ }
|
+ }
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void stopRiding(boolean suppressCancellation) {
|
+ public void removeVehicle(boolean suppressCancellation) {
|
||||||
+ super.stopRiding(suppressCancellation);
|
+ super.removeVehicle(suppressCancellation);
|
||||||
+ // Paper end - Force entity dismount during teleportation
|
+ // Paper end - Force entity dismount during teleportation
|
||||||
this.boardingCooldown = 0;
|
this.boardingCooldown = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user