mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
bundle o' patches
This commit is contained in:
parent
0745f97bb5
commit
2304bb3d6f
@ -5,14 +5,14 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index e17bb884929d4f4b7dc5b2d71234ff81d840c994..11ed386c6358e55fe5c0e5e8496fa7f7c663a7e2 100644
|
||||
index 41576d9c9518ae05f63c087736b323ce03f6046a..3d8449a91687f2637a6254bafd378707e810d769 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -137,6 +137,7 @@ public class Main {
|
||||
@@ -138,6 +138,7 @@ public class Main {
|
||||
return;
|
||||
}
|
||||
|
||||
+ org.spigotmc.SpigotConfig.disabledAdvancements = spigotConfiguration.getStringList("advancements.disabled"); // Paper - fix SPIGOT-5885, must be set early in init
|
||||
// Paper start - fix SPIGOT-5824
|
||||
File file;
|
||||
File userCacheFile = new File("usercache.json");
|
||||
File userCacheFile = new File(Services.USERID_CACHE_FILE);
|
@ -60,18 +60,18 @@ index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fd
|
||||
LootContext lootContext = EntityPredicate.createContext(player, player);
|
||||
List<CriterionTrigger.Listener<T>> list = null;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
index f8f0be77126d2f3a1c53f7405ce4de4f0dca42be..8096f01fa7f1ed73e4812912fc9b21bafdd212c8 100644
|
||||
index 736e604205c0dcbe2cf1f1e0d507f53a9c0d941b..a4f2eb219cc57303cc6642e6782700591e423cf4 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -40,6 +40,7 @@ import net.minecraft.advancements.Criterion;
|
||||
@@ -39,6 +39,7 @@ import net.minecraft.advancements.Criterion;
|
||||
import net.minecraft.advancements.CriterionProgress;
|
||||
import net.minecraft.advancements.CriterionTrigger;
|
||||
import net.minecraft.advancements.CriterionTriggerInstance;
|
||||
+import net.minecraft.advancements.critereon.SimpleCriterionTrigger;
|
||||
import net.minecraft.network.chat.ChatType;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientboundSelectAdvancementsTabPacket;
|
||||
@@ -70,6 +71,8 @@ public class PlayerAdvancements {
|
||||
@@ -69,6 +70,8 @@ public class PlayerAdvancements {
|
||||
private Advancement lastSelectedTab;
|
||||
private boolean isFirstPacket = true;
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add missing strikeLighting call to
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 3571f8406630c268b8a6ad48d2f4351e2f8fc617..198ddc0747470313e4cbab132a8e523155cfe0c1 100644
|
||||
index d84db6b9cbabd7979c391fa7d1ae1f55b5fab227..539f973d6ee49c272d516f83472e49d10f67fad2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2093,6 +2093,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@ -5,19 +5,19 @@ Subject: [PATCH] Fix some rails connecting improperly
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java b/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java
|
||||
index b0e20bb18179265f59befde2b4c685b8ee2c119e..3c5c9279389d4ffda07cbc10949c616071e6e288 100644
|
||||
index 9ae45eaf77ead0a6801046d8946d50eec24612fa..a3f877bf03f75cbfbd128c856322bcd427b95d21 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java
|
||||
@@ -65,6 +65,7 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl
|
||||
state = this.updateDir(world, pos, state, true);
|
||||
if (this.isStraight) {
|
||||
state.neighborChanged(world, pos, this, pos, notify);
|
||||
world.neighborChanged(state, pos, this, pos, notify);
|
||||
+ state = world.getBlockState(pos); // Paper - don't desync, update again
|
||||
}
|
||||
|
||||
return state;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
|
||||
index 8284df37b6b9a937c43c14b2a0f1274e087aa3ad..b68e3ced407a9e6b386cbd379e58c86f195eb17a 100644
|
||||
index fe9b6c89a1f0c98a9c73a409f2aca6a4a1c0f9e7..932a2c279f46c951182d2604b525b473b6945895 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
|
||||
@@ -70,6 +70,7 @@ public class DetectorRailBlock extends BaseRailBlock {
|
@ -9,10 +9,10 @@ the game, immediately stop the server to prevent data corruption.
|
||||
You can override this functionality at your own peril.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
|
||||
index 78058b505742541a484cadc790c445bdfb9c1136..7de66cec1eeaf797d61c815a34267c3dc85f0719 100644
|
||||
index f26a08f81495dde6205b34254d159b042e5a6ea9..12e3831324abdc1112cbe65cab0f0c75ce77a9ef 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
|
||||
@@ -111,9 +111,22 @@ public class ChunkSerializer {
|
||||
@@ -118,9 +118,22 @@ public class ChunkSerializer {
|
||||
return holder.protoChunk;
|
||||
}
|
||||
|
@ -5,27 +5,19 @@ Subject: [PATCH] Brand support
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0f031b094a180bcce1fe3b388321db838ca4df63..5611238634230f434170e895a84ae22ca2870b9c 100644
|
||||
index fdf77097cff7c3af87e390b0bfd9e8aadf7c55ec..5c00238e29cfd6ed107e3bf988a9ac2e55e55361 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -38,6 +38,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.StringTag;
|
||||
import net.minecraft.network.Connection;
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.ChatType;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
@@ -258,6 +259,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80);
|
||||
@@ -278,6 +278,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
|
||||
private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper
|
||||
|
||||
+ private String clientBrandName = null; // Paper - Brand name
|
||||
+
|
||||
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
|
||||
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
|
||||
this.server = server;
|
||||
this.connection = connection;
|
||||
@@ -3037,6 +3040,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -3212,6 +3214,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register");
|
||||
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
|
||||
|
||||
@ -34,14 +26,14 @@ index 0f031b094a180bcce1fe3b388321db838ca4df63..5611238634230f434170e895a84ae22c
|
||||
@Override
|
||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
@@ -3064,6 +3069,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -3239,6 +3243,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
try {
|
||||
byte[] data = new byte[packet.data.readableBytes()];
|
||||
packet.data.readBytes(data);
|
||||
+ // Paper start - Brand support
|
||||
+ if (packet.identifier.equals(MINECRAFT_BRAND)) {
|
||||
+ try {
|
||||
+ this.clientBrandName = new FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256);
|
||||
+ this.clientBrandName = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256);
|
||||
+ } catch (StringIndexOutOfBoundsException ex) {
|
||||
+ this.clientBrandName = "illegal";
|
||||
+ }
|
||||
@ -50,7 +42,7 @@ index 0f031b094a180bcce1fe3b388321db838ca4df63..5611238634230f434170e895a84ae22c
|
||||
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
|
||||
@@ -3073,6 +3087,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -3248,6 +3261,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
|
||||
}
|
||||
|
||||
@ -64,10 +56,10 @@ index 0f031b094a180bcce1fe3b388321db838ca4df63..5611238634230f434170e895a84ae22c
|
||||
return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 03ed4da5b2a175f19b60830f54124edd1d0d24cd..0d771219023ecbe6ebc3729009eebb9a4da1e865 100644
|
||||
index 664c93c4f26edf7f84c6cff02f97b18b8d40f851..63ef47bc63e32d2443b3b2aa3a77258269843d9d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2686,6 +2686,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2690,6 +2690,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper end
|
||||
};
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add #setMaxPlayers API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 019bbc77fe0a85de6d8eef53496981d1d7d0c320..f9ef6e64b95f90d69a897dd996a587749776350d 100644
|
||||
index 34b5250649ba98b8f4a8a4cd1a76141d360fbe86..2f3edb1383dd88514cddc271850b7f0a7f6c9230 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -144,7 +144,7 @@ public abstract class PlayerList {
|
||||
@@ -146,7 +146,7 @@ public abstract class PlayerList {
|
||||
public final PlayerDataStorage playerIo;
|
||||
private boolean doWhiteList;
|
||||
private final RegistryAccess.Frozen registryHolder;
|
||||
@ -18,10 +18,10 @@ index 019bbc77fe0a85de6d8eef53496981d1d7d0c320..f9ef6e64b95f90d69a897dd996a58774
|
||||
private int simulationDistance;
|
||||
private boolean allowCheatsForAllPlayers;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 212e43114e4797669338ffdd47548d0100365380..ce09a46ed430a80471af48b7a8ca1bf7726395c9 100644
|
||||
index 52ad386510af54e3c85ab7c952592982beaedbd1..a1a8578929a08396f9762dec0ef99956e7eeb459 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -668,6 +668,13 @@ public final class CraftServer implements Server {
|
||||
@@ -663,6 +663,13 @@ public final class CraftServer implements Server {
|
||||
return this.playerList.getMaxPlayers();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't require FACING data
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java
|
||||
index b49ecca9cc3fe8a3e2c8643c7714346b02212b7e..a59b20c847344e967862c7519896263b41071064 100644
|
||||
index da6a145b06e217ff82b0a1b04410238dc50d4869..1e6ba6d9cceda1d4867b183c3dbc03d317ed287f 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java
|
||||
@@ -14,6 +14,7 @@ import org.bukkit.event.block.BlockDispenseEvent;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 38af4d10e2e09c0917ae8ff265e5a6c610fa4404..2cb1bad01d48efe0e7474ca8308d0d7e84d691d6 100644
|
||||
index c79dd3cdb5d3d1e8cb79a7efdf48f513679c5f51..877c13a7f2ddf00ce9902b7ff14bee57674842bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1755,6 +1755,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1847,6 +1847,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
//ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
|
||||
|
||||
this.levelData.setSpawn(pos, angle);
|
||||
@ -17,7 +17,7 @@ index 38af4d10e2e09c0917ae8ff265e5a6c610fa4404..2cb1bad01d48efe0e7474ca8308d0d7e
|
||||
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
|
||||
this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 198ddc0747470313e4cbab132a8e523155cfe0c1..f7d5c6aa18ee44e0a6651ed73c922a973bb809b3 100644
|
||||
index 539f973d6ee49c272d516f83472e49d10f67fad2..99d109ebd9aa0af31916dc81d1a8b1f7bc6d42be 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -258,11 +258,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add moon phase API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index 9d247664e5867a31376b3681b7ed0c3404ea46d8..89f75b79e8501097d2411b12ae79bb073cadba7a 100644
|
||||
index e395628ccf59c1b7a4efcabb3c38e8a879b95e38..ee5e59c37301d9a806e2f696d52d9d217b232833 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -907,4 +907,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
@@ -932,4 +932,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
|
||||
throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName());
|
||||
}
|
@ -36,7 +36,7 @@ scenario / path:
|
||||
Previously would have hopped to SERVER around 12+ times there extra.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index af0a36071b4cf1ec77839eb8aa8f33917148d5e1..dd073d97d21eaa15b004cfe3929b4bf20d16d266 100644
|
||||
index 20b2736dcb1d1c7c046b4bb5ce9352ca90aaf39a..7b37ce8e03e8cc7424ad2bd36ce5701f078ed7dd 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -95,6 +95,13 @@ public class ChunkHolder {
|
||||
@ -54,10 +54,10 @@ index af0a36071b4cf1ec77839eb8aa8f33917148d5e1..dd073d97d21eaa15b004cfe3929b4bf2
|
||||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index c6ea30c9e91382297a5340096540f1ebc914fc35..104e7d0c18b032ee8198c4de25a57676d0f64745 100644
|
||||
index e4348b4f45515b879f9b2f839e7af7fa9c16a463..648a03beb70ee3905360e992a891b74c38fcef68 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -691,7 +691,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -707,7 +707,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return either.mapLeft((list) -> {
|
||||
return (LevelChunk) list.get(list.size() / 2);
|
||||
});
|
||||
@ -66,7 +66,7 @@ index c6ea30c9e91382297a5340096540f1ebc914fc35..104e7d0c18b032ee8198c4de25a57676
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1087,6 +1087,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1113,6 +1113,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return "chunkGenerate " + requiredStatus.getName();
|
||||
});
|
||||
Executor executor = (runnable) -> {
|
@ -21,10 +21,10 @@ index 5e531f9fc67bd3092b39f1d3b46b9490319dd79a..ad67d41484052e38f3b955aafa1f74cf
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index 0d6f33319521101bd10352d597b5e3e063ec443f..29f6c10e2c2626a9726d295acf12efea2b463cd3 100644
|
||||
index acb94f0dd47e292446c74958667becdc8087f505..92cef4fa250dc24dafdce4e27884457bdd097c79 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -35,6 +35,8 @@ import net.minecraft.world.level.block.BaseFireBlock;
|
||||
@@ -33,6 +33,8 @@ import net.minecraft.world.level.block.BaseFireBlock;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
@ -33,7 +33,7 @@ index 0d6f33319521101bd10352d597b5e3e063ec443f..29f6c10e2c2626a9726d295acf12efea
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
@@ -189,6 +191,15 @@ public class Explosion {
|
||||
@@ -187,6 +189,15 @@ public class Explosion {
|
||||
|
||||
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)) {
|
||||
set.add(blockposition);
|
@ -7,7 +7,7 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a
|
||||
village bell. Passes along the bell block and the player who rang it.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BellBlock.java b/src/main/java/net/minecraft/world/level/block/BellBlock.java
|
||||
index 07276602799b3890ea62946cdf8a75ac48082d1f..135632360fd8b20f1cd3672c260dd2f92e993371 100644
|
||||
index a4da6418c17e145333aa5efe427826ba53293e4d..14002e1f67e3dce421584c01e8f91769509638b7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BellBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BellBlock.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block;
|
||||
@ -25,4 +25,4 @@ index 07276602799b3890ea62946cdf8a75ac48082d1f..135632360fd8b20f1cd3672c260dd2f9
|
||||
+ if (!new io.papermc.paper.event.block.BellRingEvent(world.getWorld().getBlockAt(MCUtil.toLocation(world, pos)), entity == null ? null : entity.getBukkitEntity()).callEvent()) return false; // Paper - BellRingEvent
|
||||
((BellBlockEntity)blockEntity).onHit(direction);
|
||||
world.playSound((Player)null, pos, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 2.0F, 1.0F);
|
||||
world.gameEvent(entity, GameEvent.RING_BELL, pos);
|
||||
world.gameEvent(entity, GameEvent.BLOCK_CHANGE, pos);
|
@ -21,7 +21,7 @@ index 536fc6bf1451ea84af6084b1976eee32bf328ab0..12a77caa7899bc6d000d48d13a504476
|
||||
private void keepLoadedRange() {
|
||||
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
||||
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 f09e9ae8e976b0150c00995cd22e64feaefd27be..5341f65436bb147c8aed5206c5e4515c7517bc2e 100644
|
||||
index 6efce73f5233927104ec772e16a370926317d80d..847dbd6dae8e9a615ade642c598bc7bb45fb4722 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -106,7 +106,7 @@ public class Zombie extends Monster {
|
@ -24,7 +24,7 @@ index ad67d41484052e38f3b955aafa1f74cf6e2b3701..658569f9cefdbbfc30eef3b63e8bf552
|
||||
for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
||||
MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Paper", entry.getValue());
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index c469688c2b55b1c93435a2ac6e8e4494ab7e5229..1c63947958d202d00593e2b76d113c8b327706d7 100644
|
||||
index ed4587248fada36c4c206be1fa36fef42fc969e2..2ea1895be13eef99a87a7d1b0348699f46f281fc 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -40,6 +40,7 @@ import net.minecraft.network.protocol.Packet;
|
||||
@ -35,7 +35,7 @@ index c469688c2b55b1c93435a2ac6e8e4494ab7e5229..1c63947958d202d00593e2b76d113c8b
|
||||
import net.minecraft.server.RunningOnDifferentThreadException;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import net.minecraft.server.network.ServerLoginPacketListenerImpl;
|
||||
@@ -385,10 +386,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -387,10 +388,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
// Paper end
|
||||
|
@ -983,10 +983,10 @@ index 0000000000000000000000000000000000000000..d4273df8124d9d6d4a122f5ecef6f3d0
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||
index 8472510a4614afd8e292d83aec67115b906b9adb..0acc3b550a5bb809fe99708368114eaccb227312 100644
|
||||
index 74241146a034c5817cddc608c095d829d765f06a..70b87dc8214815f0163a16b80526ae9be4839fe8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
|
||||
@@ -255,6 +255,121 @@ public class RedStoneWireBlock extends Block {
|
||||
@@ -253,6 +253,121 @@ public class RedStoneWireBlock extends Block {
|
||||
return floor.isFaceSturdy(world, pos, Direction.UP) || floor.is(Blocks.HOPPER);
|
||||
}
|
||||
|
||||
@ -1108,7 +1108,7 @@ index 8472510a4614afd8e292d83aec67115b906b9adb..0acc3b550a5bb809fe99708368114eac
|
||||
private void updatePowerStrength(Level world, BlockPos pos, BlockState state) {
|
||||
int i = this.calculateTargetStrength(world, pos);
|
||||
|
||||
@@ -324,6 +439,7 @@ public class RedStoneWireBlock extends Block {
|
||||
@@ -322,6 +437,7 @@ public class RedStoneWireBlock extends Block {
|
||||
return Math.max(i, j - 1);
|
||||
}
|
||||
|
||||
@ -1116,7 +1116,7 @@ index 8472510a4614afd8e292d83aec67115b906b9adb..0acc3b550a5bb809fe99708368114eac
|
||||
private int getWireSignal(BlockState state) {
|
||||
return state.is((Block) this) ? (Integer) state.getValue(RedStoneWireBlock.POWER) : 0;
|
||||
}
|
||||
@@ -346,7 +462,7 @@ public class RedStoneWireBlock extends Block {
|
||||
@@ -344,7 +460,7 @@ public class RedStoneWireBlock extends Block {
|
||||
@Override
|
||||
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||
if (!oldState.is(state.getBlock()) && !world.isClientSide) {
|
||||
@ -1125,7 +1125,7 @@ index 8472510a4614afd8e292d83aec67115b906b9adb..0acc3b550a5bb809fe99708368114eac
|
||||
Iterator iterator = Direction.Plane.VERTICAL.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -373,7 +489,7 @@ public class RedStoneWireBlock extends Block {
|
||||
@@ -371,7 +487,7 @@ public class RedStoneWireBlock extends Block {
|
||||
world.updateNeighborsAt(pos.relative(enumdirection), this);
|
||||
}
|
||||
|
||||
@ -1134,8 +1134,8 @@ index 8472510a4614afd8e292d83aec67115b906b9adb..0acc3b550a5bb809fe99708368114eac
|
||||
this.updateNeighborsOfNeighboringWires(world, pos);
|
||||
}
|
||||
}
|
||||
@@ -408,7 +524,7 @@ public class RedStoneWireBlock extends Block {
|
||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) {
|
||||
@@ -406,7 +522,7 @@ public class RedStoneWireBlock extends Block {
|
||||
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||
if (!world.isClientSide) {
|
||||
if (state.canSurvive(world, pos)) {
|
||||
- this.updatePowerStrength(world, pos, state);
|
@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Thu, 27 Aug 2020 16:57:25 -0400
|
||||
Subject: [PATCH] Fix hex colors not working in some kick messages
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index 941a9d8addd44e95c467b34f77658592b9f4ef06..ec98a6540a7c4d032234dea5148adaccff7298b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -49,7 +49,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
|
||||
if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
|
||||
ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
|
||||
- MutableComponent chatmessage = Component.literal(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
|
||||
+ Component chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage, true)[0]; // Paper - Configurable connection throttle kick message // Paper - Fix hex colors not working in some kick messages
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||
this.connection.disconnect(chatmessage);
|
||||
return;
|
||||
@@ -75,12 +75,12 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) {
|
||||
- MutableComponent ichatmutablecomponent;
|
||||
+ Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages
|
||||
|
||||
if (packet.getProtocolVersion() < 754) {
|
||||
- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
|
||||
+ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
|
||||
} else {
|
||||
- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
|
||||
+ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
|
||||
}
|
||||
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent));
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 9cefee82f6bd89b825b3007c3306a5f3622a1e70..8da6770f88ce693251812f3c0a803a09286e56ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -112,7 +112,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
// CraftBukkit start
|
||||
@Deprecated
|
||||
public void disconnect(String s) {
|
||||
- this.disconnect(Component.literal(s));
|
||||
+ this.disconnect(org.bukkit.craftbukkit.util.CraftChatMessage.fromString(s, true)[0]); // Paper - Fix hex colors not working in some kick messages
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] PortalCreateEvent needs to know its entity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 1edd9d27a3af291e7ed9900009d0f6c30845e0b7..dc192218aa2e325040dc2bf0f8586e1c1577e4c7 100644
|
||||
index bdd2e7e723e1f90bf2b7f6067f6b2f2855c2065f..0f55d212ccab8f82d60688b270115650bb959acc 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -419,7 +419,7 @@ public final class ItemStack {
|
||||
@@ -433,7 +433,7 @@ public final class ItemStack {
|
||||
net.minecraft.world.level.block.state.BlockState block = world.getBlockState(newblockposition);
|
||||
|
||||
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
|
||||
@ -18,10 +18,10 @@ index 1edd9d27a3af291e7ed9900009d0f6c30845e0b7..dc192218aa2e325040dc2bf0f8586e1c
|
||||
|
||||
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
|
||||
index adcfa3cac4f11557e0f27ae905c035e188bae25f..ed216f0b6cf031883c4ca4123d82c9fc542b915e 100644
|
||||
index 378d4316a51d48cb84e2d8a553f7b28bae55630e..922b5b22a4ccfeead9d6d2b9a2a2b3cc8a1e6c55 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
|
||||
@@ -140,20 +140,23 @@ public abstract class BaseFireBlock extends Block {
|
||||
@@ -139,20 +139,23 @@ public abstract class BaseFireBlock extends Block {
|
||||
super.entityInside(state, world, pos, entity);
|
||||
}
|
||||
|
||||
@ -52,18 +52,18 @@ index adcfa3cac4f11557e0f27ae905c035e188bae25f..ed216f0b6cf031883c4ca4123d82c9fc
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
||||
index 08bc35b40720ca001d3f6c1185bdd11c61ec9ee1..d8e4fda2d501545e5f891bca317e2aa5f9368f47 100644
|
||||
index 5ce5902b13ebb9438433d189f2c03677e4cb54b3..e34b8cff424ad58eee65a65fa510fa9908dbdf39 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
+import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -358,9 +359,11 @@ public class FireBlock extends BaseFireBlock {
|
||||
@@ -356,9 +357,11 @@ public class FireBlock extends BaseFireBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -77,12 +77,12 @@ index 08bc35b40720ca001d3f6c1185bdd11c61ec9ee1..d8e4fda2d501545e5f891bca317e2aa5
|
||||
+ world.scheduleTick(blockposition, this, getFireTickDelay(world.random));
|
||||
}
|
||||
|
||||
private static int getFireTickDelay(Random random) {
|
||||
private static int getFireTickDelay(RandomSource random) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index fdb9a60ce9e1f8e3caabe1733e32e34146d4ddf3..e5e8de790b1ab546d35ddf48583461c0b8d91acd 100644
|
||||
index 0ff34d2c569fbeae95509abed343b1e2f593378a..d75eb5eef83c9b0d247c7d8cb5021e931fe3ef4c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -33,6 +33,7 @@ import net.minecraft.world.item.DyeColor;
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
@ -90,7 +90,7 @@ index fdb9a60ce9e1f8e3caabe1733e32e34146d4ddf3..e5e8de790b1ab546d35ddf48583461c0
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.EmptyBlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -134,6 +135,12 @@ public abstract class BlockBehaviour {
|
||||
@@ -135,6 +136,12 @@ public abstract class BlockBehaviour {
|
||||
DebugPackets.sendNeighborsUpdatePacket(world, pos);
|
||||
}
|
||||
|
@ -26,10 +26,10 @@ index ea3358905dcd39a1a855d98570457c65dcd7513d..396fb96abed1e77893d8ee8a15cff18c
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
index eb99e0c2462a2d1ab4508a5c3f1580b6e31d7465..c536eceef3365a7b726cd970df345ba1d055207d 100644
|
||||
index 7d186c7595dbcd109cee2cc16d70d8302b4d6b8f..9bc659a7ab2030e851c85ca511fbba51998563bf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
@@ -192,6 +192,11 @@ public class CraftEnchantment extends Enchantment {
|
||||
@@ -194,6 +194,11 @@ public class CraftEnchantment extends Enchantment {
|
||||
public net.kyori.adventure.text.Component displayName(int level) {
|
||||
return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level));
|
||||
}
|
||||
@ -42,7 +42,7 @@ index eb99e0c2462a2d1ab4508a5c3f1580b6e31d7465..c536eceef3365a7b726cd970df345ba1
|
||||
|
||||
public net.minecraft.world.item.enchantment.Enchantment getHandle() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index b38e0ac6a2eafc0d98bb81665bdc2eafbac2d7d8..048163598018ee58a9aa2ca811ed44ac194ac880 100644
|
||||
index bc6d9dc549b865d47899db947b7e5b00ff312d2f..25813d45ba3b39fa1e1d566ca04ed122717b916d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -478,6 +478,30 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 0c210a527ef1b7efd1c80e2368203ab069047363..e8ed3017e2d1ac55f79c85be1860aae84db96edc 100644
|
||||
index f05923a6292f02a01791627abce2770daff24b6a..f3a6a4d97b5be2e75c438a6f7010a8f588afe86c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -399,5 +399,40 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -405,5 +405,40 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
|
||||
return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null;
|
||||
}
|
@ -5,22 +5,22 @@ Subject: [PATCH] Cache block data strings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5edb1f4be4d0306a22827d1330a08251e5cb1fbe..e22ef9d02a64852f09a8d528a366817aceaf55dc 100644
|
||||
index 817459063cbe37422d2d1b560f4751857139c6f6..c315fb7c53be4fc304df38d17426393546b2f6f6 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2031,6 +2031,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1997,6 +1997,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().reloadResources();
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
+ org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings, they can be defined by datapacks so refresh it here
|
||||
}, this);
|
||||
|
||||
if (this.isSameThread()) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
index 275401f9bf7a78e69766e0547c94c3a115a8896c..afc69b0077f180c3e7ace3db11aa0eccc602516f 100644
|
||||
index 8ec78b26d6bfbcdad443c9649e35f79dd336b095..37a6d050ae46461ad4b9b6c0fc9b9c2879d9b6fb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
@@ -494,9 +494,39 @@ public class CraftBlockData implements BlockData {
|
||||
@@ -500,9 +500,39 @@ public class CraftBlockData implements BlockData {
|
||||
Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
|
||||
}
|
||||
|
@ -9,32 +9,32 @@ as this is how Vanilla teleports entities.
|
||||
Cancel any pending motion when teleported.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 5611238634230f434170e895a84ae22ca2870b9c..3c4c6edc06e992543f7f1b190d662eb326550034 100644
|
||||
index 5c00238e29cfd6ed107e3bf988a9ac2e55e55361..85841a93e17e685bb7d676995891d27c05521f31 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -689,7 +689,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit
|
||||
@@ -720,7 +720,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
return;
|
||||
}
|
||||
|
||||
- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||
+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper setPositionRotation for teleportation
|
||||
+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper moveTo for teleportation
|
||||
this.lastGoodX = this.awaitingPositionFromClient.x;
|
||||
this.lastGoodY = this.awaitingPositionFromClient.y;
|
||||
this.lastGoodZ = this.awaitingPositionFromClient.z;
|
||||
@@ -1573,7 +1573,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
@@ -1602,7 +1602,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
// CraftBukkit end
|
||||
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
- this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation
|
||||
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper moveTo for teleportation
|
||||
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3c3960abd63297bf6c247bc48de3b77a90cee06d..a992153f951d888874971c9bca84963643925c56 100644
|
||||
index 911dd8bf57b767e658bd9fce87616e07693d2639..641af6203a30b4614176bfc3fc4a1bf1b9143360 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -154,6 +154,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -158,6 +158,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
@ -42,7 +42,7 @@ index 3c3960abd63297bf6c247bc48de3b77a90cee06d..a992153f951d888874971c9bca849636
|
||||
static boolean isLevelAtLeast(CompoundTag tag, int level) {
|
||||
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
@@ -1567,6 +1568,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1615,6 +1616,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
||||
@ -57,27 +57,27 @@ index 3c3960abd63297bf6c247bc48de3b77a90cee06d..a992153f951d888874971c9bca849636
|
||||
this.setYRot(yaw);
|
||||
this.setXRot(pitch);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index 70e1f9bd9e4711aaf45ff8b7214726de646997ab..4bfebbb2e87464cd47a38a5da6275b2c662fa052 100644
|
||||
index cf956ad7a327b2bd16c1c68837888f6049d606df..51463da77739859aaa6fbc018345659afe16c2ee 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -161,6 +161,7 @@ public abstract class BaseSpawner {
|
||||
@@ -163,6 +163,7 @@ public abstract class BaseSpawner {
|
||||
return;
|
||||
}
|
||||
|
||||
+ entity.preserveMotion = true; // Paper - preserve entity motion from tag
|
||||
entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), world.random.nextFloat() * 360.0F, 0.0F);
|
||||
entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), randomsource.nextFloat() * 360.0F, 0.0F);
|
||||
if (entity instanceof Mob) {
|
||||
Mob entityinsentient = (Mob) entity;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 1f2503748e0534d48db558d09997683d563b649c..8ec7cd4ea41c28c1f730df649b7cf73d57d60b55 100644
|
||||
index 904ce802b2aaebc1f48f7c444e2611fefa14f9a5..a16f343864e87dfe768e2697d6834a0244ba49b1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -579,7 +579,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -590,7 +590,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
|
||||
// entity.setLocation() throws no event, and so cannot be cancelled
|
||||
- this.entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
+ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper setPosition, as per vanilla teleporting
|
||||
+ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper moveTo, as per vanilla teleporting
|
||||
// SPIGOT-619: Force sync head rotation also
|
||||
this.entity.setYHeadRot(location.getYaw());
|
||||
|
@ -30,10 +30,10 @@ This patch will significantly reduce CPU use on startup, reduce memory usage,
|
||||
and improve server startup time.
|
||||
|
||||
diff --git a/src/main/java/com/mojang/datafixers/DataFixerBuilder.java b/src/main/java/com/mojang/datafixers/DataFixerBuilder.java
|
||||
index e7e410585760c6f0cb4b6cf81fcc97333fc8ab10..503828188b25ce41b86a868853d6969b84764a84 100644
|
||||
index d25f106ab64c90438f521a2c6fa944bdedc1969a..3d5e52d997a8e7d7f3b000e3737d30762aae2ca1 100644
|
||||
--- a/src/main/java/com/mojang/datafixers/DataFixerBuilder.java
|
||||
+++ b/src/main/java/com/mojang/datafixers/DataFixerBuilder.java
|
||||
@@ -26,8 +26,10 @@ public class DataFixerBuilder {
|
||||
@@ -28,8 +28,10 @@ public class DataFixerBuilder {
|
||||
private final Int2ObjectSortedMap<Schema> schemas = new Int2ObjectAVLTreeMap<>();
|
||||
private final List<DataFix> globalList = Lists.newArrayList();
|
||||
private final IntSortedSet fixerVersions = new IntAVLTreeSet();
|
||||
@ -44,11 +44,11 @@ index e7e410585760c6f0cb4b6cf81fcc97333fc8ab10..503828188b25ce41b86a868853d6969b
|
||||
this.dataVersion = dataVersion;
|
||||
}
|
||||
|
||||
@@ -65,6 +67,7 @@ public class DataFixerBuilder {
|
||||
@@ -74,6 +76,7 @@ public class DataFixerBuilder {
|
||||
final IntBidirectionalIterator iterator = fixerUpper.fixerVersions().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
final int versionKey = iterator.nextInt();
|
||||
+ if (versionKey < minDataFixPrecacheVersion) continue; // Paper
|
||||
final Schema schema = schemas.get(versionKey);
|
||||
for (final String typeName : schema.types()) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
final CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 2cb1bad01d48efe0e7474ca8308d0d7e84d691d6..053ca558c7db0b0a7c2b768e3827e0b90094fc5b 100644
|
||||
index 877c13a7f2ddf00ce9902b7ff14bee57674842bc..8788325368e80eb162b0f665ae0995fe74317b4a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1266,6 +1266,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1284,6 +1284,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
|
||||
return false;
|
||||
} else {
|
||||
@ -23,10 +23,10 @@ index 2cb1bad01d48efe0e7474ca8308d0d7e84d691d6..053ca558c7db0b0a7c2b768e3827e0b9
|
||||
if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
|
||||
return false;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 176e5bbac94cf39805dcacfcae3a3daa98b793b7..d006964cb6c4c3cd843064ab685700c67df8c238 100644
|
||||
index 32a6b4d8e6c8f9c05cc7ca811c2188aa554f9e3e..32c78828b0c85949832dc25843c881b8eecc63d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -435,10 +435,12 @@ public class ServerPlayerGameMode {
|
||||
@@ -428,10 +428,12 @@ public class ServerPlayerGameMode {
|
||||
// return true; // CraftBukkit
|
||||
}
|
||||
// CraftBukkit start
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
index dd073d97d21eaa15b004cfe3929b4bf20d16d266..0d9fbdb23d28a4082c71275ca00e42f3bcb31926 100644
|
||||
index 7b37ce8e03e8cc7424ad2bd36ce5701f078ed7dd..e4dcce973fa6d6db8ddd37400125be8b7ee64c64 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
|
||||
@@ -245,6 +245,7 @@ public class ChunkHolder {
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a992153f951d888874971c9bca84963643925c56..e14ee2d556ca7cc28f8ca80b3e097a8146cd00f4 100644
|
||||
index 641af6203a30b4614176bfc3fc4a1bf1b9143360..4b9b86e96783f070739dcb0aa80cdfaf66b16dfd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3987,4 +3987,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4037,4 +4037,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
void accept(Entity entity, double x, double y, double z);
|
||||
}
|
||||
@ -21,7 +21,7 @@ index a992153f951d888874971c9bca84963643925c56..e14ee2d556ca7cc28f8ca80b3e097a81
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 048163598018ee58a9aa2ca811ed44ac194ac880..b2ead915b12830c68a21ae994f0c8b728431013f 100644
|
||||
index 25813d45ba3b39fa1e1d566ca04ed122717b916d..ab417ed4be57613c73fa26a42cecd548c51a1f8e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -502,6 +502,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index e14ee2d556ca7cc28f8ca80b3e097a8146cd00f4..f8876446fe73681d0a4ed72759ae4080f85c572a 100644
|
||||
index 4b9b86e96783f070739dcb0aa80cdfaf66b16dfd..367f5d5a6310a2feb1b28b15d130c0f61106f57b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -56,6 +56,7 @@ import net.minecraft.resources.ResourceKey;
|
||||
@@ -58,6 +58,7 @@ import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.MCUtil;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@ -16,7 +16,7 @@ index e14ee2d556ca7cc28f8ca80b3e097a8146cd00f4..f8876446fe73681d0a4ed72759ae4080
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.level.TicketType;
|
||||
@@ -3992,5 +3993,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4042,5 +4043,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public static int nextEntityId() {
|
||||
return ENTITY_COUNTER.incrementAndGet();
|
||||
}
|
||||
@ -27,10 +27,10 @@ index e14ee2d556ca7cc28f8ca80b3e097a8146cd00f4..f8876446fe73681d0a4ed72759ae4080
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 8ec7cd4ea41c28c1f730df649b7cf73d57d60b55..c63301472922dceb2873553bb4b0c350b37a23c3 100644
|
||||
index a16f343864e87dfe768e2697d6834a0244ba49b1..fefd03ffe3c1b4dbdf3035e80d5a00ef2fd6e670 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1267,5 +1267,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1278,5 +1278,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
public boolean isInLava() {
|
||||
return getHandle().isInLava();
|
||||
}
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e22ef9d02a64852f09a8d528a366817aceaf55dc..8ebd25e66301c62ae30d53f2104f732a32939029 100644
|
||||
index c315fb7c53be4fc304df38d17426393546b2f6f6..1f8ce89b46996491043f37783a80f4928acab8ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2097,13 +2097,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2063,13 +2063,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
if (this.isEnforceWhitelist()) {
|
||||
PlayerList playerlist = source.getServer().getPlayerList();
|
||||
UserWhiteList whitelist = playerlist.getWhiteList();
|
||||
@ -22,6 +22,6 @@ index e22ef9d02a64852f09a8d528a366817aceaf55dc..8ebd25e66301c62ae30d53f2104f732a
|
||||
|
||||
- if (!whitelist.isWhiteListed(entityplayer.getGameProfile())) {
|
||||
+ if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
|
||||
entityplayer.connection.disconnect(new TranslatableComponent("multiplayer.disconnect.not_whitelisted"));
|
||||
entityplayer.connection.disconnect(Component.translatable("multiplayer.disconnect.not_whitelisted"));
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 6 Jul 2020 18:36:41 -0400
|
||||
Subject: [PATCH] Fix Concurrency issue in WeightedList
|
||||
Subject: [PATCH] Fix Concurrency issue in ShufflingList
|
||||
|
||||
if multiple threads from worldgen sort at same time, it will crash.
|
||||
So make a copy of the list for sorting purposes.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
index c1f22c5e17418f91736237af1495a8a9910a61d5..e644bdd3a6f7c09a44149da03587b796674fa568 100644
|
||||
index c1f22c5e17418f91736237af1495a8a9910a61d5..5a5d454b5987bb01d03f91c15b7a6bff46f1de71 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
@@ -16,7 +16,7 @@ public class GateBehavior<E extends LivingEntity> extends Behavior<E> {
|
||||
@ -15,18 +15,18 @@ index c1f22c5e17418f91736237af1495a8a9910a61d5..e644bdd3a6f7c09a44149da03587b796
|
||||
private final GateBehavior.OrderPolicy orderPolicy;
|
||||
private final GateBehavior.RunningPolicy runningPolicy;
|
||||
- private final ShufflingList<Behavior<? super E>> behaviors = new ShufflingList<>();
|
||||
+ private final ShufflingList<Behavior<? super E>> behaviors = new ShufflingList<>(false); // Paper - don't use a clone
|
||||
+ private final ShufflingList<Behavior<? super E>> behaviors = new ShufflingList<>(false); // Paper - don't use a clone
|
||||
|
||||
public GateBehavior(Map<MemoryModuleType<?>, MemoryStatus> requiredMemoryState, Set<MemoryModuleType<?>> memoriesToForgetWhenStopped, GateBehavior.OrderPolicy order, GateBehavior.RunningPolicy runMode, List<Pair<Behavior<? super E>, Integer>> tasks) {
|
||||
super(requiredMemoryState);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
index 63b66966e243cfc32802e0a42f36a40d6400f0e4..4f42344fec13b8d7fe0c1dd412525853c35bacca 100644
|
||||
index 2af08836c60ddf0e1df7c53316eae6e329b5747f..090bba46b6ecd7d0e1415feb678b9b23264fe5e9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
|
||||
@@ -14,12 +14,25 @@ import java.util.stream.Stream;
|
||||
@@ -14,12 +14,25 @@ import net.minecraft.util.RandomSource;
|
||||
public class ShufflingList<U> {
|
||||
protected final List<ShufflingList.WeightedEntry<U>> entries;
|
||||
private final Random random = new Random();
|
||||
private final RandomSource random = RandomSource.create();
|
||||
+ private final boolean isUnsafe; // Paper
|
||||
|
||||
public ShufflingList() {
|
@ -11,10 +11,10 @@ This ensures the crystals/pillars are in expected state when the dragon spawns.
|
||||
See #3522
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index f713a1fefb0d8505672d653cf67ead13e321144f..b1a0654ba01c265385db877d528c1aa2103b2eb0 100644
|
||||
index ec51369448a7f84ee65915ca97a0f22093126caa..2eb6e548889cd05c9bd6fe5947ea5bce3b43eaaa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -408,6 +408,7 @@ public class EndDragonFight {
|
||||
@@ -409,6 +409,7 @@ public class EndDragonFight {
|
||||
enderDragon.moveTo(0.0D, 128.0D, 0.0D, this.level.random.nextFloat() * 360.0F, 0.0F);
|
||||
this.level.addFreshEntity(enderDragon);
|
||||
this.dragonUUID = enderDragon.getUUID();
|
@ -1,55 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Thu, 27 Aug 2020 16:57:25 -0400
|
||||
Subject: [PATCH] Fix hex colors not working in some kick messages
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index 86f99fbe3eb7a6c7ef288d7bff1d653df6f34790..8060d6461835d5b5b4429e9b280d08eae4e435e9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -50,7 +50,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
|
||||
if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
|
||||
ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
|
||||
- TranslatableComponent chatmessage = new TranslatableComponent(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
|
||||
+ Component chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage, true)[0]; // Paper - Configurable connection throttle kick message // Paper - Fix hex colors not working in some kick messages
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||
this.connection.disconnect(chatmessage);
|
||||
return;
|
||||
@@ -76,12 +76,12 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) {
|
||||
- TranslatableComponent chatmessage;
|
||||
+ Component chatmessage; // Paper - Fix hex colors not working in some kick messages
|
||||
|
||||
if (packet.getProtocolVersion() < 754) {
|
||||
- chatmessage = new TranslatableComponent( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
|
||||
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
|
||||
} else {
|
||||
- chatmessage = new TranslatableComponent( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot
|
||||
+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
|
||||
}
|
||||
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index d21f45d983bf3047811d2d73f4a38deb108ac402..ab21f25a3eb0575d08aeac717ba2b74160f54fa9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -102,14 +102,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
// CraftBukkit start
|
||||
@Deprecated
|
||||
public void disconnect(String s) {
|
||||
- try {
|
||||
- Component ichatbasecomponent = new TextComponent(s);
|
||||
- ServerLoginPacketListenerImpl.LOGGER.info("Disconnecting {}: {}", this.getUserName(), s);
|
||||
- this.connection.send(new ClientboundLoginDisconnectPacket(ichatbasecomponent));
|
||||
- this.connection.disconnect(ichatbasecomponent);
|
||||
- } catch (Exception exception) {
|
||||
- ServerLoginPacketListenerImpl.LOGGER.error("Error whilst disconnecting player", exception);
|
||||
- }
|
||||
+ disconnect(org.bukkit.craftbukkit.util.CraftChatMessage.fromString(s, true)[0]); // Paper - Fix hex colors not working in some kick messages
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
Loading…
Reference in New Issue
Block a user