Configurable Player Collision

This commit is contained in:
Aikar
2016-04-13 02:10:49 -04:00
parent 3c1c4ab059
commit a99426b5fe
4 changed files with 144 additions and 98 deletions

View File

@@ -12,12 +12,15 @@
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
double d4 = max * max;
@@ -43,7 +48,7 @@
@@ -43,9 +48,9 @@
Team.CollisionRule scoreboardteambase_enumteampush = scoreboardteam == null ? Team.CollisionRule.ALWAYS : scoreboardteam.getCollisionRule();
return (Predicate) (scoreboardteambase_enumteampush == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : EntitySelector.NO_SPECTATORS.and((entity1) -> {
- if (!entity1.isPushable()) {
+ if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API
return false;
} else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
- } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
+ } else if (entity1 instanceof Player && entity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) { // Paper - Configurable player collision
return false;
} else {
PlayerTeam scoreboardteam1 = entity1.getTeam();