mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-21 07:49:18 +00:00
46 lines
2.5 KiB
Diff
46 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Fri, 31 Mar 2023 01:12:40 +0300
|
|
Subject: [PATCH] Some boat fixes
|
|
|
|
This patch always allow to enter the boat and removes that player can be ejected from the boat underwater automatically
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
|
index 49660b0b9ee24de96006441a46bf6efa95873db3..c9050b9c019541557bf0916838cd49e3f6a7bfe9 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
|
@@ -356,7 +356,14 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
|
}
|
|
|
|
if (!this.level.isClientSide && this.outOfControlTicks >= 60.0F) {
|
|
- this.ejectPassengers();
|
|
+ // DivineMC start - Don't eject players
|
|
+ for (int i = this.passengers.size() - 1; i >= 0; --i) {
|
|
+ Entity passenger = this.passengers.get(i);
|
|
+ if (!(passenger instanceof Player)) {
|
|
+ passenger.stopRiding();
|
|
+ }
|
|
+ }
|
|
+ // DivineMC end
|
|
}
|
|
|
|
if (this.getHurtTime() > 0) {
|
|
@@ -897,7 +904,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
|
|
|
@Override
|
|
public InteractionResult interact(Player player, InteractionHand hand) {
|
|
- return player.isSecondaryUseActive() ? InteractionResult.PASS : (this.outOfControlTicks < 60.0F ? (!this.level.isClientSide ? (player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS) : InteractionResult.SUCCESS) : InteractionResult.PASS);
|
|
+ return player.isSecondaryUseActive() ? InteractionResult.PASS : (true || this.outOfControlTicks < 60.0F ? (!this.level.isClientSide ? (player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS) : InteractionResult.SUCCESS) : InteractionResult.PASS); // DivineMC - always allow to enter the boat
|
|
}
|
|
|
|
@Override
|
|
@@ -993,7 +1000,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
|
|
|
|
@Override
|
|
protected boolean canAddPassenger(Entity passenger) {
|
|
- return this.getPassengers().size() < this.getMaxPassengers() && !this.isEyeInFluid(FluidTags.WATER);
|
|
+ return this.getPassengers().size() < this.getMaxPassengers()/* && !this.isEyeInFluid(FluidTags.WATER)*/; // DivineMC - always allow to enter the boat
|
|
}
|
|
|
|
protected int getMaxPassengers() {
|