mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-06-23 02:37:47 +02:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@6fe7eb5a Load World Key when its instance is created (#13818) PaperMC/Paper@944ce44a Fix CraftWorld identifier passing PaperMC/Paper@aa6f09b0 Prevent Happy Ghast from playing mount/dismount noises when silenced (#13807) PaperMC/Paper@7b31cc2b Make leaveMessage in PlayerKickEvent nullable (#13804) PaperMC/Paper@65461225 Update health after setPlayerProfile() (#13717) PaperMC/Paper@1a8417b1 [ci/skip] Add Javadocs for PotionEffect withX methods (#13723) PaperMC/Paper@4af86ff3 Handle null ServerLevel in fromGlobalPos (#13703) PaperMC/Paper@c39822ae reset pending keepalive state on listener handoff during reconfiguration (#13712) PaperMC/Paper@dcf5577a Fix PlayerProfile applySkinToPlayerHeadContents (#13692) PaperMC/Paper@dd203a27 chore: Don't log errors for accepting the EULA via the system property (#13681) PaperMC/Paper@d74f6bc7 Support for Kill damageable entities (#13667) PaperMC/Paper@90aee8e0 Update world methods to take in account environment attributes (#13543) PaperMC/Paper@b2b1e177 Improvement to Vehicle damage events (#13572) PaperMC/Paper@49daadd2 Fix insomniaStartTicks option being ignored for phantom spawning (#13609) PaperMC/Paper@57d84f68 Prevent NPE on ThrownPotion#splash (#13683) PaperMC/Paper@4f184db3 Fix memory leak on constantly damage (#13455) PaperMC/Paper@60073714 Update MOJIRA reference in DeOp command response for multiple targets [ci/skip] (#13812) PaperMC/Paper@4aef3f0a Remove already fixed vanilla bug MC-244739 (#13787) PaperMC/Paper@945aea99 Fix Damager for HangingBreakByEntityEvent and minor improvements (#12615) PaperMC/Paper@a8c05a35 Add an option to WorldCreator to avoid spawn location computation on world creation (#13407) PaperMC/Paper@182b2f8a Add Point Of Interest API (#12117) PaperMC/Paper@8021488e Disconnect State Fixes (#13616) PaperMC/Paper@1f819732 Allow ServerboundChangeGameModePacket if player has /gamemode permissions (#13507) PaperMC/Paper@a64ea13e Re-implement per-world and per-player time (#13814) PaperMC/Paper@acfe105b Add options to disable chunk and block entity ticking (#13821) PaperMC/Paper@651d8481 Finish world key initial migration (#13824) PaperMC/Paper@f4e769a7 Improvements checks for arguments numbers (#13290) PaperMC/Paper@5dc4afc1 Promote build channel to BETA PaperMC/Paper@55be6c0e Fix boat and minecart inventories on region switch [ci/skip] (#13826) PaperMC/Paper@7799bf28 Update Paperclip to v3.0.4
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
getTPS(this.tickTimes1m, interval),
|
||||
getTPS(this.tickTimes5m, interval),
|
||||
getTPS(this.tickTimes15m, interval)
|
||||
@@ -1047,6 +_,15 @@
|
||||
@@ -1057,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
|
||||
@@ -1141,6 +_,8 @@
|
||||
@@ -1151,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
|
||||
@@ -1322,11 +_,21 @@
|
||||
@@ -1332,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
|
||||
@@ -1340,9 +_,11 @@
|
||||
@@ -1350,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;
|
||||
@@ -1965,7 +_,7 @@
|
||||
@@ -1983,7 +_,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -642,8 +_,25 @@
|
||||
@@ -643,8 +_,25 @@
|
||||
// CraftBukkit end
|
||||
this.tickTime = tickTime;
|
||||
this.server = server;
|
||||
@@ -35,8 +35,8 @@
|
||||
+ // Purpur end - Allow toggling special MobSpawners per world
|
||||
ChunkGenerator generator = levelStem.generator();
|
||||
// CraftBukkit start
|
||||
if (loadedWorldData.pdc() != null) {
|
||||
@@ -731,6 +_,7 @@
|
||||
// Paper start - per-world time
|
||||
@@ -738,6 +_,7 @@
|
||||
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
|
||||
// Paper end - rewrite chunk system
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
@@ -44,16 +44,16 @@
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -787,7 +_,7 @@
|
||||
@@ -794,7 +_,7 @@
|
||||
}
|
||||
|
||||
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
||||
- if (this.sleepStatus.areEnoughSleeping(percentage) && this.sleepStatus.areEnoughDeepSleeping(percentage, this.players)) {
|
||||
+ if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(percentage) && this.sleepStatus.areEnoughDeepSleeping(percentage, this.players)) { // Purpur - Config for skipping night
|
||||
Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock();
|
||||
org.bukkit.event.world.TimeSkipEvent event = null; // Paper - time skip event
|
||||
org.bukkit.event.world.ClockTimeSkipEvent event = null; // Paper - per-world time
|
||||
if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) {
|
||||
@@ -1026,9 +_,18 @@
|
||||
@@ -1036,9 +_,18 @@
|
||||
&& this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
|
||||
&& !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS);
|
||||
if (isTrap) {
|
||||
@@ -73,7 +73,7 @@
|
||||
horse.setAge(0);
|
||||
horse.setPos(pos.getX(), pos.getY(), pos.getZ());
|
||||
this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -1063,9 +_,35 @@
|
||||
@@ -1073,9 +_,35 @@
|
||||
if (state.is(Blocks.SNOW)) {
|
||||
int currentLayers = state.getValue(SnowLayerBlock.LAYERS);
|
||||
if (currentLayers < Math.min(maxHeight, 8)) {
|
||||
@@ -109,7 +109,7 @@
|
||||
}
|
||||
} else {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
|
||||
@@ -1086,7 +_,7 @@
|
||||
@@ -1096,7 +_,7 @@
|
||||
p -> p.is(PoiTypes.LIGHTNING_ROD),
|
||||
lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1,
|
||||
center,
|
||||
@@ -118,7 +118,7 @@
|
||||
PoiManager.Occupancy.ANY
|
||||
);
|
||||
return nearbyLightningRod.map(blockPos -> blockPos.above(1));
|
||||
@@ -1134,8 +_,26 @@
|
||||
@@ -1144,8 +_,26 @@
|
||||
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
||||
Component message;
|
||||
if (this.sleepStatus.areEnoughSleeping(percentage)) {
|
||||
@@ -145,7 +145,7 @@
|
||||
message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage));
|
||||
}
|
||||
|
||||
@@ -1301,6 +_,7 @@
|
||||
@@ -1311,6 +_,7 @@
|
||||
public void resetWeatherCycle() {
|
||||
WeatherData weatherData = this.getWeatherData();
|
||||
// CraftBukkit start
|
||||
@@ -153,7 +153,7 @@
|
||||
weatherData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||
@@ -1308,6 +_,7 @@
|
||||
@@ -1318,6 +_,7 @@
|
||||
weatherData.setRainTime(0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -161,7 +161,7 @@
|
||||
weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// CraftBukkit start
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
@@ -1979,7 +_,7 @@
|
||||
@@ -1989,7 +_,7 @@
|
||||
Explosion.BlockInteraction blockInteraction = switch (interactionType) {
|
||||
case NONE -> Explosion.BlockInteraction.KEEP;
|
||||
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
|
||||
@@ -170,7 +170,7 @@
|
||||
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
|
||||
: Explosion.BlockInteraction.KEEP;
|
||||
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
|
||||
@@ -2909,7 +_,7 @@
|
||||
@@ -2919,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
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
private volatile int latency; // Paper - improve keepalives - make volatile
|
||||
private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives
|
||||
private volatile boolean suspendFlushingOnServerThread = false;
|
||||
@@ -54,6 +_,10 @@
|
||||
@@ -53,6 +_,10 @@
|
||||
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
|
||||
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
|
||||
protected static final net.minecraft.resources.Identifier MINECRAFT_BRAND = net.minecraft.resources.Identifier.withDefaultNamespace("brand"); // Paper - Brand support
|
||||
@@ -24,7 +24,7 @@
|
||||
// Paper start - retain certain values
|
||||
public @Nullable String playerBrand;
|
||||
public final java.util.Set<String> pluginMessagerChannels;
|
||||
@@ -105,6 +_,18 @@
|
||||
@@ -104,6 +_,18 @@
|
||||
// Paper start - improve keepalives
|
||||
long now = System.nanoTime();
|
||||
io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek();
|
||||
@@ -43,7 +43,7 @@
|
||||
if (pending != null && pending.challengeId() == packet.getId()) {
|
||||
this.keepAlive.pendingKeepAlives.remove(pending);
|
||||
|
||||
@@ -179,6 +_,12 @@
|
||||
@@ -172,6 +_,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -56,17 +56,17 @@
|
||||
if (identifier.equals(MINECRAFT_BRAND)) {
|
||||
this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
|
||||
}
|
||||
@@ -264,6 +_,23 @@
|
||||
@@ -257,6 +_,23 @@
|
||||
Profiler.get().push("keepAlive");
|
||||
long now = Util.getMillis();
|
||||
// Paper start - improve keepalives
|
||||
+ // Purpur start - Alternative Keepalive Handling
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.useAlternateKeepAlive) {
|
||||
+ if (this.checkIfClosed(now) && !this.processedDisconnect) {
|
||||
+ if (this.checkIfClosed(now)) {
|
||||
+ long currTime = System.nanoTime();
|
||||
+ if ((currTime - this.keepAlive.lastKeepAliveTx) >= java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)) { // 1 second
|
||||
+ this.keepAlive.lastKeepAliveTx = currTime;
|
||||
+ if (this.keepAlivePending && !this.processedDisconnect && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) {
|
||||
+ if (this.keepAlivePending && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) {
|
||||
+ this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, io.papermc.paper.connection.DisconnectionReason.TIMEOUT);
|
||||
+ } else if (this.checkIfClosed(now)) {
|
||||
+ this.keepAlivePending = true;
|
||||
@@ -77,6 +77,6 @@
|
||||
+ }
|
||||
+ } else
|
||||
+ // Purpur end - Alternative Keepalive Handling
|
||||
if (this.checkIfClosed(now) && !this.processedDisconnect) {
|
||||
if (this.checkIfClosed(now)) {
|
||||
long currTime = System.nanoTime();
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
+
|
||||
@Override
|
||||
public void tick() {
|
||||
if (this.isDisconnected()) return; // Paper
|
||||
@@ -372,6 +_,12 @@
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
@@ -371,6 +_,12 @@
|
||||
&& this.server.playerIdleTimeout() > 0
|
||||
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
|
||||
&& !this.player.wonGame) {
|
||||
@@ -34,7 +34,7 @@
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
||||
}
|
||||
}
|
||||
@@ -693,6 +_,8 @@
|
||||
@@ -692,6 +_,8 @@
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -772,6 +_,7 @@
|
||||
@@ -771,6 +_,7 @@
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
if (packet.getId() == this.awaitingTeleport) {
|
||||
if (this.awaitingPositionFromClient == null) {
|
||||
@@ -51,7 +51,7 @@
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||
return;
|
||||
}
|
||||
@@ -1340,6 +_,10 @@
|
||||
@@ -1339,6 +_,10 @@
|
||||
final int maxBookPageSize = pageMax.intValue();
|
||||
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
||||
long byteAllowed = maxBookPageSize;
|
||||
@@ -62,7 +62,7 @@
|
||||
for (final String page : pageList) {
|
||||
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
byteTotal += byteLength;
|
||||
@@ -1364,7 +_,8 @@
|
||||
@@ -1363,7 +_,8 @@
|
||||
}
|
||||
|
||||
if (byteTotal > byteAllowed) {
|
||||
@@ -72,7 +72,7 @@
|
||||
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
|
||||
return;
|
||||
}
|
||||
@@ -1383,31 +_,45 @@
|
||||
@@ -1382,31 +_,45 @@
|
||||
Optional<String> title = packet.title();
|
||||
title.ifPresent(contents::add);
|
||||
contents.addAll(packet.pages());
|
||||
@@ -122,7 +122,7 @@
|
||||
writtenBook.set(
|
||||
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, pages, true)
|
||||
);
|
||||
@@ -1420,6 +_,16 @@
|
||||
@@ -1419,6 +_,16 @@
|
||||
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(text.filteredOrEmpty()) : Filterable.from(text);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
@Override
|
||||
public void handleEntityTagQuery(final ServerboundEntityTagQueryPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
@@ -1459,7 +_,15 @@
|
||||
@@ -1458,7 +_,15 @@
|
||||
@Override
|
||||
public void handleMovePlayer(final ServerboundMovePlayerPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
@@ -156,7 +156,7 @@
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||
} else {
|
||||
ServerLevel level = this.player.level();
|
||||
@@ -1644,7 +_,7 @@
|
||||
@@ -1643,7 +_,7 @@
|
||||
movedWrongly = true;
|
||||
if (event.getLogWarning())
|
||||
// Paper end
|
||||
@@ -165,7 +165,7 @@
|
||||
} // Paper
|
||||
}
|
||||
|
||||
@@ -1709,6 +_,8 @@
|
||||
@@ -1708,6 +_,8 @@
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -1764,6 +_,13 @@
|
||||
@@ -1763,6 +_,13 @@
|
||||
this.player.tryResetCurrentImpulseContext();
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
this.player.checkMovementStatistics(this.player.getX() - startX, this.player.getY() - startY, this.player.getZ() - startZ);
|
||||
this.lastGoodX = this.player.getX();
|
||||
this.lastGoodY = this.player.getY();
|
||||
@@ -1784,6 +_,17 @@
|
||||
@@ -1783,6 +_,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
private boolean shouldCheckPlayerMovement(final boolean isFallFlying) {
|
||||
if (this.isSingleplayerOwner()) {
|
||||
return false;
|
||||
@@ -2228,6 +_,7 @@
|
||||
@@ -2227,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 {
|
||||
@@ -2869,6 +_,7 @@
|
||||
@@ -2861,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,12 +222,12 @@
|
||||
if (target instanceof ItemEntity
|
||||
|| target instanceof ExperienceOrb
|
||||
|| target == this.player
|
||||
@@ -3650,7 +_,7 @@
|
||||
@@ -3642,7 +_,7 @@
|
||||
@Override
|
||||
public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
- if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions())) {
|
||||
+ if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !player.getBukkitEntity().hasPermission("purpur.debug.f3n")) { // Purpur - Add permission for F3+N debug
|
||||
- if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.command.gamemode")) { // Paper - add permission check
|
||||
+ if (!GameModeCommand.PERMISSION_CHECK.check(this.player.permissions()) && !this.player.getBukkitEntity().hasPermission("minecraft.command.gamemode") && !player.getBukkitEntity().hasPermission("purpur.debug.f3n")) { // Paper - add permission check // Purpur - Add permission for F3+N debug
|
||||
LOGGER.warn(
|
||||
"Player {} tried to change game mode to {} without required permissions",
|
||||
this.player.getGameProfile().name(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -282,7 +_,7 @@
|
||||
@@ -290,7 +_,7 @@
|
||||
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
|
||||
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(name)); // Spigot
|
||||
} else {
|
||||
|
||||
@@ -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
|
||||
@@ -772,6 +_,20 @@
|
||||
@@ -771,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) {
|
||||
@@ -865,6 +_,7 @@
|
||||
@@ -864,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));
|
||||
}
|
||||
|
||||
@@ -876,7 +_,7 @@
|
||||
@@ -875,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