9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 00:49:31 +00:00
Files
Leaf/patches/server/0012-Fix-Pufferfish-and-Purpur-patches.patch
2024-08-17 19:11:59 -04:00

348 lines
24 KiB
Diff

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 23609a71a993fc91271578ee0a541a9c6ec7354f..34f7f74b374d319d0d578e498db7663dd58b8458 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
@@ -32,6 +32,7 @@ public record ServerBuildInfoImpl(
private static final String BRAND_PAPER_NAME = "Paper";
private static final String BRAND_GALE_NAME = "Gale"; // Gale - branding changes
+ private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Leaf
private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur
private static final String BRAND_LEAF_NAME = "Leaf"; // Leaf
@@ -66,7 +67,9 @@ public record ServerBuildInfoImpl(
public boolean isBrandCompatible(final @NotNull Key brandId) {
return brandId.equals(this.brandId)
|| brandId.equals(BRAND_PAPER_ID)
- || brandId.equals(BRAND_GALE_ID); // Gale - branding changes // Leaf
+ || brandId.equals(BRAND_GALE_ID) // Gale - branding changes // Leaf
+ || brandId.equals(BRAND_PUFFERFISH_ID) // Leaf
+ || brandId.equals(BRAND_PURPUR_ID); // Leaf
}
@Override
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9d082b3c06281b0cafe455959d6ef20b8891110e..5071828f4ec318ca457d7c29d5ffaa3de2f43e48 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -300,7 +300,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 ]; // Purpur
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
public final GaleConfigurations galeConfigurations; // Gale - Gale configuration
@@ -313,7 +313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile boolean abnormalExit = false; // Paper
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("pufferfish-async-mob-spawning"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1036,6 +1036,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.error("[UPnP] Failed to close port {}", this.getPort());
}
}
+ // Purpur end
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
@@ -1298,9 +1299,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();
+ // Purpur start
+ this.recentTps[0] = tps5s.getAverage();
+ this.recentTps[1] = tps1.getAverage();
+ this.recentTps[2] = tps5.getAverage();
+ this.recentTps[3] = tps15.getAverage();
+ // Purpur end
lagging = recentTps[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur
tickSection = currentTime;
}
diff --git a/src/main/java/net/minecraft/server/gui/StatsComponent.java b/src/main/java/net/minecraft/server/gui/StatsComponent.java
index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb732b9e7108 100644
--- a/src/main/java/net/minecraft/server/gui/StatsComponent.java
+++ b/src/main/java/net/minecraft/server/gui/StatsComponent.java
@@ -45,7 +45,7 @@ public class StatsComponent extends JComponent {
this.msgs[1] = "Avg tick: "
+ DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / (double)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); // Purpur
// Paper end - Improve ServerGUI
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
this.repaint();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 01ea21b960b5b32cdb14cefd1c23b50ba5cb8335..e8a89db44ed4f20516a9716bc3f41658f63a312c 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -486,7 +486,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
//this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
// Gale start - MultiPaper - skip unnecessary mob spawning computations
} else {
- spawnercreature_d = null;
+ lastSpawnState = null; // Leaf - Pufferfish - Optimize mob spawning
}
// Gale end - MultiPaper - skip unnecessary mob spawning computations
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0ed4f5a291ef5009a0535273ac52a9fbac150553..fae2574cee5779c4a3ea7aec393f087676327b0e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -658,7 +658,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
long j;
- if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) {
+ if (this.purpurConfig.playersSkipNight && this.sleepStatus.areEnoughSleeping(i) && this.sleepStatus.areEnoughDeepSleeping(i, this.players)) { // Purpur
// CraftBukkit start
j = this.levelData.getDayTime() + 24000L;
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 06e5d3e2dfc762c640b5261b4962503e48c2a76f..164c126a61f550c09a7e114bf8947bde1c5a3aa8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -564,13 +564,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Purpur end
// Purpur start - copied from Mob - API for any mob to burn daylight
+ // Gale start - JettPack - optimize sun burn tick - cache eye blockpos - copied from Mob#isSunBurnTick
+ private BlockPos cached_eye_blockpos;
+ private int cached_position_hashcode;
+ // Gale end - JettPack - optimize sun burn tick - cache eye blockpos - copied from Mob#isSunBurnTick
+
public boolean isSunBurnTick() {
if (this.level().isDay() && !this.level().isClientSide) {
- float f = this.getLightLevelDependentMagicValue();
- BlockPos blockposition = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
+ // Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos - copied from Mob#isSunBurnTick
+ int positionHashCode = this.position.hashCode();
+ if (this.cached_position_hashcode != positionHashCode) {
+ this.cached_eye_blockpos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
+ this.cached_position_hashcode = positionHashCode;
+ }
+
+ float f = this.getLightLevelDependentMagicValue(cached_eye_blockpos); // Pass BlockPos to getBrightness
+
+ // Check brightness first
+ if (f <= 0.5F) return false;
+ if (this.random.nextFloat() * 30.0F >= (f - 0.4F) * 2.0F) return false;
+ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos - copied from Mob#isSunBurnTick
boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
- if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level().canSeeSky(blockposition)) {
+ if (!flag && this.level().canSeeSky(this.cached_eye_blockpos)) { // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos - copied from Mob#isSunBurnTick
return true;
}
}
@@ -876,7 +892,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void tick() {
// Pufferfish start - entity TTL
if (type != EntityType.PLAYER && type.ttl >= 0 && this.tickCount >= type.ttl) {
- discard();
+ discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Purpur
return;
}
// Pufferfish end - entity TTL
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index cb2d6bb3ab2d07dc0756591be0be76a3f6f8a5d6..27e7086b4e2c71b29aa4a1c825604395a5f35439 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1044,17 +1044,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (entity != null) {
EntityType<?> entitytypes = entity.getType();
+ // Gale start - Petal - reduce skull ItemStack lookups for reduced visibility
// Purpur start
- if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL)) {
+ if (entitytypes == EntityType.SKELETON && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.SKELETON_SKULL)) {
d0 *= entity.level().purpurConfig.skeletonHeadVisibilityPercent;
- } else if (entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD)) {
+ } else if (entitytypes == EntityType.ZOMBIE && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.ZOMBIE_HEAD)) {
d0 *= entity.level().purpurConfig.zombieHeadVisibilityPercent;
- } else if (entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
+ } else if (entitytypes == EntityType.CREEPER && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.CREEPER_HEAD)) {
d0 *= entity.level().purpurConfig.creeperHeadVisibilityPercent;
- } else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && itemstack.is(Items.PIGLIN_HEAD)) {
+ } else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.PIGLIN_HEAD)) {
d0 *= entity.level().purpurConfig.piglinHeadVisibilityPercent;
}
// Purpur end
+ // Gale end - Petal - reduce skull ItemStack lookups for reduced visibility
// Purpur start
if (entity instanceof LivingEntity entityliving) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 85d3da44ac575d26b9e6c522011e6b6288cce651..e57d4f58401a93034a39e9ed27672ac265a6e4b9 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -705,7 +705,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void aiStep() {
super.aiStep();
- if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
+ if (!this.level().isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level().purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur
Vec3i baseblockposition = this.getPickupReach();
List<ItemEntity> list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ()));
Iterator iterator = list.iterator();
@@ -1765,11 +1765,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 int cached_position_hashcode;
- // 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/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java b/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
index 7db823e9edd70808c5629f0a7efd84fe40f42dd9..f8871bfc0dae0485b965ee41b770da78cc4c7480 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/TradeWithVillager.java
@@ -22,6 +22,7 @@ public class TradeWithVillager extends Behavior<Villager> {
private static final Item[] WHEAT_SINGLETON_ARRAY = {Items.WHEAT};
private @NotNull Item @Nullable [] trades = null;
// Gale end - optimize villager data storage
+ private static final Item[] NETHER_WART_SINGLETON_ARRAY = {Items.NETHER_WART}; // Leaf - sync with Gale's Optimize-villager-data-storage.patch
public TradeWithVillager() {
super(
@@ -65,7 +66,7 @@ public class TradeWithVillager extends Behavior<Villager> {
// Purpur start
if (world.purpurConfig.villagerClericsFarmWarts && world.purpurConfig.villagerClericFarmersThrowWarts && entity.getVillagerData().getProfession() == VillagerProfession.CLERIC && entity.getInventory().countItem(Items.NETHER_WART) > Items.NETHER_WART.getDefaultMaxStackSize() / 2) {
- throwHalfStack(entity, ImmutableSet.of(Items.NETHER_WART), villager);
+ throwHalfStack(entity, NETHER_WART_SINGLETON_ARRAY, villager); // Leaf - sync with Gale's Optimize-villager-data-storage.patch
}
// Purpur end
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
index 9419f230910d0338fc4ac6e2e7b749ee7d5ee362..f80af9174e33a2407d12f37575464a2790302cfe 100644
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
@@ -24,19 +24,15 @@ public class SecondaryPoiSensor extends Sensor<Villager> {
@Override
protected void doTick(ServerLevel world, Villager entity) {
+ // Purpur start - make sure clerics don't wander to soul sand when the option is off
// Gale start - Lithium - skip secondary POI sensor if absent
var secondaryPoi = entity.getVillagerData().getProfession().secondaryPoi();
- if (secondaryPoi == null) { // Gale - optimize villager data storage
- entity.getBrain().eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
- return;
- }
- // Gale end - Lithium - skip secondary POI sensor if absent
- // Purpur start - make sure clerics don't wander to soul sand when the option is off
Brain<?> brain = entity.getBrain();
- if (!world.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().getProfession() == net.minecraft.world.entity.npc.VillagerProfession.CLERIC) {
+ if (secondaryPoi == null || (!world.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().getProfession() == net.minecraft.world.entity.npc.VillagerProfession.CLERIC)) {
brain.eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE);
return;
}
+ // Gale end - Lithium - skip secondary POI sensor if absent
// Purpur end
ResourceKey<Level> resourceKey = world.dimension();
BlockPos blockPos = entity.blockPosition();
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index c0383771b08e1d89dfa4996b979248da1de8aca1..3bb46ed871fd56bbbe52cfd2575f9e853e03cd73 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -687,7 +687,7 @@ public class ArmorStand extends LivingEntity {
@Override
public void tick() {
- maxUpStep = level().purpurConfig.armorstandStepHeight;
+ maxUpStep = level().purpurConfig.armorstandStepHeight; // Purpur
// Paper start - Allow ArmorStands not to tick
if (!this.canTick) {
if (this.noTickPoseDirty) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Blaze.java b/src/main/java/net/minecraft/world/entity/monster/Blaze.java
index 6c68c1df84e006f9992435f4c8e328c17e88c51c..f86f42863227494f7f71a7813fd49049d04aa081 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Blaze.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Blaze.java
@@ -72,7 +72,6 @@ public class Blaze extends Monster {
setDeltaMovement(mot.scale(0.9D));
}
}
- // Purpur end
@Override
public void initAttributes() {
@@ -84,6 +83,7 @@ public class Blaze extends Monster {
protected boolean isAlwaysExperienceDropper() {
return this.level().purpurConfig.blazeAlwaysDropExp;
}
+ // Purpur end
@Override
protected void registerGoals() {
diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java b/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java
index 613ef7dc40f1f2819bb38fecd3793f1c42a8f791..482a0998a3d98ba145f33efdba5989714a931cf5 100644
--- a/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java
+++ b/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java
@@ -31,7 +31,7 @@ public record VillagerProfession(
public static final VillagerProfession ARMORER = register("armorer", PoiTypes.ARMORER, SoundEvents.VILLAGER_WORK_ARMORER);
public static final VillagerProfession BUTCHER = register("butcher", PoiTypes.BUTCHER, SoundEvents.VILLAGER_WORK_BUTCHER);
public static final VillagerProfession CARTOGRAPHER = register("cartographer", PoiTypes.CARTOGRAPHER, SoundEvents.VILLAGER_WORK_CARTOGRAPHER);
- public static final VillagerProfession CLERIC = register("cleric", PoiTypes.CLERIC, ImmutableSet.of(Items.NETHER_WART), ImmutableSet.of(Blocks.SOUL_SAND), SoundEvents.VILLAGER_WORK_CLERIC); // Purpur
+ public static final VillagerProfession CLERIC = register("cleric", PoiTypes.CLERIC, new Item[] {Items.NETHER_WART}, Blocks.SOUL_SAND, SoundEvents.VILLAGER_WORK_CLERIC); // Purpur // Leaf - sync with Gale's Optimize-villager-data-storage.patch
public static final VillagerProfession FARMER = register(
"farmer",
PoiTypes.FARMER,
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 617043b24fbf073038ffc5252da75c4cfaf85d38..e40f6d244011f6444fbed3fa0f49994ff56f54ce 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -77,7 +77,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
int maxChunkLoadsPerProjectile = maxProjectileChunkLoadsConfig.perProjectile.max;
if (maxChunkLoadsPerProjectile >= 0 && this.chunksLoadedByProjectile >= maxChunkLoadsPerProjectile) {
if (maxProjectileChunkLoadsConfig.perProjectile.removeFromWorldAfterReachLimit) {
- this.discard();
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Purpur
} else if (maxProjectileChunkLoadsConfig.perProjectile.resetMovementAfterReachLimit) {
this.setDeltaMovement(0, this.getDeltaMovement().y, 0);
}
diff --git a/src/main/java/org/galemc/gale/version/AbstractPaperVersionFetcher.java b/src/main/java/org/galemc/gale/version/AbstractPaperVersionFetcher.java
index 75af21644eaf78abdebd722b671f3c47aa083a25..c55757f0a24a0b5c06333070f5875e7d8a0f7777 100644
--- a/src/main/java/org/galemc/gale/version/AbstractPaperVersionFetcher.java
+++ b/src/main/java/org/galemc/gale/version/AbstractPaperVersionFetcher.java
@@ -101,10 +101,10 @@ public abstract class AbstractPaperVersionFetcher implements VersionFetcher {
// Gale end - branding changes - version fetcher
return switch (distance) {
- case DISTANCE_ERROR -> text("Error obtaining version information", NamedTextColor.YELLOW);
- case 0 -> text("You are running the latest version", NamedTextColor.GREEN);
- case DISTANCE_UNKNOWN -> text("Unknown version", NamedTextColor.YELLOW);
- default -> text("You are " + distance + " version(s) behind", NamedTextColor.YELLOW)
+ case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur
+ case 0 -> text("* You are running the latest version", NamedTextColor.GREEN); // Purpur
+ case DISTANCE_UNKNOWN -> text("* Unknown version", NamedTextColor.YELLOW); // Purpur
+ default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur
.append(Component.newline())
.append(text("Download the new version at: ")
.append(text(this.downloadPage, NamedTextColor.GOLD) // Gale - branding changes - version fetcher
@@ -149,6 +149,6 @@ public abstract class AbstractPaperVersionFetcher implements VersionFetcher {
return null;
}
- return text("Previous version: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC);
+ return text("Previous: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC); // Purpur
}
}