@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/WorldServer.java
|
||||
+++ b/net/minecraft/server/WorldServer.java
|
||||
@@ -35,6 +35,18 @@
|
||||
@@ -39,6 +39,18 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
public static final BlockPosition a = new BlockPosition(100, 50, 0);
|
||||
@@ -46,7 +58,7 @@
|
||||
@@ -50,7 +62,7 @@
|
||||
private final ChunkProviderServer chunkProvider;
|
||||
boolean tickingEntities;
|
||||
private final MinecraftServer server;
|
||||
@@ -28,7 +28,7 @@
|
||||
public boolean savingDisabled;
|
||||
private boolean everyoneSleeping;
|
||||
private int emptyTime;
|
||||
@@ -63,8 +75,23 @@
|
||||
@@ -67,8 +79,23 @@
|
||||
private final StructureManager structureManager;
|
||||
private final boolean Q;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
||||
return block == null || block.getBlockData().isAir();
|
||||
}, IRegistry.BLOCK::getKey, this::b);
|
||||
@@ -76,10 +103,17 @@
|
||||
@@ -80,10 +107,17 @@
|
||||
this.Q = flag1;
|
||||
this.server = minecraftserver;
|
||||
this.mobSpawners = list;
|
||||
@@ -71,9 +71,9 @@
|
||||
});
|
||||
+ // CraftBukkit end
|
||||
this.portalTravelAgent = new PortalTravelAgent(this);
|
||||
this.P();
|
||||
this.Q();
|
||||
@@ -91,14 +125,48 @@
|
||||
this.R();
|
||||
@@ -95,14 +129,48 @@
|
||||
iworlddataserver.setGameType(minecraftserver.getGamemode());
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
public void a(int i, int j, boolean flag, boolean flag1) {
|
||||
this.worldDataServer.a(i);
|
||||
@@ -189,6 +257,7 @@
|
||||
@@ -193,6 +261,7 @@
|
||||
this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
if (this.lastRainLevel != this.rainLevel) {
|
||||
this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.h, this.rainLevel)), this.getDimensionKey());
|
||||
}
|
||||
@@ -207,18 +276,47 @@
|
||||
@@ -211,18 +280,47 @@
|
||||
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.h, this.rainLevel));
|
||||
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.i, this.thunderLevel));
|
||||
}
|
||||
@@ -185,8 +185,8 @@
|
||||
if (this.getGameRules().getBoolean(GameRules.DO_WEATHER_CYCLE)) {
|
||||
this.clearWeather();
|
||||
}
|
||||
@@ -240,7 +338,7 @@
|
||||
this.aj();
|
||||
@@ -244,7 +342,7 @@
|
||||
this.ak();
|
||||
this.ticking = false;
|
||||
gameprofilerfiller.exitEnter("entities");
|
||||
- boolean flag3 = !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty();
|
||||
@@ -194,7 +194,7 @@
|
||||
|
||||
if (flag3) {
|
||||
this.resetEmptyTime();
|
||||
@@ -259,6 +357,7 @@
|
||||
@@ -263,6 +361,7 @@
|
||||
Entity entity = (Entity) entry.getValue();
|
||||
Entity entity1 = entity.getVehicle();
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
if (!this.server.getSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) {
|
||||
entity.die();
|
||||
}
|
||||
@@ -266,6 +365,7 @@
|
||||
@@ -270,6 +369,7 @@
|
||||
if (!this.server.getSpawnNPCs() && entity instanceof NPC) {
|
||||
entity.die();
|
||||
}
|
||||
@@ -210,7 +210,7 @@
|
||||
|
||||
gameprofilerfiller.enter("checkDespawn");
|
||||
if (!entity.dead) {
|
||||
@@ -340,7 +440,7 @@
|
||||
@@ -344,7 +444,7 @@
|
||||
}
|
||||
|
||||
private void wakeupPlayers() {
|
||||
@@ -219,7 +219,7 @@
|
||||
entityplayer.wakeup(false, false);
|
||||
});
|
||||
}
|
||||
@@ -367,14 +467,14 @@
|
||||
@@ -371,14 +471,14 @@
|
||||
entityhorseskeleton.t(true);
|
||||
entityhorseskeleton.setAgeRaw(0);
|
||||
entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
@@ -236,7 +236,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,11 +485,11 @@
|
||||
@@ -389,11 +489,11 @@
|
||||
BiomeBase biomebase = this.getBiome(blockposition);
|
||||
|
||||
if (biomebase.a(this, blockposition1)) {
|
||||
@@ -250,7 +250,7 @@
|
||||
}
|
||||
|
||||
if (flag && this.getBiome(blockposition1).c() == BiomeBase.Precipitation.RAIN) {
|
||||
@@ -436,7 +536,7 @@
|
||||
@@ -440,7 +540,7 @@
|
||||
protected BlockPosition a(BlockPosition blockposition) {
|
||||
BlockPosition blockposition1 = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, blockposition);
|
||||
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getBuildHeight(), blockposition1.getZ()))).g(3.0D);
|
||||
@@ -259,7 +259,7 @@
|
||||
return entityliving != null && entityliving.isAlive() && this.e(entityliving.getChunkCoordinates());
|
||||
});
|
||||
|
||||
@@ -465,7 +565,7 @@
|
||||
@@ -469,7 +569,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
++i;
|
||||
} else if (entityplayer.isSleeping()) {
|
||||
++j;
|
||||
@@ -483,10 +583,22 @@
|
||||
@@ -487,10 +587,22 @@
|
||||
}
|
||||
|
||||
private void clearWeather() {
|
||||
@@ -293,7 +293,7 @@
|
||||
}
|
||||
|
||||
public void resetEmptyTime() {
|
||||
@@ -527,6 +639,7 @@
|
||||
@@ -531,6 +643,7 @@
|
||||
});
|
||||
gameprofilerfiller.c("tickNonPassenger");
|
||||
entity.tick();
|
||||
@@ -301,7 +301,7 @@
|
||||
gameprofilerfiller.exit();
|
||||
}
|
||||
|
||||
@@ -615,6 +728,7 @@
|
||||
@@ -619,6 +732,7 @@
|
||||
ChunkProviderServer chunkproviderserver = this.getChunkProvider();
|
||||
|
||||
if (!flag1) {
|
||||
@@ -309,7 +309,7 @@
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel"));
|
||||
}
|
||||
@@ -626,11 +740,19 @@
|
||||
@@ -630,11 +744,19 @@
|
||||
|
||||
chunkproviderserver.save(flag);
|
||||
}
|
||||
@@ -323,14 +323,14 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
private void ai() {
|
||||
private void aj() {
|
||||
if (this.dragonBattle != null) {
|
||||
- this.server.getSaveData().a(this.dragonBattle.a());
|
||||
+ this.worldDataServer.a(this.dragonBattle.a()); // CraftBukkit
|
||||
}
|
||||
|
||||
this.getChunkProvider().getWorldPersistentData().a();
|
||||
@@ -691,11 +813,24 @@
|
||||
@@ -695,11 +817,24 @@
|
||||
|
||||
@Override
|
||||
public boolean addEntity(Entity entity) {
|
||||
@@ -357,7 +357,7 @@
|
||||
}
|
||||
|
||||
public void addEntityTeleport(Entity entity) {
|
||||
@@ -745,13 +880,18 @@
|
||||
@@ -749,13 +884,18 @@
|
||||
this.registerEntity(entityplayer);
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@
|
||||
IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX() / 16.0D), MathHelper.floor(entity.locZ() / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
|
||||
|
||||
if (!(ichunkaccess instanceof Chunk)) {
|
||||
@@ -780,7 +920,7 @@
|
||||
@@ -784,7 +924,7 @@
|
||||
if (entity1 == null) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -387,7 +387,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -809,11 +949,16 @@
|
||||
@@ -813,11 +953,16 @@
|
||||
}
|
||||
|
||||
public boolean addAllEntitiesSafely(Entity entity) {
|
||||
@@ -397,7 +397,7 @@
|
||||
+
|
||||
+ public boolean addAllEntitiesSafely(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
|
||||
+ // CraftBukkit end
|
||||
if (entity.co().anyMatch(this::isUUIDTaken)) {
|
||||
if (entity.cp().anyMatch(this::isUUIDTaken)) {
|
||||
return false;
|
||||
} else {
|
||||
- this.addAllEntities(entity);
|
||||
@@ -406,7 +406,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,10 +1008,17 @@
|
||||
@@ -867,10 +1012,17 @@
|
||||
}
|
||||
|
||||
this.getScoreboard().a(entity);
|
||||
@@ -424,7 +424,7 @@
|
||||
}
|
||||
|
||||
private void registerEntity(Entity entity) {
|
||||
@@ -887,9 +1039,16 @@
|
||||
@@ -891,9 +1043,16 @@
|
||||
|
||||
this.entitiesByUUID.put(entity.getUniqueID(), entity);
|
||||
this.getChunkProvider().addEntity(entity);
|
||||
@@ -441,7 +441,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -919,10 +1078,33 @@
|
||||
@@ -923,10 +1082,33 @@
|
||||
this.everyoneSleeping();
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -931,6 +1113,12 @@
|
||||
@@ -935,6 +1117,12 @@
|
||||
double d1 = (double) blockposition.getY() - entityplayer.locY();
|
||||
double d2 = (double) blockposition.getZ() - entityplayer.locZ();
|
||||
|
||||
@@ -488,7 +488,7 @@
|
||||
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
|
||||
}
|
||||
@@ -991,10 +1179,20 @@
|
||||
@@ -995,10 +1183,20 @@
|
||||
|
||||
@Override
|
||||
public Explosion createExplosion(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
|
||||
@@ -509,7 +509,7 @@
|
||||
if (explosion_effect == Explosion.Effect.NONE) {
|
||||
explosion.clearBlocks();
|
||||
}
|
||||
@@ -1059,13 +1257,20 @@
|
||||
@@ -1063,13 +1261,20 @@
|
||||
}
|
||||
|
||||
public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
|
||||
@@ -532,7 +532,7 @@
|
||||
++j;
|
||||
}
|
||||
}
|
||||
@@ -1107,7 +1312,7 @@
|
||||
@@ -1111,7 +1316,7 @@
|
||||
|
||||
@Nullable
|
||||
public BlockPosition a(StructureGenerator<?> structuregenerator, BlockPosition blockposition, int i, boolean flag) {
|
||||
@@ -541,7 +541,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1145,7 +1350,13 @@
|
||||
@@ -1149,7 +1354,13 @@
|
||||
@Override
|
||||
public WorldMap a(String s) {
|
||||
return (WorldMap) this.getMinecraftServer().E().getWorldPersistentData().b(() -> {
|
||||
@@ -556,7 +556,7 @@
|
||||
}, s);
|
||||
}
|
||||
|
||||
@@ -1456,6 +1667,11 @@
|
||||
@@ -1460,6 +1671,11 @@
|
||||
@Override
|
||||
public void update(BlockPosition blockposition, Block block) {
|
||||
if (!this.isDebugWorld()) {
|
||||
@@ -568,7 +568,7 @@
|
||||
this.applyPhysics(blockposition, block);
|
||||
}
|
||||
|
||||
@@ -1470,12 +1686,12 @@
|
||||
@@ -1474,12 +1690,12 @@
|
||||
}
|
||||
|
||||
public boolean isFlatWorld() {
|
||||
@@ -583,7 +583,38 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1494,16 +1710,32 @@
|
||||
@@ -1499,9 +1715,9 @@
|
||||
|
||||
@VisibleForTesting
|
||||
public String F() {
|
||||
- return String.format("players: %s, entities: %d [%s], block_entities: %d [%s], block_ticks: %d, fluid_ticks: %d, chunk_source: %s", this.players.size(), this.entitiesById.size(), a((Collection) this.entitiesById.values(), (entity) -> {
|
||||
+ return String.format("players: %s, entities: %d [%s], block_entities: %d [%s], block_ticks: %d, fluid_ticks: %d, chunk_source: %s", this.players.size(), this.entitiesById.size(), a(this.entitiesById.values(), (entity) -> { // CraftBukkit - decompile error
|
||||
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType());
|
||||
- }), this.tileEntityListTick.size(), a((Collection) this.tileEntityListTick, (tileentity) -> {
|
||||
+ }), this.tileEntityListTick.size(), a(this.tileEntityListTick, (tileentity) -> { // CraftBukkit - decompile error
|
||||
return IRegistry.BLOCK_ENTITY_TYPE.getKey(tileentity.getTileType());
|
||||
}), this.getBlockTickList().a(), this.getFluidTickList().a(), this.P());
|
||||
}
|
||||
@@ -1509,7 +1725,7 @@
|
||||
private static <T> String a(Collection<T> collection, Function<T, MinecraftKey> function) {
|
||||
try {
|
||||
Object2IntOpenHashMap<MinecraftKey> object2intopenhashmap = new Object2IntOpenHashMap();
|
||||
- Iterator iterator = collection.iterator();
|
||||
+ Iterator<T> iterator = collection.iterator(); // CraftBukkit - decompile error
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
T t0 = iterator.next();
|
||||
@@ -1518,7 +1734,8 @@
|
||||
object2intopenhashmap.addTo(minecraftkey, 1);
|
||||
}
|
||||
|
||||
- return (String) object2intopenhashmap.object2IntEntrySet().stream().sorted(Comparator.comparing(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry::getIntValue).reversed()).limit(5L).map((it_unimi_dsi_fastutil_objects_object2intmap_entry) -> {
|
||||
+ // CraftBukkit - decompile error
|
||||
+ return (String) object2intopenhashmap.object2IntEntrySet().stream().sorted(Comparator.comparing(it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<MinecraftKey>::getIntValue).reversed()).limit(5L).map((it_unimi_dsi_fastutil_objects_object2intmap_entry) -> {
|
||||
return it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey() + ":" + it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue();
|
||||
}).collect(Collectors.joining(","));
|
||||
} catch (Exception exception) {
|
||||
@@ -1527,16 +1744,32 @@
|
||||
}
|
||||
|
||||
public static void a(WorldServer worldserver) {
|
||||
|
||||
Reference in New Issue
Block a user