mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-22 00:21:34 +00:00
Add Airplane patches
I've only added the ones that compile correctly, because some of them doesn't seem to compile with Paper/Tuinity's latest changes
This commit is contained in:
45
patches/server/0010-Reduce-chunk-loading-lookups.patch
Normal file
45
patches/server/0010-Reduce-chunk-loading-lookups.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Sauve <paul@technove.co>
|
||||
Date: Thu, 4 Feb 2021 23:33:52 -0600
|
||||
Subject: [PATCH] Reduce chunk loading & lookups
|
||||
|
||||
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/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index e1e220b3e4967590a2a77370e2a6ab919ad50eaa..5d371a3e94720e24058d007474355af6aeb7cbdd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -312,11 +312,17 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
private boolean teleport(double x, double y, double z) {
|
||||
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z);
|
||||
|
||||
- while (blockposition_mutableblockposition.getY() > this.level.getMinBuildHeight() && !this.level.getBlockState(blockposition_mutableblockposition).getMaterial().blocksMotion()) {
|
||||
+ // Airplane start - single chunk lookup
|
||||
+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level.getChunkIfLoaded(blockposition_mutableblockposition);
|
||||
+ if (chunk == null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Airplane end
|
||||
+ while (blockposition_mutableblockposition.getY() > this.level.getMinBuildHeight() && !chunk.getBlockState(blockposition_mutableblockposition).getMaterial().blocksMotion()) { // Airplane
|
||||
blockposition_mutableblockposition.move(Direction.DOWN);
|
||||
}
|
||||
|
||||
- BlockState iblockdata = this.level.getBlockState(blockposition_mutableblockposition);
|
||||
+ BlockState iblockdata = chunk.getBlockState(blockposition_mutableblockposition); // Airplane
|
||||
boolean flag = iblockdata.getMaterial().blocksMotion();
|
||||
boolean flag1 = iblockdata.getFluidState().is((Tag) FluidTags.WATER);
|
||||
|
||||
Reference in New Issue
Block a user