Compare commits
11 Commits
1.21-f21dc
...
master
Author | SHA1 | Date | |
---|---|---|---|
83e1fe4058 | |||
25386e9085 | |||
c1aaac3395 | |||
db1bc015e2 | |||
7cebc29f20 | |||
041ae7d4c7 | |||
b96da5a186 | |||
75ed34d568 | |||
6850d61143 | |||
ac16e80a35 | |||
60b3dafd31 |
@ -20,6 +20,7 @@ val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven(paperMavenPublicUrl) {
|
||||
content {
|
||||
onlyForConfigurations(configurations.paperclip.name)
|
||||
@ -28,7 +29,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
|
||||
decompiler("org.vineflower:vineflower:1.10.1")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
group = cn.lunadeer
|
||||
version = 1.21-R0.1-SNAPSHOT
|
||||
mcVersion = 1.21
|
||||
version = 1.21.1-R0.1-SNAPSHOT
|
||||
mcVersion = 1.21.1
|
||||
|
||||
foliaRef = 2b8c8798972a8393914027c45e544dd997375807
|
||||
foliaRef = 2e7bc0721af95196c85500c7bb136aeea0bc12ce
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.vfs.watch=false
|
||||
org.gradle.vfs.watch=false
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xmx2560m
|
41
patches/removed/0006-Limit-mob-pathfinding-update.patch
Normal file
41
patches/removed/0006-Limit-mob-pathfinding-update.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: zhangyuheng <zhangyuheng@lunadeer.cn>
|
||||
Date: Thu, 8 Aug 2024 15:51:22 +0800
|
||||
Subject: [PATCH] Limit mob pathfinding update
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 741ba5f0834ab5f0b0ffdeb91a9ff8cfaf922792..0141caf62b0e06676696c01a1956d4cf3564a4a4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -924,6 +924,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
}
|
||||
}
|
||||
|
||||
+ private int lastPathfindingTick = 0; // DeerFolia - limit pathfinding updates
|
||||
+
|
||||
@Override
|
||||
protected final void serverAiStep() {
|
||||
++this.noActionTime;
|
||||
@@ -943,6 +945,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
gameprofilerfiller.pop();
|
||||
int i = this.tickCount + this.getId();
|
||||
|
||||
+ // DeerFolia start - limit pathfinding updates
|
||||
+ int pathfindingTickLimit = 20; // todo - make this configurable maybe?
|
||||
+ if (this.tickCount > this.lastPathfindingTick + pathfindingTickLimit) {
|
||||
+ // DeerFolia end
|
||||
if (i % 2 != 0 && this.tickCount > 1) {
|
||||
gameprofilerfiller.push("targetSelector");
|
||||
this.targetSelector.tickRunningGoals(false);
|
||||
@@ -958,6 +964,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
this.goalSelector.tick();
|
||||
gameprofilerfiller.pop();
|
||||
}
|
||||
+ // DeerFolia - limit pathfinding updates
|
||||
+ this.lastPathfindingTick = this.tickCount;
|
||||
+ }
|
||||
+ // DeerFolia end
|
||||
|
||||
gameprofilerfiller.push("navigation");
|
||||
this.navigation.tick();
|
@ -5,7 +5,7 @@ Subject: [PATCH] Rebranding
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f0a90d13a17160cd363d54d494add4f6433b4758..e4c5df72efcdd81ffe7dd0344f7f1c20ae62acc1 100644
|
||||
index c2f2ba1df68e9823c56287f1bea23fb6d6a781a2..9b7e53036ffd5f2dc2c581e3b657644b25327b5a 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
@ -17,7 +17,7 @@ index f0a90d13a17160cd363d54d494add4f6433b4758..e4c5df72efcdd81ffe7dd0344f7f1c20
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -84,14 +84,14 @@ tasks.jar {
|
||||
@@ -85,14 +85,14 @@ tasks.jar {
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
@ -106,10 +106,10 @@ index 29bd788ae8bc61c1e62a4f84b9e259931a7041ce..133d9974c5db973029750a08cac50665
|
||||
|
||||
private static Component getUpdateStatusMessage(final String repo, final ServerBuildInfo build) {
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..d5c8b196c1282eecd74ce046242700b57cfde140 100644
|
||||
index 6ee39b534b8d992655bc0cef3c299d12cbae0034..8fd162b6441ca1a6ee779d898ee854dc5b1343c5 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@@ -20,7 +20,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
@ -205,7 +205,7 @@ index e9b6ca3aa25e140467ae866d572483050ea3fa0e..4b84eb8ceb719bb6b4dc281b32c5b67b
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..e071112059905fc1898fd3435dce49ff7f8ff244 100644
|
||||
index 64e0acf28fc241b16a7bc8d3807062fd7758ed7f..3eb75a0fbe82e6f5efc774149e3f965cc5b6b250 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -96,7 +96,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow void trading
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 0166d6bd686d68ffdcc42e908b0d1aa41a3bffdf..8da76a7383e080c54d4af6905c0732298f03847f 100644
|
||||
index 90d78ddf8518c0df307cdaa8b7cfb5549491c6e5..2a3a8d9f5176ba444f401e8ac505cb7ee7d59234 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2813,10 +2813,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -2815,10 +2815,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// Spigot end
|
||||
// Spigot Start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow sand duplication
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 7a102b4e90fbc09b8653e5b566299efe24a04cf6..4d5fcff9bb860542502f7d15a86cd14dc9cca5fa 100644
|
||||
index 2ccc358daae43dcebf03db64526f17fbd9df23f8..7356ecda5b9b416ac23e65193462ae4355b4386d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4186,13 +4186,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4188,13 +4188,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
targetPos, 16, // load 16 blocks to be safe from block physics
|
||||
ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.HIGH,
|
||||
(chunks) -> {
|
||||
@ -29,7 +29,7 @@ index 7a102b4e90fbc09b8653e5b566299efe24a04cf6..4d5fcff9bb860542502f7d15a86cd14d
|
||||
DimensionTransition.PLAY_PORTAL_SOUND.then(DimensionTransition.PLACE_PORTAL_TICKET),
|
||||
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
|
||||
)
|
||||
@@ -4389,6 +4394,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4391,6 +4396,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (!this.canPortalAsync(destination, takePassengers)) {
|
||||
return false;
|
||||
}
|
||||
@ -41,7 +41,7 @@ index 7a102b4e90fbc09b8653e5b566299efe24a04cf6..4d5fcff9bb860542502f7d15a86cd14d
|
||||
|
||||
Vec3 initialPosition = this.position();
|
||||
ChunkPos initialPositionChunk = new ChunkPos(
|
||||
@@ -4453,9 +4463,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4455,9 +4465,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
info.postDimensionTransition().onTransition(teleported);
|
||||
}
|
||||
|
||||
@ -71,22 +71,3 @@ index 5d6b1a63a2a213f8a4e81c5e574847007a82007b..6512ac412ad48196e5decc47ccbf01c7
|
||||
protected static final EntityDataAccessor<BlockPos> DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS);
|
||||
public boolean autoExpire = true; // Paper - Expand FallingBlock API
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
index 58e15d7a5f7997a7aec9edaa5d211807b2b1ef6b..6d769f57242c2454cc19255197db70b9a9cf68ca 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
@@ -70,6 +70,14 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
||||
world.getCraftServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) return; // Paper - make cancellable
|
||||
// CraftBukkit end
|
||||
+
|
||||
+ // DeerFolia start - Sand duplication
|
||||
+ if (!(entity instanceof net.minecraft.world.entity.player.Player)) {
|
||||
+ entity.endPortalLogicAsync(pos);
|
||||
+ return;
|
||||
+ }
|
||||
+ // DeerFolia end - Sand duplication
|
||||
+
|
||||
if (!world.isClientSide && world.dimension() == Level.END && entity instanceof ServerPlayer) {
|
||||
ServerPlayer entityplayer = (ServerPlayer) entity;
|
||||
|
||||
|
@ -0,0 +1,113 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: zhangyuheng <zhangyuheng@lunadeer.cn>
|
||||
Date: Wed, 7 Aug 2024 17:29:43 +0800
|
||||
Subject: [PATCH] Modify tps command to show more details
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/threadedregions/TickRegions.java b/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
|
||||
index b1c07e582dbf0a203cf734fdbcd8387a422af3a6..44d0d1bae314fba86d2d8ba36241bc77a9c2b21f 100644
|
||||
--- a/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
|
||||
+++ b/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
|
||||
@@ -2,6 +2,7 @@ package io.papermc.paper.threadedregions;
|
||||
|
||||
import ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool;
|
||||
import ca.spottedleaf.concurrentutil.util.TimeUtil;
|
||||
+import ca.spottedleaf.moonrise.common.list.ReferenceList;
|
||||
import ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkHolderManager;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import io.papermc.paper.configuration.GlobalConfiguration;
|
||||
@@ -11,9 +12,14 @@ import it.unimi.dsi.fastutil.objects.Reference2ReferenceMap;
|
||||
import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ServerChunkCache;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
import org.slf4j.Logger;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
+import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
@@ -134,6 +140,8 @@ public final class TickRegions implements ThreadedRegionizer.RegionCallbacks<Tic
|
||||
private final AtomicInteger entityCount = new AtomicInteger();
|
||||
private final AtomicInteger playerCount = new AtomicInteger();
|
||||
private final AtomicInteger chunkCount = new AtomicInteger();
|
||||
+ private final List<ServerPlayer> localPlayers = new ArrayList<>();
|
||||
+ private ReferenceList<ServerChunkCache.ChunkAndHolder> chunks;
|
||||
|
||||
public int getEntityCount() {
|
||||
return this.entityCount.get();
|
||||
@@ -147,10 +155,31 @@ public final class TickRegions implements ThreadedRegionizer.RegionCallbacks<Tic
|
||||
return this.chunkCount.get();
|
||||
}
|
||||
|
||||
+ public String getLocalPlayers() {
|
||||
+ final StringBuilder sb = new StringBuilder();
|
||||
+ for (final ServerPlayer player : this.localPlayers) {
|
||||
+ sb.append(player.getName().getString()).append(", ");
|
||||
+ }
|
||||
+ return sb.toString();
|
||||
+ }
|
||||
+
|
||||
+ public String getTickingChunks() {
|
||||
+ final StringBuilder sb = new StringBuilder();
|
||||
+ for (final ServerChunkCache.ChunkAndHolder chunk : this.chunks) {
|
||||
+ sb.append("[").append(chunk.chunk().getPos().x).append(", ").append(chunk.chunk().getPos().z).append("], ");
|
||||
+ }
|
||||
+ return sb.toString();
|
||||
+ }
|
||||
+
|
||||
void updateFrom(final RegionizedWorldData data) {
|
||||
this.entityCount.setRelease(data == null ? 0 : data.getEntityCount());
|
||||
this.playerCount.setRelease(data == null ? 0 : data.getPlayerCount());
|
||||
this.chunkCount.setRelease(data == null ? 0 : data.getChunkCount());
|
||||
+ this.localPlayers.clear();
|
||||
+ if (data != null) {
|
||||
+ this.localPlayers.addAll(data.getLocalPlayers());
|
||||
+ }
|
||||
+ this.chunks = data == null ? null : data.getTickingChunks();
|
||||
}
|
||||
|
||||
static void updateCurrentRegion() {
|
||||
diff --git a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
|
||||
index 012d3a7da7fe483393a0888c823bd2e78f5c3908..6a06726c28695c0e639f0517274078d3c673fbcf 100644
|
||||
--- a/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
|
||||
+++ b/src/main/java/io/papermc/paper/threadedregions/commands/CommandServerHealth.java
|
||||
@@ -73,7 +73,9 @@ public final class CommandServerHealth extends Command {
|
||||
.append(Component.text("Chunks: ", PRIMARY))
|
||||
.append(Component.text(NO_DECIMAL_PLACES.get().format((long)stats.getChunkCount()), INFORMATION))
|
||||
.append(Component.text(" Players: ", PRIMARY))
|
||||
- .append(Component.text(NO_DECIMAL_PLACES.get().format((long)stats.getPlayerCount()), INFORMATION))
|
||||
+ .append(Component.text(NO_DECIMAL_PLACES.get().format((long)stats.getPlayerCount()), INFORMATION)
|
||||
+ .hoverEvent(HoverEvent.showText(Component.text("Players: " + stats.getLocalPlayers(), SECONDARY)))
|
||||
+ )
|
||||
.append(Component.text(" Entities: ", PRIMARY))
|
||||
.append(Component.text(NO_DECIMAL_PLACES.get().format((long)stats.getEntityCount()) + (newline ? "\n" : ""), INFORMATION))
|
||||
.build();
|
||||
@@ -247,7 +249,10 @@ public final class CommandServerHealth extends Command {
|
||||
final Component line = Component.text()
|
||||
.append(Component.text(" - ", LIST, TextDecoration.BOLD))
|
||||
.append(Component.text("Region around block ", PRIMARY))
|
||||
- .append(Component.text(location, INFORMATION))
|
||||
+ .append(Component.text(location, INFORMATION)
|
||||
+ .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, "/minecraft:execute as @s in " + world.getWorld().getKey().toString() + " run tp " + centerBlockX + ".5 " + yLoc + " " + centerBlockZ + ".5"))
|
||||
+ .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, Component.text("Click to teleport to " + location, SECONDARY)))
|
||||
+ )
|
||||
.append(Component.text(":\n", PRIMARY))
|
||||
|
||||
.append(Component.text(" ", PRIMARY))
|
||||
@@ -260,10 +265,7 @@ public final class CommandServerHealth extends Command {
|
||||
|
||||
.append(Component.text(" ", PRIMARY))
|
||||
.append(formatRegionStats(region.getData().getRegionStats(), (i + 1) != len))
|
||||
- .build()
|
||||
-
|
||||
- .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, "/minecraft:execute as @s in " + world.getWorld().getKey().toString() + " run tp " + centerBlockX + ".5 " + yLoc + " " + centerBlockZ + ".5"))
|
||||
- .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, Component.text("Click to teleport to " + location, SECONDARY)));
|
||||
+ .build();
|
||||
|
||||
lowestRegionsBuilder.append(line);
|
||||
}
|
Loading…
Reference in New Issue
Block a user