143 lines
10 KiB
Diff
143 lines
10 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
Date: Wed, 21 Jan 2026 21:28:21 +0800
|
|
Subject: [PATCH] Carpet Features Compatible
|
|
|
|
|
|
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
|
index cb68671e513fc812723b2abbdd21e8d6e18cf808..fb8dc7e4e6652222ed901b77a7bc263f671123bb 100644
|
|
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
|
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
|
@@ -340,7 +340,7 @@ public final class RegionizedServer {
|
|
final long tickStartNanos = System.nanoTime(); // Lophine - Carpet features
|
|
++this.tickCount;
|
|
// Luminol start - Add a config to enable tick command
|
|
- if (me.earthme.luminol.config.modules.experiment.CommandConfig.tick) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) { // Lophine - redirect
|
|
MinecraftServer.getServer().tickRateManager().tick();
|
|
}
|
|
// Luminol end - Add a config to enable tick command
|
|
@@ -531,7 +531,7 @@ public final class RegionizedServer {
|
|
}
|
|
|
|
private void tickTime(final ServerLevel world, final long tickCount) {
|
|
- if ((!me.earthme.luminol.config.modules.experiment.CommandConfig.tick || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command
|
|
+ if ((!fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command // Lophine - redirect
|
|
world.serverLevelData.setGameTime(world.serverLevelData.getGameTime() + tickCount);
|
|
}
|
|
}
|
|
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
|
index 57a35d7a801621fc461e896eb2bba533d9d5bc1b..ae424c8931a2f82c6c8d4ddd8422a2c142a77a95 100644
|
|
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
|
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
|
@@ -576,7 +576,7 @@ public final class TickRegionScheduler {
|
|
// next start isn't updated until the end of this tick
|
|
this.tickRegion(tickCount, tickStart, scheduledEnd);
|
|
// Luminol start - Add a config to enable tick command
|
|
- if (me.earthme.luminol.config.modules.experiment.CommandConfig.tick) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) { // Lophine - redirect
|
|
MinecraftServer.getServer().tickRateManager().endTickWork();
|
|
}
|
|
// Luminol end - Add a config to enable tick command
|
|
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
|
index 03f3fe221b14f0317947d74e25049bcce2ebeb66..6882e85fb6413e5c346c189a82b69f3e408aafba 100644
|
|
--- a/net/minecraft/commands/Commands.java
|
|
+++ b/net/minecraft/commands/Commands.java
|
|
@@ -268,7 +268,7 @@ public class Commands {
|
|
TellRawCommand.register(this.dispatcher, context);
|
|
//TestCommand.register(this.dispatcher, context); // Folia - region threading
|
|
// Luminol start - Add a config to enable tick command
|
|
- if (me.earthme.luminol.config.modules.experiment.CommandConfig.tick) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) { // Lophine - redirect
|
|
TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
|
}
|
|
// Luminol end - Add a config to enable tick command
|
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
|
index e5fdb195aaea5d4041d2fd33e3f96966ef1c5412..4c53b688ed6b26ca7231841f3235f9a824416bba 100644
|
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -2169,7 +2169,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
|
this.lastSentFood = -1;
|
|
this.teleportSpectators(transition, oldLevel);
|
|
// Leaves start - bot support
|
|
- if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) {
|
|
+ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.checkEnabled()) {
|
|
this.server.getBotList().bots.forEach(bot -> bot.sendFakeDataIfNeed(this, true)); // Leaves - render bot
|
|
}
|
|
// Leaves end - bot support
|
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
|
index 049648756f9053895e773efdca33fe65b3555b10..36b8cf8c466c9cd4369ceab49e3ac84f224142b8 100644
|
|
--- a/net/minecraft/server/players/PlayerList.java
|
|
+++ b/net/minecraft/server/players/PlayerList.java
|
|
@@ -308,7 +308,7 @@ public abstract class PlayerList {
|
|
// org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
|
|
|
// Leaves start - bot support
|
|
- if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) {
|
|
+ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.checkEnabled()) {
|
|
org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName());
|
|
if (bot != null) {
|
|
this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false, false);
|
|
@@ -491,7 +491,7 @@ public abstract class PlayerList {
|
|
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
|
|
|
// Leaves start - bot support
|
|
- if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) {
|
|
+ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.checkEnabled()) {
|
|
org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName());
|
|
if (bot != null) {
|
|
this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false, false);
|
|
@@ -1019,7 +1019,7 @@ public abstract class PlayerList {
|
|
).callEvent();
|
|
// Paper end
|
|
// Leaves start - bot support
|
|
- if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) {
|
|
+ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.checkEnabled()) {
|
|
this.server.getBotList().bots.forEach(bot -> bot.sendFakeDataIfNeed(player, true)); // Leaves - render bot
|
|
}
|
|
// Leaves end - bot support
|
|
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
index c23976cd72d7556ef96e04a7009031fc07b7a4fd..df57ae93f91daf8daed2fef48b685c72f0615763 100644
|
|
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
|
@@ -241,7 +241,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
|
}
|
|
|
|
// Leaves start - Wool hopper counter
|
|
- if (fun.bm.lophine.config.modules.function.WoolHopperCounterConfig.unlimitedSpeed && org.leavesmc.leaves.util.HopperCounter.isEnabled()) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.WoolHopperCounterConfig.hopperCountersUnlimitedSpeed && org.leavesmc.leaves.util.HopperCounter.isEnabled()) {
|
|
net.minecraft.world.item.DyeColor woolColor = org.leavesmc.leaves.util.WoolUtils.getWoolColorAtPosition(level, entity.getBlockPos().relative(state.getValue(HopperBlock.FACING)));
|
|
if (woolColor != null) {
|
|
for (int i = 0; i < Short.MAX_VALUE; i++) {
|
|
@@ -259,7 +259,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
|
if (changed) {
|
|
entity.setCooldown(level.spigotConfig.hopperTransfer); // Spigot
|
|
// Leaves start - Wool hopper counter
|
|
- if (fun.bm.lophine.config.modules.function.WoolHopperCounterConfig.unlimitedSpeed && org.leavesmc.leaves.util.HopperCounter.isEnabled() && woolHopperCounter(level, pos, state, HopperBlockEntity.getContainerAt(level, pos))) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.WoolHopperCounterConfig.hopperCountersUnlimitedSpeed && org.leavesmc.leaves.util.HopperCounter.isEnabled() && woolHopperCounter(level, pos, state, HopperBlockEntity.getContainerAt(level, pos))) {
|
|
entity.setCooldown(0);
|
|
return true;
|
|
}
|
|
@@ -668,7 +668,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
|
}
|
|
|
|
public static boolean addItem(final Container container, final ItemEntity entity) {
|
|
- if (fun.bm.lophine.config.modules.function.WoolHopperCounterConfig.unlimitedSpeed && org.leavesmc.leaves.util.HopperCounter.isEnabled() && entity.isRemoved()) return false; // Leaves - Wool hopper counter
|
|
+ if (fun.bm.lophine.carpet.config.modules.WoolHopperCounterConfig.hopperCountersUnlimitedSpeed && org.leavesmc.leaves.util.HopperCounter.isEnabled() && entity.isRemoved()) return false; // Leaves - Wool hopper counter
|
|
boolean changed = false;
|
|
// CraftBukkit start
|
|
if (org.bukkit.event.inventory.InventoryPickupItemEvent.getHandlerList().getRegisteredListeners().length > 0) { // Paper - optimize hoppers
|
|
diff --git a/net/minecraft/world/level/dimension/end/EnderDragonFight.java b/net/minecraft/world/level/dimension/end/EnderDragonFight.java
|
|
index 8ff7320973dc4fd6ccc4ef7c1742686e0ed0e29a..373de7d03492ce907dba39a12749442116705d90 100644
|
|
--- a/net/minecraft/world/level/dimension/end/EnderDragonFight.java
|
|
+++ b/net/minecraft/world/level/dimension/end/EnderDragonFight.java
|
|
@@ -323,7 +323,7 @@ public class EnderDragonFight extends SavedData {
|
|
private int cachePortalOriginIteratorY = -1;
|
|
|
|
public BlockPattern.@Nullable BlockPatternMatch findExitPortal() {
|
|
- if (me.earthme.luminol.config.modules.optimizations.OptimizedDragonRespawnConfig.optimizedRespawn) {
|
|
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.optimizedDragonRespawn) { // Lophine - Carpet Features Compatible
|
|
int i, j;
|
|
for (i = cachePortalChunkIteratorX; i <= 8; ++i) {
|
|
for (j = cachePortalChunkIteratorZ; j <= 8; ++j) {
|