@@ -40,7 +40,7 @@
|
||||
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
||||
super(convertable_conversionsession.getDimensionPath(worldserver.dimension()).resolve("region"), datafixer, flag);
|
||||
this.visibleChunkMap = this.updatingChunkMap.clone();
|
||||
@@ -329,9 +355,12 @@
|
||||
@@ -291,9 +317,12 @@
|
||||
CompletableFuture<List<Either<IChunkAccess, PlayerChunk.Failure>>> completablefuture1 = SystemUtils.sequence(list);
|
||||
CompletableFuture<Either<List<IChunkAccess>, PlayerChunk.Failure>> completablefuture2 = completablefuture1.thenApply((list2) -> {
|
||||
List<IChunkAccess> list3 = Lists.newArrayList();
|
||||
@@ -55,7 +55,7 @@
|
||||
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
||||
Optional<IChunkAccess> optional = either.left();
|
||||
|
||||
@@ -501,7 +530,7 @@
|
||||
@@ -463,7 +492,7 @@
|
||||
|
||||
private void scheduleUnload(long i, PlayerChunk playerchunk) {
|
||||
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkToSave();
|
||||
@@ -64,7 +64,7 @@
|
||||
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkToSave();
|
||||
|
||||
if (completablefuture1 != completablefuture) {
|
||||
@@ -680,7 +709,21 @@
|
||||
@@ -642,7 +671,21 @@
|
||||
|
||||
private static void postLoadProtoChunk(WorldServer worldserver, List<NBTTagCompound> list) {
|
||||
if (!list.isEmpty()) {
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -778,7 +821,7 @@
|
||||
@@ -740,7 +783,7 @@
|
||||
if (!playerchunk.wasAccessibleSinceLastSave()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
if (!(ichunkaccess instanceof ProtoChunkExtension) && !(ichunkaccess instanceof Chunk)) {
|
||||
return false;
|
||||
@@ -927,7 +970,8 @@
|
||||
@@ -890,7 +933,8 @@
|
||||
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
return chunk.getBlockEntities().size();
|
||||
}).orElse(0), tickingtracker.getTicketDebugString(i), tickingtracker.getLevel(i), optional1.map((chunk) -> {
|
||||
return chunk.getBlockTicks().count();
|
||||
@@ -940,7 +984,7 @@
|
||||
@@ -903,7 +947,7 @@
|
||||
|
||||
private static String printFuture(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
||||
try {
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
return either != null ? (String) either.map((chunk) -> {
|
||||
return "done";
|
||||
@@ -958,7 +1002,7 @@
|
||||
@@ -921,7 +965,7 @@
|
||||
private NBTTagCompound readChunk(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
}
|
||||
|
||||
boolean anyPlayerCloseEnoughForSpawning(ChunkCoordIntPair chunkcoordintpair) {
|
||||
@@ -1382,7 +1426,7 @@
|
||||
@@ -1342,7 +1386,7 @@
|
||||
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
||||
|
||||
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
||||
@@ -133,7 +133,7 @@
|
||||
this.entity = entity;
|
||||
this.range = i;
|
||||
this.lastSectionPos = SectionPosition.of(entity);
|
||||
@@ -1435,12 +1479,17 @@
|
||||
@@ -1395,12 +1439,17 @@
|
||||
|
||||
public void updatePlayer(EntityPlayer entityplayer) {
|
||||
if (entityplayer != this.entity) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/net/minecraft/server/level/WorldServer.java
|
||||
@@ -147,6 +147,20 @@
|
||||
@@ -149,6 +149,20 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
public static final BlockPosition END_SPAWN_POINT = new BlockPosition(100, 50, 0);
|
||||
@@ -164,7 +178,7 @@
|
||||
@@ -166,7 +180,7 @@
|
||||
final List<EntityPlayer> players;
|
||||
private final ChunkProviderServer chunkSource;
|
||||
private final MinecraftServer server;
|
||||
@@ -30,7 +30,7 @@
|
||||
final EntityTickList entityTickList;
|
||||
public final PersistentEntitySectionManager<Entity> entityManager;
|
||||
public boolean noSave;
|
||||
@@ -186,9 +200,29 @@
|
||||
@@ -189,9 +203,29 @@
|
||||
private final StructureCheck structureCheck;
|
||||
private final boolean tickTime;
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
this.players = Lists.newArrayList();
|
||||
this.entityTickList = new EntityTickList();
|
||||
this.blockTicks = new TickListServer<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
|
||||
@@ -200,7 +234,13 @@
|
||||
@@ -203,7 +237,13 @@
|
||||
this.tickTime = flag1;
|
||||
this.server = minecraftserver;
|
||||
this.customSpawners = list;
|
||||
@@ -78,7 +78,7 @@
|
||||
boolean flag2 = minecraftserver.forceSynchronousWrites();
|
||||
DataFixer datafixer = minecraftserver.getFixerUpper();
|
||||
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver);
|
||||
@@ -231,14 +271,15 @@
|
||||
@@ -234,14 +274,15 @@
|
||||
long l = minecraftserver.getWorldData().worldGenSettings().seed();
|
||||
|
||||
this.structureCheck = new StructureCheck(this.chunkSource.chunkScanner(), this.registryAccess(), minecraftserver.getStructureManager(), resourcekey, chunkgenerator, this, chunkgenerator.getBiomeSource(), l, datafixer);
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
public void setWeatherParameters(int i, int j, boolean flag, boolean flag1) {
|
||||
@@ -270,12 +311,20 @@
|
||||
@@ -273,12 +314,20 @@
|
||||
long j;
|
||||
|
||||
if (this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
|
||||
@@ -120,7 +120,7 @@
|
||||
if (this.getGameRules().getBoolean(GameRules.RULE_WEATHER_CYCLE) && this.isRaining()) {
|
||||
this.resetWeatherCycle();
|
||||
}
|
||||
@@ -301,7 +350,7 @@
|
||||
@@ -304,7 +353,7 @@
|
||||
this.runBlockEvents();
|
||||
this.handlingTick = false;
|
||||
gameprofilerfiller.pop();
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
if (flag) {
|
||||
this.resetEmptyTime();
|
||||
@@ -317,7 +366,7 @@
|
||||
@@ -320,7 +369,7 @@
|
||||
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
if (!entity.isRemoved()) {
|
||||
@@ -138,7 +138,7 @@
|
||||
entity.discard();
|
||||
} else {
|
||||
gameprofilerfiller.push("checkDespawn");
|
||||
@@ -389,7 +438,7 @@
|
||||
@@ -392,7 +441,7 @@
|
||||
|
||||
private void wakeUpAllPlayers() {
|
||||
this.sleepStatus.removeAllSleepers();
|
||||
@@ -147,7 +147,7 @@
|
||||
entityplayer.stopSleepInBed(false, false);
|
||||
});
|
||||
}
|
||||
@@ -416,14 +465,14 @@
|
||||
@@ -419,14 +468,14 @@
|
||||
entityhorseskeleton.setTrap(true);
|
||||
entityhorseskeleton.setAge(0);
|
||||
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
@@ -164,7 +164,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,12 +483,12 @@
|
||||
@@ -437,12 +486,12 @@
|
||||
BiomeBase biomebase = this.getBiome(blockposition);
|
||||
|
||||
if (biomebase.shouldFreeze(this, blockposition1)) {
|
||||
@@ -179,7 +179,7 @@
|
||||
}
|
||||
|
||||
IBlockData iblockdata = this.getBlockState(blockposition1);
|
||||
@@ -635,6 +684,7 @@
|
||||
@@ -638,6 +687,7 @@
|
||||
this.rainLevel = MathHelper.clamp(this.rainLevel, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
if (this.oRainLevel != this.rainLevel) {
|
||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel), this.dimension());
|
||||
}
|
||||
@@ -653,14 +703,47 @@
|
||||
@@ -656,14 +706,47 @@
|
||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.RAIN_LEVEL_CHANGE, this.rainLevel));
|
||||
this.server.getPlayerList().broadcastAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.THUNDER_LEVEL_CHANGE, this.thunderLevel));
|
||||
}
|
||||
@@ -237,7 +237,7 @@
|
||||
}
|
||||
|
||||
public void resetEmptyTime() {
|
||||
@@ -695,6 +778,7 @@
|
||||
@@ -698,6 +781,7 @@
|
||||
});
|
||||
gameprofilerfiller.incrementCounter("tickNonPassenger");
|
||||
entity.tick();
|
||||
@@ -245,7 +245,7 @@
|
||||
this.getProfiler().pop();
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
@@ -718,6 +802,7 @@
|
||||
@@ -721,6 +805,7 @@
|
||||
});
|
||||
gameprofilerfiller.incrementCounter("tickPassenger");
|
||||
entity1.rideTick();
|
||||
@@ -253,7 +253,7 @@
|
||||
gameprofilerfiller.pop();
|
||||
Iterator iterator = entity1.getPassengers().iterator();
|
||||
|
||||
@@ -742,6 +827,7 @@
|
||||
@@ -745,6 +830,7 @@
|
||||
ChunkProviderServer chunkproviderserver = this.getChunkSource();
|
||||
|
||||
if (!flag1) {
|
||||
@@ -261,7 +261,7 @@
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.progressStartNoAbort(new ChatMessage("menu.savingLevel"));
|
||||
}
|
||||
@@ -759,11 +845,19 @@
|
||||
@@ -762,11 +848,19 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -282,7 +282,7 @@
|
||||
}
|
||||
|
||||
this.getChunkSource().getDataStorage().save();
|
||||
@@ -809,15 +903,34 @@
|
||||
@@ -812,15 +906,34 @@
|
||||
|
||||
@Override
|
||||
public boolean addFreshEntity(Entity entity) {
|
||||
@@ -320,7 +320,7 @@
|
||||
}
|
||||
|
||||
public void addDuringCommandTeleport(EntityPlayer entityplayer) {
|
||||
@@ -848,24 +961,36 @@
|
||||
@@ -851,24 +964,36 @@
|
||||
this.entityManager.addNewEntity(entityplayer);
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -879,10 +1004,32 @@
|
||||
@@ -882,10 +1007,32 @@
|
||||
entityplayer.remove(entity_removalreason);
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -891,6 +1038,12 @@
|
||||
@@ -894,6 +1041,12 @@
|
||||
double d1 = (double) blockposition.getY() - entityplayer.getY();
|
||||
double d2 = (double) blockposition.getZ() - entityplayer.getZ();
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
||||
entityplayer.connection.send(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
|
||||
}
|
||||
@@ -938,7 +1091,18 @@
|
||||
@@ -948,7 +1101,18 @@
|
||||
Iterator iterator = this.navigatingMobs.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -426,8 +426,8 @@
|
||||
+ // CraftBukkit end
|
||||
NavigationAbstract navigationabstract = entityinsentient.getNavigation();
|
||||
|
||||
if (!navigationabstract.hasDelayedRecomputation()) {
|
||||
@@ -961,10 +1125,20 @@
|
||||
if (navigationabstract.shouldRecomputePath(blockposition)) {
|
||||
@@ -984,10 +1148,20 @@
|
||||
|
||||
@Override
|
||||
public Explosion explode(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
|
||||
@@ -448,7 +448,7 @@
|
||||
if (explosion_effect == Explosion.Effect.NONE) {
|
||||
explosion.clearToBlow();
|
||||
}
|
||||
@@ -1045,13 +1219,20 @@
|
||||
@@ -1068,13 +1242,20 @@
|
||||
}
|
||||
|
||||
public <T extends ParticleParam> int sendParticles(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
|
||||
@@ -471,7 +471,7 @@
|
||||
++j;
|
||||
}
|
||||
}
|
||||
@@ -1102,7 +1283,7 @@
|
||||
@@ -1125,7 +1306,7 @@
|
||||
|
||||
@Nullable
|
||||
public BlockPosition findNearestMapFeature(StructureGenerator<?> structuregenerator, BlockPosition blockposition, int i, boolean flag) {
|
||||
@@ -480,7 +480,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1139,11 +1320,21 @@
|
||||
@@ -1162,11 +1343,21 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public WorldMap getMapData(String s) {
|
||||
@@ -503,7 +503,7 @@
|
||||
this.getServer().overworld().getDataStorage().set(s, worldmap);
|
||||
}
|
||||
|
||||
@@ -1455,6 +1646,11 @@
|
||||
@@ -1478,6 +1669,11 @@
|
||||
@Override
|
||||
public void blockUpdated(BlockPosition blockposition, Block block) {
|
||||
if (!this.isDebug()) {
|
||||
@@ -515,7 +515,7 @@
|
||||
this.updateNeighborsAt(blockposition, block);
|
||||
}
|
||||
|
||||
@@ -1474,12 +1670,12 @@
|
||||
@@ -1497,12 +1693,12 @@
|
||||
}
|
||||
|
||||
public boolean isFlat() {
|
||||
@@ -530,7 +530,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1507,7 +1703,7 @@
|
||||
@@ -1530,7 +1726,7 @@
|
||||
private static <T> String getTypeCount(Iterable<T> iterable, Function<T, String> function) {
|
||||
try {
|
||||
Object2IntOpenHashMap<String> object2intopenhashmap = new Object2IntOpenHashMap();
|
||||
@@ -539,7 +539,7 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
T t0 = iterator.next();
|
||||
@@ -1516,7 +1712,7 @@
|
||||
@@ -1539,7 +1735,7 @@
|
||||
object2intopenhashmap.addTo(s, 1);
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@
|
||||
String s1 = (String) entry.getKey();
|
||||
|
||||
return s1 + ":" + entry.getIntValue();
|
||||
@@ -1527,17 +1723,33 @@
|
||||
@@ -1550,17 +1746,33 @@
|
||||
}
|
||||
|
||||
public static void makeObsidianPlatform(WorldServer worldserver) {
|
||||
@@ -584,7 +584,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1632,6 +1844,7 @@
|
||||
@@ -1666,6 +1878,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@
|
||||
}
|
||||
|
||||
public void onTrackingEnd(Entity entity) {
|
||||
@@ -1664,6 +1877,14 @@
|
||||
@@ -1707,6 +1920,14 @@
|
||||
gameeventlistenerregistrar.onListenerRemoved(entity.level);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user