mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-25 12:05:14 +01:00
Add "disableEntityCollisionboxes"
This commit is contained in:
parent
6ae7310b64
commit
e0cdc65a30
@ -1,15 +1,15 @@
|
||||
From 10ed99eee81cc8e28e5deeb6235d17f8a3fc3f0a Mon Sep 17 00:00:00 2001
|
||||
From 9bb528c0c5db42ba279c5e6189e6dc6670d7c384 Mon Sep 17 00:00:00 2001
|
||||
From: tr7zw <tr7zw@live.de>
|
||||
Date: Thu, 5 Mar 2020 22:31:50 +0100
|
||||
Subject: [PATCH] Add config, yapfa command and basic settings
|
||||
|
||||
---
|
||||
.../java/de/tr7zw/yapfa/YapfaCommand.java | 129 +++++++++++
|
||||
src/main/java/de/tr7zw/yapfa/YapfaConfig.java | 214 ++++++++++++++++++
|
||||
src/main/java/de/tr7zw/yapfa/YapfaConfig.java | 219 ++++++++++++++++++
|
||||
.../net/minecraft/server/DedicatedServer.java | 9 +
|
||||
.../java/net/minecraft/server/Entity.java | 1 +
|
||||
.../java/net/minecraft/server/Entity.java | 3 +-
|
||||
.../net/minecraft/server/EntityLiving.java | 9 +-
|
||||
5 files changed, 360 insertions(+), 2 deletions(-)
|
||||
5 files changed, 366 insertions(+), 3 deletions(-)
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaCommand.java
|
||||
create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaConfig.java
|
||||
|
||||
@ -150,10 +150,10 @@ index 000000000..58ce1f826
|
||||
+}
|
||||
diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java
|
||||
new file mode 100644
|
||||
index 000000000..05d31f917
|
||||
index 000000000..71c04cf49
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java
|
||||
@@ -0,0 +1,214 @@
|
||||
@@ -0,0 +1,219 @@
|
||||
+package de.tr7zw.yapfa;
|
||||
+
|
||||
+import com.destroystokyo.paper.io.chunk.ChunkTaskManager;
|
||||
@ -367,6 +367,11 @@ index 000000000..05d31f917
|
||||
+ checkEntityBlockCollisionTicks = getInt("settings.checkEntityBlockCollisionTicks", 1);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean disableEntityCollisionboxes = false;
|
||||
+ private static void disableEntityCollisionboxes() {
|
||||
+ disableEntityCollisionboxes = getBoolean("settings.disableEntityCollisionboxes", false);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 8a241c28a..c4006ff01 100644
|
||||
@ -389,7 +394,7 @@ index 8a241c28a..c4006ff01 100644
|
||||
this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
|
||||
this.setSpawnNPCs(dedicatedserverproperties.spawnNpcs);
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index bfcf4a9b0..a67b3ce1b 100644
|
||||
index bfcf4a9b0..c27c1d5c2 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -662,6 +662,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@ -400,6 +405,15 @@ index bfcf4a9b0..a67b3ce1b 100644
|
||||
this.checkBlockCollisions();
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision");
|
||||
@@ -786,7 +787,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this);
|
||||
VoxelShape voxelshape = this.world.getWorldBorder().a();
|
||||
Stream<VoxelShape> stream = VoxelShapes.c(voxelshape, VoxelShapes.a(axisalignedbb.shrink(1.0E-7D)), OperatorBoolean.AND) ? Stream.empty() : Stream.of(voxelshape);
|
||||
- Stream<VoxelShape> stream1 = this.world.b(this, axisalignedbb.a(vec3d), (Set) ImmutableSet.of());
|
||||
+ Stream<VoxelShape> stream1 = de.tr7zw.yapfa.YapfaConfig.disableEntityCollisionboxes ? Stream.empty() : this.world.b(this, axisalignedbb.a(vec3d), (Set) ImmutableSet.of()); // YAPFA
|
||||
StreamAccumulator<VoxelShape> streamaccumulator = new StreamAccumulator<>(Stream.concat(stream1, stream));
|
||||
Vec3D vec3d1 = vec3d.g() == 0.0D ? vec3d : a(this, vec3d, axisalignedbb, this.world, voxelshapecollision, streamaccumulator);
|
||||
boolean flag = vec3d.x != vec3d1.x;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 5b402690d..fa3affb54 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
|
Loading…
Reference in New Issue
Block a user