mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-28 03:19:21 +00:00
Some work
This commit is contained in:
@@ -0,0 +1,307 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||
Date: Mon, 29 Apr 2024 14:18:58 -0400
|
||||
Subject: [PATCH] Fix Pufferfish and Purpur patches
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 91fa7f0bac5681413cd8d66fe1ebf2029713408f..3a970b1f751726e4eec2832e94295c242cc7c997 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -276,7 +276,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
|
||||
private static final int SAMPLE_INTERVAL = 20; // Paper - improve server tick loop
|
||||
@Deprecated(forRemoval = true) // Paper
|
||||
- public final double[] recentTps = new double[3];
|
||||
+ public final double[] recentTps = new double[4]; // Leaf - Purpur - Add 5 second tps average in /tps
|
||||
// Spigot end
|
||||
public volatile boolean hasFullyShutdown; // Paper - Improved watchdog support
|
||||
public volatile boolean abnormalExit; // Paper - Improved watchdog support
|
||||
@@ -286,7 +286,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
- public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
|
||||
+ public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("Leaf Async Mob Spawn Thread"); // Pufferfish - optimize mob spawning // Leaf - Fix Pufferfish and Purpur patches - Unify thread name
|
||||
public boolean lagging = false; // Purpur - Lagging threshold
|
||||
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
|
||||
|
||||
@@ -1248,9 +1248,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
tps15.add(currentTps, diff);
|
||||
|
||||
// Backwards compat with bad plugins
|
||||
- this.recentTps[0] = tps1.getAverage();
|
||||
- this.recentTps[1] = tps5.getAverage();
|
||||
- this.recentTps[2] = tps15.getAverage();
|
||||
+ // Leaf start - Purpur - Add 5 second tps average in /tps
|
||||
+ this.recentTps[0] = tps5s.getAverage();
|
||||
+ this.recentTps[1] = tps1.getAverage();
|
||||
+ this.recentTps[2] = tps5.getAverage();
|
||||
+ this.recentTps[3] = tps15.getAverage();
|
||||
+ // Leaf end - Purpur - Add 5 second tps average in /tps
|
||||
lagging = recentTps[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur - Lagging threshold
|
||||
tickSection = currentTime;
|
||||
}
|
||||
@@ -1278,7 +1281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.mayHaveDelayedTasks = true;
|
||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
|
||||
// Purpur start - Configurable TPS Catchup
|
||||
- if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup /*|| !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup*/) { // Purpur - Configurable TPS Catchup
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup) { // Purpur - Configurable TPS Catchup // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.nextTickTimeNanos = currentTime + l;
|
||||
this.delayedTasksMaxNextTickTimeNanos = nextTickTimeNanos;
|
||||
}
|
||||
diff --git a/net/minecraft/server/gui/StatsComponent.java b/net/minecraft/server/gui/StatsComponent.java
|
||||
index 35fd539eb2bfe60ad17ab1e558a01273666acc54..445bbdc8da7f1fdbddfc4d8787d78fea9328fb65 100644
|
||||
--- a/net/minecraft/server/gui/StatsComponent.java
|
||||
+++ b/net/minecraft/server/gui/StatsComponent.java
|
||||
@@ -43,7 +43,7 @@ public class StatsComponent extends JComponent {
|
||||
}
|
||||
this.msgs[0] = "Memory use: " + l / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
|
||||
this.msgs[1] = "Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms";
|
||||
- this.msgs[2] = "TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg);
|
||||
+ this.msgs[2] = "TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg); // Leaf - Purpur - Add 5 second tps average in /tps
|
||||
// Paper end - Improve ServerGUI
|
||||
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
|
||||
this.repaint();
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4b59db324e71846d233e43bafcdae658bcc70328..413fac2acf8cc467d328ccb1fe01399722d02941 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1255,7 +1255,7 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
|
||||
if (byteTotal > byteAllowed) {
|
||||
- ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send too large of a book. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
|
||||
+ ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size()); // Leaf - Fix Pufferfish and Purpur patches
|
||||
org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent event = new org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), itemstack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur - PlayerBookTooLargeEvent
|
||||
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;
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 1539e039d4d5fd539cfc552a4d420ae5a6fb8b56..109ec179bd7e960cb09a98e1ec6179a60b2cba57 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -522,23 +522,36 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Purpur end - Add canSaveToDisk to Entity
|
||||
|
||||
+ // Leaf start - Fix Pufferfish and Purpur patches
|
||||
+ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
+ private BlockPos cached_eye_blockpos;
|
||||
+ private net.minecraft.world.phys.Vec3 cached_position;
|
||||
+ // Gale end - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
// Purpur start - copied from Mob - API for any mob to burn daylight
|
||||
public boolean isSunBurnTick() {
|
||||
if (this.level().isBrightOutside() && !this.level().isClientSide) {
|
||||
- float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
|
||||
- BlockPos blockPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
- boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
- if (lightLevelDependentMagicValue > 0.5F
|
||||
- && this.random.nextFloat() * 30.0F < (lightLevelDependentMagicValue - 0.4F) * 2.0F
|
||||
- && !flag
|
||||
- && this.level().canSeeSky(blockPos)) {
|
||||
- return true;
|
||||
+ // Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
+ if (this.cached_position != this.position) {
|
||||
+ this.cached_eye_blockpos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
+ this.cached_position = this.position;
|
||||
}
|
||||
+
|
||||
+ float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue(cached_eye_blockpos); // Pass BlockPos to getBrightness
|
||||
+
|
||||
+ // Check brightness first
|
||||
+ if (lightLevelDependentMagicValue <= 0.5F) return false;
|
||||
+ if (this.random.nextFloat() * 30.0F >= (lightLevelDependentMagicValue - 0.4F) * 2.0F) return false;
|
||||
+ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
+
|
||||
+ boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
+
|
||||
+ return !flag && this.level().canSeeSky(this.cached_eye_blockpos); // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
}
|
||||
|
||||
- return false;
|
||||
+ return false; // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos - diff on change
|
||||
}
|
||||
// Purpur end - copied from Mob - API for any mob to burn daylight
|
||||
+ // Leaf end - Fix Pufferfish and Purpur patches
|
||||
|
||||
public Entity(EntityType<?> entityType, Level level) {
|
||||
this.type = entityType;
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index dfca015796b87059b19db55b4911bd0de2580798..40ab67a6930242553ed7acc9d6cc474a36e23888 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1024,13 +1024,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
// Gale start - Petal - reduce skull ItemStack lookups for reduced visibility
|
||||
EntityType<?> type = lookingEntity.getType();
|
||||
// Purpur start - Mob head visibility percent
|
||||
- if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)) {
|
||||
+ if (type == EntityType.SKELETON && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.SKELETON_SKULL)) { // Leaf - Fix Pufferfish and Purpur patches
|
||||
d *= lookingEntity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
||||
- } else if (type == EntityType.ZOMBIE && itemBySlot.is(Items.ZOMBIE_HEAD)) {
|
||||
+ } else if (type == EntityType.ZOMBIE && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.ZOMBIE_HEAD)) { // Leaf - Fix Pufferfish and Purpur patches
|
||||
d *= lookingEntity.level().purpurConfig.zombieHeadVisibilityPercent;
|
||||
- } else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && itemBySlot.is(Items.PIGLIN_HEAD)) {
|
||||
+ } else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.PIGLIN_HEAD)) { // Leaf - Fix Pufferfish and Purpur patches
|
||||
d *= lookingEntity.level().purpurConfig.piglinHeadVisibilityPercent;
|
||||
- } else if (type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
||||
+ } else if (type == EntityType.CREEPER && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.CREEPER_HEAD)) { // Leaf - Fix Pufferfish and Purpur patches
|
||||
d *= lookingEntity.level().purpurConfig.creeperHeadVisibilityPercent;
|
||||
}
|
||||
// Purpur end - Mob head visibility percent
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index ba2f9ab55e52e25788b38c81e1070ae953b66371..33c99f3b24596fbbf3283b455ea8bf340203e01b 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -1505,10 +1505,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
protected void playAttackSound() {
|
||||
}
|
||||
|
||||
- // Gale start - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
- private BlockPos cached_eye_blockpos;
|
||||
- private net.minecraft.world.phys.Vec3 cached_position;
|
||||
- // Gale end - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
public boolean isSunBurnTick() {
|
||||
// Purpur - implemented in Entity - API for any mob to burn daylight
|
||||
return super.isSunBurnTick();
|
||||
diff --git a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
index 60ec389615cfcad388ed37b8d3ee04e87db36755..34fe1d3bd6603225f84ab18794bbb1189d4b4f49 100644
|
||||
--- a/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
+++ b/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
@@ -22,20 +22,17 @@ public class SecondaryPoiSensor extends Sensor<Villager> {
|
||||
|
||||
@Override
|
||||
protected void doTick(ServerLevel level, Villager entity) {
|
||||
- // Gale start - Lithium - skip secondary POI sensor if absent
|
||||
+ // Leaf start - Fix Pufferfish and Purpur patches
|
||||
+ // Purpur: Option for Villager Clerics to farm Nether Wart - make sure clerics don't wander to soul sand when the option is off
|
||||
+ // Gale: Lithium - skip secondary POI sensor if absent
|
||||
var secondaryPoi = entity.getVillagerData().profession().value().secondaryPoi();
|
||||
- if (secondaryPoi.isEmpty()) {
|
||||
- entity.getBrain().eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
|
||||
- return;
|
||||
- }
|
||||
- // Gale end - Lithium - skip secondary POI sensor if absent
|
||||
- // Purpur start - Option for Villager Clerics to farm Nether Wart - make sure clerics don't wander to soul sand when the option is off
|
||||
Brain<?> brain = entity.getBrain();
|
||||
- if (!level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().profession().is(net.minecraft.world.entity.npc.VillagerProfession.CLERIC)) {
|
||||
+ if (secondaryPoi.isEmpty() || !level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().profession().is(net.minecraft.world.entity.npc.VillagerProfession.CLERIC)) {
|
||||
brain.eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
|
||||
return;
|
||||
}
|
||||
// Purpur end - Option for Villager Clerics to farm Nether Wart
|
||||
+ // Leaf end - Fix Pufferfish and Purpur patches
|
||||
ResourceKey<Level> resourceKey = level.dimension();
|
||||
BlockPos blockPos = entity.blockPosition();
|
||||
List<GlobalPos> list = Lists.newArrayList();
|
||||
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index 441287e74243a413c97a98b7898bab7833ac6458..18107d9be4d9ba816852ee4595a5349867834bef 100644
|
||||
--- a/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -283,8 +283,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
private int behaviorTick = 0; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
AllayAi.updateActivity(this);
|
||||
super.customServerAiStep(level);
|
||||
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
index de207d747026453fabe2e6e725d2aa8504fbc9a1..524a7c31708a03f7a9dae75731caa8a450a6488d 100644
|
||||
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
||||
@@ -372,8 +372,7 @@ public class Axolotl extends Animal implements Bucketable {
|
||||
private int behaviorTick = 0; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
AxolotlAi.updateActivity(this);
|
||||
if (!this.isNoAi()) {
|
||||
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 89fa6a785ff73b30effd58dde4fbcbf99fdad168..71bae5f5ed284fed30262872771f85de97383d6d 100644
|
||||
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -259,8 +259,7 @@ public class Frog extends Animal {
|
||||
private int behaviorTick = 0; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
FrogAi.updateActivity(this);
|
||||
super.customServerAiStep(level);
|
||||
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
index a445bbe84d919ffadd8f3f0006b12140cd8060fd..7a3bfa91ffc5c7c6b04eef7b1b1d3c04c5a6d856 100644
|
||||
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -134,8 +134,7 @@ public class Tadpole extends AbstractFish {
|
||||
private int behaviorTick = 0; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
TadpoleAi.updateActivity(this);
|
||||
super.customServerAiStep(level);
|
||||
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
index 40ba2e6dc6b1efbd17dba582561c133f6b41df25..39d4da47dcd7bbb33ad907b428dc0f65eaa23a82 100644
|
||||
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -226,8 +226,7 @@ public class Goat extends Animal {
|
||||
private int behaviorTick = 0; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
GoatAi.updateActivity(this);
|
||||
super.customServerAiStep(level);
|
||||
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
index 584955d151e95727406bc68d6a6f15a33c0f920c..865a83fc73d79893e9bdedad37a6e3986d15fc2b 100644
|
||||
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
||||
@@ -206,8 +206,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
||||
private int behaviorTick; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
HoglinAi.updateActivity(this);
|
||||
if (this.isConverting()) {
|
||||
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
index bac328ebdf9f94d156211e03d3913157e2b80374..bf1b33b7bb71ec8387d95d9089f199627a041945 100644
|
||||
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
|
||||
@@ -357,8 +357,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
||||
private int behaviorTick; // Pufferfish
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- //if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Purpur - only use brain if no rider // Leaf - Fix Pufferfish and Purpur patches
|
||||
this.getBrain().tick(level, this);
|
||||
PiglinAi.updateActivity(this);
|
||||
super.customServerAiStep(level);
|
||||
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index bde9370798c037c494a9c73f328cb251e68c21b1..3a6be0122d49b20f78be6cc8f1c7acb5c2e45f39 100644
|
||||
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -85,7 +85,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
|
||||
if (maxChunkLoadsPerProjectile >= 0 && this.chunksLoadedByProjectile >= maxChunkLoadsPerProjectile) {
|
||||
if (maxProjectileChunkLoadsConfig.perProjectile.removeFromWorldAfterReachLimit) {
|
||||
- this.discard();
|
||||
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Leaf - Fix Pufferfish and Purpur patches - Purpur
|
||||
} else if (maxProjectileChunkLoadsConfig.perProjectile.resetMovementAfterReachLimit) {
|
||||
this.setDeltaMovement(0, this.getDeltaMovement().y, 0);
|
||||
}
|
||||
@@ -7,10 +7,10 @@ Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 91fa7f0bac5681413cd8d66fe1ebf2029713408f..626ce084ace620bd3883fb3f542b0bd77dfb5f8e 100644
|
||||
index 3a970b1f751726e4eec2832e94295c242cc7c997..3f8c4d048e813bb4af53a17e0e231927b2694889 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1844,7 +1844,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1847,7 +1847,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -7,7 +7,7 @@ This Check is added in 1.17.x -> 1.18.x that updated by Mojang.
|
||||
By removing this check, it gives ability for hackers to use some modules of hack clients.
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4b59db324e71846d233e43bafcdae658bcc70328..eba90724a6e5e8a93d775d3e0703a0b37a77e7e5 100644
|
||||
index 413fac2acf8cc467d328ccb1fe01399722d02941..776c23f64fdda3bcc93d66e811be7438c22be1f7 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2003,8 +2003,13 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -19,7 +19,7 @@ This patch was ported downstream from the Petal fork.
|
||||
Makes most pathfinding-related work happen asynchronously
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index ba2f9ab55e52e25788b38c81e1070ae953b66371..86d07d8f7c171a8930990ab02360e79066cad7d5 100644
|
||||
index 33c99f3b24596fbbf3283b455ea8bf340203e01b..e9ebf23b0b1af85e3738a70acc0eaa3e8980261f 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -243,6 +243,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -582,10 +582,10 @@ index e9dfff7e3726cd2229f89bb39fa1ca4815d99a6d..654ecd20ef4a43f7ffc447c15434ce46
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 89fa6a785ff73b30effd58dde4fbcbf99fdad168..5e0f34a929ddad69807db2edcf473a6c00392926 100644
|
||||
index 71bae5f5ed284fed30262872771f85de97383d6d..50f9a11f8cb53fd1fa34017598ff3fe828b3ca25 100644
|
||||
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -489,9 +489,25 @@ public class Frog extends Animal {
|
||||
@@ -488,9 +488,25 @@ public class Frog extends Animal {
|
||||
return pathType != PathType.WATER_BORDER && super.canCutCorner(pathType);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix sprint glitch
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index dfca015796b87059b19db55b4911bd0de2580798..6cb9b8be0bd5d9fb225472f8eefd50233d3bbdb2 100644
|
||||
index 40ab67a6930242553ed7acc9d6cc474a36e23888..ab7bdbce80046df43e4889c20c4d3d9fb1d2e2c4 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1387,7 +1387,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -13,18 +13,18 @@ To avoid the hefty ArrayDeque's size() call, we check if we *really* need to exe
|
||||
Most entities won't have any scheduled tasks, so this is a nice performance bonus. These optimizations, however, wouldn't work in a Folia environment, but because in SparklyPaper executeTick is always executed on the main thread, it ain't an issue for us (yay).
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 626ce084ace620bd3883fb3f542b0bd77dfb5f8e..9b61d82b59715f7de484dca663113cc2cf9be3b2 100644
|
||||
index 3f8c4d048e813bb4af53a17e0e231927b2694889..6f150603d9083c7e4b673e127b6d43aa33242f02 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
|
||||
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("Leaf Async Mob Spawn Thread"); // Pufferfish - optimize mob spawning // Leaf - Fix Pufferfish and Purpur patches - Unify thread name
|
||||
public boolean lagging = false; // Purpur - Lagging threshold
|
||||
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
|
||||
+ public final Set<net.minecraft.world.entity.Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
@@ -1669,6 +1670,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1672,6 +1673,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) org.bukkit.Bukkit.getGlobalRegionScheduler()).tick();
|
||||
@@ -47,7 +47,7 @@ index 626ce084ace620bd3883fb3f542b0bd77dfb5f8e..9b61d82b59715f7de484dca663113cc2
|
||||
getAllLevels().forEach(level -> {
|
||||
for (final net.minecraft.world.entity.Entity entity : level.getEntities().getAll()) {
|
||||
if (entity.isRemoved()) {
|
||||
@@ -1680,6 +1697,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1683,6 +1700,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Virtual thread for chat executor
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 9b61d82b59715f7de484dca663113cc2cf9be3b2..18a0150536a847f9617a736245086d590bf80b74 100644
|
||||
index 6f150603d9083c7e4b673e127b6d43aa33242f02..17d3a8a2cc3c86ed6aae9c20ed9f281dc9715cf5 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2667,7 +2667,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2670,7 +2670,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool(
|
||||
@@ -97,7 +97,7 @@ index 8516d47b0ba79d91638837199e7ae0fb6cb44a79..4f4b55dd099dd2c2fea118b18b535881
|
||||
RandomSource fork();
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 1539e039d4d5fd539cfc552a4d420ae5a6fb8b56..f764c8d108f8ce8d7a901907eb41c9ee4c441d68 100644
|
||||
index 109ec179bd7e960cb09a98e1ec6179a60b2cba57..1f439c158f58fac08d17a262c01a1202ff3eb8e0 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -149,7 +149,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Remove stream in entity visible effects filter
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 6cb9b8be0bd5d9fb225472f8eefd50233d3bbdb2..19c1dca135ada485e5aab78a0c0622ee9856e1e9 100644
|
||||
index ab7bdbce80046df43e4889c20c4d3d9fb1d2e2c4..916a964263a9b71d20007c29302341dd50c94b85 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -988,12 +988,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -46,10 +46,10 @@ index 6c7edbbf3935c40ccb78bee680ea75431718b9bd..a1b4dc70d555cce5e06c0298736d8b89
|
||||
public String toString() {
|
||||
return "Reference{" + this.key + "=" + this.value + "}";
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index f764c8d108f8ce8d7a901907eb41c9ee4c441d68..8120d78a3175b47b1e6db2f568d79f084f4db044 100644
|
||||
index 1f439c158f58fac08d17a262c01a1202ff3eb8e0..753515c65a2b49db15ef6616cc7caf276fdbbeb1 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -1963,7 +1963,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1976,7 +1976,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
FluidState fluidState = this.level().getFluidState(blockPos);
|
||||
double d = blockPos.getY() + fluidState.getHeight(this.level(), blockPos);
|
||||
if (d > eyeY) {
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Replace Entity active effects map with optimized collection
|
||||
Dreeam TODO: check this
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 19c1dca135ada485e5aab78a0c0622ee9856e1e9..534dd27d27395f9c98c62ea7014bb3a8df8caa2e 100644
|
||||
index 916a964263a9b71d20007c29302341dd50c94b85..fe201ffb28df1171bc22f7ed40cd729b9f3f1017 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -196,6 +196,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable player knockback zombie
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 534dd27d27395f9c98c62ea7014bb3a8df8caa2e..be774fafac70360ea9872ba74dd766619a98c00b 100644
|
||||
index fe201ffb28df1171bc22f7ed40cd729b9f3f1017..f36af61d7620f57f396d879d669161b8b1a30875 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -2079,6 +2079,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -8,7 +8,7 @@ Original project: https://github.com/PaperMC/Paper
|
||||
Paper pull request: https://github.com/PaperMC/Paper/pull/10990
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 86d07d8f7c171a8930990ab02360e79066cad7d5..f138ce7c55bb5241b0c27874151183bfef983cce 100644
|
||||
index e9ebf23b0b1af85e3738a70acc0eaa3e8980261f..d473c09e98eb5d3ef7b3e096197c7bf9a6219c56 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -207,6 +207,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -212,7 +212,7 @@ index d23ed8dbda5132337c8c96c67cf924e438ea9f4b..889b7e8752129dd3b5ba196c4b294496
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index eba90724a6e5e8a93d775d3e0703a0b37a77e7e5..1692d243a147e927c910890bd168f2fc5b166e29 100644
|
||||
index 776c23f64fdda3bcc93d66e811be7438c22be1f7..38b2714c4f0b53b91f61c89de42965919d586025 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1811,7 +1811,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -7,7 +7,7 @@ Original license: GPL v3
|
||||
Original project: https://github.com/Gensokyo-Reimagined/Nitori
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 18a0150536a847f9617a736245086d590bf80b74..10084fa3c0b8e1e6eaefc4fd733fc74ff295d588 100644
|
||||
index 17d3a8a2cc3c86ed6aae9c20ed9f281dc9715cf5..354823def23167feb1e7b35cd9db5ef1584e7e8c 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1067,6 +1067,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -34,7 +34,7 @@ index 632920e04686d8a0fd0a60e87348be1fe7862a3c..ba0dd850f90564fab3a5b922bb28d244
|
||||
IO_POOL.adjustThreadCount(ioThreads);
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 6abc57669e87f7f98f3b76af3c0e50825fea6eb1..d561202169d6f19c1e9ad8009415af9eaa707b96 100644
|
||||
index 6abc57669e87f7f98f3b76af3c0e50825fea6eb1..aa9dd6b75e8d3cfa1c527ef28e195b06772e5ade 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -593,7 +593,7 @@ public class Metrics {
|
||||
@@ -42,7 +42,7 @@ index 6abc57669e87f7f98f3b76af3c0e50825fea6eb1..d561202169d6f19c1e9ad8009415af9e
|
||||
// Only start Metrics, if it's enabled in the config
|
||||
if (config.getBoolean("enabled", true)) {
|
||||
- Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger());
|
||||
+ Metrics metrics = new Metrics("Gale", serverUUID, logFailedRequests, Bukkit.getLogger()); // Gale - branding changes - metrics
|
||||
+ Metrics metrics = new Metrics("Leaf", serverUUID, logFailedRequests, Bukkit.getLogger()); // Gale - branding changes - metrics // Leaf - metrics
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
@@ -51,18 +51,18 @@ index 6abc57669e87f7f98f3b76af3c0e50825fea6eb1..d561202169d6f19c1e9ad8009415af9e
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : "offline"));
|
||||
- final String paperVersion;
|
||||
+ final String galeVersion; // Gale - branding changes - metrics
|
||||
+ final String leafVersion; // Gale - branding changes - metrics // Leaf - metrics
|
||||
final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
||||
if (implVersion != null) {
|
||||
final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||
- paperVersion = "git-Paper-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash);
|
||||
+ galeVersion = "git-Gale-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Gale - branding changes - metrics
|
||||
+ leafVersion = "git-Leaf-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Gale - branding changes - metrics // Leaf - metrics
|
||||
} else {
|
||||
- paperVersion = "unknown";
|
||||
+ galeVersion = "unknown"; // Gale - branding changes - metrics
|
||||
+ leafVersion = "unknown"; // Gale - branding changes - metrics // Leaf - metrics
|
||||
}
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion));
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("gale_version", () -> galeVersion)); // Gale - branding changes - metrics
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("leaf_version", () -> leafVersion)); // Gale - branding changes - metrics // Leaf - metrics
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
- Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||
Date: Mon, 29 Apr 2024 14:18:58 -0400
|
||||
Subject: [PATCH] Fix Pufferfish and Purpur patches
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
index 5b844d2fea387f2cb655169f458ec0ca627f1c65..f267abd6f905180cfa5cf4961cf79f57544a891c 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
@@ -32,9 +32,11 @@ public record ServerBuildInfoImpl(
|
||||
|
||||
private static final String BRAND_PAPER_NAME = "Paper";
|
||||
private static final String BRAND_GALE_NAME = "Gale"; // Gale - branding changes
|
||||
- // Leaf start - Rebrand
|
||||
+ // Leaf start - Rebrand & Fix Pufferfish and Purpur patches
|
||||
+ private static final String BRAND_PUFFERFISH_NAME = "Pufferfish";
|
||||
+ private static final String BRAND_PURPUR_NAME = "Purpur";
|
||||
private static final String BRAND_LEAF_NAME = "Leaf";
|
||||
- // Leaf end - Rebrand
|
||||
+ // Leaf end - Rebrand & Fix Pufferfish and Purpur patches
|
||||
|
||||
private static final String BUILD_DEV = "DEV";
|
||||
|
||||
@@ -65,11 +67,13 @@ public record ServerBuildInfoImpl(
|
||||
|
||||
@Override
|
||||
public boolean isBrandCompatible(final @NotNull Key brandId) {
|
||||
- // Leaf start - Rebrand
|
||||
+ // Leaf start - Rebrand & Fix Pufferfish and Purpur patches
|
||||
return brandId.equals(this.brandId)
|
||||
|| brandId.equals(BRAND_PAPER_ID)
|
||||
- || brandId.equals(BRAND_GALE_ID); // Gale - branding changes
|
||||
- // Leaf end - Rebrand
|
||||
+ || brandId.equals(BRAND_GALE_ID) // Gale - branding changes
|
||||
+ || brandId.equals(BRAND_PUFFERFISH_ID)
|
||||
+ || brandId.equals(BRAND_PURPUR_ID);
|
||||
+ // Leaf end - Rebrand & Fix Pufferfish and Purpur patches
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -13,7 +13,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 612eacf43f8b6b92354fa43479bd0ead728dd7b9..a35c0af0c53bab4c1b3623e903d3057c816e5d3b 100644
|
||||
index c9c7590a5635d966a0ca262ed5985714d9e66598..119d26ada18ad1451b893657a1c9fa3bc2be6be4 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -936,6 +936,46 @@ public class Metrics {
|
||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index a35c0af0c53bab4c1b3623e903d3057c816e5d3b..3e9bbe0dae0cd1bdb390f68612dbf824b6ed4df7 100644
|
||||
index 119d26ada18ad1451b893657a1c9fa3bc2be6be4..8685b42dd00c964b0fbf42334cd6d23f187b2658 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -976,6 +976,22 @@ public class Metrics {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user