Add option for boats to eject players on land

This commit is contained in:
William Blake Galbreath
2019-09-07 23:22:34 -05:00
parent 8cd762ab83
commit 09b1b15283
2 changed files with 45 additions and 0 deletions

View File

@@ -270,6 +270,10 @@ bamboo
- **default**: 10
- **description**: Maximum height bamboo may be small thickness
* boat-eject-players-on-land
- **default**: false
- **description**: Whether or not boats eject players when on land
campfire-obeys-gravity
~~~~~~~~~~~~~~~~~~~~~~
* **default**: true

View File

@@ -0,0 +1,41 @@
From baac2e148d13279531edb0d1cb3015732a70243b Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 7 Sep 2019 22:47:59 -0500
Subject: [PATCH] Add option for boats to eject players on land
---
src/main/java/net/minecraft/server/EntityBoat.java | 1 +
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index b5bcd1f80..37a98eba6 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
@@ -425,6 +425,7 @@ public class EntityBoat extends Entity {
if (f > 0.0F) {
this.aH = f;
+ if (world.purpurConfig.boatEjectPlayersOnLand) ejectPassengers(); // Purpur
return EntityBoat.EnumStatus.ON_LAND;
} else {
return EntityBoat.EnumStatus.IN_AIR;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 3ff5dc4a3..f68744460 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -74,6 +74,11 @@ public class PurpurWorldConfig {
bambooSmallHeight = getInt("bamboo.small-height", bambooSmallHeight);
}
+ public boolean boatEjectPlayersOnLand = false;
+ private void boatEjectPlayersOnLand() {
+ boatEjectPlayersOnLand = getBoolean("boat-eject-players-on-land", boatEjectPlayersOnLand);
+ }
+
public boolean campfireObeysGravity = true;
private void campfireObeysGravity() {
campfireObeysGravity = getBoolean("campfire-obeys-gravity", campfireObeysGravity);
--
2.23.0.rc1