2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
|
|
Date: Sat, 14 Nov 2020 16:48:37 +0100
|
|
|
|
Subject: [PATCH] Collision option for requiring a player participant
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-01-14 10:46:04 +01:00
|
|
|
index 5436949cd928303cf80b606c747f386f0189f774..025ec74fe0ada57e1809d7e16c27b3a08007ad78 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-01-14 10:46:04 +01:00
|
|
|
@@ -1934,6 +1934,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
2021-06-11 14:02:28 +02:00
|
|
|
public void push(Entity entity) {
|
|
|
|
if (!this.isPassengerOfSameVehicle(entity)) {
|
|
|
|
if (!entity.noPhysics && !this.noPhysics) {
|
2022-06-09 10:51:45 +02:00
|
|
|
+ if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
|
2021-06-11 14:02:28 +02:00
|
|
|
double d0 = entity.getX() - this.getX();
|
|
|
|
double d1 = entity.getZ() - this.getZ();
|
|
|
|
double d2 = Mth.absMax(d0, d1);
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
2023-12-23 02:44:36 +01:00
|
|
|
index 82ffd50017dc234a9718db551fca0e73a6deded0..9780232286052d2cbbd604e71caf47dfb81fc1dc 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -792,6 +792,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
public void push(Entity entity) {
|
2023-06-08 02:54:54 +02:00
|
|
|
if (!this.level().isClientSide) {
|
2021-06-11 14:02:28 +02:00
|
|
|
if (!entity.noPhysics && !this.noPhysics) {
|
2023-06-08 21:35:20 +02:00
|
|
|
+ if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper
|
2021-06-11 14:02:28 +02:00
|
|
|
if (!this.hasPassenger(entity)) {
|
|
|
|
// CraftBukkit start
|
|
|
|
VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
2023-12-06 04:00:14 +01:00
|
|
|
index 6b0ec9da5a368775924f5b97c74acc5bfd609fa1..8b0efc4d78a04effddae0799b7ee5759ed5c720f 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -207,6 +207,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void push(Entity entity) {
|
2023-06-08 21:35:20 +02:00
|
|
|
+ if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper
|
2021-06-11 14:02:28 +02:00
|
|
|
if (entity instanceof Boat) {
|
|
|
|
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
|
|
|
|
// CraftBukkit start
|