More more more more more patches

This commit is contained in:
Nassim Jahnke 2023-03-14 20:54:57 +01:00
parent d2bcd5358b
commit b7ee1ae38a
146 changed files with 68 additions and 730 deletions

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption);
if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) { if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) {

View File

@ -141,16 +141,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private KeyPair keyPair; private KeyPair keyPair;
@Nullable @Nullable
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.averageTickTime = this.averageTickTime * 0.8F + (float) l / 1000000.0F * 0.19999999F; this.averageTickTime = this.averageTickTime * 0.8F + (float) j / 1000000.0F * 0.19999999F;
long i1 = Util.getNanos(); long k = Util.getNanos();
+ // Paper start + // Paper start
+ tickTimes5s.add(this.tickCount, l); + tickTimes5s.add(this.tickCount, j);
+ tickTimes10s.add(this.tickCount, l); + tickTimes10s.add(this.tickCount, j);
+ tickTimes60s.add(this.tickCount, l); + tickTimes60s.add(this.tickCount, j);
+ // Paper end + // Paper end
+ this.frameTimer.logFrameDuration(k - i);
this.frameTimer.logFrameDuration(i1 - i);
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@ -1092,19 +1092,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (newWithinViewDistance && !oldWithinViewDistance) { if (newWithinViewDistance && !oldWithinViewDistance) {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos.toLong()); ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos.toLong());
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
ServerPlayer entityplayer;
+ java.util.Map<Object, net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket> refreshPackets = new java.util.HashMap<>(); // Paper - Anti-Xray - Bypass
for (Iterator iterator = this.getPlayers(chunkcoordintpair, false).iterator(); iterator.hasNext(); entityplayer.trackChunk(chunkcoordintpair, (Packet) mutableobject.getValue())) {
entityplayer = (ServerPlayer) iterator.next();
- if (mutableobject.getValue() == null) {
- mutableobject.setValue(new ClientboundLevelChunkWithLightPacket(chunk1, this.lightEngine, (BitSet) null, (BitSet) null, true));
- }
+ Boolean shouldModify = chunk1.getLevel().chunkPacketBlockController.shouldModify(entityplayer, chunk1);
+ mutableobject.setValue(refreshPackets.computeIfAbsent(shouldModify, s -> new ClientboundLevelChunkWithLightPacket(chunk1, this.lightEngine, (BitSet) null, (BitSet) null, true, (Boolean) s))); // Paper - Anti-Xray - Bypass
}
} }
- private void playerLoadedChunk(ServerPlayer player, MutableObject<ClientboundLevelChunkWithLightPacket> cachedDataPacket, LevelChunk chunk) { - private void playerLoadedChunk(ServerPlayer player, MutableObject<ClientboundLevelChunkWithLightPacket> cachedDataPacket, LevelChunk chunk) {
@ -1130,11 +1118,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/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 { @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error // Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
- super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig))); // Paper - super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig))); // Paper
+ super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor + super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor
this.pvpMode = minecraftserver.isPvpAllowed(); this.pvpMode = minecraftserver.isPvpAllowed();
this.convertable = convertable_conversionsession; this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
@ -1176,8 +1164,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator) { // Paper - protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator) { // Paper
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor + protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
this.generator = gen; this.generator = gen;

View File

@ -28,7 +28,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity { @@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity {
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence); this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
Vec3 vec3d = shooter.getDeltaMovement(); Vec3 vec3d = shooter.getDeltaMovement();

View File

@ -22,8 +22,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
implementation("commons-lang:commons-lang:2.6") implementation("commons-lang:commons-lang:2.6")
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation + implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0")
runtimeOnly("mysql:mysql-connector-java:8.0.29") runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
@@ -0,0 +0,0 @@ tasks.check { @@ -0,0 +0,0 @@ tasks.check {
} }

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
Entity entity = this.getVehicle(); Entity entity = this.getVehicle();
super.stopRiding(suppressCancellation); // Paper - suppress super.stopRiding(suppressCancellation); // Paper - suppress

View File

@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { @@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
this.stats = server.getPlayerList().getPlayerStats(this); this.stats = server.getPlayerList().getPlayerStats(this);
this.advancements = server.getPlayerList().getPlayerAdvancements(this); this.advancements = server.getPlayerList().getPlayerAdvancements(this);
this.maxUpStep = 1.0F; this.setMaxUpStep(1.0F);
- this.fudgeSpawnLocation(world); - this.fudgeSpawnLocation(world);
+ //this.fudgeSpawnLocation(world); // Paper - don't move to spawn on login, only first join + //this.fudgeSpawnLocation(world); // Paper - don't move to spawn on login, only first join

View File

@ -15,7 +15,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.level.isClientSide()) { if (this.level.isClientSide()) {
this.level.getEntities(EntityTypeTest.forClass(net.minecraft.world.entity.player.Player.class), this.getBoundingBox(), EntitySelector.pushableBy(this)).forEach(this::doPush); this.level.getEntities(EntityTypeTest.forClass(net.minecraft.world.entity.player.Player.class), this.getBoundingBox(), EntitySelector.pushableBy(this)).forEach(this::doPush);
} else { } else {

View File

@ -151,7 +151,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting {
return this.lookControl; return this.lookControl;
} }
@ -169,8 +169,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // Paper end
+ +
public MoveControl getMoveControl() { public MoveControl getMoveControl() {
if (this.isPassenger() && this.getVehicle() instanceof Mob) { Entity entity = this.getControlledVehicle();
Mob entityinsentient = (Mob) this.getVehicle();
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
@ -325,13 +325,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.immunize(); // Paper + this.immunize(); // Paper
return true; return true;
} else { } else {
List<ItemEntity> list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25D, 0.0D, 0.25D), EntitySelector.ENTITY_STILL_ALIVE); for(ItemEntity itemEntity : this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25D, 0.0D, 0.25D), EntitySelector.ENTITY_STILL_ALIVE)) {
if (!list.isEmpty()) { if (HopperBlockEntity.addItem(this, itemEntity)) {
HopperBlockEntity.addItem(this, list.get(0)); + this.immunize(); // Paper
+ this.immunize(); // Paper return true;
}
} }
return false;
@@ -0,0 +0,0 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper @@ -0,0 +0,0 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) { public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) {
return new HopperMenu(syncId, playerInventory, this); return new HopperMenu(syncId, playerInventory, this);

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
} else if (this.isInLava() && (!this.onGround || d7 > d8)) { } else if (this.isInLava() && (!this.onGround || d7 > d8)) {
this.jumpInLiquid(FluidTags.LAVA); this.jumpInLiquid(FluidTags.LAVA);
} else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) { } else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) {

View File

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
Player player = entity.getBukkitEntity(); Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.getRawAddress()).getAddress()); PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress());
- if (this.getBans().isBanned(gameprofile) && !this.getBans().get(gameprofile).hasExpired()) { - if (this.getBans().isBanned(gameprofile) && !this.getBans().get(gameprofile).hasExpired()) {
- UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile); - UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile);

View File

@ -18,7 +18,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
} }
} }

View File

@ -74,8 +74,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
public boolean canChangeDimensions() { public boolean canChangeDimensions() {
- return true; - return !this.isPassenger() && !this.isVehicle();
+ return isAlive() && valid; // Paper + return !this.isPassenger() && !this.isVehicle() && isAlive() && valid; // Paper
} }
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
@ -83,7 +83,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
// Paper start // Paper start
org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource); org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource);
if (deathEvent == null || !deathEvent.isCancelled()) { if (deathEvent == null || !deathEvent.isCancelled()) {
@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper start - clear equipment if event is not cancelled // Paper start - clear equipment if event is not cancelled
if (this instanceof Mob) { if (this instanceof Mob) {
for (EquipmentSlot slot : this.clearedEquipmentSlots) { for (EquipmentSlot slot : this.clearedEquipmentSlots) {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.dropCustomDeathLoot(source, i, flag); this.dropCustomDeathLoot(source, i, flag);
this.clearEquipmentSlots = prev; // Paper this.clearEquipmentSlots = prev; // Paper
} }

View File

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -0,0 +0,0 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -0,0 +0,0 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.maxWorldSize = this.get("max-world-size", (integer) -> { this.maxWorldSize = this.get("max-world-size", (integer) -> {
return Mth.clamp(integer, (int) 1, 29999984); return Mth.clamp(integer, 1, 29999984);
}, 29999984); }, 29999984);
- this.syncChunkWrites = this.get("sync-chunk-writes", true); - this.syncChunkWrites = this.get("sync-chunk-writes", true);
+ this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag + this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag

View File

@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { @@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
return s; }
} }
+ // Paper start - Client option API + // Paper start - Client option API

View File

@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
public final float bobOffs; public final float bobOffs;
private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit
public boolean canMobPickup = true; // Paper public boolean canMobPickup = true; // Paper
@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public ItemEntity(EntityType<? extends ItemEntity> type, Level world) { public ItemEntity(EntityType<? extends ItemEntity> type, Level world) {
super(type, world); super(type, world);
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
} }
} }
@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start - fire ItemDespawnEvent // CraftBukkit start - fire ItemDespawnEvent
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
this.age = 0; this.age = 0;
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
this.lastTick = MinecraftServer.currentTick; this.lastTick = MinecraftServer.currentTick;
// CraftBukkit end // CraftBukkit end
@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start - fire ItemDespawnEvent // CraftBukkit start - fire ItemDespawnEvent
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
this.age = 0; this.age = 0;
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
private boolean isMergable() { private boolean isMergable() {
ItemStack itemstack = this.getItem(); ItemStack itemstack = this.getItem();
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
private void tryToMerge(ItemEntity other) { private void tryToMerge(ItemEntity other) {
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
com.google.common.base.Preconditions.checkArgument(!stack.isEmpty(), "Cannot drop air"); // CraftBukkit com.google.common.base.Preconditions.checkArgument(!stack.isEmpty(), "Cannot drop air"); // CraftBukkit
this.getEntityData().set(ItemEntity.DATA_ITEM, stack); this.getEntityData().set(ItemEntity.DATA_ITEM, stack);
this.getEntityData().markDirty(ItemEntity.DATA_ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty this.getEntityData().markDirty(ItemEntity.DATA_ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty
@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
@Override @Override
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
public void makeFakeItem() { public void makeFakeItem() {
this.setNeverPickUp(); this.setNeverPickUp();

View File

@ -23,14 +23,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java
@@ -0,0 +0,0 @@ public class IceBlock extends HalfTransparentBlock { @@ -0,0 +0,0 @@ public class IceBlock extends HalfTransparentBlock {
@Override @Override
public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) { public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool) {
super.playerDestroy(world, player, pos, state, blockEntity, stack); super.playerDestroy(world, player, pos, state, blockEntity, tool);
+ // Paper start + // Paper start
+ this.afterDestroy(world, pos, stack); + this.afterDestroy(world, pos, tool);
+ } + }
+ public void afterDestroy(Level world, BlockPos pos, ItemStack stack) { + public void afterDestroy(Level world, BlockPos pos, ItemStack tool) {
+ // Paper end + // Paper end
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) { if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) == 0) {
if (world.dimensionType().ultraWarm()) { if (world.dimensionType().ultraWarm()) {
world.removeBlock(pos, false); world.removeBlock(pos, false);
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java

View File

@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
throw new IllegalStateException("Failed to initialize server"); throw new IllegalStateException("Failed to initialize server");
} }
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.updateStatusIcon(this.status); this.status = this.buildServerStatus();
// Spigot start // Spigot start
+ // Paper start - move done tracking + // Paper start - move done tracking
@ -321,15 +321,6 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
+import net.minecraft.util.ExceptionCollector;
+import net.minecraft.world.level.lighting.LayerLightEventListener;
import net.minecrell.terminalconsole.TerminalConsoleAppender; // Paper
public class Main {
@@ -0,0 +0,0 @@ public class Main { @@ -0,0 +0,0 @@ public class Main {
OptionSet options = null; OptionSet options = null;
@ -410,9 +401,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ tryPreloadClass("com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent"); + tryPreloadClass("com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent");
+ tryPreloadClass("com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent"); + tryPreloadClass("com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent");
+ // Minecraft, seen during saving + // Minecraft, seen during saving
+ tryPreloadClass(LayerLightEventListener.DummyLightLayerEventListener.class.getName()); + tryPreloadClass(net.minecraft.world.level.lighting.LayerLightEventListener.DummyLightLayerEventListener.class.getName());
+ tryPreloadClass(LayerLightEventListener.class.getName()); + tryPreloadClass(net.minecraft.world.level.lighting.LayerLightEventListener.class.getName());
+ tryPreloadClass(ExceptionCollector.class.getName()); + tryPreloadClass(net.minecraft.util.ExceptionCollector.class.getName());
+ // Paper end + // Paper end
+ } + }
+ } + }

View File

@ -10,7 +10,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
} }
@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private void updatingUsingItem() { private void updatingUsingItem() {
if (this.isUsingItem()) { if (this.isUsingItem()) {
if (ItemStack.isSame(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { if (ItemStack.isSame(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.shouldTriggerItemUseEffects()) { if (this.shouldTriggerItemUseEffects()) {
this.triggerItemUseEffects(stack, 5); this.triggerItemUseEffects(stack, 5);
} }
@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.completeUsingItem(); this.completeUsingItem();
} }
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag
this.useItem = itemstack; this.useItem = itemstack;
@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!this.level.isClientSide) { if (!this.level.isClientSide) {
this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(1, true);
this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND); this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND);
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
} else if (!this.isUsingItem() && !this.useItem.isEmpty()) { } else if (!this.isUsingItem() && !this.useItem.isEmpty()) {
this.useItem = ItemStack.EMPTY; this.useItem = ItemStack.EMPTY;
@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
} }
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
this.useItem = ItemStack.EMPTY; this.useItem = ItemStack.EMPTY;

View File

@ -24,4 +24,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer // Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error

View File

@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return new BlockPos((int) (packedPos >> 38), (int) ((packedPos << 52) >> 52), (int) ((packedPos << 26) >> 38)); // Paper - simplify/inline + return new BlockPos((int) (packedPos >> 38), (int) ((packedPos << 52) >> 52), (int) ((packedPos << 26) >> 38)); // Paper - simplify/inline
} }
public long asLong() { public static BlockPos containing(double x, double y, double z) {
@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { @@ -0,0 +0,0 @@ public class BlockPos extends Vec3i {
} }

View File

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java --- a/src/main/java/net/minecraft/network/ConnectionProtocol.java
+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java +++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java
@@ -0,0 +0,0 @@ public enum ConnectionProtocol { @@ -0,0 +0,0 @@ public enum ConnectionProtocol implements BundlerInfo.Provider {
@Nullable @Nullable
public Packet<?> createPacket(int id, FriendlyByteBuf buf) { public Packet<?> createPacket(int id, FriendlyByteBuf buf) {

View File

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion { @@ -0,0 +0,0 @@ public class Explosion {
for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) {
BlockPos blockposition = new BlockPos(d4, d5, d6); BlockPos blockposition = BlockPos.containing(d4, d5, d6);
BlockState iblockdata = this.level.getBlockState(blockposition); BlockState iblockdata = this.level.getBlockState(blockposition);
- FluidState fluid = this.level.getFluidState(blockposition); - FluidState fluid = this.level.getFluidState(blockposition);
+ FluidState fluid = iblockdata.getFluidState(); // Paper + FluidState fluid = iblockdata.getFluidState(); // Paper

Some files were not shown because too many files have changed in this diff Show More