Collision option for requiring a player participant

This commit is contained in:
Mariell Hoversholm
2020-11-14 16:48:37 +01:00
parent 33a7c0284d
commit df6902585c
3 changed files with 74 additions and 60 deletions

View File

@@ -39,8 +39,11 @@
return true;
}
@@ -182,9 +198,29 @@
@@ -180,11 +196,32 @@
@Override
public void push(Entity entity) {
+ if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper - Collision option for requiring a player participant
if (entity instanceof AbstractBoat) {
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
+ // CraftBukkit start
@@ -69,7 +72,7 @@
super.push(entity);
}
@@ -247,6 +283,7 @@
@@ -247,6 +284,7 @@
return this.getDirection().getClockWise();
}
@@ -77,7 +80,7 @@
@Override
public void tick() {
this.oldStatus = this.status;
@@ -287,6 +324,21 @@
@@ -287,6 +325,21 @@
this.setDeltaMovement(Vec3.ZERO);
}
@@ -99,7 +102,7 @@
this.applyEffectsFromBlocks();
this.applyEffectsFromBlocks();
this.tickBubbleColumn();
@@ -790,11 +842,18 @@
@@ -790,11 +843,18 @@
@Override
public void remove(Entity.RemovalReason reason) {

View File

@@ -106,9 +106,11 @@
}
}
@@ -521,6 +563,14 @@
@@ -520,7 +562,16 @@
public void push(Entity entity) {
if (!this.level().isClientSide) {
if (!entity.noPhysics && !this.noPhysics) {
+ if (!this.level().paperConfig().collisions.allowVehicleCollisions && this.level().paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper - Collision option for requiring a player participant
if (!this.hasPassenger(entity)) {
+ // CraftBukkit start
+ VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
@@ -121,7 +123,7 @@
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
double d2 = d0 * d0 + d1 * d1;
@@ -645,4 +695,27 @@
@@ -645,4 +696,27 @@
public boolean isFurnace() {
return false;
}