mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-06-22 18:27:46 +02:00
Upstream Paper's upgrade to vineflower 12.0.0 (#1782)
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
getTPS(this.tickTimes1m, interval),
|
||||
getTPS(this.tickTimes5m, interval),
|
||||
getTPS(this.tickTimes15m, interval)
|
||||
@@ -1057,6 +_,15 @@
|
||||
@@ -1047,6 +_,15 @@
|
||||
|
||||
LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -41,7 +41,7 @@
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.spark.disable(); // Paper - spark
|
||||
@@ -1151,6 +_,8 @@
|
||||
@@ -1141,6 +_,8 @@
|
||||
this.safeShutdown(wait, false);
|
||||
}
|
||||
public void safeShutdown(final boolean wait, final boolean isRestarting) {
|
||||
@@ -50,7 +50,7 @@
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1332,11 +_,21 @@
|
||||
@@ -1322,11 +_,21 @@
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
// Paper start - Improve outdated version checking
|
||||
@@ -73,7 +73,7 @@
|
||||
while (this.running) {
|
||||
final long tickStart = System.nanoTime(); // Paper - improve tick loop
|
||||
long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval
|
||||
@@ -1350,9 +_,11 @@
|
||||
@@ -1340,9 +_,11 @@
|
||||
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart));
|
||||
final long catchup = (long)Math.max(
|
||||
1,
|
||||
@@ -86,7 +86,7 @@
|
||||
// adjust ticksBehind so that it is not greater-than catchup
|
||||
if (ticksBehind - catchup > 0L) {
|
||||
final long difference = ticksBehind - catchup;
|
||||
@@ -1983,7 +_,7 @@
|
||||
@@ -1973,7 +_,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
- if (level > enchantment.getMaxLevel()) {
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.allowUnsafeEnchantCommand && level > enchantment.getMaxLevel()) { // Purpur - Config to allow unsafe enchants
|
||||
throw ERROR_LEVEL_TOO_HIGH.create(level, enchantment.getMaxLevel());
|
||||
} else {
|
||||
int success = 0;
|
||||
@@ -77,7 +_,7 @@
|
||||
ItemStack item = target.getMainHandItem();
|
||||
if (!item.isEmpty()) {
|
||||
if (enchantment.canEnchant(item)
|
||||
- && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder)) {
|
||||
+ && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder) || (org.purpurmc.purpur.PurpurConfig.allowUnsafeEnchantCommand && !item.hasEnchantment(enchantmentHolder))) { // Purpur - Config to allow unsafe enchants
|
||||
item.enchant(enchantmentHolder, level);
|
||||
success++;
|
||||
} else if (targets.size() == 1) {
|
||||
}
|
||||
|
||||
@@ -78,7 +_,7 @@
|
||||
ItemStack item = target.getMainHandItem();
|
||||
if (!item.isEmpty()) {
|
||||
if (enchantment.canEnchant(item)
|
||||
- && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder)) {
|
||||
+ && EnchantmentHelper.isEnchantmentCompatible(EnchantmentHelper.getEnchantmentsForCrafting(item).keySet(), enchantmentHolder) || (org.purpurmc.purpur.PurpurConfig.allowUnsafeEnchantCommand && !item.hasEnchantment(enchantmentHolder))) { // Purpur - Config to allow unsafe enchants
|
||||
item.enchant(enchantmentHolder, level);
|
||||
success++;
|
||||
} else if (targets.size() == 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
--- a/net/minecraft/server/commands/GiveCommand.java
|
||||
+++ b/net/minecraft/server/commands/GiveCommand.java
|
||||
@@ -61,6 +_,7 @@
|
||||
remaining -= size;
|
||||
ItemStack copyToDrop = prototypeItemStack.copyWithCount(size);
|
||||
boolean added = player.getInventory().add(copyToDrop);
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableGiveCommandDrops) continue; // Purpur - add config option for toggling give command dropping
|
||||
if (added && copyToDrop.isEmpty()) {
|
||||
ItemEntity drop = player.drop(prototypeItemStack.copy(), false, false, false, null); // Paper - do not fire PlayerDropItemEvent for /give command
|
||||
if (drop != null) {
|
||||
@@ -62,6 +_,7 @@
|
||||
remaining -= size;
|
||||
ItemStack copyToDrop = prototypeItemStack.copyWithCount(size);
|
||||
boolean added = player.getInventory().add(copyToDrop);
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableGiveCommandDrops) continue; // Purpur - add config option for toggling give command dropping
|
||||
if (added && copyToDrop.isEmpty()) {
|
||||
ItemEntity drop = player.drop(prototypeItemStack.copy(), false, false, false, null); // Paper - do not fire PlayerDropItemEvent for /give command
|
||||
if (drop != null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -216,6 +_,7 @@
|
||||
@@ -211,6 +_,7 @@
|
||||
public void run() {
|
||||
if (!org.bukkit.craftbukkit.Main.useConsole) return; // CraftBukkit
|
||||
// Paper start - Use TerminalConsoleAppender
|
||||
@@ -8,7 +8,7 @@
|
||||
new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start();
|
||||
/*
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
|
||||
@@ -294,6 +_,15 @@
|
||||
@@ -289,6 +_,15 @@
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
@@ -24,8 +24,8 @@
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
// this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading
|
||||
@@ -336,6 +_,30 @@
|
||||
if (true) throw new IllegalStateException("Failed to bind to port", var11); // Paper - Propagate failed to bind to port error
|
||||
@@ -331,6 +_,30 @@
|
||||
if (true) throw new IllegalStateException("Failed to bind to port", e); // Paper - Propagate failed to bind to port error
|
||||
return false;
|
||||
}
|
||||
+ // Purpur start - UPnP Port Forwarding
|
||||
@@ -55,13 +55,13 @@
|
||||
|
||||
// CraftBukkit start
|
||||
this.server.loadPlugins();
|
||||
@@ -410,6 +_,9 @@
|
||||
MinecraftServerStatistics.registerJmxMonitoring(this);
|
||||
LOGGER.info("JMX monitoring enabled");
|
||||
}
|
||||
@@ -406,6 +_,9 @@
|
||||
MinecraftServerStatistics.registerJmxMonitoring(this);
|
||||
LOGGER.info("JMX monitoring enabled");
|
||||
}
|
||||
+
|
||||
+ org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur - Implement TPSBar
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.beeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur - Give bee counts in beehives to Purpur clients
|
||||
+ org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur - Implement TPSBar
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.beeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur - Give bee counts in beehives to Purpur clients
|
||||
|
||||
this.saveEverything(false, true, true);
|
||||
this.notificationManager().serverStarted();
|
||||
this.saveEverything(false, true, true);
|
||||
this.notificationManager().serverStarted();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -40,6 +_,11 @@
|
||||
@@ -39,6 +_,11 @@
|
||||
private Thread logAppenderThread;
|
||||
private final Collection<Runnable> finalizers = Lists.newArrayList();
|
||||
private final AtomicBoolean isClosing = new AtomicBoolean();
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
public static MinecraftServerGui showFrameFor(final DedicatedServer server) {
|
||||
try {
|
||||
@@ -47,7 +_,7 @@
|
||||
@@ -46,7 +_,7 @@
|
||||
} catch (Exception var3) {
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
final MinecraftServerGui gui = new MinecraftServerGui(server);
|
||||
frame.setDefaultCloseOperation(2);
|
||||
frame.add(gui);
|
||||
@@ -55,7 +_,7 @@
|
||||
@@ -54,7 +_,7 @@
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setVisible(true);
|
||||
// Paper start - Improve ServerGUI
|
||||
@@ -30,7 +30,7 @@
|
||||
try {
|
||||
frame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("logo.png"))));
|
||||
} catch (java.io.IOException ignore) {
|
||||
@@ -65,7 +_,7 @@
|
||||
@@ -64,7 +_,7 @@
|
||||
@Override
|
||||
public void windowClosing(final WindowEvent event) {
|
||||
if (!gui.isClosing.getAndSet(true)) {
|
||||
@@ -39,7 +39,7 @@
|
||||
server.halt(true);
|
||||
gui.runFinalizers();
|
||||
}
|
||||
@@ -113,7 +_,7 @@
|
||||
@@ -112,7 +_,7 @@
|
||||
|
||||
private JComponent buildChatPanel() {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
@@ -48,7 +48,7 @@
|
||||
JScrollPane scrollPane = new JScrollPane(chatArea, 22, 30);
|
||||
chatArea.setEditable(false);
|
||||
chatArea.setFont(MONOSPACED);
|
||||
@@ -122,10 +_,43 @@
|
||||
@@ -121,10 +_,43 @@
|
||||
String text = chatField.getText().trim();
|
||||
if (!text.isEmpty()) {
|
||||
this.server.handleConsoleInput(text, this.server.createCommandSourceStack());
|
||||
@@ -90,9 +90,9 @@
|
||||
+ });
|
||||
+ // Purpur end - GUI Improvements
|
||||
chatArea.addFocusListener(new FocusAdapter() {
|
||||
{
|
||||
Objects.requireNonNull(MinecraftServerGui.this);
|
||||
@@ -164,7 +_,7 @@
|
||||
@Override
|
||||
public void focusGained(final FocusEvent arg0) {
|
||||
@@ -159,7 +_,7 @@
|
||||
}
|
||||
|
||||
private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\e\\[[\\d;]*[^\\d;]"); // CraftBukkit // Paper
|
||||
@@ -101,7 +101,7 @@
|
||||
if (!SwingUtilities.isEventDispatchThread()) {
|
||||
SwingUtilities.invokeLater(() -> this.print(console, scrollPane, line));
|
||||
} else {
|
||||
@@ -175,16 +_,29 @@
|
||||
@@ -170,16 +_,29 @@
|
||||
shouldScroll = scrollBar.getValue() + scrollBar.getSize().getHeight() + MONOSPACED.getSize() * 4 > scrollBar.getMaximum();
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
|
||||
: Explosion.BlockInteraction.KEEP;
|
||||
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
|
||||
@@ -2919,7 +_,7 @@
|
||||
@@ -2914,7 +_,7 @@
|
||||
// Spigot start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||
// Paper start - Fix merchant inventory not closing on entity removal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -454,6 +_,9 @@
|
||||
@@ -435,6 +_,9 @@
|
||||
public boolean isRealPlayer; // Paper
|
||||
public com.destroystokyo.paper.event.entity.@Nullable PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public org.bukkit.event.player.PlayerQuitEvent.@Nullable QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
@@ -527,6 +_,9 @@
|
||||
@@ -508,6 +_,9 @@
|
||||
this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
|
||||
this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
|
||||
this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
|
||||
@@ -20,7 +20,7 @@
|
||||
// Paper start - Expand PlayerGameModeChangeEvent
|
||||
this.loadGameTypes(input);
|
||||
}
|
||||
@@ -568,6 +_,9 @@
|
||||
@@ -549,6 +_,9 @@
|
||||
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
|
||||
}
|
||||
this.getBukkitEntity().setExtraData(output); // CraftBukkit
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
private void saveParentVehicle(final ValueOutput playerOutput) {
|
||||
@@ -1203,6 +_,7 @@
|
||||
@@ -1179,6 +_,7 @@
|
||||
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
|
||||
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
|
||||
Team team = this.getTeam();
|
||||
@@ -38,59 +38,66 @@
|
||||
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
|
||||
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
|
||||
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
||||
@@ -1311,6 +_,13 @@
|
||||
if (this.isInvulnerableTo(level, source)) {
|
||||
@@ -1288,6 +_,13 @@
|
||||
return false;
|
||||
} else {
|
||||
+ // Purpur start - Add boat fall damage config
|
||||
+ if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {
|
||||
+ if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.boat.Boat && !level().purpurConfig.boatsDoFallDamage) {
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
+ // Purpur start - Add boat fall damage config
|
||||
+ if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {
|
||||
+ if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.boat.Boat && !level().purpurConfig.boatsDoFallDamage) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end - Add boat fall damage config
|
||||
Entity entity = source.getEntity();
|
||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||
!(entity instanceof Player playerx && !this.canHarmPlayer(playerx))
|
||||
@@ -1570,6 +_,7 @@
|
||||
+ }
|
||||
+ // Purpur end - Add boat fall damage config
|
||||
Entity entity = source.getEntity();
|
||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||
!(entity instanceof Player player && !this.canHarmPlayer(player))
|
||||
@@ -1529,7 +_,7 @@
|
||||
}
|
||||
|
||||
profiler.pop();
|
||||
profiler.push("placing");
|
||||
+ this.portalPos = org.bukkit.craftbukkit.util.CraftLocation.toBlockPos(exit); // Purpur - Fix stuck in portals
|
||||
this.setServerLevel(newLevel);
|
||||
this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit - use internal teleport without event
|
||||
this.connection.resetPosition();
|
||||
@@ -1686,7 +_,7 @@
|
||||
),
|
||||
monster -> monster.isPreventingPlayerRest(this.level(), this)
|
||||
);
|
||||
- if (!monsters.isEmpty()) {
|
||||
+ if (!this.level().purpurConfig.playerSleepNearMonsters && !monsters.isEmpty()) { // Purpur - Config to ignore nearby mobs when sleeping
|
||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||
}
|
||||
}
|
||||
@@ -1726,8 +_,19 @@
|
||||
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
if (!this.level().canSleepThroughNights()) {
|
||||
- this.sendOverlayMessage(Component.translatable("sleep.not_possible"));
|
||||
+ // Purpur start - Customizable sleeping actionbar messages
|
||||
+ Component clientMessage;
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.sleepNotPossible.isBlank()) {
|
||||
+ clientMessage = null;
|
||||
+ } else if (!org.purpurmc.purpur.PurpurConfig.sleepNotPossible.equalsIgnoreCase("default")) {
|
||||
+ clientMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.sleepNotPossible));
|
||||
+ } else {
|
||||
+ clientMessage = Component.translatable("sleep.not_possible");
|
||||
}
|
||||
+ if (clientMessage != null) {
|
||||
+ this.sendOverlayMessage(clientMessage);
|
||||
+ }// Purpur end - Customizable sleeping actionbar messages
|
||||
+ }
|
||||
if (newLevel.dimension() == lastDimension) {
|
||||
- this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit
|
||||
+ this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit
|
||||
this.connection.resetPosition();
|
||||
transition.postTeleportTransition().onTransition(this);
|
||||
return this;
|
||||
@@ -1552,6 +_,7 @@
|
||||
|
||||
this.level().updateSleepingPlayerList();
|
||||
return result;
|
||||
@@ -1821,6 +_,7 @@
|
||||
profiler.pop();
|
||||
profiler.push("placing");
|
||||
+ this.portalPos = org.bukkit.craftbukkit.util.CraftLocation.toBlockPos(exit); // Purpur - Fix stuck in portals
|
||||
this.setServerLevel(newLevel);
|
||||
this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit - use internal teleport without event
|
||||
this.connection.resetPosition();
|
||||
@@ -1664,7 +_,7 @@
|
||||
new AABB(bedCenter.x() - 8.0, bedCenter.y() - 5.0, bedCenter.z() - 8.0, bedCenter.x() + 8.0, bedCenter.y() + 5.0, bedCenter.z() + 8.0),
|
||||
monster -> monster.isPreventingPlayerRest(this.level(), this)
|
||||
);
|
||||
- if (!monsters.isEmpty()) {
|
||||
+ if (!this.level().purpurConfig.playerSleepNearMonsters && !monsters.isEmpty()) { // Purpur - Config to ignore nearby mobs when sleeping
|
||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||
}
|
||||
}
|
||||
@@ -1700,7 +_,17 @@
|
||||
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
if (!this.level().canSleepThroughNights()) {
|
||||
- this.sendOverlayMessage(Component.translatable("sleep.not_possible"));
|
||||
+ // Purpur start - Customizable sleeping actionbar messages
|
||||
+ Component clientMessage;
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.sleepNotPossible.isBlank()) {
|
||||
+ clientMessage = null;
|
||||
+ } else if (!org.purpurmc.purpur.PurpurConfig.sleepNotPossible.equalsIgnoreCase("default")) {
|
||||
+ clientMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.sleepNotPossible));
|
||||
+ } else {
|
||||
+ clientMessage = Component.translatable("sleep.not_possible");
|
||||
+ } if (clientMessage != null) {
|
||||
+ this.sendOverlayMessage(clientMessage);
|
||||
+ }// Purpur end - Customizable sleeping actionbar messages
|
||||
}
|
||||
|
||||
this.level().updateSleepingPlayerList();
|
||||
@@ -1794,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
public void openTextEdit(final SignBlockEntity sign, final boolean isFrontText) {
|
||||
@@ -98,7 +105,7 @@
|
||||
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos()));
|
||||
this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), isFrontText));
|
||||
}
|
||||
@@ -2164,6 +_,26 @@
|
||||
@@ -2138,6 +_,26 @@
|
||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||
}
|
||||
|
||||
@@ -125,7 +132,7 @@
|
||||
@Override
|
||||
public void completeUsingItem() {
|
||||
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
||||
@@ -2403,6 +_,20 @@
|
||||
@@ -2373,6 +_,20 @@
|
||||
);
|
||||
}
|
||||
|
||||
@@ -146,7 +153,7 @@
|
||||
@Override
|
||||
public void sendSystemMessage(final Component message) {
|
||||
this.sendSystemMessage(message, false);
|
||||
@@ -2554,7 +_,67 @@
|
||||
@@ -2524,7 +_,67 @@
|
||||
|
||||
public void resetLastActionTime() {
|
||||
this.lastActionTime = Util.getMillis();
|
||||
@@ -215,7 +222,7 @@
|
||||
|
||||
public ServerStatsCounter getStats() {
|
||||
return this.stats;
|
||||
@@ -3179,4 +_,65 @@
|
||||
@@ -3149,4 +_,65 @@
|
||||
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -371,6 +_,7 @@
|
||||
@@ -370,6 +_,7 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
BlockPos pos = hitResult.getBlockPos();
|
||||
BlockState state = level.getBlockState(pos);
|
||||
boolean cancelledBlock = false;
|
||||
@@ -549,7 +_,7 @@
|
||||
@@ -551,7 +_,7 @@
|
||||
boolean haveSomethingInOurHands = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
|
||||
boolean suppressUsingBlock = player.isSecondaryUseActive() && haveSomethingInOurHands;
|
||||
ItemStack usedItemStack = itemStack.copy();
|
||||
@@ -25,7 +25,7 @@
|
||||
InteractionResult itemUse = state.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
|
||||
if (itemUse.consumesAction()) {
|
||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, pos, usedItemStack);
|
||||
@@ -595,4 +_,18 @@
|
||||
@@ -597,4 +_,18 @@
|
||||
public void setLevel(final ServerLevel newLevel) {
|
||||
this.level = newLevel;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
private boolean shouldCheckPlayerMovement(final boolean isFallFlying) {
|
||||
if (this.isSingleplayerOwner()) {
|
||||
return false;
|
||||
@@ -2227,6 +_,7 @@
|
||||
@@ -2229,6 +_,7 @@
|
||||
|
||||
boolean cancelled;
|
||||
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
|
||||
@@ -214,7 +214,7 @@
|
||||
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemStack, hand);
|
||||
cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||
} else {
|
||||
@@ -2861,6 +_,7 @@
|
||||
@@ -2863,6 +_,7 @@
|
||||
ItemStack mainHandItem = this.player.getMainHandItem();
|
||||
if (this.player.isWithinAttackRange(mainHandItem, targetBounds, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience
|
||||
if (!mainHandItem.has(DataComponents.PIERCING_WEAPON)) {
|
||||
@@ -222,7 +222,7 @@
|
||||
if (target instanceof ItemEntity
|
||||
|| target instanceof ExperienceOrb
|
||||
|| target == this.player
|
||||
@@ -3642,7 +_,7 @@
|
||||
@@ -3644,7 +_,7 @@
|
||||
@Override
|
||||
public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -288,7 +_,7 @@
|
||||
@@ -284,7 +_,7 @@
|
||||
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
|
||||
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(name)); // Spigot
|
||||
} else {
|
||||
@@ -8,4 +8,4 @@
|
||||
+ ServerLoginPacketListenerImpl.this.disconnect(org.purpurmc.purpur.PurpurConfig.unverifiedUsername.equals("default") ? Component.translatable("multiplayer.disconnect.unverified_username") : io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.unverifiedUsername))); // Purpur - Config for unverified username message
|
||||
ServerLoginPacketListenerImpl.LOGGER.error("Username '{}' tried to join with an invalid session", name);
|
||||
}
|
||||
} catch (AuthenticationUnavailableException var4) {
|
||||
} catch (AuthenticationUnavailableException ignored) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -313,6 +_,7 @@
|
||||
@@ -312,6 +_,7 @@
|
||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
@@ -8,7 +8,7 @@
|
||||
// CraftBukkit start - moved down
|
||||
LOGGER.info(
|
||||
"{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // Paper - add world identifier
|
||||
@@ -437,6 +_,7 @@
|
||||
@@ -432,6 +_,7 @@
|
||||
}
|
||||
public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player, final net.kyori.adventure.text.Component leaveMessage) {
|
||||
// Paper end - Fix kick event leave message not being sent
|
||||
@@ -16,7 +16,7 @@
|
||||
ServerLevel level = player.level();
|
||||
player.awardStat(Stats.LEAVE_GAME);
|
||||
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
|
||||
@@ -771,6 +_,20 @@
|
||||
@@ -768,6 +_,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
public void broadcastAll(final Packet<?> packet, final ResourceKey<Level> dimension) {
|
||||
for (ServerPlayer player : this.players) {
|
||||
if (player.level().dimension() == dimension) {
|
||||
@@ -864,6 +_,7 @@
|
||||
@@ -861,6 +_,7 @@
|
||||
case ADMINS -> EntityEvent.PERMISSION_LEVEL_ADMINS;
|
||||
case OWNERS -> EntityEvent.PERMISSION_LEVEL_OWNERS;
|
||||
};
|
||||
@@ -45,7 +45,7 @@
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, eventId));
|
||||
}
|
||||
|
||||
@@ -875,7 +_,7 @@
|
||||
@@ -872,7 +_,7 @@
|
||||
|
||||
// Paper start - whitelist verify event / login event
|
||||
public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) {
|
||||
|
||||
Reference in New Issue
Block a user