Compilation error fixes

This commit is contained in:
Nassim Jahnke 2022-06-08 15:59:48 +02:00
parent 7ece9454f7
commit b561fd8b25
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
9 changed files with 74 additions and 14 deletions

View File

@ -20,15 +20,18 @@ remains the same.
diff --git a/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java b/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java diff --git a/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java b/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..e8b4053babe46999980b92643125405064af1c04 index 0000000000000000000000000000000000000000..35551289c27735e2a77102f31ef8cae843aeb225
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java +++ b/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java
@@ -0,0 +1,46 @@ @@ -0,0 +1,64 @@
+package io.papermc.paper.util.math; +package io.papermc.paper.util.math;
+ +
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.level.levelgen.PositionalRandomFactory;
+
+import java.util.Random; +import java.util.Random;
+ +
+public final class ThreadUnsafeRandom extends Random { +public final class ThreadUnsafeRandom extends Random implements RandomSource {
+ +
+ // See javadoc and internal comments for java.util.Random where these values come from, how they are used, and the author for them. + // See javadoc and internal comments for java.util.Random where these values come from, how they are used, and the author for them.
+ private static final long multiplier = 0x5DEECE66DL; + private static final long multiplier = 0x5DEECE66DL;
@ -42,6 +45,21 @@ index 0000000000000000000000000000000000000000..e8b4053babe46999980b926431254050
+ private long seed; + private long seed;
+ +
+ @Override + @Override
+ public RandomSource fork() {
+ return new ThreadUnsafeRandom();
+ }
+
+ @Override
+ public PositionalRandomFactory forkPositional() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int nextInt(int origin, int bound) {
+ return RandomSource.super.nextInt(origin, bound);
+ }
+
+ @Override
+ public void setSeed(long seed) { + public void setSeed(long seed) {
+ // note: called by Random constructor + // note: called by Random constructor
+ this.seed = initialScramble(seed); + this.seed = initialScramble(seed);

View File

@ -15,7 +15,7 @@ will be more effective, since more time will be allocated
to actually processing chunk tasks vs the ticket level updates. to actually processing chunk tasks vs the ticket level updates.
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index b22c771ca35466574d5a73f2da3fc8762cb29487..b243de50a44099f619b2c704e51badb9b22b74b6 100644 index b22c771ca35466574d5a73f2da3fc8762cb29487..65a76e76cd101298a8cad4d23e0928ef3e08289a 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java --- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -38,6 +38,7 @@ import net.minecraft.world.level.chunk.ChunkStatus; @@ -38,6 +38,7 @@ import net.minecraft.world.level.chunk.ChunkStatus;
@ -238,6 +238,15 @@ index b22c771ca35466574d5a73f2da3fc8762cb29487..b243de50a44099f619b2c704e51badb9
} }
// Paper end // Paper end
return removed; // CraftBukkit return removed; // CraftBukkit
@@ -564,7 +638,7 @@ public abstract class DistanceManager {
}
if (flag) {
- this.ticketTracker.update(entry.getLongKey(), DistanceManager.getTicketLevelAt((SortedArraySet) entry.getValue()), false);
+ this.updateTicketLevel(entry.getLongKey(), DistanceManager.getTicketLevelAt((SortedArraySet) entry.getValue())); // Paper - replace ticket level propagator
}
if (((SortedArraySet) entry.getValue()).isEmpty()) {
@@ -587,7 +661,7 @@ public abstract class DistanceManager { @@ -587,7 +661,7 @@ public abstract class DistanceManager {
SortedArraySet<Ticket<?>> tickets = entry.getValue(); SortedArraySet<Ticket<?>> tickets = entry.getValue();
if (tickets.remove(target)) { if (tickets.remove(target)) {

View File

@ -108,6 +108,27 @@ index de882af105fae1166aced908cfe45b826a07f418..0d430382a05dfc0802a2569816c5ec87
// org.bukkit.craftbukkit.block.data.CraftWaterlogged // org.bukkit.craftbukkit.block.data.CraftWaterlogged
private static final net.minecraft.world.level.block.state.properties.BooleanProperty WATERLOGGED = getBoolean(net.minecraft.world.level.block.LightBlock.class, "waterlogged"); private static final net.minecraft.world.level.block.state.properties.BooleanProperty WATERLOGGED = getBoolean(net.minecraft.world.level.block.LightBlock.class, "waterlogged");
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java
index f070c35833b33ad2d7cfa629d8702a95e9bc6d04..5a021dc1931d35cbe235ab399aa98f3c7e93ded3 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java
@@ -51,4 +51,16 @@ public final class CraftMangroveLeaves extends org.bukkit.craftbukkit.block.data
public void setWaterlogged(boolean waterlogged) {
set(CraftMangroveLeaves.WATERLOGGED, waterlogged);
}
+
+ // Paper start
+ @Override
+ public int getMinimumDistance() {
+ return getMin(CraftMangroveLeaves.DISTANCE);
+ }
+
+ @Override
+ public int getMaximumDistance() {
+ return getMax(CraftMangroveLeaves.DISTANCE);
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java
index c6bd91bdf6bf64701ffc69619174cc3b43b72d88..c6289306f0f933b67ff1f6db63ef976df7aa5438 100644 index c6bd91bdf6bf64701ffc69619174cc3b43b72d88..c6289306f0f933b67ff1f6db63ef976df7aa5438 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Implement enchantWithLevels API
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 4a8ac558d308c4e3bc63cdd8d7071a3f9ff3aa81..4b60a9b78e410695310926e1fd319ce7d9eb5e61 100644 index 4a8ac558d308c4e3bc63cdd8d7071a3f9ff3aa81..ce64286ac5b836283318ac1ac0bd4afb29db9bb7 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -376,6 +376,21 @@ public final class CraftItemFactory implements ItemFactory { @@ -376,6 +376,21 @@ public final class CraftItemFactory implements ItemFactory {
@ -23,7 +23,7 @@ index 4a8ac558d308c4e3bc63cdd8d7071a3f9ff3aa81..4b60a9b78e410695310926e1fd319ce7
+ if (internalStack.tag != null) { + if (internalStack.tag != null) {
+ internalStack.tag.remove(net.minecraft.world.item.ItemStack.TAG_ENCH); + internalStack.tag.remove(net.minecraft.world.item.ItemStack.TAG_ENCH);
+ } + }
+ final net.minecraft.world.item.ItemStack enchanted = net.minecraft.world.item.enchantment.EnchantmentHelper.enchantItem(random, internalStack, levels, allowTreasure); + final net.minecraft.world.item.ItemStack enchanted = net.minecraft.world.item.enchantment.EnchantmentHelper.enchantItem(new org.bukkit.craftbukkit.util.RandomSourceWrapper(random), internalStack, levels, allowTreasure);
+ return CraftItemStack.asCraftMirror(enchanted); + return CraftItemStack.asCraftMirror(enchanted);
+ } + }
+ +

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity
Bad plugins doing this would cause some obvious problems... Bad plugins doing this would cause some obvious problems...
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index fc03e5ddc126a57d4ca9f158b7d0f67401e1ca4b..7deb28159c822b2a05df228028278776e5bea4d5 100644 index 0d327667f6cb1ad2adf993b14883b7967049aa02..9d8d4f4aef4f7a055f697761d31df9a285c7a2c7 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
@@ -2632,6 +2632,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2631,6 +2631,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
protected boolean addPassenger(Entity entity) { // CraftBukkit protected boolean addPassenger(Entity entity) { // CraftBukkit

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Guard against invalid entity positions
Anything not finite should be blocked and logged Anything not finite should be blocked and logged
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7deb28159c822b2a05df228028278776e5bea4d5..f8652e17a1d9779b6ca39aa251b15f49e3b2f6e1 100644 index 9d8d4f4aef4f7a055f697761d31df9a285c7a2c7..9e5e7fd12468cd409152a2c41ceb811209594a6c 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
@@ -4136,11 +4136,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4135,11 +4135,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale); return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add pre-unbreaking amount to PlayerItemDamageEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index acd80da6e249f83ccd96c3bd24c3b75d9084fc91..2772eafc6ad0b7376a4d8b3e0342634c3cdb223e 100644 index 30b307076e61c183acd5a1d900043b09f54734fc..6b3cfc19c4fd1382ddf534265a1114995a4f6b55 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -565,10 +565,11 @@ public final class ItemStack { @@ -563,10 +563,11 @@ public final class ItemStack {
} }
} }

View File

@ -4,6 +4,18 @@ Date: Thu, 7 Apr 2022 16:13:39 +0200
Subject: [PATCH] Add support for Proxy Protocol Subject: [PATCH] Add support for Proxy Protocol
diff --git a/build.gradle.kts b/build.gradle.kts
index 3ff7814add16834c70494afb76d8a7788545d009..50d35d6e60f398501af447319de9d6ccd4db8b00 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {
*/
implementation("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - implementation
annotationProcessor("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - Needed to generate meta for our Log4j plugins
+ implementation("io.netty:netty-codec-haproxy:4.1.76.Final")
// Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1") // Paper
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 72e17ac76e5f3ac1283bec2133f76bc197353dd6..d4ff14b9e6028259c27ea9cb2b4be587ebabfb41 100644 index 72e17ac76e5f3ac1283bec2133f76bc197353dd6..d4ff14b9e6028259c27ea9cb2b4be587ebabfb41 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f8652e17a1d9779b6ca39aa251b15f49e3b2f6e1..e1b7fc9fb342cc03d3447d3638f9376ef89d5543 100644 index 9e5e7fd12468cd409152a2c41ceb811209594a6c..87a2228c5c5038153935184f0e4a2f11053b202d 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
@@ -747,6 +747,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -746,6 +746,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void baseTick() { public void baseTick() {
this.level.getProfiler().push("entityBaseTick"); this.level.getProfiler().push("entityBaseTick");