geforkt von Mirrors/Paper
Patching patches
Dieser Commit ist enthalten in:
Ursprung
b748ab8e70
Commit
ee75b5dc2d
@ -17,9 +17,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import com.destroystokyo.paper.event.block.BeaconEffectEvent;
|
||||
+// Paper end
|
||||
|
||||
public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Nameable {
|
||||
|
||||
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
@@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
int j = BeaconBlockEntity.getLevel(beaconLevel);
|
||||
List list = BeaconBlockEntity.getHumansInRange(world, pos, beaconLevel);
|
||||
|
@ -115,13 +115,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -0,0 +0,0 @@ public final class NaturalSpawner {
|
||||
}
|
||||
NaturalSpawner.LOGGER.warn("Can't spawn entity of type: {}", BuiltInRegistries.ENTITY_TYPE.getKey(type));
|
||||
} catch (Exception exception) {
|
||||
NaturalSpawner.LOGGER.warn("Failed to create mob", exception);
|
||||
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public final class NaturalSpawner {
|
||||
entity = biomesettingsmobs_c.type.create(world.getLevel());
|
||||
} catch (Exception exception) {
|
||||
@ -191,18 +191,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (filechannel != null) {
|
||||
try {
|
||||
filechannel.close();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
|
||||
@@ -0,0 +0,0 @@ public class DimensionDataStorage {
|
||||
|
||||
pushbackInputStream.close();
|
||||
} catch (Throwable var15) {
|
||||
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(var15); // Paper
|
||||
try {
|
||||
fileInputStream.close();
|
||||
} catch (Throwable var10) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
@ -6,11 +6,11 @@ Subject: [PATCH] Configurable cactus bamboo and reed growth heights
|
||||
Bamboo - Both the minimum fully-grown heights and the maximum are configurable
|
||||
- Machine_Maker
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BambooBlock.java b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
|
||||
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BambooStalkBlock.java
|
||||
@@ -0,0 +0,0 @@ public class BambooStalkBlock extends Block implements BonemealableBlock {
|
||||
if (random.nextFloat() < (world.spigotConfig.bambooModifier / (100.0f * 3)) && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
int i = this.getHeightBelowUpToMax(world, pos) + 1;
|
||||
|
||||
@ -19,34 +19,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.growBamboo(state, world, pos, random, i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
|
||||
@@ -0,0 +0,0 @@ public class BambooStalkBlock extends Block implements BonemealableBlock {
|
||||
int i = this.getHeightAboveUpToMax(world, pos);
|
||||
int j = this.getHeightBelowUpToMax(world, pos);
|
||||
|
||||
- return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1;
|
||||
+ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooBlock.STAGE) != 1; // Paper
|
||||
- return i + j + 1 < 16 && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1;
|
||||
+ return i + j + 1 < ((Level) world).paperConfig().maxGrowthHeight.bamboo.max && (Integer) world.getBlockState(pos.above(i)).getValue(BambooStalkBlock.STAGE) != 1; // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
|
||||
@@ -0,0 +0,0 @@ public class BambooStalkBlock extends Block implements BonemealableBlock {
|
||||
BlockPos blockposition1 = pos.above(i);
|
||||
BlockState iblockdata1 = world.getBlockState(blockposition1);
|
||||
|
||||
- if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here
|
||||
+ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights
|
||||
- if (k >= 16 || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here
|
||||
+ if (k >= world.paperConfig().maxGrowthHeight.bamboo.max || !iblockdata1.is(Blocks.BAMBOO) || (Integer) iblockdata1.getValue(BambooStalkBlock.STAGE) == 1 || !world.isEmptyBlock(blockposition1.above())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here // Paper - Configurable cactus bamboo and reed growth heights
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
|
||||
@@ -0,0 +0,0 @@ public class BambooStalkBlock extends Block implements BonemealableBlock {
|
||||
}
|
||||
|
||||
int j = (Integer) state.getValue(BambooBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
|
||||
int j = (Integer) state.getValue(BambooStalkBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
|
||||
- int k = (height < 11 || random.nextFloat() >= 0.25F) && height != 15 ? 0 : 1;
|
||||
+ int k = (height < world.paperConfig().maxGrowthHeight.bamboo.min || random.nextFloat() >= 0.25F) && height != (world.paperConfig().maxGrowthHeight.bamboo.max - 1) ? 0 : 1; // Paper
|
||||
|
||||
// CraftBukkit start
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooBlock.AGE, j)).setValue(BambooBlock.LEAVES, blockpropertybamboosize)).setValue(BambooBlock.STAGE, k), 3)) {
|
||||
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooStalkBlock.AGE, j)).setValue(BambooStalkBlock.LEAVES, blockpropertybamboosize)).setValue(BambooStalkBlock.STAGE, k), 3)) {
|
||||
@@ -0,0 +0,0 @@ public class BambooStalkBlock extends Block implements BonemealableBlock {
|
||||
protected int getHeightAboveUpToMax(BlockGetter world, BlockPos pos) {
|
||||
int i;
|
||||
|
||||
@ -55,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
|
||||
@@ -0,0 +0,0 @@ public class BambooStalkBlock extends Block implements BonemealableBlock {
|
||||
protected int getHeightBelowUpToMax(BlockGetter world, BlockPos pos) {
|
||||
int i;
|
||||
|
@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.spawnDelay -= tickDelay; // Paper
|
||||
} else {
|
||||
boolean flag = false;
|
||||
|
||||
RandomSource randomsource = world.getRandom();
|
||||
@@ -0,0 +0,0 @@ public abstract class BaseSpawner {
|
||||
((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), MobSpawnType.SPAWNER, (SpawnGroupData) null, (CompoundTag) null);
|
||||
}
|
@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
gameprofilerfiller.popPush("iceandsnow");
|
||||
int l;
|
||||
|
||||
- if (this.random.nextInt(16) == 0) {
|
||||
+ if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
|
||||
blockposition = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, this.getBlockRandomPos(j, 0, k, 15));
|
@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return true;
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
OutgoingPlayerChatMessage outgoing = OutgoingPlayerChatMessage.create(original);
|
||||
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
|
||||
|
||||
- if (!async && s.startsWith("/")) {
|
||||
+ if (false && !async && s.startsWith("/")) { // Paper - don't handle commands in chat logic
|
||||
@ -114,7 +114,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public void chat(String msg) {
|
||||
if (this.getHandle().connection == null) return;
|
||||
|
||||
- this.getHandle().connection.chat(msg, PlayerChatMessage.system(new ChatMessageContent(msg)), false);
|
||||
- this.getHandle().connection.chat(msg, PlayerChatMessage.system(msg), false);
|
||||
+ // Paper start - improve chat handling
|
||||
+ if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) {
|
||||
+ this.getHandle().connection.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS);
|
||||
@ -124,7 +124,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ } else {
|
||||
+ // TODO text filtering
|
||||
+ // TODO chat decorating
|
||||
+ this.getHandle().connection.chat(msg, PlayerChatMessage.system(new net.minecraft.network.chat.ChatMessageContent(msg)), false);
|
||||
+ this.getHandle().connection.chat(msg, PlayerChatMessage.system(msg), false);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
@ -12727,7 +12727,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
*/
|
||||
+ Class.forName(net.minecraft.world.entity.npc.VillagerTrades.class.getName());// Paper - load this sync so it won't fail later async
|
||||
final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> {
|
||||
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, config.get(), ops.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new);
|
||||
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
@ -13548,7 +13548,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
private final ThreadedLevelLightEngine lightEngine;
|
||||
public final BlockableEventLoop<Runnable> mainThreadExecutor; // Paper - public
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
private RandomState randomState;
|
||||
private final ChunkGeneratorStructureState chunkGeneratorState;
|
||||
public final Supplier<DimensionDataStorage> overworldDataStorage;
|
||||
private final PoiManager poiManager;
|
||||
- public final LongSet toDrop;
|
||||
@ -13637,8 +13637,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.playerMap = new PlayerMap();
|
||||
this.entityMap = new Int2ObjectOpenHashMap();
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
this.chunkGeneratorState = chunkGenerator.createState(iregistrycustom.lookupOrThrow(Registries.STRUCTURE_SET), this.randomState, j);
|
||||
this.mainThreadExecutor = mainThreadExecutor;
|
||||
- ProcessorMailbox<Runnable> threadedmailbox = ProcessorMailbox.create(executor, "worldgen");
|
||||
+ // Paper - rewrite chunk system
|
||||
@ -13660,7 +13660,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.lightEngine = new ThreadedLevelLightEngine(chunkProvider, this, this.level.dimensionType().hasSkyLight(), null, null); // Paper - rewrite chunk system
|
||||
this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor);
|
||||
this.overworldDataStorage = persistentStateManagerFactory;
|
||||
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world.registryAccess(), world);
|
||||
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, iregistrycustom, world);
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
@Nullable
|
||||
@ -15336,9 +15336,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
final EntityTickList entityTickList;
|
||||
- public final PersistentEntitySectionManager<Entity> entityManager;
|
||||
+ //public final PersistentEntitySectionManager<Entity> entityManager; // Paper - rewrite chunk system
|
||||
private final GameEventDispatcher gameEventDispatcher;
|
||||
public boolean noSave;
|
||||
private final SleepStatus sleepStatus;
|
||||
private int emptyTime;
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
@ -15470,10 +15470,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.chunkSource = new ServerChunkCache(this, convertable_conversionsession, datafixer, structuretemplatemanager, executor, chunkgenerator, j, k, flag2, worldloadlistener, null, () -> { // Paper - rewrite chunk system
|
||||
return minecraftserver.overworld().getDataStorage();
|
||||
});
|
||||
chunkgenerator.ensureStructuresGenerated(this.chunkSource.randomState());
|
||||
this.chunkSource.getGeneratorState().ensureStructuresGenerated();
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
this.sleepStatus = new SleepStatus();
|
||||
this.gameEventDispatcher = new GameEventDispatcher(this);
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
+
|
||||
+ this.chunkTaskScheduler = new io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler(this, io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.workerThreads); // Paper - rewrite chunk system
|
||||
@ -15496,10 +15496,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
gameprofilerfiller.push("entityManagement");
|
||||
- this.entityManager.tick();
|
||||
+ //this.entityManager.tick(); // Paper - rewrite chunk system
|
||||
gameprofilerfiller.popPush("gameEvents");
|
||||
this.sendGameEvents();
|
||||
gameprofilerfiller.pop();
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldTickBlocksAt(long chunkPos) {
|
||||
@ -15609,7 +15607,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public String getWatchdogStats() {
|
||||
- return String.format(Locale.ROOT, "players: %s, entities: %s [%s], block_entities: %d [%s], block_ticks: %d, fluid_ticks: %d, chunk_source: %s", this.players.size(), this.entityManager.gatherStats(), ServerLevel.getTypeCount(this.entityManager.getEntityGetter().getAll(), (entity) -> {
|
||||
+ return String.format(Locale.ROOT, "players: %s, entities: %s [%s], block_entities: %d [%s], block_ticks: %d, fluid_ticks: %d, chunk_source: %s", this.players.size(), this.entityLookup.getDebugInfo(), ServerLevel.getTypeCount(this.entityLookup.getAll(), (entity) -> { // Paper - rewrite chunk system
|
||||
return Registry.ENTITY_TYPE.getKey(entity.getType()).toString();
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
|
||||
}), this.blockEntityTickers.size(), ServerLevel.getTypeCount(this.blockEntityTickers, TickingBlockEntity::getType), this.getBlockTicks().count(), this.getFluidTicks().count(), this.gatherChunkSourceStats());
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@ -15687,7 +15685,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper end - rewrite chunk system
|
||||
}
|
||||
|
||||
private final class EntityCallbacks implements LevelCallback<Entity> {
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java b/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ThreadedLevelLightEngine.java
|
||||
@ -15949,15 +15947,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
||||
|
||||
// Spigot - view distance
|
||||
- playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, worldserver1.spigotConfig.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation()));
|
||||
+ playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetTickViewDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); // Paper - replace old player chunk management
|
||||
- playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, worldserver1.spigotConfig.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation()));
|
||||
+ playerconnection.send(new ClientboundLoginPacket(player.getId(), worlddata.isHardcore(), player.gameMode.getGameModeForPlayer(), player.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.synchronizedRegistries, worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance(), worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetTickViewDistance(), flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat(), player.getLastDeathLocation())); // Paper - replace old player chunk management
|
||||
player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||
playerconnection.send(new ClientboundUpdateEnabledFeaturesPacket(FeatureFlags.REGISTRY.toNames(worldserver1.enabledFeatures())));
|
||||
playerconnection.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName())));
|
||||
playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
// CraftBukkit start
|
||||
LevelData worlddata = worldserver1.getLevelData();
|
||||
entityplayer1.connection.send(new ClientboundRespawnPacket(worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), flag, entityplayer1.getLastDeathLocation()));
|
||||
entityplayer1.connection.send(new ClientboundRespawnPacket(worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), (byte) i, entityplayer1.getLastDeathLocation()));
|
||||
- entityplayer1.connection.send(new ClientboundSetChunkCacheRadiusPacket(worldserver1.spigotConfig.viewDistance)); // Spigot
|
||||
- entityplayer1.connection.send(new ClientboundSetSimulationDistancePacket(worldserver1.spigotConfig.simulationDistance)); // Spigot
|
||||
+ entityplayer1.connection.send(new ClientboundSetChunkCacheRadiusPacket(worldserver1.getChunkSource().chunkMap.playerChunkManager.getTargetSendDistance())); // Spigot // Paper - replace old player chunk management
|
||||
@ -16441,7 +16439,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public final Optional<PoiSection> noAllocateOptional = Optional.of(this); // Paper - rewrite chunk system
|
||||
|
||||
public static Codec<PoiSection> codec(Runnable updateListener) {
|
||||
return RecordCodecBuilder.<PoiSection>create((instance) -> { // Paper - decompile fix
|
||||
return RecordCodecBuilder.<PoiSection>create((instance) -> {
|
||||
@@ -0,0 +0,0 @@ public class PoiSection {
|
||||
this(updateListener, true, ImmutableList.of());
|
||||
}
|
||||
@ -16488,7 +16486,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i);
|
||||
+ // Paper start - per player view distance - allow block updates for non-ticking chunks in player view distance
|
||||
+ // if copied from above
|
||||
+ } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((ServerLevel)this).getChunkSource().chunkMap.playerChunkManager.broadcastMap.getObjectsInRange(MCUtil.getCoordinateKey(blockposition)) != null)) { // Paper - replace old player chunk management
|
||||
+ } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((ServerLevel)this).getChunkSource().chunkMap.playerChunkManager.broadcastMap.getObjectsInRange(io.papermc.paper.util.MCUtil.getCoordinateKey(blockposition)) != null)) { // Paper - replace old player chunk management
|
||||
+ ((ServerLevel)this).getChunkSource().blockChanged(blockposition);
|
||||
+ // Paper end - per player view distance
|
||||
}
|
||||
@ -16532,30 +16530,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
this.getProfiler().incrementCounter("getEntities");
|
||||
List<T> list = Lists.newArrayList();
|
||||
|
||||
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
|
||||
this.getProfiler().incrementCounter("getEntities");
|
||||
- this.getEntities().get(filter, box, (entity) -> {
|
||||
- if (predicate.test(entity)) {
|
||||
- list.add(entity);
|
||||
- result.add(entity);
|
||||
- if (result.size() >= limit) {
|
||||
- return AbortableIterationConsumer.Continuation.ABORT;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (entity instanceof EnderDragon) {
|
||||
- EnderDragon entityenderdragon = (EnderDragon) entity;
|
||||
- EnderDragonPart[] aentitycomplexpart = entityenderdragon.getSubEntities();
|
||||
- int i = aentitycomplexpart.length;
|
||||
- int j = aentitycomplexpart.length;
|
||||
-
|
||||
- for (int j = 0; j < i; ++j) {
|
||||
- EnderDragonPart entitycomplexpart = aentitycomplexpart[j];
|
||||
- for (int k = 0; k < j; ++k) {
|
||||
- EnderDragonPart entitycomplexpart = aentitycomplexpart[k];
|
||||
- T t0 = filter.tryCast(entitycomplexpart); // CraftBukkit - decompile error
|
||||
-
|
||||
- if (t0 != null && predicate.test(t0)) {
|
||||
- list.add(t0);
|
||||
- result.add(t0);
|
||||
- if (result.size() >= limit) {
|
||||
- return AbortableIterationConsumer.Continuation.ABORT;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ // Paper start - optimise this call
|
||||
+ if (filter instanceof net.minecraft.world.entity.EntityType) {
|
||||
+ ((ServerLevel)this).getEntityLookup().getEntities((net.minecraft.world.entity.EntityType)filter, box, list, predicate);
|
||||
+ //TODO use limit
|
||||
+ if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) {
|
||||
+ ((ServerLevel) this).getEntityLookup().getEntities(entityTypeTest, box, result, predicate);
|
||||
+ } else {
|
||||
+ Predicate<? super T> test = (obj) -> {
|
||||
+ return filter.tryCast(obj) != null;
|
||||
@ -16563,22 +16568,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ predicate = predicate == null ? test : test.and((Predicate) predicate);
|
||||
+ Class base;
|
||||
+ if (filter == null || (base = filter.getBaseClass()) == null || base == Entity.class) {
|
||||
+ ((ServerLevel)this).getEntityLookup().getEntities((Entity) null, box, (List)list, (Predicate)predicate);
|
||||
+ ((ServerLevel) this).getEntityLookup().getEntities((Entity) null, box, (List) result, (Predicate)predicate);
|
||||
+ } else {
|
||||
+ ((ServerLevel)this).getEntityLookup().getEntities(base, null, box, (List)list, (Predicate)predicate); // Paper - optimise this call
|
||||
+ ((ServerLevel) this).getEntityLookup().getEntities(base, null, box, (List) result, (Predicate)predicate); // Paper - optimise this call
|
||||
}
|
||||
-
|
||||
- return AbortableIterationConsumer.Continuation.CONTINUE;
|
||||
- });
|
||||
+ }
|
||||
+ // Paper end - optimise this call
|
||||
return list;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public long nextSubTickCount() {
|
||||
return (long) (this.subTickCount++);
|
||||
|
||||
private ExplosionInteraction() {}
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ //protected final io.papermc.paper.world.EntitySliceManager entitySliceManager; // Paper - rewrite chunk system
|
||||
+
|
||||
@ -17477,7 +17482,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ } // Paper end
|
||||
}
|
||||
|
||||
public void scanChunk(ChunkPos chunkcoordintpair, StreamTagVisitor streamtagvisitor) throws IOException {
|
||||
public void scanChunk(ChunkPos chunkPos, StreamTagVisitor scanner) throws IOException {
|
||||
@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
|
@ -401,8 +401,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ 3093,
|
||||
+ 3094,
|
||||
+ 3097,
|
||||
+ 3108
|
||||
+ // All up to 1.19.1-pre2
|
||||
+ 3108,
|
||||
+ 3201,
|
||||
+ 3209,
|
||||
+ 3214
|
||||
+ // All up to 1.19.3-rc1
|
||||
+ };
|
||||
+ Arrays.sort(converterVersions);
|
||||
+
|
||||
@ -991,6 +994,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public static final int V1_19_1_PRE1 = 3107;
|
||||
+ public static final int V1_19_1_RC1 = 3109;
|
||||
+ public static final int V1_19_1_PRE2 = 3110;
|
||||
+ public static final int V22W42A = 3205;
|
||||
+ public static final int V22W43A = 3206;
|
||||
+ public static final int V22W44A = 3207;
|
||||
+ public static final int V22W45A = 3208;
|
||||
+ public static final int V22W46A = 3210;
|
||||
+ public static final int V1_19_3_PRE1 = 3211;
|
||||
+ public static final int V1_19_3_PRE2 = 3212;
|
||||
+ public static final int V1_19_3_PRE3 = 3213;
|
||||
+ public static final int V1_19_3_RC1 = 3215;
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/advancements/ConverterAbstractAdvancementsRename.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/advancements/ConverterAbstractAdvancementsRename.java
|
||||
new file mode 100644
|
||||
@ -5838,8 +5850,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:evocation_illager", "minecraft:evocation_illager_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:ghast", "minecraft:ghast_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:guardian", "minecraft:guardian_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:ender_dragon", "minecraft:ender_dragon_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:horse", "minecraft:horse_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:husk", "minecraft:husk_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:iron_golem", "minecraft:iron_golem_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:llama", "minecraft:llama_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:magma_cube", "minecraft:magma_cube_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:mooshroom", "minecraft:mooshroom_spawn_egg");
|
||||
@ -5856,6 +5870,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:skeleton", "minecraft:skeleton_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:skeleton_horse", "minecraft:skeleton_horse_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:slime", "minecraft:slime_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:snow_golem", "minecraft:snow_golem_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:spider", "minecraft:spider_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:squid", "minecraft:squid_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:stray", "minecraft:stray_spawn_egg");
|
||||
@ -5864,6 +5879,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:villager", "minecraft:villager_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:vindication_illager", "minecraft:vindication_illager_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:witch", "minecraft:witch_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:wither", "minecraft:wither_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:wither_skeleton", "minecraft:wither_skeleton_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:wolf", "minecraft:wolf_spawn_egg");
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:zombie", "minecraft:zombie_spawn_egg");
|
||||
@ -5872,8 +5888,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ENTITY_ID_TO_NEW_EGG_ID.put("minecraft:zombie_villager", "minecraft:zombie_villager_spawn_egg");
|
||||
+ }
|
||||
+
|
||||
+ public ConverterFlattenSpawnEgg() {
|
||||
+ super(MCVersions.V17W47A,5);
|
||||
+ public ConverterFlattenSpawnEgg(final int version, final int versionStep) {
|
||||
+ super(version, versionStep);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@ -6789,6 +6805,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ V3094.register();
|
||||
+ V3097.register();
|
||||
+ V3108.register();
|
||||
+ V3201.register();
|
||||
+ // V3202 registers a simple tile entity
|
||||
+ // V3203 registers a simple entity
|
||||
+ // V3204 registers a simple tile entity
|
||||
+ V3209.register();
|
||||
+ V3214.register();
|
||||
+ }
|
||||
+
|
||||
+ private MCTypeRegistry() {}
|
||||
@ -7151,7 +7173,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (textString.charAt(0) == '"' && textString.charAt(textString.length() - 1) == '"'
|
||||
+ || textString.charAt(0) == '{' && textString.charAt(textString.length() - 1) == '}') {
|
||||
+ try {
|
||||
+ component = GsonHelper.fromJson(BlockEntitySignTextStrictJsonFix.GSON, textString, Component.class, true);
|
||||
+ component = GsonHelper.fromNullableJson(BlockEntitySignTextStrictJsonFix.GSON, textString, Component.class, true);
|
||||
+ if (component == null) {
|
||||
+ component = CommonComponents.EMPTY;
|
||||
+ }
|
||||
@ -8448,7 +8470,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ MCTypeRegistry.ITEM_STACK.addStructureConverter(new ConverterFlattenItemStack());
|
||||
+
|
||||
+ // V5
|
||||
+ MCTypeRegistry.ITEM_STACK.addConverterForId("minecraft:spawn_egg", new ConverterFlattenSpawnEgg());
|
||||
+ MCTypeRegistry.ITEM_STACK.addConverterForId("minecraft:spawn_egg", new ConverterFlattenSpawnEgg(VERSION, 5));
|
||||
+ /* This datafixer has been disabled because the collar colour handler did not change from 1.12 -> 1.13 at all.
|
||||
+ // So clearly somebody fucked up. This fixes wolf colours incorrectly converting between versions
|
||||
+ MCTypeRegistry.ENTITY.addConverterForId("minecraft:wolf", new DataConverter<>(VERSION, 5) {
|
||||
@ -10833,7 +10855,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.world.scores.criteria.ObjectiveCriteria;
|
||||
+
|
||||
+public final class V1514 {
|
||||
+
|
||||
@ -10875,8 +10896,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ });
|
||||
+
|
||||
+ MCTypeRegistry.OBJECTIVE.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ private static ObjectiveCriteria.RenderType getRenderType(String string) {
|
||||
+ return string.equals("health") ? ObjectiveCriteria.RenderType.HEARTS : ObjectiveCriteria.RenderType.INTEGER;
|
||||
+ private static String getRenderType(String string) {
|
||||
+ return string.equals("health") ? "hearts" : "integer";
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@ -10888,7 +10909,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ final String criteriaName = data.getString("CriteriaName", "");
|
||||
+
|
||||
+ data.setString("RenderType", getRenderType(criteriaName).getId());
|
||||
+ data.setString("RenderType", getRenderType(criteriaName));
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
@ -11088,7 +11109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ if (!"null".equals(page) && !StringUtils.isEmpty(page)) {
|
||||
+ if (page.charAt(0) == '"' && page.charAt(page.length() - 1) == '"' || page.charAt(0) == '{' && page.charAt(page.length() - 1) == '}') {
|
||||
+ try {
|
||||
+ component = GsonHelper.fromJson(BlockEntitySignTextStrictJsonFix.GSON, page, Component.class, true);
|
||||
+ component = GsonHelper.fromNullableJson(BlockEntitySignTextStrictJsonFix.GSON, page, Component.class, true);
|
||||
+ if (component == null) {
|
||||
+ component = CommonComponents.EMPTY;
|
||||
+ }
|
||||
@ -17668,6 +17689,101 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ });
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3201.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3201.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3201.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.converters.DataConverter;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+
|
||||
+public final class V3201 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V1_19_2 + 81;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MCTypeRegistry.OPTIONS.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ private static void fixList(final MapType<String> data, final String target) {
|
||||
+ if (data == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ final String curr = data.getString(target);
|
||||
+ if (curr == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ data.setString(target, curr.replace("\"programer_art\"", "\"programmer_art\""));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ fixList(data, "resourcePacks");
|
||||
+ fixList(data, "incompatibleResourcePacks");
|
||||
+ return null;
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3209.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3209.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3209.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.converters.itemstack.ConverterFlattenSpawnEgg;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+
|
||||
+public final class V3209 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V22W45A + 1;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ // Note: This converter reads entity id from its sub data, but we need no breakpoint because entity ids are not
|
||||
+ // remapped this version
|
||||
+ MCTypeRegistry.ITEM_STACK.addConverterForId("minecraft:pig_spawn_egg", new ConverterFlattenSpawnEgg(VERSION, 0));
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3214.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3214.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3214.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.converters.DataConverter;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+
|
||||
+public final class V3214 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V1_19_3_PRE3 + 1;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MCTypeRegistry.OPTIONS.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ final String value = data.getString("ao");
|
||||
+
|
||||
+ if ("0".equals(value)) {
|
||||
+ data.setString("ao", "false");
|
||||
+ } else if ("1".equals(value) || "2".equals(value)) {
|
||||
+ data.setString("ao", "true");
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V501.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V501.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
@ -18015,12 +18131,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import ca.spottedleaf.dataconverter.types.ObjectType;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+import com.mojang.logging.LogUtils;
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.core.Registry;
|
||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||
+import net.minecraft.world.item.BlockItem;
|
||||
+import net.minecraft.world.item.Item;
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.EntityBlock;
|
||||
+import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
+import net.minecraft.world.level.block.state.BlockState;
|
||||
+import org.slf4j.Logger;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.LinkedHashMap;
|
||||
+import java.util.Map;
|
||||
+
|
||||
+public final class V704 {
|
||||
@ -18161,23 +18284,58 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:sculk_catalyst", "minecraft:sculk_catalyst");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:mangrove_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:sculk_shrieker", "minecraft:sculk_shrieker");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:chiseled_bookshelf", "minecraft:chiseled_bookshelf");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:bamboo_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:oak_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:spruce_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:birch_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:jungle_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:acacia_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:dark_oak_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:mangrove_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:bamboo_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:crimson_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:warped_hanging_sign", "minecraft:sign");
|
||||
+ ITEM_ID_TO_TILE_ENTITY_ID.put("minecraft:piglin_head", "minecraft:skull");
|
||||
+ }
|
||||
+
|
||||
+ // This class is responsible for also integrity checking the item id to tile id map here, we just use the item registry to figure it out
|
||||
+
|
||||
+ static {
|
||||
+ for (final Item item : Registry.ITEM) {
|
||||
+ for (final Item item : BuiltInRegistries.ITEM) {
|
||||
+ if (!(item instanceof BlockItem)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!(((BlockItem)item).getBlock() instanceof EntityBlock)) {
|
||||
+ if (!(((BlockItem)item).getBlock() instanceof EntityBlock entityBlock)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ final String itemName = Registry.ITEM.getKey(item).toString();
|
||||
+ if (!ITEM_ID_TO_TILE_ENTITY_ID.containsKey(itemName)) {
|
||||
+ String possibleId;
|
||||
+ try {
|
||||
+ final BlockEntity entity = entityBlock.newBlockEntity(new BlockPos(0, 0, 0), ((Block)entityBlock).defaultBlockState());
|
||||
+ if (entity != null) {
|
||||
+ possibleId = BlockEntityType.getKey(entity.getType()).toString();
|
||||
+ } else {
|
||||
+ possibleId = null;
|
||||
+ }
|
||||
+ } catch (final Throwable th) {
|
||||
+ possibleId = null;
|
||||
+ }
|
||||
+
|
||||
+ final String itemName = BuiltInRegistries.ITEM.getKey(item).toString();
|
||||
+ final String mappedTo = ITEM_ID_TO_TILE_ENTITY_ID.get(itemName);
|
||||
+ if (mappedTo == null) {
|
||||
+ LOGGER.error("Item id " + itemName + " does not contain tile mapping! (V704)");
|
||||
+ } else if (possibleId != null && !mappedTo.equals(possibleId)) {
|
||||
+ final boolean chestCase = mappedTo.equals("minecraft:chest") && possibleId.equals("minecraft:trapped_chest");
|
||||
+ final boolean signCase = mappedTo.equals("minecraft:sign") && possibleId.equals("minecraft:hanging_sign");
|
||||
+ // save data is identical for the chest and sign case, so we don't care
|
||||
+ // it's also important to note that there is no versioning for this map, so it is possible
|
||||
+ // that mapping them correctly could cause issues converting old data
|
||||
+ if (!chestCase && !signCase) {
|
||||
+ LOGGER.error("Item id " + itemName + " is mapped to the wrong tile entity! Mapped to: " + mappedTo + ", expected: " + possibleId);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
System.err.println("*** Error, this build is outdated ***");
|
||||
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");
|
@ -4495,8 +4495,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- private final BlockableEventLoop<Runnable> mainThreadExecutor;
|
||||
+ public final BlockableEventLoop<Runnable> mainThreadExecutor; // Paper - public
|
||||
public ChunkGenerator generator;
|
||||
private RandomState randomState;
|
||||
public final Supplier<DimensionDataStorage> overworldDataStorage;
|
||||
private final RandomState randomState;
|
||||
private final ChunkGeneratorStructureState chunkGeneratorState;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
|
||||
@ -4823,15 +4823,15 @@ diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
|
||||
this.hasPostProcess = blockbase_info.hasPostProcess;
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
this.emissiveRendering = blockbase_info.emissiveRendering;
|
||||
this.offsetType = (BlockBehaviour.OffsetType) blockbase_info.offsetType.apply(this.asState());
|
||||
this.spawnParticlesOnBreak = blockbase_info.spawnParticlesOnBreak;
|
||||
+ this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
return this.shapeExceedsCube;
|
||||
}
|
||||
// Paper end
|
||||
@ -4849,7 +4849,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper end - starlight
|
||||
|
||||
public void initCache() {
|
||||
if (!this.getBlock().hasDynamicShape()) {
|
||||
this.fluidState = ((Block) this.owner).getFluidState(this.asState());
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
this.cache = new BlockBehaviour.BlockStateBase.Cache(this.asState());
|
||||
}
|
||||
this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here
|
||||
@ -4929,7 +4930,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ // Paper end
|
||||
public static ChunkStatus byName(String id) {
|
||||
return (ChunkStatus) Registry.CHUNK_STATUS.get(ResourceLocation.tryParse(id));
|
||||
return (ChunkStatus) BuiltInRegistries.CHUNK_STATUS.get(ResourceLocation.tryParse(id));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
@ -5027,16 +5028,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper end - rewrite light engine
|
||||
+
|
||||
public ImposterProtoChunk(LevelChunk wrapped, boolean bl) {
|
||||
super(wrapped.getPos(), UpgradeData.EMPTY, wrapped.levelHeightAccessor, wrapped.getLevel().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), wrapped.getBlendingData());
|
||||
super(wrapped.getPos(), UpgradeData.EMPTY, wrapped.levelHeightAccessor, wrapped.getLevel().registryAccess().registryOrThrow(Registries.BIOME), wrapped.getBlendingData());
|
||||
this.wrapped = wrapped;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess {
|
||||
}
|
||||
|
||||
public LevelChunk(Level world, ChunkPos pos, UpgradeData upgradeData, LevelChunkTicks<Block> blockTickScheduler, LevelChunkTicks<Fluid> fluidTickScheduler, long inhabitedTime, @Nullable LevelChunkSection[] sectionArrayInitializer, @Nullable LevelChunk.PostLoadProcessor entityLoader, @Nullable BlendingData blendingData) {
|
||||
super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), inhabitedTime, sectionArrayInitializer, blendingData);
|
||||
- super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registries.BIOME), inhabitedTime, sectionArrayInitializer, blendingData);
|
||||
+ super(pos, upgradeData, world, world.registryAccess().registryOrThrow(Registries.BIOME)), inhabitedTime, sectionArrayInitializer, blendingData);
|
||||
+ // Paper start - rewrite light engine
|
||||
+ this.setBlockNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
|
||||
+ this.setSkyNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
|
||||
@ -5117,7 +5120,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
LevelChunkSection[] achunksection = new LevelChunkSection[i];
|
||||
boolean flag1 = world.dimensionType().hasSkyLight();
|
||||
ServerChunkCache chunkproviderserver = world.getChunkSource();
|
||||
LevelLightEngine lightengine = chunkproviderserver.getLightEngine();
|
||||
- LevelLightEngine lightengine = chunkproviderserver.getLightEngine();
|
||||
+ LevelLightEngine lightengine = chunkproviderserver.getLightEngine();;
|
||||
+ // Paper start
|
||||
+ ca.spottedleaf.starlight.common.light.SWMRNibbleArray[] blockNibbles = ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world);
|
||||
+ ca.spottedleaf.starlight.common.light.SWMRNibbleArray[] skyNibbles = ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world);
|
||||
@ -5125,7 +5129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ final int maxSection = io.papermc.paper.util.WorldUtil.getMaxLightSection(world);
|
||||
+ boolean canReadSky = world.dimensionType().hasSkyLight();
|
||||
+ // Paper end
|
||||
Registry<Biome> iregistry = world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);
|
||||
Registry<Biome> iregistry = world.registryAccess().registryOrThrow(Registries.BIOME);
|
||||
Codec<PalettedContainer<Holder<Biome>>> codec = ChunkSerializer.makeBiomeCodecRW(iregistry); // CraftBukkit - read/write
|
||||
boolean flag2 = false;
|
||||
@@ -0,0 +0,0 @@ public class ChunkSerializer {
|
||||
@ -5193,9 +5197,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ((LevelChunk)object1).setSkyNibbles(skyNibbles); // Paper - replace light impl
|
||||
} else {
|
||||
ProtoChunkTicks<Block> protochunkticklist = ProtoChunkTicks.load(nbt.getList("block_ticks", 10), (s) -> {
|
||||
return Registry.BLOCK.getOptional(ResourceLocation.tryParse(s));
|
||||
return BuiltInRegistries.BLOCK.getOptional(ResourceLocation.tryParse(s));
|
||||
@@ -0,0 +0,0 @@ public class ChunkSerializer {
|
||||
return Registry.FLUID.getOptional(ResourceLocation.tryParse(s));
|
||||
return BuiltInRegistries.FLUID.getOptional(ResourceLocation.tryParse(s));
|
||||
}, chunkPos);
|
||||
ProtoChunk protochunk = new ProtoChunk(chunkPos, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, world, iregistry, blendingdata);
|
||||
+ protochunk.setBlockNibbles(blockNibbles); // Paper - replace light impl
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren