mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-23 15:00:30 +01:00
more more more more more more more more work
This commit is contained in:
parent
772fb3e385
commit
32d9c6684b
32 changed files with 82 additions and 81 deletions
|
@ -5,19 +5,19 @@ Subject: [PATCH] Validate usernames
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index ed3af916dfa875dd0a5f1e730d20d11efd6419c6..cd4e76fe5b79c7d9e615b4886a568c74db757436 100644
|
||||
index f10647075a55630d91673ef3ccf91f9079f69d37..542cd004b9ebee8c5bfc96d6ae0dc6820dfc6692 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -60,6 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -61,6 +61,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
private GameProfile authenticatedProfile;
|
||||
private final String serverId;
|
||||
@Nullable
|
||||
private ServerPlayer delayedAcceptPlayer;
|
||||
private ServerPlayer player; // CraftBukkit
|
||||
+ public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding
|
||||
|
||||
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
|
||||
this.state = ServerLoginPacketListenerImpl.State.HELLO;
|
||||
@@ -212,10 +213,38 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
// Paper end
|
||||
@@ -132,10 +133,38 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
return this.requestedUsername != null ? this.requestedUsername + " (" + s + ")" : s;
|
||||
}
|
||||
|
||||
+ // Paper start - validate usernames
|
||||
|
@ -52,14 +52,14 @@ index ed3af916dfa875dd0a5f1e730d20d11efd6419c6..cd4e76fe5b79c7d9e615b4886a568c74
|
|||
+ }
|
||||
+ }
|
||||
+ // Paper end - validate usernames
|
||||
this.requestedUsername = packet.name();
|
||||
GameProfile gameprofile = this.server.getSingleplayerProfile();
|
||||
|
||||
if (gameprofile != null && packet.name().equalsIgnoreCase(gameprofile.getName())) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 64e40e3caa85bff9382a483237301a8f231d1991..d25aa54689360e89b18535da54ce2c90ab21f819 100644
|
||||
index 3542ba4c043e4d38caa191efbabfa98092228a84..2580b728ee74f69d0788aae8c4f16ecd1dcec999 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -673,7 +673,7 @@ public abstract class PlayerList {
|
||||
@@ -660,7 +660,7 @@ public abstract class PlayerList {
|
||||
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
entityplayer = (ServerPlayer) this.players.get(i);
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b54a3dcbd94582158a7119b92b02be5a4e32877c..18269a33f6eb3623fbfa6dd551426515404e8c95 100644
|
||||
index ee8d5345e8ce8e0e082d82e9e52f5918f92a242e..d9ec9577d3686cafe6f9a9e33361b8f04c5089b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -561,7 +561,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -550,7 +550,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver));
|
||||
LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey);
|
||||
|
||||
|
@ -18,10 +18,10 @@ index b54a3dcbd94582158a7119b92b02be5a4e32877c..18269a33f6eb3623fbfa6dd551426515
|
|||
biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2b4167581303c79ead5628745efb7a0fa87cf405..a49a2225e18e069e4c2bf12a15d411a5a63c7313 100644
|
||||
index 8dc88ba48dbbf97c41d15cd1f01a5292b4e5a56c..86558a2080973ab2810085ee3d713285bf56e40d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1221,7 +1221,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1224,7 +1224,7 @@ public final class CraftServer implements Server {
|
||||
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
|
||||
LevelStem worlddimension = iregistry.get(actualDimension);
|
||||
|
||||
|
@ -31,7 +31,7 @@ index 2b4167581303c79ead5628745efb7a0fa87cf405..a49a2225e18e069e4c2bf12a15d411a5
|
|||
biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index dfcf7748ef45d35538e65f655f3a892f582435ca..0159eb5302c73dd51daa11f100901acc431449c0 100644
|
||||
index 888a60457bfbfd364e91b9e3d5c9df9dc7a2c564..54809679dcc4307b91af1e97e6bf0395d6baf403 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -202,6 +202,30 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
@ -22,10 +22,10 @@ index ee37ec0de1ca969144824427ae42b0c81434a1b4..4ebe22ac20f1a98694cc3bec570ef5bb
|
|||
this.name = buf.readUtf();
|
||||
this.method = buf.readByte();
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerScoreboard.java b/src/main/java/net/minecraft/server/ServerScoreboard.java
|
||||
index 610d312b9c8f6c8d1f102e8ba2fe9fc2cc3e98c5..3a4a0727ad44322e3ba85512cd077808dab080b7 100644
|
||||
index e84332b6f031e83283c1b6e90bb82a6053ff46d7..03d13c2425170a6513ea7442a4a12fc9aa6e211d 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerScoreboard.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerScoreboard.java
|
||||
@@ -92,6 +92,25 @@ public class ServerScoreboard extends Scoreboard {
|
||||
@@ -95,6 +95,25 @@ public class ServerScoreboard extends Scoreboard {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ index 610d312b9c8f6c8d1f102e8ba2fe9fc2cc3e98c5..3a4a0727ad44322e3ba85512cd077808
|
|||
@Override
|
||||
public void removePlayerFromTeam(String playerName, PlayerTeam team) {
|
||||
super.removePlayerFromTeam(playerName, team);
|
||||
@@ -99,6 +118,17 @@ public class ServerScoreboard extends Scoreboard {
|
||||
@@ -102,6 +121,17 @@ public class ServerScoreboard extends Scoreboard {
|
||||
this.setDirty();
|
||||
}
|
||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable height for slime spawn
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
index b0c5324dadc0a66786ec5edb7b4796ceeaa8e0d2..5aa702d68096af180340feb65a07856301b4f258 100644
|
||||
index 21311d67565443b4ef59f8676f616237d28a8084..48a420b7455f872c351e04be3918808e51b192ed 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
@@ -322,7 +322,11 @@ public class Slime extends Mob implements Enemy {
|
||||
@@ -329,7 +329,11 @@ public class Slime extends Mob implements Enemy {
|
||||
|
||||
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
|
||||
if (world.getDifficulty() != Difficulty.PEACEFUL) {
|
||||
|
@ -21,7 +21,7 @@ index b0c5324dadc0a66786ec5edb7b4796ceeaa8e0d2..5aa702d68096af180340feb65a078563
|
|||
return checkMobSpawnRules(type, world, spawnReason, pos, random);
|
||||
}
|
||||
|
||||
@@ -333,7 +337,10 @@ public class Slime extends Mob implements Enemy {
|
||||
@@ -340,7 +344,10 @@ public class Slime extends Mob implements Enemy {
|
||||
ChunkPos chunkcoordintpair = new ChunkPos(pos);
|
||||
boolean flag = world.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper
|
||||
|
|
@ -5,13 +5,13 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index cd4e76fe5b79c7d9e615b4886a568c74db757436..3fcd7bfdb8945b276c94a263e9da6b85ce470366 100644
|
||||
index 542cd004b9ebee8c5bfc96d6ae0dc6820dfc6692..ced150fa9160310408f57e89d115de740097eaf5 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -371,7 +371,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -326,7 +326,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
|
||||
// Paper start
|
||||
com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);
|
||||
com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile);
|
||||
- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress
|
||||
+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile, ServerLoginPacketListenerImpl.this.connection.hostname); // Paper - add rawAddress & hostname
|
||||
server.getPluginManager().callEvent(asyncEvent);
|
|
@ -9,10 +9,10 @@ so this resets it after each call to
|
|||
Zombie#getExperienceReward
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index e58c3e2163be271ff2668a55098ea8f48f8636ad..3f8c1d1d3c408fc4f15c4b5680bc22c86f104a9d 100644
|
||||
index b13365fe65507ad2935797a31baa8474b018f516..1ddbba72a5fd3d225b651815a38d178941fba289 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -174,11 +174,16 @@ public class Zombie extends Monster {
|
||||
@@ -175,11 +175,16 @@ public class Zombie extends Monster {
|
||||
|
||||
@Override
|
||||
public int getExperienceReward() {
|
|
@ -7,10 +7,10 @@ Makes the PlayerKickEvent fire on the main thread for
|
|||
illegal characters or chat out-of-order errors.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 6345d9d3ade4c490e4a6266fc5ecbd5b2de8ddeb..9535d8effbc588b69df9dba9aba4b3090370ae69 100644
|
||||
index 735b47f2c452229f7d6951b5b1869ef40b14d26b..46a5cc73b1fef1cfa69e110619eedc431e1b7fa9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2167,7 +2167,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2007,7 +2007,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
|
||||
|
@ -20,7 +20,7 @@ index 6345d9d3ade4c490e4a6266fc5ecbd5b2de8ddeb..9535d8effbc588b69df9dba9aba4b309
|
|||
} else {
|
||||
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
|
||||
|
||||
@@ -2201,7 +2203,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2040,7 +2042,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@Override
|
||||
public void handleChatCommand(ServerboundChatCommandPacket packet) {
|
||||
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
|
||||
|
@ -30,7 +30,7 @@ index 6345d9d3ade4c490e4a6266fc5ecbd5b2de8ddeb..9535d8effbc588b69df9dba9aba4b309
|
|||
} else {
|
||||
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
|
||||
|
||||
@@ -2287,7 +2291,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2126,7 +2130,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
||||
if (!this.updateChatOrder(timestamp)) {
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
|
|
@ -24,10 +24,10 @@ index f96d61bdeb556665d6e6e5023f9d77fd82204e89..e3f355c85eb7cc8c1683e3009502c10a
|
|||
public void write(FriendlyByteBuf buf) {
|
||||
buf.writeLong(this.sectionPos.asLong());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index cda8b48a77fc23a674b9e3ef1b60649bcac294f8..166c7d1c23862b65b332ca6573a2a75c5926c9e8 100644
|
||||
index 610075864157c5db7f09b60228f22b615928cb21..91d572075ea018e4768f11115723d67b06018bf0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -889,6 +889,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -849,6 +849,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(packet);
|
||||
}
|
||||
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Freeze Tick Lock API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d441db38210b15c6fae5a1632f4e2372c7a04b7c..ceddbc2e0fdec358bd7776af264df33696ecbd6d 100644
|
||||
index addd14088a5fa1671345de1537fbbd9d57dd4b40..353cf7574aea63413899a4b6d5edf43cc675c1da 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -402,6 +402,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -401,6 +401,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
private org.bukkit.util.Vector origin;
|
||||
@javax.annotation.Nullable
|
||||
private UUID originWorld;
|
||||
|
@ -16,7 +16,7 @@ index d441db38210b15c6fae5a1632f4e2372c7a04b7c..ceddbc2e0fdec358bd7776af264df336
|
|||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -833,7 +834,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -749,7 +750,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setRemainingFireTicks(this.remainingFireTicks - 1);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ index d441db38210b15c6fae5a1632f4e2372c7a04b7c..ceddbc2e0fdec358bd7776af264df336
|
|||
this.setTicksFrozen(0);
|
||||
this.level().levelEvent((Player) null, 1009, this.blockPosition, 1);
|
||||
}
|
||||
@@ -2417,6 +2418,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2299,6 +2300,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (fromNetherPortal) {
|
||||
nbt.putBoolean("Paper.FromNetherPortal", true);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ index d441db38210b15c6fae5a1632f4e2372c7a04b7c..ceddbc2e0fdec358bd7776af264df336
|
|||
// Paper end
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
@@ -2582,6 +2586,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2464,6 +2468,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (spawnReason == null) {
|
||||
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
|
||||
}
|
||||
|
@ -46,10 +46,10 @@ index d441db38210b15c6fae5a1632f4e2372c7a04b7c..ceddbc2e0fdec358bd7776af264df336
|
|||
|
||||
} catch (Throwable throwable) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index a35e59544786776391ba135f247ac1a28be3d754..50ee81007ae10f68aa40a666605203862f5e20a8 100644
|
||||
index 2a23448e756199b631355cd10b567ea1d54caa37..7b4a04193f783a077cfec47887fc6b76b3985d8d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3417,7 +3417,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3446,7 +3446,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
this.level().getProfiler().pop();
|
||||
this.level().getProfiler().push("freezing");
|
||||
|
@ -59,7 +59,7 @@ index a35e59544786776391ba135f247ac1a28be3d754..50ee81007ae10f68aa40a66660520386
|
|||
|
||||
if (this.isInPowderSnow && this.canFreeze()) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index d976796c6e80d8abc5c110bdefc09f63cfc4a60a..f61d3cd3cdbfe17f6818fbbb163f80ba3de50ca1 100644
|
||||
index f05d8107368e639adf60f3e5d944c65300087a3c..87c303ff576cd05291d50d5676e86ca93a13b301 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -669,6 +669,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
@ -5,13 +5,14 @@ Subject: [PATCH] More PotionEffectType API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
|
||||
index 5a8c29cc117ce9478cc205f6fdbe63d227268775..3bda325cfd5d0d8dcc878cf547c9ae9e82fde240 100644
|
||||
index 8f63c21186d8daa290286676bc2478d8629c533b..b3b7a4694f599d936f365e22d6190e6180cde617 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
|
||||
@@ -105,4 +105,46 @@ public class CraftPotionEffectType extends PotionEffectType {
|
||||
public Color getColor() {
|
||||
return Color.fromRGB(this.handle.getColor());
|
||||
@@ -128,4 +128,47 @@ public class CraftPotionEffectType extends PotionEffectType {
|
||||
return CraftRegistry.getMinecraftRegistry(Registries.MOB_EFFECT)
|
||||
.getOptional(CraftNamespacedKey.toMinecraft(bukkit.getKey())).orElseThrow();
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public org.bukkit.NamespacedKey getKey() {
|
|
@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a49a2225e18e069e4c2bf12a15d411a5a63c7313..86364d6f0792a9656d1ecb9537cf1cb2c064bca9 100644
|
||||
index 86558a2080973ab2810085ee3d713285bf56e40d..527a93067e8d134e77ca80cde554e0212c1568da 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2012,6 +2012,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2015,6 +2015,13 @@ public final class CraftServer implements Server {
|
||||
return console.console;
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ seeds/salts to the frequency reducer which has a similar effect.
|
|||
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
index eee2239cd715d01c5adbf1cd79282e115f42cd2e..8bab3fcfc6aa6c0b37621474a69f15e94bda2113 100644
|
||||
index a94ddf0d9a72ce9507a146fa935197b5685a7dd1..9cdfc9e7614708934cc05146f1464c187d736aed 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -568,7 +568,7 @@ public abstract class ChunkGenerator {
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Implement regenerateChunk
|
|||
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0159eb5302c73dd51daa11f100901acc431449c0..9c7d9ab63cd24e58a0e0e5af15fc434f8811591a 100644
|
||||
index 54809679dcc4307b91af1e97e6bf0395d6baf403..a37f411baab87fa0c13b1379e23cd0b62ed67de2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -141,6 +141,7 @@ import org.jetbrains.annotations.NotNull;
|
|
@ -20,10 +20,10 @@ index e581dc10f3c805f7f8b6e4c842092609e7e1a0f8..b0204af850ee182773ad458208cccd94
|
|||
}
|
||||
return InteractionResult.FAIL;
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index afbf619feb35751046131e7b22791e789d16427f..f62585f3112886c927f1f65f982b9db9194457e9 100644
|
||||
index d6f833583c6ae915133b055768d7fcb97680a640..710369e06f66c033dbfa551b0c00362009938e44 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -353,7 +353,7 @@ public final class ItemStack {
|
||||
@@ -358,7 +358,7 @@ public final class ItemStack {
|
||||
int oldCount = this.getCount();
|
||||
ServerLevel world = (ServerLevel) context.getLevel();
|
||||
|
||||
|
@ -32,7 +32,7 @@ index afbf619feb35751046131e7b22791e789d16427f..f62585f3112886c927f1f65f982b9db9
|
|||
world.captureBlockStates = true;
|
||||
// special case bonemeal
|
||||
if (item == Items.BONE_MEAL) {
|
||||
@@ -412,7 +412,7 @@ public final class ItemStack {
|
||||
@@ -417,7 +417,7 @@ public final class ItemStack {
|
||||
world.capturedBlockStates.clear();
|
||||
if (blocks.size() > 1) {
|
||||
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
|
|||
Copies appropriate checks from CraftWorld#getSpawnLimit
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 86364d6f0792a9656d1ecb9537cf1cb2c064bca9..99c1577685351477ec127e9c0758125b886a50e8 100644
|
||||
index 527a93067e8d134e77ca80cde554e0212c1568da..c4edd7e5b7b7f71dba397f2694642bbf1ed65ae9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2189,6 +2189,8 @@ public final class CraftServer implements Server {
|
||||
@@ -2192,6 +2192,8 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
||||
// Paper start
|
|
@ -46,10 +46,10 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 99c1577685351477ec127e9c0758125b886a50e8..815c95626a1cc4ed7e9641c37825a98fcfceaf4b 100644
|
||||
index c4edd7e5b7b7f71dba397f2694642bbf1ed65ae9..c781078f2858fdbc633f0eeaa57121b816645e90 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2610,6 +2610,15 @@ public final class CraftServer implements Server {
|
||||
@@ -2613,6 +2613,15 @@ public final class CraftServer implements Server {
|
||||
return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ index 99c1577685351477ec127e9c0758125b886a50e8..815c95626a1cc4ed7e9641c37825a98f
|
|||
default -> throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
@@ -2642,6 +2651,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2645,6 +2654,13 @@ public final class CraftServer implements Server {
|
||||
net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE;
|
||||
return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList());
|
||||
}
|
|
@ -9,18 +9,18 @@ This might result in chunks loading far slower in the nether,
|
|||
for example.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 18269a33f6eb3623fbfa6dd551426515404e8c95..42a3b0b7eee3b8eb7e833335dfdba76d185ad141 100644
|
||||
index d9ec9577d3686cafe6f9a9e33361b8f04c5089b2..da43ef3d1ec41f91d755cea834ab0dd528c66c3a 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1305,6 +1305,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
||||
@@ -1292,6 +1292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
if (super.pollTask()) {
|
||||
return true;
|
||||
} else {
|
||||
+ boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
|
||||
if (this.haveTime()) {
|
||||
Iterator iterator = this.getAllLevels().iterator();
|
||||
|
||||
@@ -1312,12 +1313,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1299,12 +1300,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||
|
||||
if (worldserver.getChunkSource().pollTask()) {
|
|
@ -10,10 +10,10 @@ just looking at the LevelStem key, look at the DimensionType key which
|
|||
is one level below that. Defaults to off to keep vanilla behavior.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 42a3b0b7eee3b8eb7e833335dfdba76d185ad141..5b64fe9f8c6d6fecad67a395a38fe6d7c91c5954 100644
|
||||
index da43ef3d1ec41f91d755cea834ab0dd528c66c3a..9fdbec87b9da0fd0ff965fd694fc1cdf7a56a0d3 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -588,7 +588,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -577,7 +577,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.commandStorage = new CommandStorage(worldpersistentdata);
|
||||
} else {
|
||||
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11);
|
|
@ -7,10 +7,10 @@ Some parts of legacy conversion will need the overworld
|
|||
to get the legacy structure data storage
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5b64fe9f8c6d6fecad67a395a38fe6d7c91c5954..980b8055b971376e5999d81accf4db3b54cf584e 100644
|
||||
index 9fdbec87b9da0fd0ff965fd694fc1cdf7a56a0d3..71b46f4f4739fa744bdbbf4729609d4bb3ca2669 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -600,9 +600,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -589,9 +589,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
||||
|
@ -23,10 +23,10 @@ index 5b64fe9f8c6d6fecad67a395a38fe6d7c91c5954..980b8055b971376e5999d81accf4db3b
|
|||
|
||||
if (worlddata.getCustomBossEvents() != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 815c95626a1cc4ed7e9641c37825a98fcfceaf4b..a84fc43521dc86d458c7bdc5b91e45953bb76e30 100644
|
||||
index c781078f2858fdbc633f0eeaa57121b816645e90..f92e3f2f1a2947a1ff1dff3c54ff29e9da2856a6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1250,10 +1250,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1253,10 +1253,11 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -38,4 +38,4 @@ index 815c95626a1cc4ed7e9641c37825a98fcfceaf4b..a84fc43521dc86d458c7bdc5b91e4595
|
|||
+ // Paper - move up
|
||||
|
||||
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
|
||||
//internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system
|
||||
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API
|
|
@ -9,10 +9,10 @@ This excludes hanging entities, as this fix caused problematic behavior due to t
|
|||
position field.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 31fa0f4fbf195d0db7a89a060b1cc4fd30dc5ab0..fe7aff356a9e7b4f41c3d5cb3bd5afbb0646c16a 100644
|
||||
index 1f71e11ec2bd617595de788f42562a436e61c156..e7df888c8fa3cde13d727b3bd6b4d66aabea4527 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -174,7 +174,7 @@ public class ServerEntity {
|
||||
@@ -171,7 +171,7 @@ public class ServerEntity {
|
||||
boolean flag4 = false;
|
||||
boolean flag5 = false;
|
||||
|
|
@ -24,10 +24,10 @@ index 0000000000000000000000000000000000000000..6b0bed550763f34e18c9e92f9a47ec0c
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 980b8055b971376e5999d81accf4db3b54cf584e..d8747518678596586dccb636d8e9b805260e75a7 100644
|
||||
index 71b46f4f4739fa744bdbbf4729609d4bb3ca2669..624533bd0acea1a444fbd2b396528f8946cf5b2f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2057,6 +2057,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2062,6 +2062,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
|
@ -49,7 +49,7 @@ index 9fe5a680c0ad5624cebcd61fd8812e88d29fc209..6f5246f3cfc6b6757fad2a634299921d
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
||||
index 421c2131fec0b7266c773c3f1983308f6921df6b..12d9556a11ac4ef2e7a62fcd2686d868904bc010 100644
|
||||
index 25e909b90293855321b8f05ab3488bad8c064853..ef798adc296ae1595cfcd33fed5aa71b9ad00037 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
||||
@@ -14,6 +14,7 @@ public class PotionBrewing {
|
||||
|
@ -69,7 +69,7 @@ index 421c2131fec0b7266c773c3f1983308f6921df6b..12d9556a11ac4ef2e7a62fcd2686d868
|
|||
}
|
||||
|
||||
protected static boolean isContainerIngredient(ItemStack stack) {
|
||||
@@ -66,6 +67,11 @@ public class PotionBrewing {
|
||||
@@ -60,6 +61,11 @@ public class PotionBrewing {
|
||||
}
|
||||
|
||||
public static boolean hasMix(ItemStack input, ItemStack ingredient) {
|
||||
|
@ -81,7 +81,7 @@ index 421c2131fec0b7266c773c3f1983308f6921df6b..12d9556a11ac4ef2e7a62fcd2686d868
|
|||
if (!ALLOWED_CONTAINER.test(input)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -103,6 +109,13 @@ public class PotionBrewing {
|
||||
@@ -93,6 +99,13 @@ public class PotionBrewing {
|
||||
|
||||
public static ItemStack mix(ItemStack ingredient, ItemStack input) {
|
||||
if (!input.isEmpty()) {
|
||||
|
@ -94,8 +94,8 @@ index 421c2131fec0b7266c773c3f1983308f6921df6b..12d9556a11ac4ef2e7a62fcd2686d868
|
|||
+ // Paper end
|
||||
Potion potion = PotionUtils.getPotion(input);
|
||||
Item item = input.getItem();
|
||||
int i = 0;
|
||||
@@ -127,6 +140,54 @@ public class PotionBrewing {
|
||||
|
||||
@@ -112,6 +125,54 @@ public class PotionBrewing {
|
||||
return input;
|
||||
}
|
||||
|
||||
|
@ -164,10 +164,10 @@ index 424406d2692856cfd82b6f3b7b6228fa3bd20c2f..c57efcb9a79337ec791e4e8f6671612f
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a84fc43521dc86d458c7bdc5b91e45953bb76e30..741d486f81121a8ddda71be5c8b8603d23f75799 100644
|
||||
index f92e3f2f1a2947a1ff1dff3c54ff29e9da2856a6..23057d0463af66041ab151ff5f198bb6d1fba124 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -304,6 +304,7 @@ public final class CraftServer implements Server {
|
||||
@@ -307,6 +307,7 @@ public final class CraftServer implements Server {
|
||||
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
|
||||
public static Exception excessiveVelEx; // Paper - Velocity warnings
|
||||
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
|
||||
|
@ -175,7 +175,7 @@ index a84fc43521dc86d458c7bdc5b91e45953bb76e30..741d486f81121a8ddda71be5c8b8603d
|
|||
|
||||
static {
|
||||
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
|
||||
@@ -333,7 +334,7 @@ public final class CraftServer implements Server {
|
||||
@@ -336,7 +337,7 @@ public final class CraftServer implements Server {
|
||||
Enchantments.SHARPNESS.getClass();
|
||||
org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations();
|
||||
|
||||
|
@ -184,7 +184,7 @@ index a84fc43521dc86d458c7bdc5b91e45953bb76e30..741d486f81121a8ddda71be5c8b8603d
|
|||
MobEffects.BLINDNESS.getClass();
|
||||
PotionEffectType.stopAcceptingRegistrations();
|
||||
// Ugly hack :(
|
||||
@@ -2969,5 +2970,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2972,5 +2973,10 @@ public final class CraftServer implements Server {
|
||||
return datapackManager;
|
||||
}
|
||||
|
|
@ -10,10 +10,10 @@ so we do not need that. The client only needs the chunk it is currently in to
|
|||
be loaded to close the loading screen, so we just send an empty one.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d25aa54689360e89b18535da54ce2c90ab21f819..b56a7067faafb687ff5d529b1d4a40c1e15b2ea2 100644
|
||||
index 2580b728ee74f69d0788aae8c4f16ecd1dcec999..fdb4e975ae67abf5aba7df8b8c34e991d08b1398 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -396,6 +396,16 @@ public abstract class PlayerList {
|
||||
@@ -379,6 +379,16 @@ public abstract class PlayerList {
|
||||
|
||||
// Paper start - move vehicle into method so it can be called above - short circuit around that code
|
||||
onPlayerJoinFinish(player, worldserver1, s1);
|
Loading…
Reference in a new issue