mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix #39 Going outside border broken
This commit is contained in:
@@ -5,19 +5,25 @@ Subject: [PATCH] Add option to teleport to spawn if outside world border
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index ab64c0491..061906a56 100644
|
||||
index ab64c04919..61df55b8c8 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -277,6 +277,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -277,6 +277,13 @@ public abstract class EntityLiving extends Entity {
|
||||
double d1 = this.world.getWorldBorder().getDamageAmount();
|
||||
|
||||
if (d1 > 0.0D) {
|
||||
+ if (world.purpurConfig.teleportIfOutsideBorder && this instanceof EntityPlayer) teleportTo((WorldServer) world, world.getSpawn()); else // Purpur
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.teleportIfOutsideBorder && this instanceof EntityPlayer) {
|
||||
+ this.ejectPassengers();
|
||||
+ this.stopRiding(true);
|
||||
+ ((EntityPlayer) this).playerConnection.teleport(MCUtil.toLocation(world, world.getSpawn()));
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
this.damageEntity(DamageSource.STUCK, (float) Math.max(1, MathHelper.floor(-d0 * d1)));
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 87b863031..63d4cf5c4 100644
|
||||
index 87b8630315..63d4cf5c44 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -180,6 +180,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Totems work in inventory
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 061906a569..0b23d4f3e5 100644
|
||||
index 61df55b8c8..8530e78a9c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1318,6 +1318,19 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1324,6 +1324,19 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user