mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-25 05:44:45 +01:00
more patches done
This commit is contained in:
parent
2744031e64
commit
8df1b4ad21
26 changed files with 46 additions and 130 deletions
patches
api
Add-ElderGuardianAppearanceEvent.patchAdd-Git-information-to-version-command-on-startup.patchAdd-PlayerSignCommandPreprocessEvent.patchAdd-more-LimitedRegion-API.patchAdd-more-line-of-sight-methods.patchAdds-PlayerArmSwingEvent.patchMissing-Entity-Behavior-API.patch
server
Add-ElderGuardianAppearanceEvent.patchAdd-more-LimitedRegion-API.patchAdds-PlayerArmSwingEvent.patchBuild-system-changes.patchEnsure-disconnect-for-book-edit-is-called-on-main.patchFix-PlayerDropItemEvent-using-wrong-item.patchFix-PotionSplashEvent-for-water-splash-potions.patchFix-commands-from-signs-not-firing-command-events.patchFix-dangerous-end-portal-logic.patchFix-invulnerable-end-crystals.patchFix-return-value-of-Block-applyBoneMeal-always-being.patchLine-Of-Sight-Changes.patchMake-item-validations-configurable.patchMissing-Entity-Behavior-API.patchOptimize-Biome-Mob-Lookups-for-Mob-Spawning.patchUse-getChunkIfLoadedImmediately-in-places.patchadd-per-world-spawn-limits.patch
unapplied/server
|
@ -65,19 +65,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public @NotNull BlockState getBlockState(int x, int y, int z) {
|
+ public @NotNull BlockState getBlockState(int x, int y, int z) {
|
||||||
+ BlockEntity entity = getDelegate().getBlockEntity(new BlockPos(x, y, z));
|
+ BlockEntity entity = getDelegate().getBlockEntity(new BlockPos(x, y, z));
|
||||||
+ return CraftMetaBlockState.createBlockState(entity.getBlockState().getBukkitMaterial(), entity.save(new CompoundTag()));
|
+ return CraftMetaBlockState.createBlockState(entity.getBlockState().getBukkitMaterial(), entity.saveWithFullMetadata());
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void scheduleBlockUpdate(int x, int y, int z) {
|
+ public void scheduleBlockUpdate(int x, int y, int z) {
|
||||||
+ BlockPos position = new BlockPos(x, y, z);
|
+ BlockPos position = new BlockPos(x, y, z);
|
||||||
+ getDelegate().getBlockTicks().scheduleTick(position, getDelegate().getBlockIfLoaded(position), 0);
|
+ getDelegate().scheduleTick(position, getDelegate().getBlockIfLoaded(position), 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void scheduleFluidUpdate(int x, int y, int z) {
|
+ public void scheduleFluidUpdate(int x, int y, int z) {
|
||||||
+ BlockPos position = new BlockPos(x, y, z);
|
+ BlockPos position = new BlockPos(x, y, z);
|
||||||
+ getDelegate().getLiquidTicks().scheduleTick(position, getDelegate().getFluidState(position).getType(), 0);
|
+ getDelegate().scheduleTick(position, getDelegate().getFluidState(position).getType(), 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ function.accept((T) entity.getBukkitEntity());
|
+ function.accept((T) entity.getBukkitEntity());
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ getDelegate().addEntity(entity, reason);
|
+ getDelegate().addFreshEntity(entity, reason);
|
||||||
+ return (T) entity.getBukkitEntity();
|
+ return (T) entity.getBukkitEntity();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -137,7 +137,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- return super.getBlockState(x, y, z);
|
- return super.getBlockState(x, y, z);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ net.minecraft.world.level.block.entity.BlockEntity entity = getHandle().getBlockEntity(new BlockPos(x, y, z));
|
+ net.minecraft.world.level.block.entity.BlockEntity entity = getHandle().getBlockEntity(new BlockPos(x, y, z));
|
||||||
+ return org.bukkit.craftbukkit.inventory.CraftMetaBlockState.createBlockState(entity.getBlockState().getBukkitMaterial(), entity.save(new CompoundTag()));
|
+ return org.bukkit.craftbukkit.inventory.CraftMetaBlockState.createBlockState(entity.getBlockState().getBukkitMaterial(), entity.saveWithFullMetadata());
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,13 +169,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void scheduleBlockUpdate(int x, int y, int z) {
|
+ public void scheduleBlockUpdate(int x, int y, int z) {
|
||||||
+ BlockPos position = new BlockPos(x, y, z);
|
+ BlockPos position = new BlockPos(x, y, z);
|
||||||
+ getHandle().getBlockTicks().scheduleTick(position, getHandle().getBlockIfLoaded(position), 0);
|
+ getHandle().scheduleTick(position, getHandle().getBlockIfLoaded(position), 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void scheduleFluidUpdate(int x, int y, int z) {
|
+ public void scheduleFluidUpdate(int x, int y, int z) {
|
||||||
+ BlockPos position = new BlockPos(x, y, z);
|
+ BlockPos position = new BlockPos(x, y, z);
|
||||||
+ getHandle().getLiquidTicks().scheduleTick(position, getHandle().getFluidState(position).getType(), 0);
|
+ getHandle().scheduleTick(position, getHandle().getFluidState(position).getType(), 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -203,7 +203,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||||
@@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
@@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
||||||
for (BlockPos lightPosition : craftData.getLights()) {
|
for (BlockPos lightPosition : craftData.getLights()) {
|
||||||
((ProtoChunk) chunk).addLight(new BlockPos((x << 4) + lightPosition.getX(), lightPosition.getY(), (z << 4) + lightPosition.getZ())); // PAIL rename addLightBlock
|
((ProtoChunk) chunk).addLight(new BlockPos((x << 4) + lightPosition.getX(), lightPosition.getY(), (z << 4) + lightPosition.getZ()));
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
|
@ -21,6 +21,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
implementation("com.googlecode.json-simple:json-simple:1.1.1") {
|
implementation("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||||
// This includes junit transitively for whatever reason
|
// This includes junit transitively for whatever reason
|
||||||
isTransitive = false
|
isTransitive = false
|
||||||
|
@@ -0,0 +0,0 @@ tasks.jar {
|
||||||
|
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||||
|
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||||
|
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||||
|
+ val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||||
|
attributes(
|
||||||
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||||
|
"Implementation-Title" to "CraftBukkit",
|
||||||
|
@@ -0,0 +0,0 @@ tasks.jar {
|
||||||
|
"Specification-Title" to "Bukkit",
|
||||||
|
"Specification-Version" to project.version,
|
||||||
|
"Specification-Vendor" to "Bukkit Team",
|
||||||
|
+ "Git-Branch" to gitBranch, // Paper
|
||||||
|
+ "Git-Commit" to gitHash, // Paper
|
||||||
|
)
|
||||||
|
for (tld in setOf("net", "com", "org")) {
|
||||||
|
attributes("$tld/bukkit", "Sealed" to true)
|
||||||
@@ -0,0 +0,0 @@ relocation {
|
@@ -0,0 +0,0 @@ relocation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
Iterator iterator = list.iterator();
|
Iterator iterator = list.iterator();
|
||||||
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||||
double d0 = this.distanceToSqr(entityliving);
|
double d0 = this.distanceToSqr((Entity) entityliving);
|
||||||
|
|
||||||
if (d0 < 16.0D && entityliving.isSensitiveToWater()) {
|
if (d0 < 16.0D && entityliving.isSensitiveToWater()) {
|
||||||
- entityliving.hurt(DamageSource.indirectMagic(entityliving, this.getOwner()), 1.0F);
|
- entityliving.hurt(DamageSource.indirectMagic(this, this.getOwner()), 1.0F);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ double intensity = 1.0D - Math.sqrt(d0) / 4.0D;
|
+ double intensity = 1.0D - Math.sqrt(d0) / 4.0D;
|
||||||
+ affected.put(entityliving.getBukkitLivingEntity(), intensity);
|
+ affected.put(entityliving.getBukkitLivingEntity(), intensity);
|
||||||
+ // entityliving.damageEntity(DamageSource.c(entityliving, this.getShooter()), 1.0F); // Paper - moved down
|
+ // entityliving.hurt(DamageSource.indirectMagic(this, this.getOwner()), 1.0F); // Paper - moved down
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
Iterator iterator1 = list1.iterator();
|
Iterator iterator1 = list1.iterator();
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||||
double d0 = this.distanceToSqr(entityliving);
|
double d0 = this.distanceToSqr((Entity) entityliving);
|
||||||
|
|
||||||
if (d0 < 16.0D) {
|
if (d0 < 16.0D) {
|
||||||
+ // Paper - diff on change, used when calling the splash event for water splash potions
|
+ // Paper - diff on change, used when calling the splash event for water splash potions
|
|
@ -23,7 +23,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ showSignClickCommandFailureMessagesToPlayer = getBoolean("show-sign-click-command-failure-msgs-to-player", showSignClickCommandFailureMessagesToPlayer);
|
+ showSignClickCommandFailureMessagesToPlayer = getBoolean("show-sign-click-command-failure-msgs-to-player", showSignClickCommandFailureMessagesToPlayer);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/io/papermc/paper/commands/DelegatingCommandSource.java b/src/main/java/io/papermc/paper/commands/DelegatingCommandSource.java
|
diff --git a/src/main/java/io/papermc/paper/commands/DelegatingCommandSource.java b/src/main/java/io/papermc/paper/commands/DelegatingCommandSource.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||||
|
@ -110,7 +109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ // Paper start - send messages back to the player
|
+ // Paper start - send messages back to the player
|
||||||
+ CommandSource commandSource = this.level.paperConfig.showSignClickCommandFailureMessagesToPlayer ? new io.papermc.paper.commands.DelegatingCommandSource(this) {
|
+ CommandSource commandSource = this.level.paperConfig.showSignClickCommandFailureMessagesToPlayer ? new io.papermc.paper.commands.DelegatingCommandSource(this) {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void sendMessage(net.minecraft.network.chat.Component message, java.util.UUID sender) {
|
+ public void sendMessage(Component message, UUID sender) {
|
||||||
+ player.sendMessage(message, sender);
|
+ player.sendMessage(message, sender);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -121,8 +120,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ } : this;
|
+ } : this;
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
// CraftBukkit - this
|
// CraftBukkit - this
|
||||||
- return new CommandSourceStack(this, Vec3.atCenterOf((Vec3i) this.worldPosition), Vec2.ZERO, (ServerLevel) this.level, 2, s, (Component) object, this.level.getServer(), player);
|
- return new CommandSourceStack(this, Vec3.atCenterOf(this.worldPosition), Vec2.ZERO, (ServerLevel) this.level, 2, s, (Component) object, this.level.getServer(), player);
|
||||||
+ return new CommandSourceStack(commandSource, Vec3.atCenterOf((Vec3i) this.worldPosition), Vec2.ZERO, (ServerLevel) this.level, 2, s, (Component) object, this.level.getServer(), player); // Paper
|
+ return new CommandSourceStack(commandSource, Vec3.atCenterOf(this.worldPosition), Vec2.ZERO, (ServerLevel) this.level, 2, s, (Component) object, this.level.getServer(), player); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
public DyeColor getColor() {
|
public DyeColor getColor() {
|
|
@ -14,9 +14,9 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
}
|
||||||
// Paper end - optimise entity tracking
|
// Paper end
|
||||||
|
|
||||||
+ // Paper start - make end portalling safe
|
+ // Paper start - make end portalling safe
|
||||||
+ public BlockPos portalBlock;
|
+ public BlockPos portalBlock;
|
||||||
|
@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ ResourceKey<Level> resourcekey = world.getTypeKey() == DimensionType.END_LOCATION ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends
|
+ ResourceKey<Level> resourcekey = world.getTypeKey() == LevelStem.END ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends
|
||||||
+ ServerLevel worldserver = world.getServer().getLevel(resourcekey);
|
+ ServerLevel worldserver = world.getServer().getLevel(resourcekey);
|
||||||
+
|
+
|
||||||
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(this.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(this.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||||
|
@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
public Entity(EntityType<?> type, Level world) {
|
public Entity(EntityType<?> type, Level world) {
|
||||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||||
this.passengers = ImmutableList.of();
|
this.passengers = ImmutableList.of();
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
}
|
||||||
|
|
||||||
this.processPortalCooldown();
|
this.processPortalCooldown();
|
|
@ -19,7 +19,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ fixInvulnerableEndCrystalExploit = getBoolean("unsupported-settings.fix-invulnerable-end-crystal-exploit", fixInvulnerableEndCrystalExploit);
|
+ fixInvulnerableEndCrystalExploit = getBoolean("unsupported-settings.fix-invulnerable-end-crystal-exploit", fixInvulnerableEndCrystalExploit);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||||
enableBrigadierConsoleHighlighting = getBoolean("settings.console.enable-brigadier-highlighting", enableBrigadierConsoleHighlighting);
|
config.set("settings.unsupported-settings.allow-headless-pistons-readme", "This setting controls if players should be able to create headless pistons.");
|
||||||
enableBrigadierConsoleCompletions = getBoolean("settings.console.enable-brigadier-completions", enableBrigadierConsoleCompletions);
|
allowHeadlessPistons = getBoolean("settings.unsupported-settings.allow-headless-pistons", false);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public static int itemValidationDisplayNameLength = 8192;
|
+ public static int itemValidationDisplayNameLength = 8192;
|
|
@ -54,4 +54,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
private final Map<EntityType<?>, MobSpawnSettings.MobSpawnCost> mobSpawnCosts = Maps.newLinkedHashMap();
|
private final Map<EntityType<?>, MobSpawnSettings.MobSpawnCost> mobSpawnCosts = Maps.newLinkedHashMap();
|
||||||
private float creatureGenerationProbability = 0.1F;
|
private float creatureGenerationProbability = 0.1F;
|
||||||
private boolean playerCanSpawn;
|
|
|
@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper
|
+ return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paper start
|
@Override
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@ -44,13 +44,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean hasChunk(int chunkX, int chunkZ) {
|
+ public boolean hasChunk(int chunkX, int chunkZ) {
|
||||||
+ return ((ServerLevel) this).getChunkIfLoaded(chunkX, chunkZ) != null;
|
+ return this.getChunkIfLoaded(chunkX, chunkZ) != null;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public ResourceKey<DimensionType> getTypeKey() {
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
return this.typeKey;
|
|
||||||
}
|
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, final DimensionType dimensionmanager, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
|
||||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
|
||||||
for (int l1 = j; l1 <= l; ++l1) {
|
for (int l1 = j; l1 <= l; ++l1) {
|
|
@ -9,10 +9,10 @@ diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/m
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.world.entity.EntityType;
|
@@ -0,0 +0,0 @@ import net.minecraft.world.Difficulty;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.monster.Vindicator;
|
import net.minecraft.world.entity.monster.Vindicator;
|
||||||
import net.minecraft.world.entity.monster.Zombie;
|
import net.minecraft.world.entity.monster.Zombie;
|
||||||
import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.EngineMode;
|
|
||||||
+import net.minecraft.world.level.NaturalSpawner;
|
+import net.minecraft.world.level.NaturalSpawner;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
@ -1,27 +0,0 @@
|
||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Professor Bloodstone <git@bloodstone.dev>
|
|
||||||
Date: Sun, 20 Jun 2021 01:14:41 +0200
|
|
||||||
Subject: [PATCH] Add git branch and commit to manifest
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/build.gradle.kts
|
|
||||||
+++ b/build.gradle.kts
|
|
||||||
@@ -0,0 +0,0 @@ tasks.jar {
|
|
||||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
|
||||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
|
||||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
|
||||||
+ val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
|
||||||
attributes(
|
|
||||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
|
||||||
"Implementation-Title" to "CraftBukkit",
|
|
||||||
@@ -0,0 +0,0 @@ tasks.jar {
|
|
||||||
"Specification-Version" to project.version,
|
|
||||||
"Specification-Vendor" to "Bukkit Team",
|
|
||||||
"Multi-Release" to "true", // Paper
|
|
||||||
+ "Git-Branch" to gitBranch, // Paper
|
|
||||||
+ "Git-Commit" to gitHash, // Paper
|
|
||||||
)
|
|
||||||
for (tld in setOf("net", "com", "org")) {
|
|
||||||
attributes("$tld/bukkit", "Sealed" to true)
|
|
|
@ -1,72 +0,0 @@
|
||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
||||||
Date: Mon, 10 May 2021 15:46:57 -0700
|
|
||||||
Subject: [PATCH] Fix incorrect status dataconverter for pre 1.13 chunks
|
|
||||||
|
|
||||||
Vanilla was setting non-populated OR non-lit chunks to empty, but
|
|
||||||
really this is just completely wrong. It should be set to "carved"
|
|
||||||
at minmum, because pre 1.13 chunks went through 3 distinct stages
|
|
||||||
of generation: carving, population, and lighting - in this order.
|
|
||||||
There is no "empty" status, because a chunk was simply carved
|
|
||||||
or it didn't exist. So mapping any chunk data to empty is simply
|
|
||||||
invalid.
|
|
||||||
|
|
||||||
If the chunk is terrain populated, then obviously it must be at
|
|
||||||
minmum "decorated." If the chunk is lit and populated, then it is marked
|
|
||||||
"mobs_spawned" (which is what Vanilla is doing, and this is the last
|
|
||||||
stage before moving to full so it looks correct).
|
|
||||||
|
|
||||||
So now here is a table representing the new status conversion:
|
|
||||||
|
|
||||||
Chunk is lit Chunk is populated Vanilla
|
|
||||||
F F empty
|
|
||||||
T F empty
|
|
||||||
F T empty
|
|
||||||
T T mobs_spawned
|
|
||||||
|
|
||||||
Chunk is lit Chunk is populated Paper
|
|
||||||
F F carved
|
|
||||||
T F carved
|
|
||||||
F T decorated
|
|
||||||
T T mobs_spawned
|
|
||||||
|
|
||||||
This should fix some problems converting old data, as the
|
|
||||||
changes here are going to prevent the chunk from being regenerated
|
|
||||||
incorrectly.
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/ChunkToProtochunkFix.java b/src/main/java/net/minecraft/util/datafix/fixes/ChunkToProtochunkFix.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/util/datafix/fixes/ChunkToProtochunkFix.java
|
|
||||||
+++ b/src/main/java/net/minecraft/util/datafix/fixes/ChunkToProtochunkFix.java
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkToProtochunkFix extends DataFix {
|
|
||||||
OpticFinder<?> opticFinder2 = DSL.fieldFinder("TileTicks", type5);
|
|
||||||
return TypeRewriteRule.seq(this.fixTypeEverywhereTyped("ChunkToProtoChunkFix", type, this.getOutputSchema().getType(References.CHUNK), (typed) -> {
|
|
||||||
return typed.updateTyped(opticFinder, type4, (typedx) -> {
|
|
||||||
- Optional<? extends Stream<? extends Dynamic<?>>> optional = typedx.getOptionalTyped(opticFinder2).flatMap((typed) -> {
|
|
||||||
- return typed.write().result();
|
|
||||||
+ Optional<? extends Stream<? extends Dynamic<?>>> optional = typedx.getOptionalTyped(opticFinder2).flatMap((it) -> { // Paper - remap fix
|
|
||||||
+ return it.write().result(); // Paper - remap fix
|
|
||||||
}).flatMap((dynamicx) -> {
|
|
||||||
return dynamicx.asStreamOpt().result();
|
|
||||||
});
|
|
||||||
Dynamic<?> dynamic = typedx.get(DSL.remainderFinder());
|
|
||||||
- boolean bl = dynamic.get("TerrainPopulated").asBoolean(false) && (!dynamic.get("LightPopulated").asNumber().result().isPresent() || dynamic.get("LightPopulated").asBoolean(false));
|
|
||||||
- dynamic = dynamic.set("Status", dynamic.createString(bl ? "mobs_spawned" : "empty"));
|
|
||||||
+ // Paper start - fix incorrect status conversion
|
|
||||||
+ // Vanilla is setting chunks to incorrect status here, they should be using at minimum carved.
|
|
||||||
+ // for populated chunks, it should be at minimum decorated
|
|
||||||
+ // and for lit and populated, mobs_spawned is correct (technically mobs_spawned should be for populated,
|
|
||||||
+ // but if it's not lit then it can't be set above lit)
|
|
||||||
+ final boolean terrainPopulated = dynamic.get("TerrainPopulated").asBoolean(false);
|
|
||||||
+ final boolean lightPopulated = dynamic.get("LightPopulated").asBoolean(false) || dynamic.get("LightPopulated").asNumber().result().isPresent();
|
|
||||||
+ final String newStatus = !terrainPopulated ? "carved" : (lightPopulated ? "mobs_spawned" : "decorated");
|
|
||||||
+
|
|
||||||
+ dynamic = dynamic.set("Status", dynamic.createString(newStatus));
|
|
||||||
+ // Paper end - fix incorrect status conversion
|
|
||||||
dynamic = dynamic.set("hasLegacyStructureData", dynamic.createBoolean(true));
|
|
||||||
Dynamic<?> dynamic3;
|
|
||||||
- if (bl) {
|
|
||||||
+ if (true) { // Paper - fix incorrect status conversion
|
|
||||||
Optional<ByteBuffer> optional2 = dynamic.get("Biomes").asByteBufferOpt().result();
|
|
||||||
if (optional2.isPresent()) {
|
|
||||||
ByteBuffer byteBuffer = optional2.get();
|
|
Loading…
Add table
Reference in a new issue