mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2026-01-04 15:31:45 +00:00
Updated Upstream (Paper)
This commit is contained in:
@@ -29,7 +29,7 @@ index 2868dab7b100d9c325b0e5056f86660d631dec4b..2acad4c3fd58178b0f8b22bdb04eeeeb
|
||||
}
|
||||
diff --git a/src/main/java/org/galemc/gale/version/GaleSemanticVersion.java b/src/main/java/org/galemc/gale/version/GaleSemanticVersion.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d313213da0498d9229a3ac859513ed985fbfe381
|
||||
index 0000000000000000000000000000000000000000..da57462950965fe3bcb7f08e2ba9f15e4508876a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/galemc/gale/version/GaleSemanticVersion.java
|
||||
@@ -0,0 +1,37 @@
|
||||
@@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..d313213da0498d9229a3ac859513ed98
|
||||
+ * The <code>patch</code> version is incremented for small changes that do not affect the goal of any feature,
|
||||
+ * such as bug fixes, performance improvements or changes in wording.
|
||||
+ */
|
||||
+ public static final @NotNull String version = "0.6.9";
|
||||
+ public static final @NotNull String version = "0.6.10";
|
||||
+
|
||||
+ /**
|
||||
+ * The "<code>major.minor</code>" portion of the {@link #version}.
|
||||
|
||||
@@ -160,7 +160,7 @@ index a0aa1f1a7adf986d500a2135aa42e138aa3c4f08..6d19b985222d78750828fd2719c1fbf7
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
index e471960e0443392f6f54732b052a4debf2a8fd97..c56b9264d83ae98a4cc0945ea1bd919e9a5de57a 100644
|
||||
index 2d3068b7748032342edd81e6ea4a7c08988fb28d..c36c58e330c139d1b28e5ff2a23deaca0008ce89 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
|
||||
@@ -135,7 +135,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -172,7 +172,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..c56b9264d83ae98a4cc0945ea1bd919e
|
||||
|
||||
|
||||
public PaperConfigurations(final Path globalFolder) {
|
||||
@@ -300,7 +300,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -303,7 +303,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..c56b9264d83ae98a4cc0945ea1bd919e
|
||||
return createWorldContextMap(level.convertable.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig);
|
||||
}
|
||||
|
||||
@@ -401,17 +401,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -404,17 +404,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ index e471960e0443392f6f54732b052a4debf2a8fd97..c56b9264d83ae98a4cc0945ea1bd919e
|
||||
@Deprecated
|
||||
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
@@ -434,9 +423,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
@@ -437,9 +426,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
}
|
||||
|
||||
// Symlinks are not correctly checked in createDirectories
|
||||
@@ -381,7 +381,7 @@ index 18aac3da3c88f33b1a71a5920a8daa27e9723913..513916690d2579760f59edecb1a273f4
|
||||
this.convertable = convertable_conversionsession;
|
||||
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index f39ab10c5b0b8d86b579a5b683491204c51db70b..f95aa6362605c10145a212ed4b7df42ad443f4cf 100644
|
||||
index 773bfdd3ed457a352b5329f280c0d10297d579ba..d37848e2b361f5c3a893036c8710a3b41622d7f2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1,10 +1,7 @@
|
||||
|
||||
@@ -13,10 +13,10 @@ As part of: Mirai (https://github.com/etil2jz/Mirai)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 019d3bbd78fb0b06861979d223915fedb6c99442..21f77ea9d8a68eef569f1df6eba0495e5740acdd 100644
|
||||
index 3bc7230ca62ebe3426da293e436a962bb0134f85..8cd33a3cbce5195923317f05bf1d73809300cd52 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -91,7 +91,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -92,7 +92,7 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public class Timings extends ConfigurationPart.Post {
|
||||
public boolean enabled = true;
|
||||
public boolean verbose = true;
|
||||
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 21f77ea9d8a68eef569f1df6eba0495e5740acdd..7a7d10a9c1764ae618112a453a5191124b1e6e8d 100644
|
||||
index 8cd33a3cbce5195923317f05bf1d73809300cd52..3810cae80cb2dcb721ed25d566b1fe3fb87db4c2 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -89,7 +89,10 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -90,7 +90,10 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Timings timings;
|
||||
|
||||
public class Timings extends ConfigurationPart.Post {
|
||||
@@ -46,7 +46,7 @@ index 21f77ea9d8a68eef569f1df6eba0495e5740acdd..7a7d10a9c1764ae618112a453a519112
|
||||
public boolean verbose = true;
|
||||
public String url = "https://timin.gs/"; // Gale - use timin.gs by default
|
||||
public boolean serverNamePrivacy = false;
|
||||
@@ -103,6 +106,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -104,6 +107,13 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
|
||||
@Override
|
||||
public void postProcess() {
|
||||
|
||||
@@ -1094,7 +1094,7 @@ index e8485fb900b25e911a858678a833852731cb2ace..6a3b3370eb0c2670c13e3133ac86a9b1
|
||||
}
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index e11d7283662834047b2ff81a2fd25a4263792deb..056d7f857cbda68792ee27b35f14fc6872fd90e1 100644
|
||||
index 78c98f38bc263664ea4cd344670243a7d372885c..e832b6ce0e253a5696b50ee5956ef69762560261 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -405,7 +405,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1607,7 +1607,7 @@ index 8f97c9df726ac20cfce7bdddd5dd4f8c5aa76c35..8f2c0dcb0ca69ea1b09bb055c6a94949
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index f95aa6362605c10145a212ed4b7df42ad443f4cf..baf53980acfe52ec23b7f2f2183c2287c7b15d74 100644
|
||||
index d37848e2b361f5c3a893036c8710a3b41622d7f2..0097cc2d0856d782764d3a128f14440aed805bdb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -129,7 +129,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1635,7 +1635,7 @@ index f95aa6362605c10145a212ed4b7df42ad443f4cf..baf53980acfe52ec23b7f2f2183c2287
|
||||
this.levelData = worlddatamutable;
|
||||
this.dimensionTypeRegistration = holder;
|
||||
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
|
||||
@@ -863,9 +861,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -947,9 +945,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -1645,7 +1645,7 @@ index f95aa6362605c10145a212ed4b7df42ad443f4cf..baf53980acfe52ec23b7f2f2183c2287
|
||||
timings.tileEntityPending.startTiming(); // Spigot
|
||||
this.tickingBlockEntities = true;
|
||||
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
||||
@@ -910,7 +905,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -994,7 +989,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
||||
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
|
||||
@@ -1653,7 +1653,7 @@ index f95aa6362605c10145a212ed4b7df42ad443f4cf..baf53980acfe52ec23b7f2f2183c2287
|
||||
spigotConfig.currentPrimedTnt = 0; // Spigot
|
||||
}
|
||||
|
||||
@@ -1103,7 +1097,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1187,7 +1181,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
||||
@@ -1661,7 +1661,7 @@ index f95aa6362605c10145a212ed4b7df42ad443f4cf..baf53980acfe52ec23b7f2f2183c2287
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
|
||||
return list;
|
||||
@@ -1122,7 +1115,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1206,7 +1199,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
|
||||
@@ -1669,7 +1669,7 @@ index f95aa6362605c10145a212ed4b7df42ad443f4cf..baf53980acfe52ec23b7f2f2183c2287
|
||||
// Paper start - optimise this call
|
||||
//TODO use limit
|
||||
if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) {
|
||||
@@ -1379,11 +1371,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1463,11 +1455,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Wed, 23 Nov 2022 16:15:43 +0100
|
||||
Subject: [PATCH] Strip raytracing for EntityLiving#hasLineOfSight
|
||||
|
||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following patch:
|
||||
"Strip raytracing for EntityLiving#hasLineOfSight"
|
||||
By: Paul Sauve <paul@technove.co>
|
||||
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
* Airplane description *
|
||||
|
||||
The IBlockAccess#rayTrace method is very wasteful in both allocations,
|
||||
and in logic. While EntityLiving#hasLineOfSight provides static
|
||||
parameters for collisions with blocks and fluids, the method still does
|
||||
a lot of dynamic checks for both of these, which result in extra work.
|
||||
As well, since the fluid collision option is set to NONE, the entire
|
||||
fluid collision system is completely unneeded, yet used anyways.
|
||||
|
||||
* Airplane copyright *
|
||||
|
||||
Airplane
|
||||
Copyright (C) 2020 Technove LLC
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 056d7f857cbda68792ee27b35f14fc6872fd90e1..e1f8f3480bfda2bc3c042d0b57cbb051ad3d95bc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3633,7 +3633,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
|
||||
|
||||
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
|
||||
- return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
|
||||
+ return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().rayTraceDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.BlockHitResult.Type.MISS; // Paper - use distanceToSqr // Gale - Airplane - strip raytracing for EntityLiving#hasLineOfSight
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
index 0e8746759752b692668886370181aa5db1fd0bb0..e5e50817c83b6a7d3daf90960ed402180998ca49 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
|
||||
@@ -68,6 +68,16 @@ public interface BlockGetter extends LevelHeightAccessor {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Gale start - Airplane - strip raytracing for EntityLiving#hasLineOfSight - broken down variant of below rayTraceBlock, used by World#rayTraceDirect
|
||||
+ default net.minecraft.world.phys.BlockHitResult.Type rayTraceBlockDirect(Vec3 vec3d, Vec3 vec3d1, BlockPos blockposition, BlockState iblockdata, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
|
||||
+ if (iblockdata.isAir()) return null; // Tuinity - optimise air cases
|
||||
+ VoxelShape voxelshape = ClipContext.Block.COLLIDER.get(iblockdata, this, blockposition, voxelshapecoll);
|
||||
+ net.minecraft.world.phys.BlockHitResult movingobjectpositionblock = this.clipWithInteractionOverride(vec3d, vec3d1, blockposition, voxelshape, iblockdata);
|
||||
+
|
||||
+ return movingobjectpositionblock == null ? null : movingobjectpositionblock.getType();
|
||||
+ }
|
||||
+ // Gale end - Airplane - strip raytracing for EntityLiving#hasLineOfSight - broken down variant of below rayTraceBlock, used by World#rayTraceDirect
|
||||
+
|
||||
// CraftBukkit start - moved block handling into separate method for use by Block#rayTrace
|
||||
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
|
||||
// Paper start - Prevent raytrace from loading chunks
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index baf53980acfe52ec23b7f2f2183c2287c7b15d74..96921ace1ecc5472794df9bf4fa5fd73e9779f5c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -409,6 +409,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return null;
|
||||
}
|
||||
|
||||
+ // Gale start - Airplane - strip raytracing for EntityLiving#hasLineOfSight - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace)
|
||||
+ public net.minecraft.world.phys.BlockHitResult.Type rayTraceDirect(net.minecraft.world.phys.Vec3 vec3d, net.minecraft.world.phys.Vec3 vec3d1, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
|
||||
+ // most of this code comes from IBlockAccess#a(RayTrace, BiFunction, Function), but removes the needless functions
|
||||
+ if (vec3d.equals(vec3d1)) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+
|
||||
+ double endX = Mth.lerp(-1.0E-7D, vec3d1.x, vec3d.x);
|
||||
+ double endY = Mth.lerp(-1.0E-7D, vec3d1.y, vec3d.y);
|
||||
+ double endZ = Mth.lerp(-1.0E-7D, vec3d1.z, vec3d.z);
|
||||
+
|
||||
+ double startX = Mth.lerp(-1.0E-7D, vec3d.x, vec3d1.x);
|
||||
+ double startY = Mth.lerp(-1.0E-7D, vec3d.y, vec3d1.y);
|
||||
+ double startZ = Mth.lerp(-1.0E-7D, vec3d.z, vec3d1.z);
|
||||
+
|
||||
+ int currentX = Mth.floor(startX);
|
||||
+ int currentY = Mth.floor(startY);
|
||||
+ int currentZ = Mth.floor(startZ);
|
||||
+
|
||||
+ BlockPos.MutableBlockPos currentBlock = new BlockPos.MutableBlockPos(currentX, currentY, currentZ);
|
||||
+
|
||||
+ LevelChunk chunk = this.getChunkIfLoaded(currentBlock);
|
||||
+ if (chunk == null) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+
|
||||
+ net.minecraft.world.phys.BlockHitResult.Type initialCheck = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
|
||||
+
|
||||
+ if (initialCheck != null) {
|
||||
+ return initialCheck;
|
||||
+ }
|
||||
+
|
||||
+ double diffX = endX - startX;
|
||||
+ double diffY = endY - startY;
|
||||
+ double diffZ = endZ - startZ;
|
||||
+
|
||||
+ int xDirection = Mth.sign(diffX);
|
||||
+ int yDirection = Mth.sign(diffY);
|
||||
+ int zDirection = Mth.sign(diffZ);
|
||||
+
|
||||
+ double normalizedX = xDirection == 0 ? Double.MAX_VALUE : (double) xDirection / diffX;
|
||||
+ double normalizedY = yDirection == 0 ? Double.MAX_VALUE : (double) yDirection / diffY;
|
||||
+ double normalizedZ = zDirection == 0 ? Double.MAX_VALUE : (double) zDirection / diffZ;
|
||||
+
|
||||
+ double normalizedXDirection = normalizedX * (xDirection > 0 ? 1.0D - Mth.frac(startX) : Mth.frac(startX));
|
||||
+ double normalizedYDirection = normalizedY * (yDirection > 0 ? 1.0D - Mth.frac(startY) : Mth.frac(startY));
|
||||
+ double normalizedZDirection = normalizedZ * (zDirection > 0 ? 1.0D - Mth.frac(startZ) : Mth.frac(startZ));
|
||||
+
|
||||
+ net.minecraft.world.phys.BlockHitResult.Type result;
|
||||
+
|
||||
+ do {
|
||||
+ if (normalizedXDirection > 1.0D && normalizedYDirection > 1.0D && normalizedZDirection > 1.0D) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+
|
||||
+ if (normalizedXDirection < normalizedYDirection) {
|
||||
+ if (normalizedXDirection < normalizedZDirection) {
|
||||
+ currentX += xDirection;
|
||||
+ normalizedXDirection += normalizedX;
|
||||
+ } else {
|
||||
+ currentZ += zDirection;
|
||||
+ normalizedZDirection += normalizedZ;
|
||||
+ }
|
||||
+ } else if (normalizedYDirection < normalizedZDirection) {
|
||||
+ currentY += yDirection;
|
||||
+ normalizedYDirection += normalizedY;
|
||||
+ } else {
|
||||
+ currentZ += zDirection;
|
||||
+ normalizedZDirection += normalizedZ;
|
||||
+ }
|
||||
+
|
||||
+ currentBlock.set(currentX, currentY, currentZ);
|
||||
+ if (chunk.getPos().x != currentBlock.getX() >> 4 || chunk.getPos().z != currentBlock.getZ() >> 4) {
|
||||
+ chunk = this.getChunkIfLoaded(currentBlock);
|
||||
+ if (chunk == null) {
|
||||
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
|
||||
+ }
|
||||
+ }
|
||||
+ result = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
|
||||
+ } while (result == null);
|
||||
+
|
||||
+ return result;
|
||||
+ }
|
||||
+ // Gale end - Airplane - strip raytracing for EntityLiving#hasLineOfSight - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace)
|
||||
+
|
||||
public boolean isInWorldBounds(BlockPos pos) {
|
||||
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
|
||||
}
|
||||
@@ -31,7 +31,7 @@ index 287f6a38a6f042983c5e652ff9800fb215a91221..47acb63bfca2f722a595cf6614c28e75
|
||||
|
||||
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 96921ace1ecc5472794df9bf4fa5fd73e9779f5c..cb32c25a95fb16f02d84371d4bd0e4bc2755cb79 100644
|
||||
index 0097cc2d0856d782764d3a128f14440aed805bdb..013b445da073ba0e97eb5f80879f122286e1d2c5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -181,6 +181,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
index d4c91e0a0c64fcb7f1145de3f30134cb1f1f8ee6..aed7e9affaae1e0d1e3324a41e5818435f76fd0f 100644
|
||||
index 8f8b29f80d1573981ccffd207dd6e0941e71a352..aed7e9affaae1e0d1e3324a41e5818435f76fd0f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.core.BlockPos;
|
||||
@@ -56,7 +56,7 @@ index d4c91e0a0c64fcb7f1145de3f30134cb1f1f8ee6..aed7e9affaae1e0d1e3324a41e581843
|
||||
public static BehaviorControl<PathfinderMob> create(Predicate<Holder<PoiType>> poiPredicate, MemoryModuleType<GlobalPos> poiPosModule, boolean onlyRunIfChild, Optional<Byte> entityStatus) {
|
||||
return create(poiPredicate, poiPosModule, poiPosModule, onlyRunIfChild, entityStatus);
|
||||
}
|
||||
@@ -42,11 +50,13 @@ public class AcquirePoi {
|
||||
@@ -42,12 +50,13 @@ public class AcquirePoi {
|
||||
return false;
|
||||
} else if (mutableLong.getValue() == 0L) {
|
||||
mutableLong.setValue(world.getGameTime() + (long)world.random.nextInt(20));
|
||||
@@ -66,6 +66,7 @@ index d4c91e0a0c64fcb7f1145de3f30134cb1f1f8ee6..aed7e9affaae1e0d1e3324a41e581843
|
||||
return false;
|
||||
} else {
|
||||
mutableLong.setValue(time + 20L + (long)world.getRandom().nextInt(20));
|
||||
- if (entity.getNavigation().isStuck()) mutableLong.add(200); // Paper - Wait an additional 10s to check again if they're stuck
|
||||
+ addAdditionalTimeToMutableLongIfEntityIsStuck(mutableLong, world, entity); // Gale - Airplane - reduce acquire POI for stuck entities
|
||||
PoiManager poiManager = world.getPoiManager();
|
||||
long2ObjectMap.long2ObjectEntrySet().removeIf((entry) -> {
|
||||
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index e1f8f3480bfda2bc3c042d0b57cbb051ad3d95bc..6ad84442f7722f709c7430a1b22a59957852c28b 100644
|
||||
index e832b6ce0e253a5696b50ee5956ef69762560261..607a5ad9164085842cd802fcf9f15357d9d8ef29 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index cb32c25a95fb16f02d84371d4bd0e4bc2755cb79..7ef39a42040d84264a059e32b1d853083ece7b32 100644
|
||||
index 013b445da073ba0e97eb5f80879f122286e1d2c5..708a188e22e8936a6d53ed77f8a2e07525b61e6a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -272,6 +272,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1,53 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Wed, 23 Nov 2022 22:29:05 +0100
|
||||
Subject: [PATCH] Use fast item merge raytracing
|
||||
|
||||
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following patch:
|
||||
"Patch Paper to use fast item merge raytracing"
|
||||
By: Paul Sauve <paul@technove.co>
|
||||
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
* Airplane copyright *
|
||||
|
||||
Airplane
|
||||
Copyright (C) 2020 Technove LLC
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 52196431a6538872755344859a0454a0e50c3b6e..a85f3a9b52748b32eece5364c59d0aa282f91a22 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -270,10 +270,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
if (entityitem.isMergable()) {
|
||||
// Paper Start - Fix items merging through walls
|
||||
if (this.level().paperConfig().fixes.fixItemsMergingThroughWalls) {
|
||||
+ // Gale start - Airplane - use fast item merge raytracing - skip the allocations
|
||||
+ /*
|
||||
net.minecraft.world.level.ClipContext rayTrace = new net.minecraft.world.level.ClipContext(this.position(), entityitem.position(),
|
||||
net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, this);
|
||||
net.minecraft.world.phys.BlockHitResult rayTraceResult = this.level().clip(rayTrace);
|
||||
if (rayTraceResult.getType() == net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ */
|
||||
+ if (level().rayTraceDirect(this.position(), entityitem.position(), net.minecraft.world.phys.shapes.CollisionContext.of(this)) ==
|
||||
+ net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ // Gale end - Airplane - use fast item merge raytracing - skip the allocations
|
||||
}
|
||||
// Paper End
|
||||
this.tryToMerge(entityitem);
|
||||
@@ -57,10 +57,10 @@ index b7318670e039e05a058e437e025519d40557bb88..efbc8483a51c5272ca81747c82dc65e7
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 7ef39a42040d84264a059e32b1d853083ece7b32..db481e39fca1d6fd6dcd0c076f413b0f191fb0b3 100644
|
||||
index 708a188e22e8936a6d53ed77f8a2e07525b61e6a..761e3c07726bdead7acf9769b9a973750b7d0335 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1015,13 +1015,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1014,13 +1014,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
try {
|
||||
tickConsumer.accept(entity);
|
||||
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
@@ -13,7 +13,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 9606c6954f2c53dbbda7e7235cf37308822fea02..4466f21a83cb9ddca7309a194afcb8eded92de81 100644
|
||||
index b36949c1b5bd2c5af1ee7496c8b8372fe263ad79..09049dea171e627174f986737eec68667650ef26 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -73,6 +73,7 @@ tasks.withType<JavaCompile> {
|
||||
@@ -28,7 +28,7 @@ but is so much cheaper than the suffocation check that it's worth
|
||||
keeping it.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 6ad84442f7722f709c7430a1b22a59957852c28b..559e85f266614f08e5b383e41f9898b2cca28513 100644
|
||||
index 607a5ad9164085842cd802fcf9f15357d9d8ef29..597866e969e0f5deddaaaedd9b1618edd507bae9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -412,7 +412,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -17,7 +17,7 @@ Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
Only do an item "suck in" action once per second
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index a85f3a9b52748b32eece5364c59d0aa282f91a22..a54e0c2759a3987dc74dfdd8e61962841122a5f6 100644
|
||||
index d39f31e7cf315c7cdc1daab28164380e44dd8341..2639acd2c16c178ac134dd04e0cdc83dad1aa1d6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -14,11 +14,13 @@ import net.minecraft.world.entity.Entity;
|
||||
@@ -346,7 +346,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..43f402d9032e4570a81a80e412215598
|
||||
protected CipherBase(Cipher cipher) {
|
||||
this.cipher = cipher;
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index cf20f0983fc25b26cf92b9d3a28746b1909fc56b..f20738fbfbc85a73e43898ec2b15c3a834ba7099 100644
|
||||
index 52cb6476604c98465f81ff9e8d8344d7536a8868..98aa13ba9b5d2ac6ddac8e825f76e3c6211dc0d2 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -21,7 +21,6 @@ import io.netty.channel.epoll.EpollSocketChannel;
|
||||
@@ -399,7 +399,7 @@ index 8a68baf6bd46b59cf57c94ffe5651d47a7cae99c..bd7fa1b2a6fed82ce66fe2b8e3498e4d
|
||||
private static final FormattedText TEXT_NULL = FormattedText.of("null");
|
||||
private final String key;
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index dae36c6452ccd57a436dd918547b64d59957ab0a..f06cafd80d7c027ca97e50bcb45ad520d17c7e55 100644
|
||||
index a7ebf851a65231074c89a24f30de4ac2fb5b63e4..cb4a30bdf9beb4b1296ff47a6f6f299f0534b481 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -93,7 +93,7 @@ public class Main {
|
||||
@@ -680,7 +680,7 @@ index 97ff19efa0b3943ccb7a6e02cba6ed2fea61adac..b2ae2bd8bd4ff3cb6457e8c08172e348
|
||||
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
|
||||
this.type = type;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 559e85f266614f08e5b383e41f9898b2cca28513..506cbd835df841608d0d26a2a9313ee3434bf1ab 100644
|
||||
index 597866e969e0f5deddaaaedd9b1618edd507bae9..d1267b31ec49d3b0faf1fab57fe53f3058ccca21 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3099,7 +3099,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -798,7 +798,7 @@ index 2bfbdaeb2b0d99dfd956cd5936403fe8b0eeae64..84f1c4c3ded4f201899f3c74e639349b
|
||||
public Enchantments() {}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index db481e39fca1d6fd6dcd0c076f413b0f191fb0b3..8e84db48bb2658ce9d24c31f413aa23924839731 100644
|
||||
index 761e3c07726bdead7acf9769b9a973750b7d0335..aaa83188bc5c9da1ab7a50bd3f97a420e242a714 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -12,6 +12,8 @@ import java.util.function.Consumer;
|
||||
@@ -810,7 +810,7 @@ index db481e39fca1d6fd6dcd0c076f413b0f191fb0b3..8e84db48bb2658ce9d24c31f413aa239
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@@ -1518,7 +1520,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1517,7 +1519,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
|
||||
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
|
||||
if (slices == null) {
|
||||
@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 506cbd835df841608d0d26a2a9313ee3434bf1ab..2f252bbe2946ea3228933b4b8c91a4e46fe99705 100644
|
||||
index d1267b31ec49d3b0faf1fab57fe53f3058ccca21..c7e0aa9ea247a14441858c4d4d03151e4c61abdd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -583,11 +583,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user