Skip to content

Commit

Permalink
some more compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Sep 22, 2023
1 parent 1ebaffa commit 603c33d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
6 changes: 3 additions & 3 deletions patches/server/0009-MC-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@ index 0000000000000000000000000000000000000000..a5f706d6f716b2a463ae58adcde69d9e
+}
diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
new file mode 100644
index 0000000000000000000000000000000000000000..95eac2e12a16938d81ab512b00e90c5234b42834
index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580dca31652
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
@@ -0,0 +1,295 @@
Expand Down Expand Up @@ -2898,14 +2898,14 @@ index 0000000000000000000000000000000000000000..95eac2e12a16938d81ab512b00e90c52
+ public static void onChunkHolderCreate(final ServerLevel level, final ChunkHolder holder) {
+ final ChunkMap chunkMap = level.chunkSource.chunkMap;
+ for (int index = 0, len = chunkMap.regionManagers.size(); index < len; ++index) {
+ chunkMap.regionManagers.get(index).addChunk(holder.pos.x, holder.pos.z);
+ chunkMap.regionManagers.get(index).addChunk(holder.getPos().x, holder.getPos().z);
+ }
+ }
+
+ public static void onChunkHolderDelete(final ServerLevel level, final ChunkHolder holder) {
+ final ChunkMap chunkMap = level.chunkSource.chunkMap;
+ for (int index = 0, len = chunkMap.regionManagers.size(); index < len; ++index) {
+ chunkMap.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
+ chunkMap.regionManagers.get(index).removeChunk(holder.getPos().x, holder.getPos().z);
+ }
+ }
+
Expand Down
28 changes: 15 additions & 13 deletions patches/server/0140-Basic-PlayerProfile-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/

diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
new file mode 100644
index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51652be598
index 0000000000000000000000000000000000000000..e513ce5bcb5070b8a57737228904381f1bda658e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -0,0 +1,399 @@
@@ -0,0 +1,401 @@
+package com.destroystokyo.paper.profile;
+
+import com.mojang.authlib.yggdrasil.ProfileResult;
+import io.papermc.paper.configuration.GlobalConfiguration;
+import com.google.common.base.Charsets;
+import com.google.common.collect.Iterables;
Expand All @@ -32,6 +33,7 @@ index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51
+import net.minecraft.Util;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.players.GameProfileCache;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Validate;
+import org.bukkit.configuration.serialization.SerializableAs;
+import org.bukkit.craftbukkit.configuration.ConfigSerializationUtil;
Expand Down Expand Up @@ -186,7 +188,7 @@ index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51
+
+ @Override
+ public boolean isComplete() {
+ return profile.isComplete();
+ return this.getId() != null && StringUtils.isNotBlank(this.getName());
+ }
+
+ @Override
Expand Down Expand Up @@ -239,7 +241,7 @@ index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51
+ }
+ }
+ }
+ return this.profile.isComplete();
+ return this.isComplete();
+ }
+
+ public boolean complete(boolean textures) {
Expand All @@ -249,15 +251,15 @@ index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51
+ MinecraftServer server = MinecraftServer.getServer();
+ boolean isCompleteFromCache = this.completeFromCache(true, onlineMode);
+ if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) {
+ GameProfile result = server.getSessionService().fillProfileProperties(profile, true);
+ if (result != null) {
+ copyProfileProperties(result, this.profile, true);
+ ProfileResult result = server.getSessionService().fetchProfile(this.getId(), true);
+ if (result != null && result.profile() != null) {
+ copyProfileProperties(result.profile(), this.profile, true);
+ }
+ if (this.profile.isComplete()) {
+ if (this.isComplete()) {
+ server.getProfileCache().add(this.profile);
+ }
+ }
+ return profile.isComplete() && (!onlineMode || !textures || hasTextures());
+ return this.isComplete() && (!onlineMode || !textures || hasTextures());
+ }
+
+ private static void copyProfileProperties(GameProfile source, GameProfile target) {
Expand All @@ -273,13 +275,13 @@ index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51
+ }
+
+ for (Property property : sourceProperties.values()) {
+ targetProperties.removeAll(property.getName());
+ targetProperties.put(property.getName(), property);
+ targetProperties.removeAll(property.name());
+ targetProperties.put(property.name(), property);
+ }
+ }
+
+ private static ProfileProperty toBukkit(Property property) {
+ return new ProfileProperty(property.getName(), property.getValue(), property.getSignature());
+ return new ProfileProperty(property.name(), property.value(), property.signature());
+ }
+
+ public static PlayerProfile asBukkitCopy(GameProfile gameProfile) {
Expand Down Expand Up @@ -338,7 +340,7 @@ index 0000000000000000000000000000000000000000..3ff790cec1ad89caec4be64421dd7d51
+ throw new IllegalArgumentException("Property data (" + propertyData + ") is not a valid Map");
+ }
+ Property property = CraftProfileProperty.deserialize((Map<?, ?>) propertyData);
+ profile.profile.getProperties().put(property.getName(), property);
+ profile.profile.getProperties().put(property.name(), property);
+ }
+ }
+
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0326-Duplicate-UUID-Resolve-Option.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.

diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
index 95eac2e12a16938d81ab512b00e90c5234b42834..9aea7de906103e4a8dcbcac397cc05ce1abb4aa2 100644
index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..f27644293468efc3988bea50f5b96fd117e826f8 100644
--- a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
@@ -224,7 +224,17 @@ public final class ChunkSystem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,23 @@ index 4e67a4689e8c373df611f90ca7ca7e7cfed66563..fadda21fe9e28529b48945ad07517378
}
break;
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 2e240ad721928a9a68370114ba61c21884ef1472..6c688e41b65376fdaf70de633e560f84b984dfc6 100644
index 2e240ad721928a9a68370114ba61c21884ef1472..1a72fc5368731be617f9cab72e9e756d5b2a27ee 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -51,7 +51,7 @@ public class GameRules {
public static final GameRules.Key<GameRules.BooleanValue> RULE_SENDCOMMANDFEEDBACK = GameRules.register("sendCommandFeedback", GameRules.Category.CHAT, GameRules.BooleanValue.create(true));
public static final GameRules.Key<GameRules.BooleanValue> RULE_REDUCEDDEBUGINFO = GameRules.register("reducedDebugInfo", GameRules.Category.MISC, GameRules.BooleanValue.create(false, (minecraftserver, gamerules_gameruleboolean) -> {
int i = gamerules_gameruleboolean.get() ? 22 : 23;
- Iterator iterator = minecraftserver.getPlayerList().getPlayers().iterator();
+ Iterator iterator = minecraftserver.players().iterator(); // Paper

while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
@@ -66,7 +66,7 @@ public class GameRules {
public static final GameRules.Key<GameRules.IntegerValue> RULE_MAX_ENTITY_CRAMMING = GameRules.register("maxEntityCramming", GameRules.Category.MOBS, GameRules.IntegerValue.create(24));
public static final GameRules.Key<GameRules.BooleanValue> RULE_WEATHER_CYCLE = GameRules.register("doWeatherCycle", GameRules.Category.UPDATES, GameRules.BooleanValue.create(true));
public static final GameRules.Key<GameRules.BooleanValue> RULE_LIMITED_CRAFTING = GameRules.register("doLimitedCrafting", GameRules.Category.PLAYER, GameRules.BooleanValue.create(false, (minecraftserver, gamerules_gameruleboolean) -> {
- Iterator iterator = minecraftserver.getPlayerList().getPlayers().iterator();
+ Iterator iterator = minecraftserver.players().iterator(); // Paper

while (iterator.hasNext()) {
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0925-Use-array-for-gamerule-storage.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Use array for gamerule storage


diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 6c688e41b65376fdaf70de633e560f84b984dfc6..318f3724365a72c7fd137cd4959134266ea5f5cc 100644
index 1a72fc5368731be617f9cab72e9e756d5b2a27ee..6639902efb85b4f49f26ba5f90556fb871ef8a0e 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -110,6 +110,7 @@ public class GameRules {
Expand Down

0 comments on commit 603c33d

Please sign in to comment.