8 Commits

Author SHA1 Message Date
Oliver
6fe7cbabbd fancynpcs, packets: Update to 25w46a 2025-11-18 12:29:29 +01:00
Oliver
0d378fa951 config: Use java 17 instead of 17 2025-11-18 11:50:29 +01:00
Oliver
ccf9fe0d59 fancynpcs: Update version to 2.8.0.309 2025-11-18 11:35:00 +01:00
Oliver
b3fc33cb95 fancynpcs: load USE_MINECRAFT_USERCACHE_FEATURE_FLAG 2025-11-18 11:34:48 +01:00
Oliver
e1ba7dd888 Merge pull request #153 from FancyInnovations/fix/folia-visibility-issues
fancynpcs: Add enable-folia-visibility-fix feature flag
2025-11-18 11:33:51 +01:00
Oliver
8735da08a6 Merge branch 'main' into fix/folia-visibility-issues 2025-11-18 11:33:10 +01:00
Oliver
540b3ad738 fancynpcs: Add enable-folia-visibility-fix fflag 2025-11-18 11:32:06 +01:00
Oliver
f71c783163 fancynpcs: Always respawn npcs with a delay when using Folia 2025-10-06 21:31:42 +02:00
8 changed files with 28 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ repositories {
} }
dependencies { dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
compileOnly("de.oliver.FancyAnalytics:logger:0.0.8") compileOnly("de.oliver.FancyAnalytics:logger:0.0.8")
compileOnly("org.jetbrains:annotations:26.0.2") compileOnly("org.jetbrains:annotations:26.0.2")
@@ -26,7 +26,7 @@ dependencies {
tasks { tasks {
compileJava { compileJava {
options.encoding = Charsets.UTF_8.name() options.encoding = Charsets.UTF_8.name()
options.release.set(21) options.release.set(17) //TODO change to 21, once 1.19.4 support is dropped
} }
java { java {
@@ -47,5 +47,5 @@ tasks {
} }
java { java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21)) toolchain.languageVersion.set(JavaLanguageVersion.of(17)) //TODO change to 21, once 1.19.4 support is dropped
} }

View File

@@ -6,7 +6,7 @@ plugins {
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
dependencies { dependencies {
paperweight.paperDevBundle("25w45a-R0.1-SNAPSHOT") paperweight.paperDevBundle("25w46a-R0.1-SNAPSHOT")
compileOnly(project(":libraries:packets:packets-api")) compileOnly(project(":libraries:packets:packets-api"))
testImplementation(project(":libraries:packets")) testImplementation(project(":libraries:packets"))

View File

@@ -1 +1 @@
2.8.0.308 2.8.0.309

View File

@@ -10,6 +10,7 @@ dependencies {
compileOnly("io.papermc.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT")
compileOnly(project(":libraries:common")) compileOnly(project(":libraries:common"))
compileOnly(project(":libraries:config"))
compileOnly("de.oliver.FancyAnalytics:logger:0.0.8") compileOnly("de.oliver.FancyAnalytics:logger:0.0.8")
implementation("org.lushplugins:ChatColorHandler:6.0.0") implementation("org.lushplugins:ChatColorHandler:6.0.0")

View File

@@ -1,5 +1,6 @@
package de.oliver.fancynpcs.api; package de.oliver.fancynpcs.api;
import com.fancyinnovations.config.featureflags.FeatureFlagConfig;
import de.oliver.fancyanalytics.logger.ExtendedFancyLogger; import de.oliver.fancyanalytics.logger.ExtendedFancyLogger;
import de.oliver.fancylib.serverSoftware.schedulers.FancyScheduler; import de.oliver.fancylib.serverSoftware.schedulers.FancyScheduler;
import de.oliver.fancylib.translations.Translator; import de.oliver.fancylib.translations.Translator;
@@ -44,6 +45,8 @@ public interface FancyNpcsPlugin {
FancyNpcsConfig getFancyNpcConfig(); FancyNpcsConfig getFancyNpcConfig();
FeatureFlagConfig getFeatureFlagConfig();
NpcManager getNpcManager(); NpcManager getNpcManager();
AttributeManager getAttributeManager(); AttributeManager getAttributeManager();

View File

@@ -1,6 +1,7 @@
package de.oliver.fancynpcs.api; package de.oliver.fancynpcs.api;
import de.oliver.fancylib.RandomUtils; import de.oliver.fancylib.RandomUtils;
import de.oliver.fancylib.serverSoftware.ServerSoftware;
import de.oliver.fancylib.translations.Translator; import de.oliver.fancylib.translations.Translator;
import de.oliver.fancynpcs.api.actions.ActionTrigger; import de.oliver.fancynpcs.api.actions.ActionTrigger;
import de.oliver.fancynpcs.api.actions.NpcAction; import de.oliver.fancynpcs.api.actions.NpcAction;
@@ -18,6 +19,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
public abstract class Npc { public abstract class Npc {
@@ -110,6 +112,15 @@ public abstract class Npc {
if (shouldBeVisible && !wasVisible) { if (shouldBeVisible && !wasVisible) {
spawn(player); spawn(player);
// Respawn the npc to fix visibility issues on Folia
if (ServerSoftware.isFolia() && FancyNpcsPlugin.get().getFeatureFlagConfig().getFeatureFlag("enable-folia-visibility-fix").isEnabled()) {
FancyNpcsPlugin.get().getNpcThread().schedule(() -> {
remove(player);
spawn(player);
}, 100, TimeUnit.MILLISECONDS);
}
} else if (!shouldBeVisible && wasVisible) { } else if (!shouldBeVisible && wasVisible) {
remove(player); remove(player);
} }

View File

@@ -6,7 +6,7 @@ plugins {
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
dependencies { dependencies {
paperweight.paperDevBundle("25w45a-R0.1-SNAPSHOT") paperweight.paperDevBundle("25w46a-R0.1-SNAPSHOT")
// compileOnly("com.fancyinnovations:fancymc:1.21.6-pre2") // compileOnly("com.fancyinnovations:fancymc:1.21.6-pre2")
compileOnly(project(":plugins:fancynpcs:fn-api")) compileOnly(project(":plugins:fancynpcs:fn-api"))

View File

@@ -82,6 +82,7 @@ public class FancyNpcs extends JavaPlugin implements FancyNpcsPlugin {
public static final FeatureFlag PLAYER_NPCS_FEATURE_FLAG = new FeatureFlag("player-npcs", "Every player can only manage the npcs they have created", false); public static final FeatureFlag PLAYER_NPCS_FEATURE_FLAG = new FeatureFlag("player-npcs", "Every player can only manage the npcs they have created", false);
public static final FeatureFlag USE_NATIVE_THREADS_FEATURE_FLAG = new FeatureFlag("use-native-threads", "Use native threads instead of virtual threads.", false); public static final FeatureFlag USE_NATIVE_THREADS_FEATURE_FLAG = new FeatureFlag("use-native-threads", "Use native threads instead of virtual threads.", false);
public static final FeatureFlag ENABLE_DEBUG_MODE_FEATURE_FLAG = new FeatureFlag("enable-debug-mode", "Enable debug mode", false); public static final FeatureFlag ENABLE_DEBUG_MODE_FEATURE_FLAG = new FeatureFlag("enable-debug-mode", "Enable debug mode", false);
public static final FeatureFlag ENABLE_FOLIA_VISIBILITY_FIX_FEATURE_FLAG = new FeatureFlag("enable-folia-visibility-fix", "When enabled, all npcs will respawn after 100ms when they should spawn", false);
public static final FeatureFlag USE_MINECRAFT_USERCACHE_FEATURE_FLAG = new FeatureFlag("use-minecraft-usercache", "Include the content of usercache.json to the username->uuid cache", false); public static final FeatureFlag USE_MINECRAFT_USERCACHE_FEATURE_FLAG = new FeatureFlag("use-minecraft-usercache", "Include the content of usercache.json to the username->uuid cache", false);
private static FancyNpcs instance; private static FancyNpcs instance;
@@ -154,6 +155,8 @@ public class FancyNpcs extends JavaPlugin implements FancyNpcsPlugin {
featureFlagConfig.addFeatureFlag(PLAYER_NPCS_FEATURE_FLAG); featureFlagConfig.addFeatureFlag(PLAYER_NPCS_FEATURE_FLAG);
featureFlagConfig.addFeatureFlag(USE_NATIVE_THREADS_FEATURE_FLAG); featureFlagConfig.addFeatureFlag(USE_NATIVE_THREADS_FEATURE_FLAG);
featureFlagConfig.addFeatureFlag(ENABLE_DEBUG_MODE_FEATURE_FLAG); featureFlagConfig.addFeatureFlag(ENABLE_DEBUG_MODE_FEATURE_FLAG);
featureFlagConfig.addFeatureFlag(ENABLE_FOLIA_VISIBILITY_FIX_FEATURE_FLAG);
featureFlagConfig.addFeatureFlag(USE_MINECRAFT_USERCACHE_FEATURE_FLAG);
featureFlagConfig.load(); featureFlagConfig.load();
if (ENABLE_DEBUG_MODE_FEATURE_FLAG.isEnabled()) { if (ENABLE_DEBUG_MODE_FEATURE_FLAG.isEnabled()) {
@@ -598,6 +601,7 @@ public class FancyNpcs extends JavaPlugin implements FancyNpcsPlugin {
return textConfig; return textConfig;
} }
@Override
public FeatureFlagConfig getFeatureFlagConfig() { public FeatureFlagConfig getFeatureFlagConfig() {
return featureFlagConfig; return featureFlagConfig;
} }