Push forward
This commit is contained in:
+4
-4
@@ -17,13 +17,13 @@ index c5a9d380f318f176a2bf5d30a10a6d528d23bb92..5f7dad51fdca3b85f8ae164b1f58241e
|
||||
}
|
||||
+ // Shiroha start - Fix high velocity moving issue
|
||||
+ // Filter the threads as it may be called by the chunk system worker thread
|
||||
+ if (moe.monnairealms.camellia.config.modules.fixes.FoliaEntityMovingFixConfig.enabled && ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()){
|
||||
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.FoliaEntityMovingFixConfig.enabled && ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()){
|
||||
+ var finalPosition = delta.add(this.position);
|
||||
+ // not NaN (Prevent incorrect checks under NaN minecarts)
|
||||
+ if (!Double.isNaN(finalPosition.x) && !Double.isNaN(finalPosition.y) && !Double.isNaN(finalPosition.z)) {
|
||||
+ // kill tick passively if it's moving out of region and we'll catch this exception
|
||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level,finalPosition)) {
|
||||
+ throw new moe.monnairealms.camellia.utils.entity.EntityMoveOutOfRegionException(this, delta, moverType);
|
||||
+ throw new io.nanachiyo0721.shiroha.utils.entity.EntityMoveOutOfRegionException(this, delta, moverType);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
@@ -39,13 +39,13 @@ index a0eb1f608a99301e0197ab1d1a6fbbb0a0be4ce0..52bcb87e96f7b5997559bd532481f548
|
||||
public <T extends Entity> void guardEntityTick(final Consumer<T> tick, final T entity) {
|
||||
try {
|
||||
tick.accept(entity);
|
||||
+ } catch (moe.monnairealms.camellia.utils.entity.EntityMoveOutOfRegionException moveOutOfRegionException) { // Shiroha - Fix high velocity moving issue
|
||||
+ } catch (io.nanachiyo0721.shiroha.utils.entity.EntityMoveOutOfRegionException moveOutOfRegionException) { // Shiroha - Fix high velocity moving issue
|
||||
+ // Shiroha start - Fix high velocity moving issue
|
||||
+ final Entity ent = moveOutOfRegionException.getEntity();
|
||||
+ var currPosition = ent.position();
|
||||
+ var toPosition = moveOutOfRegionException.getMovement().add(currPosition);
|
||||
+
|
||||
+ if (moe.monnairealms.camellia.config.modules.fixes.FoliaEntityMovingFixConfig.warnOnDetected) {
|
||||
+ if (io.nanachiyo0721.shiroha.config.modules.fixes.FoliaEntityMovingFixConfig.warnOnDetected) {
|
||||
+ MinecraftServer.LOGGER.warn("Entity {} with entityId {} has tried moving to another region!",ent, ent.getId());
|
||||
+ }
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user