diff --git a/build.gradle.kts b/build.gradle.kts index 26611af0..00b7702e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,6 +26,7 @@ repositories { url = uri("https://jitpack.io") content { includeGroup("com.github.XiaMoZhiShi") + includeGroup("com.github.NiFeather") } } @@ -93,21 +94,21 @@ dependencies { project.property("protocols_local_version") else project.property("protocols_version"); - implementation("com.github.XiaMoZhiShi:feathermorph-protocols:${protocolVersion}") + implementation("com.github.NiFeather:feathermorph-protocols:${protocolVersion}") implementation("com.github.XiaMoZhiShi:PluginBase:${project.property("pluginbase_version")}") { exclude("com.google.code.gson", "gson") } } -group = "xiamomc.morph" +group = "xyz.nifeather.morph" version = "${project.property("project_version")}" description = "A morph plugin that aims to provide many features out-of-the-box" java.sourceCompatibility = JavaVersion.VERSION_21 bukkit { load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD - main = "xiamomc.morph.MorphPlugin" + main = "xyz.nifeather.morph.MorphPlugin" apiVersion = "1.19" authors = listOf("MATRIX-feather") depend = listOf() @@ -130,7 +131,7 @@ bukkit { featherMorphCommand.aliases = listOf("fm"); } - val permissionRoot = "xiamomc.morph." + val permissionRoot = "feathermorph." permissions { register(permissionRoot + "morph") @@ -155,7 +156,13 @@ bukkit { val opPermsStrList = listOf( permissionRoot + "disguise_revealing", + permissionRoot + "manage", + permissionRoot + "manage.grant", + permissionRoot + "manage.revoke", + permissionRoot + "manage.unmorph", + permissionRoot + "manage.morph", + permissionRoot + "query", permissionRoot + "queryall", permissionRoot + "reload", @@ -199,10 +206,10 @@ tasks.build { tasks.shadowJar { minimize() archiveFileName = "FeatherMorph-${project.property("project_version")}+${project.property("mc_version")}-final.jar" - relocate("xiamomc.pluginbase", "xiamomc.morph.shaded.pluginbase") - relocate("org.bstats", "xiamomc.morph.shaded.bstats") - relocate("de.tr7zw.changeme.nbtapi", "xiamomc.morph.shaded.nbtapi") - relocate("de.themoep.inventorygui", "xiamomc.morph.shaded.inventorygui") + relocate("xiamomc.pluginbase", "xyz.nifeather.morph.shaded.pluginbase") + relocate("org.bstats", "xyz.nifeather.morph.shaded.bstats") + relocate("de.tr7zw.changeme.nbtapi", "xyz.nifeather.morph.shaded.nbtapi") + relocate("de.themoep.inventorygui", "xyz.nifeather.morph.shaded.inventorygui") } tasks.withType() { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MonsterValues.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MonsterValues.java deleted file mode 100644 index 7c6251d3..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MonsterValues.java +++ /dev/null @@ -1,5 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; - -public class MonsterValues extends MobValues -{ -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ParrotValues.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ParrotValues.java deleted file mode 100644 index 41fc9140..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ParrotValues.java +++ /dev/null @@ -1,15 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; - -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.TameableAnimalValues; - -public class ParrotValues extends TameableAnimalValues -{ - public final SingleValue PARROT_VARIANT = createSingle("parrot_variant", 0).withRandom(0, 1, 2, 3, 4); - - public ParrotValues() - { - super(); - - registerSingle(PARROT_VARIANT); - } -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractGolemValues.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractGolemValues.java deleted file mode 100644 index 8553895d..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractGolemValues.java +++ /dev/null @@ -1,7 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; - -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.MobValues; - -public class AbstractGolemValues extends MobValues -{ -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AgeableMobValues.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AgeableMobValues.java deleted file mode 100644 index 14269228..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AgeableMobValues.java +++ /dev/null @@ -1,16 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; - -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.MobValues; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; - -public class AgeableMobValues extends MobValues -{ - public final SingleValue IS_BABY = createSingle("ageable_mob_is_baby", false); - - public AgeableMobValues() - { - super(); - - registerSingle(IS_BABY); - } -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AnimalValues.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AnimalValues.java deleted file mode 100644 index 44c93576..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AnimalValues.java +++ /dev/null @@ -1,5 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; - -public class AnimalValues extends AgeableMobValues -{ -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/WaterAnimalValues.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/WaterAnimalValues.java deleted file mode 100644 index 1dc91e31..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/WaterAnimalValues.java +++ /dev/null @@ -1,7 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; - -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.MobValues; - -public class WaterAnimalValues extends MobValues -{ -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/InventoryLivingWatcher.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/InventoryLivingWatcher.java deleted file mode 100644 index 1143e790..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/InventoryLivingWatcher.java +++ /dev/null @@ -1,28 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; - -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.pluginbase.Annotations.Resolved; - -public class InventoryLivingWatcher extends LivingEntityWatcher -{ - public InventoryLivingWatcher(Player bindingPlayer, EntityType entityType) - { - super(bindingPlayer, entityType); - } - - @Resolved(shouldSolveImmediately = true) - private PacketFactory packetFactory; - - @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) - { - super.onEntryWrite(key, oldVal, newVal); - - if (key.equals(CustomEntries.DISPLAY_FAKE_EQUIPMENT) || key.equals(CustomEntries.EQUIPMENT)) - sendPacketToAffectedPlayers(packetFactory.getEquipmentPacket(getBindingPlayer(), this)); - } -} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/CustomEntries.java b/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/CustomEntries.java deleted file mode 100644 index 747acd86..00000000 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/CustomEntries.java +++ /dev/null @@ -1,45 +0,0 @@ -package xiamomc.morph.backends.server.renderer.network.registries; - -import com.mojang.authlib.GameProfile; -import net.minecraft.Util; -import xiamomc.morph.misc.DisguiseEquipment; - -import java.util.UUID; - -public class CustomEntries -{ - /** - * This should always present for player disguise! - */ - public static final RegistryKey PROFILE = RegistryKey.of("profile", new GameProfile(UUID.randomUUID(), "sample")).doRequireNonNull(); - - /** - * Should profile listed in the tab list? - * - * Also, 'TRUE' means the profile listing is also handled by external sources - */ - public static final RegistryKey PROFILE_LISTED = RegistryKey.of("profile_listed", false); - - public static final RegistryKey DISGUISE_NAME = RegistryKey.of("disguise_name", "").doRequireNonNull(); - - public static final RegistryKey EQUIPMENT = RegistryKey.of("equip", new DisguiseEquipment()); - public static final RegistryKey DISPLAY_FAKE_EQUIPMENT = RegistryKey.of("display_fake_equip", false); - - /** - * @deprecated UUID for player disguise now is {@link CustomEntries#SPAWN_ID} - */ - @Deprecated(since = "1.2.6", forRemoval = true) - public static final RegistryKey TABLIST_UUID = RegistryKey.of("tablist_uuid", Util.NIL_UUID); - - public static final RegistryKey WARDEN_CHARGING_ATTACK = RegistryKey.of("warden_charging_attack", false); - public static final RegistryKey ATTACK_ANIMATION = RegistryKey.of("attack_animation", false); - - public static final RegistryKey SLIME_SIZE_REAL = RegistryKey.of("slime_size_real", 0); - - public static final RegistryKey ANIMATION = RegistryKey.of("animation", "morph:unknown"); - - public static final RegistryKey SPAWN_UUID = RegistryKey.of("spawn_uuid", Util.NIL_UUID); - public static final RegistryKey SPAWN_ID = RegistryKey.of("spawn_id", -1); - - public static final RegistryKey VANISHED = RegistryKey.of("vanished", false); -} diff --git a/src/main/java/xiamomc/morph/providers/animation/AnimationProvider.java b/src/main/java/xiamomc/morph/providers/animation/AnimationProvider.java deleted file mode 100644 index c5f7709a..00000000 --- a/src/main/java/xiamomc/morph/providers/animation/AnimationProvider.java +++ /dev/null @@ -1,14 +0,0 @@ -package xiamomc.morph.providers.animation; - -import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphPluginObject; - -public abstract class AnimationProvider extends MorphPluginObject -{ - /** - * @param disguiseID - * @return The sequence of the given parameters, {@link xiamomc.morph.providers.animation.bundled.FallbackAnimationSet} if invalid. - */ - @NotNull - public abstract AnimationSet getAnimationSetFor(String disguiseID); -} diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/FallbackAnimationSet.java b/src/main/java/xiamomc/morph/providers/animation/bundled/FallbackAnimationSet.java deleted file mode 100644 index 7d96aa8b..00000000 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/FallbackAnimationSet.java +++ /dev/null @@ -1,7 +0,0 @@ -package xiamomc.morph.providers.animation.bundled; - -import xiamomc.morph.providers.animation.AnimationSet; - -public class FallbackAnimationSet extends AnimationSet -{ -} diff --git a/src/main/java/xiamomc/morph/storage/offlinestore/IOfflineState.java b/src/main/java/xiamomc/morph/storage/offlinestore/IOfflineState.java deleted file mode 100644 index 6de723ca..00000000 --- a/src/main/java/xiamomc/morph/storage/offlinestore/IOfflineState.java +++ /dev/null @@ -1,5 +0,0 @@ -package xiamomc.morph.storage.offlinestore; - -public interface IOfflineState -{ -} diff --git a/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfigurationStore.java b/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfigurationStore.java deleted file mode 100644 index d32a6fb9..00000000 --- a/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfigurationStore.java +++ /dev/null @@ -1,395 +0,0 @@ -package xiamomc.morph.storage.skill; - -import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import org.bukkit.NamespacedKey; -import org.bukkit.attribute.Attribute; -import org.bukkit.entity.EntityType; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.AbilityManager; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.IMorphAbility; -import xiamomc.morph.abilities.impl.AttributeModifyingAbility; -import xiamomc.morph.abilities.impl.onAttack.ExtraKnockbackAbility; -import xiamomc.morph.abilities.options.AttributeModifyOption; -import xiamomc.morph.skills.DefaultConfigGenerator; -import xiamomc.morph.skills.IMorphSkill; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.impl.LaunchProjectileMorphSkill; -import xiamomc.morph.skills.impl.SonicBoomMorphSkill; -import xiamomc.morph.storage.MorphJsonBasedStorage; -import xiamomc.morph.utilities.DisguiseUtils; -import xiamomc.morph.utilities.EntityTypeUtils; -import xiamomc.pluginbase.Annotations.Resolved; - -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * 技能配置存储,有关技能执行、注册技能请查看{@link MorphSkillHandler} 和 {@link AbilityManager} - */ -public class SkillAbilityConfigurationStore extends MorphJsonBasedStorage -{ - /** - * 配置 -> 技能 - */ - private final Map> configToSkillMap = new Object2ObjectOpenHashMap<>(); - - /** - * 获取已配置的技能 - * - * @return 配置 -> 技能表 - */ - public Map> getConfiguredSkills() - { - return configToSkillMap; - } - - @Override - protected @NotNull String getFileName() - { - return "skills.json"; - } - - @Override - protected @NotNull SkillAbilityConfigurationContainer createDefault() - { - return DefaultConfigGenerator.createInstance().generateConfiguration(); - } - - @Override - protected @NotNull String getDisplayName() - { - return "技能存储"; - } - - private final int targetVersion = 27; - - @Resolved - private MorphSkillHandler skillHandler; - - @Resolved - private AbilityManager abilityHandler; - - @Override - public boolean reloadConfiguration() - { - var val = super.reloadConfiguration(); - - var success = new AtomicBoolean(val); - - if (!success.get()) - logger.warn("We met some problem reloading, some configurations may not be added."); - - if (!val) return false; - - try - { - configToSkillMap.clear(); - abilityHandler.clearAbilities(); - - storingObject.configurations.forEach(c -> - { - if (!registerConfiguration(c)) success.set(false); - - var abilities = new ObjectArrayList>(); - - c.getAbilitiyIdentifiers().forEach(i -> - { - if (i.isEmpty()) return; - - var key = NamespacedKey.fromString(i); - - if (key == null) - logger.error("Invalid skill identifier: " + i); - - var ability = abilityHandler.getAbility(key); - - if (ability == null) return; - - abilities.add(ability); - - if (!ability.setOptionGeneric(c.getIdentifier(), c.getAbilityOptions(ability))) - { - logger.warn("Unable to add skill configuration" + c.getIdentifier() + " -> " + ability.getIdentifier()); - success.set(false); - } - }); - - abilityHandler.setAbilities(c, abilities); - }); - - if (storingObject.version < targetVersion) - success.set(migrate(storingObject) || success.get()); - - saveConfiguration(); - } - catch (Throwable t) - { - logger.error("Error occurred while processing skill configurations:" + t.getMessage()); - t.printStackTrace(); - - configToSkillMap.clear(); - return false; - } - - return true; - } - - /** - * 注册一个技能配置 - * @param configuration 要注册的配置 - * @return 操作是否成功 - */ - public boolean registerConfiguration(SkillAbilityConfiguration configuration) - { - if (configToSkillMap.containsKey(configuration)) - return true; - - if (configToSkillMap.keySet().stream().anyMatch(c -> c.getIdentifier().equals(configuration.getIdentifier()))) - { - logger.error("Another configuration instance already registered as " + configuration.getIdentifier() + "!"); - return false; - } - - var type = configuration.getSkillIdentifier(); - - if (type.equals(SkillType.UNKNOWN)) - { - logger.error(configuration + " has an invalid skill identifier"); - return false; - } - - var skillOptional = skillHandler.getRegistedSkills().stream() - .filter(s -> s.getIdentifier().equals(type)).findFirst(); - - if (skillOptional.isEmpty()) - { - logger.error("Unable to find any skill that matches the identifier: " + type.asString()); - return false; - } - - configToSkillMap.put(configuration, skillOptional.get()); - - return true; - } - - private boolean migrate(SkillAbilityConfigurationContainer config) - { - logger.info("Updating skill configurations..."); - - try - { - var version = config.version; - - //1: fake_inventory改名fake_equip - if (version < 1) - { - var oldFakeInvKey = new NamespacedKey("morph", "fake_inventory"); - config.configurations.forEach(c -> - { - if (c.getSkillIdentifier().equals(oldFakeInvKey)) - c.setSkillIdentifier(SkillType.INVENTORY); - }); - } - - //5: 技能设置迁移到settings中 - if (version < 5) - { - config.configurations.forEach(c -> - { - var effect = c.getEffectConfiguration(); - var projective = c.getProjectiveConfiguration(); - var explosion = c.getExplosionConfiguration(); - var teleport = c.getTeleportConfiguration(); - - c.setOption(SkillType.TELEPORT.asString(), teleport); - c.setOption(SkillType.APPLY_EFFECT.asString(), effect); - c.setOption(SkillType.LAUNCH_PROJECTILE.asString(), projective); - c.setOption(SkillType.EXPLODE.asString(), explosion); - }); - } - - //9: 实现Warden的音爆技能 - if (version < 9) - { - var targetConfig = getConfigFor(EntityType.WARDEN, config); - - if (targetConfig != null && targetConfig.getSkillIdentifier().equals(SkillType.NONE)) - { - targetConfig.setSkillIdentifier(SkillType.SONIC_BOOM); - targetConfig.setCooldown(SonicBoomMorphSkill.defaultCooldown); - } - } - - //11: 调整fallback机制 - if (version < 11) - { - config.configurations.stream() - .filter(s -> s.getIdentifier().equals(EntityType.PLAYER.getKey().asString())) - .findFirst().ifPresent(targetConfig -> targetConfig.setIdentifier("player:" + MorphManager.disguiseFallbackName)); - - } - - //马匹被动改成更改属性 - if (version < 13) - { - var targetConfig= getConfigFor(EntityType.HORSE, config); - - if (targetConfig != null) - { - var targetIdentifier = AbilityType.HAS_SPEED_BOOST.asString(); - targetConfig.getAbilitiyIdentifiers().removeIf(s -> s.equals(targetIdentifier)); - } - } - - //恶魂的技能合并到弹射物中 - if (version < 14) - { - var ghastConfig = getConfigFor(EntityType.GHAST, config); - - if (ghastConfig != null) - { - //noinspection removal - ghastConfig.moveOption(SkillType.GHAST, SkillType.LAUNCH_PROJECTILE); - ghastConfig.setSkillIdentifier(SkillType.LAUNCH_PROJECTILE); - - var option = ghastConfig.getSkillOptions(new LaunchProjectileMorphSkill()); - if (option != null) - { - option.put("delay", DisguiseUtils.GHAST_EXECUTE_DELAY); - option.put("warning_sound_name", "entity.ghast.warn"); - } - } - } - - //一些拥有飞行被动的伪装同时也拥有免疫摔落伤害的被动 - if (version < 19) - { - for (EntityType entityType : EntityTypeUtils.noFallDamage1()) - { - config.configurations.stream().filter(s -> s != null && s.getIdentifier().equals(entityType.getKey().asString())) - .findFirst().ifPresent(cfg -> cfg.getAbilitiyIdentifiers().removeIf(s -> s.equals(AbilityType.NO_FALL_DAMAGE.asString()))); - } - } - - //实现了女巫的抛掷技能 - if (version < 21) - { - var option = getConfigFor(EntityType.WITCH, config); - - if (option != null) - { - if (option.getSkillIdentifier().equals(SkillType.NONE)) - { - option.setSkillIdentifier(SkillType.WITCH); - option.setCooldown(80); - } - } - } - - //铁傀儡和监守者的攻击伤害和速度 - if (version < 25) - { - var wardenConfig = getConfigFor(EntityType.WARDEN, config); - - if (wardenConfig != null) - { - var option = (AttributeModifyOption) wardenConfig.getAbilityOptions(abilityHandler.getAbility(AbilityType.ATTRIBUTE)); - - if (option != null) - { - option.with(Attribute.GENERIC_ATTACK_DAMAGE, AttributeModifyOption.OperationType.add, 30) - .with(Attribute.GENERIC_ATTACK_SPEED, AttributeModifyOption.OperationType.multiply_base, -0.6d); - - wardenConfig.setOption(AbilityType.ATTRIBUTE.asString(), option); - } - } - - var ironConfig = getConfigFor(EntityType.IRON_GOLEM, config); - if (ironConfig != null) - { - var option = ironConfig.getAbilityOptions(new AttributeModifyingAbility()); - - if (option != null) - { - option.with(Attribute.GENERIC_ATTACK_DAMAGE, AttributeModifyOption.OperationType.add, 15) - .with(Attribute.GENERIC_ATTACK_SPEED, AttributeModifyOption.OperationType.multiply_base, -0.6d); - - ironConfig.setOption(AbilityType.ATTRIBUTE.asString(), option); - } - } - - //var ds = this.createGson().toJson(storingObject); - //logger.info(ds); - } - - // 马匹踏上1格高的方块 - if (version < 26) - { - var horseConfig = getConfigFor(EntityType.HORSE, config); - if (horseConfig != null) - { - var option = horseConfig.getAbilityOptions(new AttributeModifyingAbility()); - if (option != null) - { - option.with(Attribute.GENERIC_STEP_HEIGHT, AttributeModifyOption.OperationType.add, 0.4d); - - horseConfig.setOption(AbilityType.ATTRIBUTE.asString(), option); - } - } - } - - if (version < 27) - { - var ironConfig = getConfigFor(EntityType.IRON_GOLEM, config); - if (ironConfig != null) - { - var option = ironConfig.getAbilityOptions(new ExtraKnockbackAbility()); - if (option != null) - { - if (option.yMotion == 0.4d) - option.yMotion = 0.8d; - - ironConfig.setOption(AbilityType.EXTRA_KNOCKBACK.asString(), option); - } - } - } - - //更新默认设置 - var generator = DefaultConfigGenerator.createInstance(); - generator.setConfigurationList(config.configurations); - generator.generateSkills(); - generator.generateAbilities(); - - config.version = targetVersion; - - logger.info("Done! Reloading skill configurations..."); - this.addSchedule(this::reloadConfiguration); - return true; - } - catch (Throwable t) - { - logger.error("Error occurred while updating skill configuration: " + t.getMessage()); - t.printStackTrace(); - return false; - } - } - - @Nullable - private SkillAbilityConfiguration getConfigFor(String id, SkillAbilityConfigurationContainer config) - { - return config.configurations.stream() - .filter(s -> s != null && s.getIdentifier().equals(id)) - .findFirst().orElse(null); - } - - @Nullable - private SkillAbilityConfiguration getConfigFor(EntityType type, SkillAbilityConfigurationContainer config) - { - return getConfigFor(type.getKey().asString(), config); - } -} diff --git a/src/main/java/xiamomc/morph/MorphManager.java b/src/main/java/xyz/nifeather/morph/MorphManager.java similarity index 93% rename from src/main/java/xiamomc/morph/MorphManager.java rename to src/main/java/xyz/nifeather/morph/MorphManager.java index ed5c5a10..d5f6a863 100644 --- a/src/main/java/xiamomc/morph/MorphManager.java +++ b/src/main/java/xyz/nifeather/morph/MorphManager.java @@ -1,9 +1,7 @@ -package xiamomc.morph; +package xyz.nifeather.morph; import ca.spottedleaf.moonrise.common.util.TickThread; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import it.unimi.dsi.fastutil.objects.ObjectList; +import it.unimi.dsi.fastutil.objects.*; import net.kyori.adventure.text.Component; import org.bukkit.*; import org.bukkit.command.CommandSender; @@ -17,48 +15,48 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.WrapperAttribute; -import xiamomc.morph.backends.fallback.NilBackend; -import xiamomc.morph.backends.server.ServerBackend; -import xiamomc.morph.misc.playerList.PlayerListHandler; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.api.gameplay.*; -import xiamomc.morph.events.api.lifecycle.ManagerFinishedInitializeEvent; -import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.HintStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.messages.vanilla.VanillaMessageStore; -import xiamomc.morph.misc.*; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.abilities.AbilityManager; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.WrapperAttribute; +import xyz.nifeather.morph.backends.fallback.NilBackend; +import xyz.nifeather.morph.backends.server.ServerBackend; +import xyz.nifeather.morph.events.api.gameplay.*; +import xyz.nifeather.morph.misc.*; +import xyz.nifeather.morph.misc.playerList.PlayerListHandler; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.api.lifecycle.ManagerFinishedInitializeEvent; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.HintStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMapAddCommand; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMapSyncCommand; import xiamomc.morph.network.commands.S2C.map.S2CMapCommand; import xiamomc.morph.network.commands.S2C.map.S2CMapRemoveCommand; import xiamomc.morph.network.commands.S2C.map.S2CPartialMapCommand; import xiamomc.morph.network.commands.S2C.set.*; -import xiamomc.morph.network.multiInstance.MultiInstanceService; -import xiamomc.morph.network.multiInstance.protocol.Operation; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.providers.disguise.DisguiseProvider; -import xiamomc.morph.providers.disguise.FallbackDisguiseProvider; -import xiamomc.morph.providers.disguise.PlayerDisguiseProvider; -import xiamomc.morph.providers.disguise.VanillaDisguiseProvider; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.skills.SkillCooldownInfo; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.storage.offlinestore.OfflineDisguiseState; -import xiamomc.morph.storage.offlinestore.OfflineStateStore; -import xiamomc.morph.storage.playerdata.PlayerDataStore; -import xiamomc.morph.storage.playerdata.PlayerMeta; -import xiamomc.morph.utilities.DisguiseUtils; -import xiamomc.morph.utilities.PermissionUtils; +import xyz.nifeather.morph.network.multiInstance.MultiInstanceService; +import xyz.nifeather.morph.network.multiInstance.protocol.Operation; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.providers.disguise.DisguiseProvider; +import xyz.nifeather.morph.providers.disguise.FallbackDisguiseProvider; +import xyz.nifeather.morph.providers.disguise.PlayerDisguiseProvider; +import xyz.nifeather.morph.providers.disguise.VanillaDisguiseProvider; +import xyz.nifeather.morph.skills.MorphSkillHandler; +import xyz.nifeather.morph.skills.SkillCooldownInfo; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.storage.offlinestore.OfflineDisguiseState; +import xyz.nifeather.morph.storage.offlinestore.OfflineStateStore; +import xyz.nifeather.morph.storage.playerdata.PlayerDataStoreNew; +import xyz.nifeather.morph.storage.playerdata.PlayerMeta; +import xyz.nifeather.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.utilities.PermissionUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; @@ -71,9 +69,9 @@ public class MorphManager extends MorphPluginObject implements IManagePlayerData { - private final List activeDisguises = Collections.synchronizedList(new ObjectArrayList<>()); + private final List activeDisguises = ObjectLists.synchronize(new ObjectArrayList<>()); - private final PlayerDataStore data = new PlayerDataStore(); + private final PlayerDataStoreNew data = new PlayerDataStoreNew(); private final OfflineStateStore offlineStorage = new OfflineStateStore(); @@ -210,7 +208,7 @@ private void tryBackends() { logger.error("Unable to initialize ServerBackend as our disguise backend: " + t.getMessage()); logger.error("Using NilBackend, displaying disguises at the server side will not be supported this run."); - logger.error("Please consider reporting this issue to our GitHub: https://github.com/XiaMoZhiShi/MorphPlugin/issues"); + logger.error("Please consider reporting this issue to our GitHub: https://github.com/MATRIX-feather/FeatherMorph/issues"); t.printStackTrace(); } @@ -886,7 +884,7 @@ private DisguiseBuildResult buildDisguise(MorphParameters parameters, DisguiseMe } @Resolved - private VanillaMessageStore vanillaMessageStore; + private AbilityManager abilityManager; private void postBuildDisguise(DisguiseBuildResult result, MorphParameters parameters, @@ -1566,6 +1564,15 @@ public boolean grantMorphToPlayer(Player player, String disguiseIdentifier) multiInstanceService.notifyDisguiseMetaChange(player.getUniqueId(), Operation.ADD_IF_ABSENT, disguiseIdentifier); var config = data.getPlayerMeta(player); + var locale = MessageUtils.getLocale(player); + + var meta = data.getDisguiseMeta(disguiseIdentifier); + assert meta != null; // 这里不会出现meta是null的情况,除非抽了 + + var message = MessageUtils.prefixes(player, MorphStrings.morphUnlockedString() + .withLocale(locale) + .resolve("what", meta.asComponent(locale))); + player.sendMessage(message); if (clientHandler.clientConnected(player)) { @@ -1594,6 +1601,19 @@ public boolean revokeMorphFromPlayer(Player player, String disguiseIdentifier) { clientHandler.sendDiff(null, List.of(disguiseIdentifier), player); multiInstanceService.notifyDisguiseMetaChange(player.getUniqueId(), Operation.REMOVE, disguiseIdentifier); + + var locale = MessageUtils.getLocale(player); + var meta = data.getDisguiseMeta(disguiseIdentifier); + assert meta != null; // 和上面一样 + + var message = MorphStrings.morphLockedString() + .resolve("what", meta.asComponent(locale)) + .toComponent(locale); + player.sendMessage(message); + + var disguiseState = this.getDisguiseStateFor(player); + if (disguiseState != null && disguiseState.getDisguiseIdentifier().equalsIgnoreCase(disguiseIdentifier)) + this.unMorph(player, true); } return success; @@ -1664,6 +1684,7 @@ public boolean saveConfiguration() @ApiStatus.Internal public List listAllPlayerMeta() { + data.shouldLoadAllData(true); return data.getAll(); } } \ No newline at end of file diff --git a/src/main/java/xiamomc/morph/MorphPlugin.java b/src/main/java/xyz/nifeather/morph/MorphPlugin.java similarity index 85% rename from src/main/java/xiamomc/morph/MorphPlugin.java rename to src/main/java/xyz/nifeather/morph/MorphPlugin.java index d2f6bb65..dbac0511 100644 --- a/src/main/java/xiamomc/morph/MorphPlugin.java +++ b/src/main/java/xyz/nifeather/morph/MorphPlugin.java @@ -1,4 +1,4 @@ -package xiamomc.morph; +package xyz.nifeather.morph; import com.ticxo.modelengine.api.ModelEngineAPI; import net.kyori.adventure.text.minimessage.MiniMessage; @@ -8,30 +8,31 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.scoreboard.Scoreboard; import org.jetbrains.annotations.ApiStatus; -import xiamomc.morph.abilities.AbilityManager; -import xiamomc.morph.commands.MorphCommandManager; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.*; -import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.interfaces.IManageRequests; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphMessageStore; -import xiamomc.morph.messages.vanilla.VanillaMessageStore; -import xiamomc.morph.misc.NetworkingHelper; -import xiamomc.morph.misc.PlayerOperationSimulator; -import xiamomc.morph.misc.recipe.RecipeManager; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.gui.IconLookup; -import xiamomc.morph.misc.integrations.modelengine.ModelEngineHelper; -import xiamomc.morph.misc.integrations.placeholderapi.PlaceholderIntegration; -import xiamomc.morph.misc.integrations.residence.ResidenceEventProcessor; -import xiamomc.morph.misc.integrations.tab.TabAdapter; -import xiamomc.morph.network.multiInstance.MultiInstanceService; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.storage.skill.SkillAbilityConfigurationStore; -import xiamomc.morph.transforms.Transformer; -import xiamomc.morph.updates.UpdateHandler; +import xyz.nifeather.morph.abilities.AbilityManager; +import xyz.nifeather.morph.commands.MorphCommandManager; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.*; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.interfaces.IManageRequests; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphMessageStore; +import xyz.nifeather.morph.messages.vanilla.VanillaMessageStore; +import xyz.nifeather.morph.misc.NetworkingHelper; +import xyz.nifeather.morph.misc.PlayerOperationSimulator; +import xyz.nifeather.morph.misc.recipe.RecipeManager; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.gui.IconLookup; +import xyz.nifeather.morph.misc.integrations.modelengine.ModelEngineHelper; +import xyz.nifeather.morph.misc.integrations.placeholderapi.PlaceholderIntegration; +import xyz.nifeather.morph.misc.integrations.residence.ResidenceEventProcessor; +import xyz.nifeather.morph.misc.integrations.tab.TabAdapter; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; +import xyz.nifeather.morph.network.multiInstance.MultiInstanceService; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.skills.MorphSkillHandler; +import xyz.nifeather.morph.storage.skill.SkillsConfigurationStoreNew; +import xyz.nifeather.morph.transforms.Transformer; +import xyz.nifeather.morph.updates.UpdateHandler; import xiamomc.pluginbase.Command.CommandHelper; import xiamomc.pluginbase.Messages.MessageStore; import xiamomc.pluginbase.XiaMoJavaPlugin; @@ -218,7 +219,7 @@ public void onEnable() dependencyManager.cache(cmdHelper = new MorphCommandManager()); - dependencyManager.cache(new SkillAbilityConfigurationStore()); + dependencyManager.cache(new SkillsConfigurationStoreNew()); dependencyManager.cache(new MessageUtils()); @@ -294,6 +295,8 @@ public void onDisable() if (instanceService != null) instanceService.onDisable(); + PlayerSkinProvider.getInstance().shutdown(); + var messenger = this.getServer().getMessenger(); messenger.unregisterOutgoingPluginChannel(this); diff --git a/src/main/java/xiamomc/morph/MorphPluginObject.java b/src/main/java/xyz/nifeather/morph/MorphPluginObject.java similarity index 96% rename from src/main/java/xiamomc/morph/MorphPluginObject.java rename to src/main/java/xyz/nifeather/morph/MorphPluginObject.java index fd80dfdf..15034b35 100644 --- a/src/main/java/xiamomc/morph/MorphPluginObject.java +++ b/src/main/java/xyz/nifeather/morph/MorphPluginObject.java @@ -1,4 +1,4 @@ -package xiamomc.morph; +package xyz.nifeather.morph; import org.bukkit.Bukkit; import org.bukkit.entity.Entity; diff --git a/src/main/java/xiamomc/morph/RequestManager.java b/src/main/java/xyz/nifeather/morph/RequestManager.java similarity index 92% rename from src/main/java/xiamomc/morph/RequestManager.java rename to src/main/java/xyz/nifeather/morph/RequestManager.java index e0d5878b..01f6e2e7 100644 --- a/src/main/java/xiamomc/morph/RequestManager.java +++ b/src/main/java/xyz/nifeather/morph/RequestManager.java @@ -1,17 +1,17 @@ -package xiamomc.morph; +package xyz.nifeather.morph; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.entity.Player; -import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.interfaces.IManageRequests; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.RequestStrings; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.RequestInfo; -import xiamomc.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.interfaces.IManageRequests; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.RequestStrings; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.RequestInfo; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import xiamomc.morph.network.commands.S2C.S2CRequestCommand; -import xiamomc.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.network.server.MorphClientHandler; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; diff --git a/src/main/java/xiamomc/morph/RevealingHandler.java b/src/main/java/xyz/nifeather/morph/RevealingHandler.java similarity index 97% rename from src/main/java/xiamomc/morph/RevealingHandler.java rename to src/main/java/xyz/nifeather/morph/RevealingHandler.java index 409046f7..2ff75c91 100644 --- a/src/main/java/xiamomc/morph/RevealingHandler.java +++ b/src/main/java/xyz/nifeather/morph/RevealingHandler.java @@ -1,13 +1,13 @@ -package xiamomc.morph; +package xyz.nifeather.morph; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; import xiamomc.morph.network.commands.S2C.set.S2CSetRevealingCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.utilities.MathUtils; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.utilities.MathUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; diff --git a/src/main/java/xiamomc/morph/abilities/AbilityManager.java b/src/main/java/xyz/nifeather/morph/abilities/AbilityManager.java similarity index 57% rename from src/main/java/xiamomc/morph/abilities/AbilityManager.java rename to src/main/java/xyz/nifeather/morph/abilities/AbilityManager.java index cc83a2c0..4c677698 100644 --- a/src/main/java/xiamomc/morph/abilities/AbilityManager.java +++ b/src/main/java/xyz/nifeather/morph/abilities/AbilityManager.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities; +package xyz.nifeather.morph.abilities; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -7,20 +7,21 @@ import org.bukkit.NamespacedKey; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.abilities.impl.*; -import xiamomc.morph.abilities.impl.onAttack.ExtraKnockbackAbility; -import xiamomc.morph.abilities.impl.onAttack.PotionOnAttackAbility; -import xiamomc.morph.abilities.impl.potion.*; -import xiamomc.morph.events.api.lifecycle.AbilitiesFinishedInitializeEvent; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfigurationStore; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.abilities.impl.*; +import xyz.nifeather.morph.abilities.impl.potion.*; +import xyz.nifeather.morph.abilities.impl.onAttack.ExtraKnockbackAbility; +import xyz.nifeather.morph.abilities.impl.onAttack.PotionOnAttackAbility; +import xyz.nifeather.morph.events.api.lifecycle.AbilitiesFinishedInitializeEvent; +import xyz.nifeather.morph.storage.skill.ISkillOption; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.storage.skill.SkillsConfigurationStoreNew; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; public class AbilityManager extends MorphPluginObject @@ -28,9 +29,7 @@ public class AbilityManager extends MorphPluginObject private final List> registedAbilities = new ObjectArrayList<>(); @Resolved - private SkillAbilityConfigurationStore store; - - private boolean initalizeDone; + private SkillsConfigurationStoreNew store; /** * 注册一个被动技能 @@ -50,32 +49,6 @@ public boolean registerAbility(IMorphAbility ability) registedAbilities.add(ability); - //SkillConfigurationStore只会在重载时给已经注册的被动添加设置 - //所有在重载/初始化完成后加入的技能都需要我们手动查询 - if (initalizeDone) - { - //添加设置 - store.getConfiguredSkills().forEach((configuration, skill) -> - { - if (!ability.setOptionGeneric(configuration.getIdentifier(), configuration.getAbilityOptions(ability))) - { - logger.warn("Unable to initialize skill configuration for " + configuration.getIdentifier() + " -> " + ability.getIdentifier()); - } - }); - - //添加到map中所有符合条件的技能配置里 - var id = ability.getIdentifier().asString(); - var matchingConfigs = configToAbilitiesMap.entrySet() - .stream().filter(e -> e.getKey().getAbilitiyIdentifiers().contains(id)).toList(); - - matchingConfigs.forEach(c -> - { - var list = configToAbilitiesMap.get(c.getKey()); - - if (!list.contains(ability)) list.add(ability); - }); - } - Bukkit.getPluginManager().registerEvents(ability, plugin); return true; } @@ -140,52 +113,84 @@ private void load() new SpiderAbility() )); - initalizeDone = true; - Bukkit.getPluginManager().callEvent(new AbilitiesFinishedInitializeEvent(this)); } + @NotNull + public Map getOptionsFor(String disguiseIdentifier) + { + var configuration = store.get(disguiseIdentifier); + if (configuration == null) return new Object2ObjectOpenHashMap<>(); + + Map optionMap = new ConcurrentHashMap<>(); + configuration.getAbilitiyIdentifiers().forEach(a -> + { + var idKey = NamespacedKey.fromString(a); + + if (idKey == null) + { + logger.warn("Invalid ability ID: %s".formatted(a)); + return; + } + + var abilityInstance = this.getAbility(idKey); + if (abilityInstance == null) return; + + optionMap.put(idKey, configuration.getAbilityOptions(abilityInstance)); + }); + + return optionMap; + } + @Nullable - public IMorphAbility getAbility(@Nullable NamespacedKey key) + public IMorphAbility getAbility(@Nullable NamespacedKey abilityIdentifier) { - if (key == null) return null; + if (abilityIdentifier == null) return null; var val = registedAbilities.stream() - .filter(a -> a.getIdentifier().equals(key)).findFirst().orElse(null); + .filter(a -> a.getIdentifier().equals(abilityIdentifier)).findFirst().orElse(null); if (val == null) - logger.warn("Unknown ability: " + key.asString()); + logger.warn("Unknown ability: " + abilityIdentifier.asString()); return val; } - private final Map>> configToAbilitiesMap = new Object2ObjectOpenHashMap<>(); - /** * 为某个伪装ID获取被动技能 * - * @param id 伪装ID + * @param disguiseIdentifier 伪装ID * @return 被动技能列表 */ @NotNull - public List> getAbilitiesFor(String id) + public List> getAbilitiesFor(String disguiseIdentifier) { - return this.getAbilitiesFor(id, false); + return this.getAbilitiesFor(disguiseIdentifier, false); } + /** + * @param disguiseIdentifier 目标伪装 + * @param noFallback 是否要搜索命名空间的默认配置 + */ @NotNull - public List> getAbilitiesFor(String id, boolean noFallback) + public List> getAbilitiesFor(String disguiseIdentifier, boolean noFallback) { - var entry = configToAbilitiesMap.entrySet().stream() - .filter(s -> s.getKey().getIdentifier().equals(id)).findFirst().orElse(null); + var configuration = store.get(disguiseIdentifier); - if (entry != null) + if (configuration != null) { - return entry.getValue(); + List> abilities = new ObjectArrayList<>(); + configuration.getAbilitiyIdentifiers().forEach(id -> + { + var instance = this.getAbility(NamespacedKey.fromString(id)); + if (instance != null) abilities.add(instance); + }); + + return abilities; } else if (!noFallback) { - var idSpilt = id.split(":", 2); + var idSpilt = disguiseIdentifier.split(":", 2); if (idSpilt.length < 1) return List.of(); var idNew = idSpilt[0] + ":" + MorphManager.disguiseFallbackName; @@ -195,15 +200,4 @@ else if (!noFallback) return List.of(); } - - public void setAbilities(SkillAbilityConfiguration configuration, List> abilities) - { - configToAbilitiesMap.put(configuration, abilities); - } - - public void clearAbilities() - { - configToAbilitiesMap.clear(); - registedAbilities.forEach(IMorphAbility::clearOptions); - } } diff --git a/src/main/java/xiamomc/morph/abilities/AbilityType.java b/src/main/java/xyz/nifeather/morph/abilities/AbilityType.java similarity index 98% rename from src/main/java/xiamomc/morph/abilities/AbilityType.java rename to src/main/java/xyz/nifeather/morph/abilities/AbilityType.java index b6c8b21b..cd82c09d 100644 --- a/src/main/java/xiamomc/morph/abilities/AbilityType.java +++ b/src/main/java/xyz/nifeather/morph/abilities/AbilityType.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities; +package xyz.nifeather.morph.abilities; import org.bukkit.NamespacedKey; diff --git a/src/main/java/xiamomc/morph/abilities/AbilityUpdater.java b/src/main/java/xyz/nifeather/morph/abilities/AbilityUpdater.java similarity index 85% rename from src/main/java/xiamomc/morph/abilities/AbilityUpdater.java rename to src/main/java/xyz/nifeather/morph/abilities/AbilityUpdater.java index 1b3abb2a..b03c34c6 100644 --- a/src/main/java/xiamomc/morph/abilities/AbilityUpdater.java +++ b/src/main/java/xyz/nifeather/morph/abilities/AbilityUpdater.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities; +package xyz.nifeather.morph.abilities; import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -8,20 +8,23 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Unmodifiable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.utilities.PermissionUtils; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.storage.skill.IAbilityConfigLookup; +import xyz.nifeather.morph.utilities.PermissionUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; import java.util.Arrays; import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; -public class AbilityUpdater extends MorphPluginObject +public class AbilityUpdater extends MorphPluginObject implements IAbilityConfigLookup { @NotNull private final DisguiseState parentState; @@ -255,4 +258,27 @@ public static boolean hasPermissionFor(IMorphAbility ability, DisguiseState s var singleAbilityPerm = CommonPermissions.abilityPermissionOf(ability.getIdentifier().asString(), state.getDisguiseIdentifier()); return PermissionUtils.hasPermission(state.getPlayer(), singleAbilityPerm, true); } + + //region IAbilityConfigLookup + + private final Map abilityConfigMap = new ConcurrentHashMap<>(); + + @Override + @Nullable + public X lookupAbilityConfig(String identifier, Class expectedClass) + { + var val = abilityConfigMap.getOrDefault(identifier, null); + if (val == null) return null; + + if (expectedClass.isInstance(val)) return (X) val; + else return null; + } + + @Override + public void setAbilityConfig(String identifier, Object config) + { + abilityConfigMap.put(identifier, config); + } + + //endregion IAbilityConfigLookup } diff --git a/src/main/java/xiamomc/morph/abilities/EffectMorphAbility.java b/src/main/java/xyz/nifeather/morph/abilities/EffectMorphAbility.java similarity index 89% rename from src/main/java/xiamomc/morph/abilities/EffectMorphAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/EffectMorphAbility.java index dbe7f1aa..141665ff 100644 --- a/src/main/java/xiamomc/morph/abilities/EffectMorphAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/EffectMorphAbility.java @@ -1,9 +1,9 @@ -package xiamomc.morph.abilities; +package xyz.nifeather.morph.abilities; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; -import xiamomc.morph.abilities.impl.NoOpOptionAbility; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.abilities.impl.NoOpOptionAbility; +import xyz.nifeather.morph.misc.DisguiseState; import xiamomc.pluginbase.Annotations.Initializer; public abstract class EffectMorphAbility extends NoOpOptionAbility diff --git a/src/main/java/xiamomc/morph/abilities/IMorphAbility.java b/src/main/java/xyz/nifeather/morph/abilities/IMorphAbility.java similarity index 75% rename from src/main/java/xiamomc/morph/abilities/IMorphAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/IMorphAbility.java index 3d2f2460..4e9817a7 100644 --- a/src/main/java/xiamomc/morph/abilities/IMorphAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/IMorphAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities; +package xyz.nifeather.morph.abilities; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; @@ -6,9 +6,8 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.slf4j.LoggerFactory; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.storage.skill.ISkillOption; import java.util.List; import java.util.UUID; @@ -81,36 +80,27 @@ public default boolean handle(Player player, DisguiseState state) * * @return 操作是否成功 */ - public boolean setOption(@NotNull String disguiseIdentifier, @Nullable T option); + public default boolean setOption(@NotNull String disguiseIdentifier, @Nullable T option) + { + return false; + } /** * @apiNote 内部轮子 * @return option是否可以cast为目标option,为null则返回true并略过,反之返回setOption的结果 */ + @Deprecated(forRemoval = true) @ApiStatus.Internal public default boolean setOptionGeneric(String disguiseIdentifier, ISkillOption option) { - T castedOption; - - if (option == null) - return true; - - try - { - castedOption = (T) option; - } - catch (ClassCastException e) - { - LoggerFactory.getLogger("morph").error("添加设置时出现问题: " + e.getMessage()); - e.printStackTrace(); - return false; - } - - return setOption(disguiseIdentifier, castedOption); + return false; } /** * 清除此被动的所有设置 */ - public void clearOptions(); + @Deprecated(forRemoval = true) + public default void clearOptions() + { + } } diff --git a/src/main/java/xiamomc/morph/abilities/MorphAbility.java b/src/main/java/xyz/nifeather/morph/abilities/MorphAbility.java similarity index 79% rename from src/main/java/xiamomc/morph/abilities/MorphAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/MorphAbility.java index aaaff20b..76ae913d 100644 --- a/src/main/java/xiamomc/morph/abilities/MorphAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/MorphAbility.java @@ -1,14 +1,13 @@ -package xiamomc.morph.abilities; +package xyz.nifeather.morph.abilities; -import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Unmodifiable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.storage.skill.ISkillOption; import java.util.List; import java.util.Map; @@ -104,11 +103,7 @@ public T getDefaultOption() @Nullable protected T getOptionFor(DisguiseState state) { - return getOr( - () -> optionMap.get(state.getDisguiseIdentifier()), - Objects::nonNull, - () -> optionMap.get(state.skillLookupIdentifier()) - ); + return state.getAbilityUpdater().lookupAbilityConfig(this.getIdentifier().asString(), (Class)getDefaultOption().getClass()); } public interface Returner @@ -133,23 +128,4 @@ protected R getOr(Returner value, Predicate p, Returner fallbackVal else return fallbackValue.apply(); } - - protected final Map optionMap = new Object2ObjectOpenHashMap<>(); - - @Override - public boolean setOption(@NotNull String disguiseIdentifier, @Nullable T option) - { - if (option == null) - return false; - - optionMap.put(disguiseIdentifier, option); - - return true; - } - - @Override - public void clearOptions() - { - optionMap.clear(); - } } diff --git a/src/main/java/xiamomc/morph/abilities/impl/AttributeModifyingAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/AttributeModifyingAbility.java similarity index 93% rename from src/main/java/xiamomc/morph/abilities/impl/AttributeModifyingAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/AttributeModifyingAbility.java index 2e758d8b..423ffb66 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/AttributeModifyingAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/AttributeModifyingAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.attribute.Attribute; @@ -8,10 +8,10 @@ import org.bukkit.inventory.EquipmentSlotGroup; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.AttributeModifyOption; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.AttributeModifyOption; +import xyz.nifeather.morph.misc.DisguiseState; import java.util.Arrays; import java.util.Objects; diff --git a/src/main/java/xiamomc/morph/abilities/impl/BossbarAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/BossbarAbility.java similarity index 90% rename from src/main/java/xiamomc/morph/abilities/impl/BossbarAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/BossbarAbility.java index d35d4ec0..0a6a3d75 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/BossbarAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/BossbarAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.bossbar.BossBar; @@ -11,13 +11,13 @@ import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.BossbarOption; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.BossbarOption; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.utilities.DisguiseUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; diff --git a/src/main/java/xiamomc/morph/abilities/impl/BurnsUnderSunAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/BurnsUnderSunAbility.java similarity index 86% rename from src/main/java/xiamomc/morph/abilities/impl/BurnsUnderSunAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/BurnsUnderSunAbility.java index bed2a496..d4bae01f 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/BurnsUnderSunAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/BurnsUnderSunAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.World; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.misc.DisguiseState; public class BurnsUnderSunAbility extends NoOpOptionAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/ChatOverrideAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/ChatOverrideAbility.java similarity index 82% rename from src/main/java/xiamomc/morph/abilities/impl/ChatOverrideAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/ChatOverrideAbility.java index 18b1905b..8f22cd8f 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/ChatOverrideAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/ChatOverrideAbility.java @@ -1,19 +1,19 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import io.papermc.paper.event.player.AsyncChatEvent; import org.bukkit.NamespacedKey; import org.bukkit.event.EventHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.ChatOverrideOption; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.MorphChatRenderer; -import xiamomc.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.ChatOverrideOption; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.MorphChatRenderer; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; diff --git a/src/main/java/xiamomc/morph/abilities/impl/DamageReducingAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/DamageReducingAbility.java similarity index 85% rename from src/main/java/xiamomc/morph/abilities/impl/DamageReducingAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/DamageReducingAbility.java index e48c32ca..1e480ea4 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/DamageReducingAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/DamageReducingAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.ReduceDamageOption; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.ReduceDamageOption; import xiamomc.pluginbase.Annotations.Resolved; public abstract class DamageReducingAbility extends MorphAbility diff --git a/src/main/java/xiamomc/morph/abilities/impl/DryOutInAirAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/DryOutInAirAbility.java similarity index 78% rename from src/main/java/xiamomc/morph/abilities/impl/DryOutInAirAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/DryOutInAirAbility.java index 02c41e34..9b08ca7e 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/DryOutInAirAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/DryOutInAirAbility.java @@ -1,16 +1,16 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.DryoutAbilityOption; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.utilities.DamageSourceUtils; -import xiamomc.morph.utilities.MathUtils; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.DryoutAbilityOption; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.utilities.DamageSourceUtils; +import xyz.nifeather.morph.utilities.MathUtils; public class DryOutInAirAbility extends MorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/FlyAbility.java similarity index 91% rename from src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/FlyAbility.java index 3724f9fb..178ed73e 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/FlyAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.world.level.GameType; @@ -11,16 +11,16 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerGameModeChangeEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.FlyOption; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.utilities.MathUtils; -import xiamomc.morph.utilities.PermissionUtils; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.FlyOption; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.utilities.MathUtils; +import xyz.nifeather.morph.utilities.PermissionUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; @@ -92,7 +92,7 @@ public boolean handle(Player player, DisguiseState state) if (gameMode == GameType.CREATIVE || gameMode == GameType.SPECTATOR) return super.handle(player, state); - var option = optionMap.get(state.skillLookupIdentifier()); + var option = this.getOptionFor(state); var worldName = player.getWorld().getName(); var allowFlightConditions = player.getFoodLevel() > option.getMinimumHunger() @@ -184,11 +184,11 @@ public boolean revokeFromPlayer(Player player, DisguiseState state) return new FlyOption(); } - public float getTargetFlySpeed(String identifier) + public float getTargetFlySpeed(DisguiseState state) { - if (identifier == null) return Float.NaN; + if (state == null) return Float.NaN; - var value = optionMap.getOrDefault(identifier, null); + var value = this.getOptionFor(state); if (value != null) return value.getFlyingSpeed(); @@ -204,7 +204,7 @@ public boolean updateFlyingState(DisguiseState state) if (player.getGameMode() != GameMode.SPECTATOR) { - float speed = getTargetFlySpeed(state.skillLookupIdentifier()); + float speed = getTargetFlySpeed(state); speed = Float.isNaN(speed) ? 0.1f : MathUtils.clamp(-1f, 1f, speed); diff --git a/src/main/java/xiamomc/morph/abilities/impl/HealsFromEntityAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/HealsFromEntityAbility.java similarity index 93% rename from src/main/java/xiamomc/morph/abilities/impl/HealsFromEntityAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/HealsFromEntityAbility.java index ea8d384c..7f70a6a8 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/HealsFromEntityAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/HealsFromEntityAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.nbt.CompoundTag; @@ -12,16 +12,16 @@ import org.bukkit.entity.Projectile; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.HealsFromEntityOption; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.HealsFromEntityOption; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.NmsRecord; import xiamomc.morph.network.commands.S2C.set.S2CSetSNbtCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.utilities.DamageSourceUtils; -import xiamomc.morph.utilities.EntityTypeUtils; -import xiamomc.morph.utilities.NbtUtils; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.utilities.DamageSourceUtils; +import xyz.nifeather.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.utilities.NbtUtils; import xiamomc.pluginbase.Annotations.Resolved; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/abilities/impl/NoFallDamageAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/NoFallDamageAbility.java similarity index 88% rename from src/main/java/xiamomc/morph/abilities/impl/NoFallDamageAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/NoFallDamageAbility.java index 4dc1dc5a..515c934c 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/NoFallDamageAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/NoFallDamageAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.AbilityType; public class NoFallDamageAbility extends NoOpOptionAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/NoOpOptionAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/NoOpOptionAbility.java similarity index 61% rename from src/main/java/xiamomc/morph/abilities/impl/NoOpOptionAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/NoOpOptionAbility.java index 934b9ded..87f76aab 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/NoOpOptionAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/NoOpOptionAbility.java @@ -1,8 +1,8 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.skills.options.NoOpConfiguration; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.skills.options.NoOpConfiguration; public abstract class NoOpOptionAbility extends MorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/NoSweetBushDamageAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/NoSweetBushDamageAbility.java similarity index 90% rename from src/main/java/xiamomc/morph/abilities/impl/NoSweetBushDamageAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/NoSweetBushDamageAbility.java index 065183d6..d71af7e4 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/NoSweetBushDamageAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/NoSweetBushDamageAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.AbilityType; public class NoSweetBushDamageAbility extends NoOpOptionAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/OnAttackAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/OnAttackAbility.java similarity index 82% rename from src/main/java/xiamomc/morph/abilities/impl/OnAttackAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/OnAttackAbility.java index 8777701e..10caae26 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/OnAttackAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/OnAttackAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.storage.skill.ISkillOption; public abstract class OnAttackAbility extends MorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/ReduceFallDamageAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/ReduceFallDamageAbility.java similarity index 79% rename from src/main/java/xiamomc/morph/abilities/impl/ReduceFallDamageAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/ReduceFallDamageAbility.java index 9024b79b..c7d277c1 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/ReduceFallDamageAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/ReduceFallDamageAbility.java @@ -1,10 +1,10 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.event.entity.EntityDamageEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.options.ReduceDamageOption; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.options.ReduceDamageOption; public class ReduceFallDamageAbility extends DamageReducingAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/ReduceMagicDamageAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/ReduceMagicDamageAbility.java similarity index 79% rename from src/main/java/xiamomc/morph/abilities/impl/ReduceMagicDamageAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/ReduceMagicDamageAbility.java index 1e4ae300..5e14172f 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/ReduceMagicDamageAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/ReduceMagicDamageAbility.java @@ -1,10 +1,10 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.event.entity.EntityDamageEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.options.ReduceDamageOption; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.options.ReduceDamageOption; public class ReduceMagicDamageAbility extends DamageReducingAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/SmallJumpBoostAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/SmallJumpBoostAbility.java similarity index 79% rename from src/main/java/xiamomc/morph/abilities/impl/SmallJumpBoostAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/SmallJumpBoostAbility.java index 88fbebf3..d42042f0 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/SmallJumpBoostAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/SmallJumpBoostAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; public class SmallJumpBoostAbility extends EffectMorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/SnowyAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/SnowyAbility.java similarity index 89% rename from src/main/java/xiamomc/morph/abilities/impl/SnowyAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/SnowyAbility.java index 08d6b5af..9730eb1c 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/SnowyAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/SnowyAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -6,8 +6,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.misc.DisguiseState; public class SnowyAbility extends NoOpOptionAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/SpiderAbility.java similarity index 82% rename from src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/SpiderAbility.java index 0655019f..215a850a 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/SpiderAbility.java @@ -1,15 +1,15 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.utilities.CollisionUtils; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.utilities.CollisionUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; diff --git a/src/main/java/xiamomc/morph/abilities/impl/TakesDamageFromWaterAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/TakesDamageFromWaterAbility.java similarity index 74% rename from src/main/java/xiamomc/morph/abilities/impl/TakesDamageFromWaterAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/TakesDamageFromWaterAbility.java index 8ff5bcda..9191c6f7 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/TakesDamageFromWaterAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/TakesDamageFromWaterAbility.java @@ -1,12 +1,12 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.MorphAbility; -import xiamomc.morph.abilities.options.TakesDamageFromWaterOption; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.MorphAbility; +import xyz.nifeather.morph.abilities.options.TakesDamageFromWaterOption; +import xyz.nifeather.morph.misc.DisguiseState; public class TakesDamageFromWaterAbility extends MorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/WardenAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/WardenAbility.java similarity index 96% rename from src/main/java/xiamomc/morph/abilities/impl/WardenAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/WardenAbility.java index 21ee6664..53a64efb 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/WardenAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/WardenAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.GameEvent; @@ -7,7 +7,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.world.GenericGameEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.AbilityType; import java.util.List; diff --git a/src/main/java/xiamomc/morph/abilities/impl/WardenLessAwareAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/WardenLessAwareAbility.java similarity index 92% rename from src/main/java/xiamomc/morph/abilities/impl/WardenLessAwareAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/WardenLessAwareAbility.java index 7b7cd5d4..4cbf409a 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/WardenLessAwareAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/WardenLessAwareAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl; +package xyz.nifeather.morph.abilities.impl; import io.papermc.paper.event.entity.WardenAngerChangeEvent; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.AbilityType; public class WardenLessAwareAbility extends NoOpOptionAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java similarity index 90% rename from src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java index 9a695ed4..2d432dae 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl.onAttack; +package xyz.nifeather.morph.abilities.impl.onAttack; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.attributes.Attributes; @@ -6,10 +6,10 @@ import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.impl.OnAttackAbility; -import xiamomc.morph.abilities.options.ExtraKnockbackOption; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.impl.OnAttackAbility; +import xyz.nifeather.morph.abilities.options.ExtraKnockbackOption; import xiamomc.pluginbase.Annotations.Resolved; public class ExtraKnockbackAbility extends OnAttackAbility diff --git a/src/main/java/xiamomc/morph/abilities/impl/onAttack/PotionOnAttackAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/onAttack/PotionOnAttackAbility.java similarity index 83% rename from src/main/java/xiamomc/morph/abilities/impl/onAttack/PotionOnAttackAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/onAttack/PotionOnAttackAbility.java index 18b5c338..3fd8b25a 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/onAttack/PotionOnAttackAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/onAttack/PotionOnAttackAbility.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.impl.onAttack; +package xyz.nifeather.morph.abilities.impl.onAttack; import org.bukkit.NamespacedKey; import org.bukkit.entity.LivingEntity; @@ -6,10 +6,10 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.impl.OnAttackAbility; -import xiamomc.morph.abilities.options.PotionEffectOption; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.impl.OnAttackAbility; +import xyz.nifeather.morph.abilities.options.PotionEffectOption; import xiamomc.pluginbase.Annotations.Resolved; public class PotionOnAttackAbility extends OnAttackAbility diff --git a/src/main/java/xiamomc/morph/abilities/impl/potion/BreatheUnderWaterAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/BreatheUnderWaterAbility.java similarity index 78% rename from src/main/java/xiamomc/morph/abilities/impl/potion/BreatheUnderWaterAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/potion/BreatheUnderWaterAbility.java index 4674db3b..75d1fa6b 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/potion/BreatheUnderWaterAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/BreatheUnderWaterAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl.potion; +package xyz.nifeather.morph.abilities.impl.potion; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; public class BreatheUnderWaterAbility extends EffectMorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/potion/FeatherFallingAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/FeatherFallingAbility.java similarity index 78% rename from src/main/java/xiamomc/morph/abilities/impl/potion/FeatherFallingAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/potion/FeatherFallingAbility.java index 2f7e0b12..0c174cce 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/potion/FeatherFallingAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/FeatherFallingAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl.potion; +package xyz.nifeather.morph.abilities.impl.potion; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; public class FeatherFallingAbility extends EffectMorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/potion/FireResistanceAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/FireResistanceAbility.java similarity index 78% rename from src/main/java/xiamomc/morph/abilities/impl/potion/FireResistanceAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/potion/FireResistanceAbility.java index d30cbc17..54abe687 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/potion/FireResistanceAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/FireResistanceAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl.potion; +package xyz.nifeather.morph.abilities.impl.potion; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; public class FireResistanceAbility extends EffectMorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/potion/JumpBoostAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/JumpBoostAbility.java similarity index 77% rename from src/main/java/xiamomc/morph/abilities/impl/potion/JumpBoostAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/potion/JumpBoostAbility.java index a70458dd..d529d801 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/potion/JumpBoostAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/JumpBoostAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl.potion; +package xyz.nifeather.morph.abilities.impl.potion; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; public class JumpBoostAbility extends EffectMorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/potion/NightVisionAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/NightVisionAbility.java similarity index 80% rename from src/main/java/xiamomc/morph/abilities/impl/potion/NightVisionAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/potion/NightVisionAbility.java index 91ab8da9..54ff217c 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/potion/NightVisionAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/NightVisionAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl.potion; +package xyz.nifeather.morph.abilities.impl.potion; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; public class NightVisionAbility extends EffectMorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/potion/SpeedBoostAbility.java b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/SpeedBoostAbility.java similarity index 77% rename from src/main/java/xiamomc/morph/abilities/impl/potion/SpeedBoostAbility.java rename to src/main/java/xyz/nifeather/morph/abilities/impl/potion/SpeedBoostAbility.java index 4bba7fc2..a61da821 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/potion/SpeedBoostAbility.java +++ b/src/main/java/xyz/nifeather/morph/abilities/impl/potion/SpeedBoostAbility.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.impl.potion; +package xyz.nifeather.morph.abilities.impl.potion; import org.bukkit.NamespacedKey; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.EffectMorphAbility; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.EffectMorphAbility; @Deprecated public class SpeedBoostAbility extends EffectMorphAbility diff --git a/src/main/java/xiamomc/morph/abilities/options/AttributeModifyOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/AttributeModifyOption.java similarity index 97% rename from src/main/java/xiamomc/morph/abilities/options/AttributeModifyOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/AttributeModifyOption.java index 528db34e..3b590c5c 100644 --- a/src/main/java/xiamomc/morph/abilities/options/AttributeModifyOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/AttributeModifyOption.java @@ -1,4 +1,4 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -7,7 +7,7 @@ import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeModifier; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/abilities/options/BossbarOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/BossbarOption.java similarity index 96% rename from src/main/java/xiamomc/morph/abilities/options/BossbarOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/BossbarOption.java index df490a86..dbd0fb19 100644 --- a/src/main/java/xiamomc/morph/abilities/options/BossbarOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/BossbarOption.java @@ -1,11 +1,11 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectArraySet; import net.kyori.adventure.bossbar.BossBar; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/abilities/options/ChatOverrideOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/ChatOverrideOption.java similarity index 86% rename from src/main/java/xiamomc/morph/abilities/options/ChatOverrideOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/ChatOverrideOption.java index 482b652d..514d1778 100644 --- a/src/main/java/xiamomc/morph/abilities/options/ChatOverrideOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/ChatOverrideOption.java @@ -1,9 +1,9 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class ChatOverrideOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/DryoutAbilityOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/DryoutAbilityOption.java similarity index 85% rename from src/main/java/xiamomc/morph/abilities/options/DryoutAbilityOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/DryoutAbilityOption.java index d68b5684..7bba0390 100644 --- a/src/main/java/xiamomc/morph/abilities/options/DryoutAbilityOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/DryoutAbilityOption.java @@ -1,8 +1,8 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class DryoutAbilityOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/ExtraKnockbackOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/ExtraKnockbackOption.java similarity index 91% rename from src/main/java/xiamomc/morph/abilities/options/ExtraKnockbackOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/ExtraKnockbackOption.java index ac12adca..fbd65656 100644 --- a/src/main/java/xiamomc/morph/abilities/options/ExtraKnockbackOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/ExtraKnockbackOption.java @@ -1,9 +1,9 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import net.minecraft.world.phys.Vec3; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class ExtraKnockbackOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/FlyOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/FlyOption.java similarity index 91% rename from src/main/java/xiamomc/morph/abilities/options/FlyOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/FlyOption.java index b3f4127f..27de80b7 100644 --- a/src/main/java/xiamomc/morph/abilities/options/FlyOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/FlyOption.java @@ -1,8 +1,8 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class FlyOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/HealsFromEntityOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/HealsFromEntityOption.java similarity index 93% rename from src/main/java/xiamomc/morph/abilities/options/HealsFromEntityOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/HealsFromEntityOption.java index 6d8132e4..d259d041 100644 --- a/src/main/java/xiamomc/morph/abilities/options/HealsFromEntityOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/HealsFromEntityOption.java @@ -1,10 +1,10 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.bukkit.entity.EntityType; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class HealsFromEntityOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/PotionEffectOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/PotionEffectOption.java similarity index 89% rename from src/main/java/xiamomc/morph/abilities/options/PotionEffectOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/PotionEffectOption.java index 7bac2262..1ef1275b 100644 --- a/src/main/java/xiamomc/morph/abilities/options/PotionEffectOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/PotionEffectOption.java @@ -1,9 +1,9 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.bukkit.potion.PotionEffectType; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class PotionEffectOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/ReduceDamageOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/ReduceDamageOption.java similarity index 90% rename from src/main/java/xiamomc/morph/abilities/options/ReduceDamageOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/ReduceDamageOption.java index bdafd190..7bc61567 100644 --- a/src/main/java/xiamomc/morph/abilities/options/ReduceDamageOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/ReduceDamageOption.java @@ -1,8 +1,8 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class ReduceDamageOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/abilities/options/TakesDamageFromWaterOption.java b/src/main/java/xyz/nifeather/morph/abilities/options/TakesDamageFromWaterOption.java similarity index 79% rename from src/main/java/xiamomc/morph/abilities/options/TakesDamageFromWaterOption.java rename to src/main/java/xyz/nifeather/morph/abilities/options/TakesDamageFromWaterOption.java index 1a550783..a9687445 100644 --- a/src/main/java/xiamomc/morph/abilities/options/TakesDamageFromWaterOption.java +++ b/src/main/java/xyz/nifeather/morph/abilities/options/TakesDamageFromWaterOption.java @@ -1,8 +1,8 @@ -package xiamomc.morph.abilities.options; +package xyz.nifeather.morph.abilities.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class TakesDamageFromWaterOption implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/backends/DisguiseBackend.java b/src/main/java/xyz/nifeather/morph/backends/DisguiseBackend.java similarity index 98% rename from src/main/java/xiamomc/morph/backends/DisguiseBackend.java rename to src/main/java/xyz/nifeather/morph/backends/DisguiseBackend.java index 548e4171..c9e50da0 100644 --- a/src/main/java/xiamomc/morph/backends/DisguiseBackend.java +++ b/src/main/java/xyz/nifeather/morph/backends/DisguiseBackend.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends; +package xyz.nifeather.morph.backends; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -6,8 +6,8 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; import java.util.Collection; diff --git a/src/main/java/xiamomc/morph/backends/DisguiseWrapper.java b/src/main/java/xyz/nifeather/morph/backends/DisguiseWrapper.java similarity index 97% rename from src/main/java/xiamomc/morph/backends/DisguiseWrapper.java rename to src/main/java/xyz/nifeather/morph/backends/DisguiseWrapper.java index c2b60f1b..d7c1f94f 100644 --- a/src/main/java/xiamomc/morph/backends/DisguiseWrapper.java +++ b/src/main/java/xyz/nifeather/morph/backends/DisguiseWrapper.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends; +package xyz.nifeather.morph.backends; import com.mojang.authlib.GameProfile; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; @@ -16,11 +16,11 @@ import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.misc.CollisionBoxRecord; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.misc.CollisionBoxRecord; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.utilities.EntityTypeUtils; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/xiamomc/morph/backends/EventWrapper.java b/src/main/java/xyz/nifeather/morph/backends/EventWrapper.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/EventWrapper.java rename to src/main/java/xyz/nifeather/morph/backends/EventWrapper.java index 47cbd036..be6c3d2d 100644 --- a/src/main/java/xiamomc/morph/backends/EventWrapper.java +++ b/src/main/java/xyz/nifeather/morph/backends/EventWrapper.java @@ -1,13 +1,11 @@ -package xiamomc.morph.backends; +package xyz.nifeather.morph.backends; -import com.mojang.authlib.GameProfile; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.function.Consumer; public abstract class EventWrapper extends DisguiseWrapper diff --git a/src/main/java/xiamomc/morph/backends/WrapperAttribute.java b/src/main/java/xyz/nifeather/morph/backends/WrapperAttribute.java similarity index 97% rename from src/main/java/xiamomc/morph/backends/WrapperAttribute.java rename to src/main/java/xyz/nifeather/morph/backends/WrapperAttribute.java index d25603ef..2ac75b59 100644 --- a/src/main/java/xiamomc/morph/backends/WrapperAttribute.java +++ b/src/main/java/xyz/nifeather/morph/backends/WrapperAttribute.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends; +package xyz.nifeather.morph.backends; import com.mojang.authlib.GameProfile; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/xiamomc/morph/backends/WrapperEvent.java b/src/main/java/xyz/nifeather/morph/backends/WrapperEvent.java similarity index 80% rename from src/main/java/xiamomc/morph/backends/WrapperEvent.java rename to src/main/java/xyz/nifeather/morph/backends/WrapperEvent.java index cad3d19f..3ea5f7f2 100644 --- a/src/main/java/xiamomc/morph/backends/WrapperEvent.java +++ b/src/main/java/xyz/nifeather/morph/backends/WrapperEvent.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends; +package xyz.nifeather.morph.backends; import com.mojang.authlib.GameProfile; diff --git a/src/main/java/xiamomc/morph/backends/fallback/NilBackend.java b/src/main/java/xyz/nifeather/morph/backends/fallback/NilBackend.java similarity index 93% rename from src/main/java/xiamomc/morph/backends/fallback/NilBackend.java rename to src/main/java/xyz/nifeather/morph/backends/fallback/NilBackend.java index b797e8b9..bbfd7238 100644 --- a/src/main/java/xiamomc/morph/backends/fallback/NilBackend.java +++ b/src/main/java/xyz/nifeather/morph/backends/fallback/NilBackend.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.fallback; +package xyz.nifeather.morph.backends.fallback; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -8,16 +8,16 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.WrapperAttribute; -import xiamomc.morph.messages.BackendStrings; -import xiamomc.morph.misc.NetworkingHelper; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMapAddCommand; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMapRemoveCommand; -import xiamomc.morph.network.server.MorphClientHandler; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.WrapperAttribute; +import xyz.nifeather.morph.messages.BackendStrings; +import xyz.nifeather.morph.misc.NetworkingHelper; +import xyz.nifeather.morph.network.server.MorphClientHandler; import java.util.Collection; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/backends/fallback/NilDisguise.java b/src/main/java/xyz/nifeather/morph/backends/fallback/NilDisguise.java similarity index 96% rename from src/main/java/xiamomc/morph/backends/fallback/NilDisguise.java rename to src/main/java/xyz/nifeather/morph/backends/fallback/NilDisguise.java index e2078d14..231a0acd 100644 --- a/src/main/java/xiamomc/morph/backends/fallback/NilDisguise.java +++ b/src/main/java/xyz/nifeather/morph/backends/fallback/NilDisguise.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.fallback; +package xyz.nifeather.morph.backends.fallback; import com.mojang.authlib.GameProfile; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; diff --git a/src/main/java/xiamomc/morph/backends/fallback/NilWrapper.java b/src/main/java/xyz/nifeather/morph/backends/fallback/NilWrapper.java similarity index 91% rename from src/main/java/xiamomc/morph/backends/fallback/NilWrapper.java rename to src/main/java/xyz/nifeather/morph/backends/fallback/NilWrapper.java index c0ec0357..5d98f067 100644 --- a/src/main/java/xiamomc/morph/backends/fallback/NilWrapper.java +++ b/src/main/java/xyz/nifeather/morph/backends/fallback/NilWrapper.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.fallback; +package xyz.nifeather.morph.backends.fallback; import com.mojang.authlib.GameProfile; import net.minecraft.nbt.CompoundTag; @@ -11,15 +11,15 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.EventWrapper; -import xiamomc.morph.backends.WrapperAttribute; -import xiamomc.morph.backends.WrapperEvent; -import xiamomc.morph.misc.DisguiseEquipment; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.utilities.NbtUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.EventWrapper; +import xyz.nifeather.morph.backends.WrapperAttribute; +import xyz.nifeather.morph.backends.WrapperEvent; +import xyz.nifeather.morph.misc.DisguiseEquipment; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.utilities.NbtUtils; import java.util.Map; import java.util.Optional; diff --git a/src/main/java/xiamomc/morph/backends/modelengine/MEBackend.java b/src/main/java/xyz/nifeather/morph/backends/modelengine/MEBackend.java similarity index 95% rename from src/main/java/xiamomc/morph/backends/modelengine/MEBackend.java rename to src/main/java/xyz/nifeather/morph/backends/modelengine/MEBackend.java index da68f515..abfb5098 100644 --- a/src/main/java/xiamomc/morph/backends/modelengine/MEBackend.java +++ b/src/main/java/xyz/nifeather/morph/backends/modelengine/MEBackend.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.modelengine; +package xyz.nifeather.morph.backends.modelengine; import com.ticxo.modelengine.api.ModelEngineAPI; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; @@ -8,12 +8,12 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.modelengine.vanish.IVanishSource; -import xiamomc.morph.backends.modelengine.vanish.ProtocolLibVanishSource; -import xiamomc.morph.backends.modelengine.vanish.VanillaVanishSource; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.modelengine.vanish.IVanishSource; +import xyz.nifeather.morph.backends.modelengine.vanish.ProtocolLibVanishSource; +import xyz.nifeather.morph.backends.modelengine.vanish.VanillaVanishSource; import java.util.Collection; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/backends/modelengine/MEDisguiseInstance.java b/src/main/java/xyz/nifeather/morph/backends/modelengine/MEDisguiseInstance.java similarity index 76% rename from src/main/java/xiamomc/morph/backends/modelengine/MEDisguiseInstance.java rename to src/main/java/xyz/nifeather/morph/backends/modelengine/MEDisguiseInstance.java index 008cd6c5..c2c96488 100644 --- a/src/main/java/xiamomc/morph/backends/modelengine/MEDisguiseInstance.java +++ b/src/main/java/xyz/nifeather/morph/backends/modelengine/MEDisguiseInstance.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.modelengine; +package xyz.nifeather.morph.backends.modelengine; public class MEDisguiseInstance { diff --git a/src/main/java/xiamomc/morph/backends/modelengine/MEDisguiseWrapper.java b/src/main/java/xyz/nifeather/morph/backends/modelengine/MEDisguiseWrapper.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/modelengine/MEDisguiseWrapper.java rename to src/main/java/xyz/nifeather/morph/backends/modelengine/MEDisguiseWrapper.java index a6f0e758..2ce4bd96 100644 --- a/src/main/java/xiamomc/morph/backends/modelengine/MEDisguiseWrapper.java +++ b/src/main/java/xyz/nifeather/morph/backends/modelengine/MEDisguiseWrapper.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.modelengine; +package xyz.nifeather.morph.backends.modelengine; import com.ticxo.modelengine.api.ModelEngineAPI; import com.ticxo.modelengine.api.model.ActiveModel; @@ -15,13 +15,13 @@ import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.WrapperEvent; -import xiamomc.morph.misc.DisguiseEquipment; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.WrapperEvent; +import xyz.nifeather.morph.misc.DisguiseEquipment; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/xiamomc/morph/backends/modelengine/vanish/IVanishSource.java b/src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/IVanishSource.java similarity index 73% rename from src/main/java/xiamomc/morph/backends/modelengine/vanish/IVanishSource.java rename to src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/IVanishSource.java index a85094fd..d3b3c94c 100644 --- a/src/main/java/xiamomc/morph/backends/modelengine/vanish/IVanishSource.java +++ b/src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/IVanishSource.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.modelengine.vanish; +package xyz.nifeather.morph.backends.modelengine.vanish; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/backends/modelengine/vanish/ProtocolLibVanishSource.java b/src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/ProtocolLibVanishSource.java similarity index 87% rename from src/main/java/xiamomc/morph/backends/modelengine/vanish/ProtocolLibVanishSource.java rename to src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/ProtocolLibVanishSource.java index 914d2c90..7d0bcbeb 100644 --- a/src/main/java/xiamomc/morph/backends/modelengine/vanish/ProtocolLibVanishSource.java +++ b/src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/ProtocolLibVanishSource.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.modelengine.vanish; +package xyz.nifeather.morph.backends.modelengine.vanish; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; @@ -12,13 +12,13 @@ import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.PlayerWatcher; -import xiamomc.morph.backends.server.renderer.utilties.WatcherUtils; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.PacketFactory; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.PlayerWatcher; +import xyz.nifeather.morph.backends.server.renderer.utilties.WatcherUtils; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.utilities.EntityTypeUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/backends/modelengine/vanish/VanillaVanishSource.java b/src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/VanillaVanishSource.java similarity index 85% rename from src/main/java/xiamomc/morph/backends/modelengine/vanish/VanillaVanishSource.java rename to src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/VanillaVanishSource.java index 279d181f..563a30af 100644 --- a/src/main/java/xiamomc/morph/backends/modelengine/vanish/VanillaVanishSource.java +++ b/src/main/java/xyz/nifeather/morph/backends/modelengine/vanish/VanillaVanishSource.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.modelengine.vanish; +package xyz.nifeather.morph.backends.modelengine.vanish; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import xiamomc.morph.MorphPluginObject; +import xyz.nifeather.morph.MorphPluginObject; public class VanillaVanishSource extends MorphPluginObject implements IVanishSource { diff --git a/src/main/java/xiamomc/morph/backends/server/ServerBackend.java b/src/main/java/xyz/nifeather/morph/backends/server/ServerBackend.java similarity index 95% rename from src/main/java/xiamomc/morph/backends/server/ServerBackend.java rename to src/main/java/xyz/nifeather/morph/backends/server/ServerBackend.java index 43e236cc..379354a4 100644 --- a/src/main/java/xiamomc/morph/backends/server/ServerBackend.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/ServerBackend.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server; +package xyz.nifeather.morph.backends.server; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.nbt.CompoundTag; @@ -6,15 +6,15 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.WrapperEvent; -import xiamomc.morph.backends.server.renderer.ServerRenderer; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.messages.BackendStrings; -import xiamomc.morph.misc.playerList.PlayerListHandler; -import xiamomc.morph.utilities.NbtUtils; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.WrapperEvent; +import xyz.nifeather.morph.backends.server.renderer.ServerRenderer; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.messages.BackendStrings; +import xyz.nifeather.morph.misc.playerList.PlayerListHandler; +import xyz.nifeather.morph.utilities.NbtUtils; import javax.annotation.Nullable; import java.util.Arrays; diff --git a/src/main/java/xiamomc/morph/backends/server/ServerDisguise.java b/src/main/java/xyz/nifeather/morph/backends/server/ServerDisguise.java similarity index 97% rename from src/main/java/xiamomc/morph/backends/server/ServerDisguise.java rename to src/main/java/xyz/nifeather/morph/backends/server/ServerDisguise.java index 1eff24f5..52f976a0 100644 --- a/src/main/java/xiamomc/morph/backends/server/ServerDisguise.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/ServerDisguise.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server; +package xyz.nifeather.morph.backends.server; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/xiamomc/morph/backends/server/ServerDisguiseWrapper.java b/src/main/java/xyz/nifeather/morph/backends/server/ServerDisguiseWrapper.java similarity index 87% rename from src/main/java/xiamomc/morph/backends/server/ServerDisguiseWrapper.java rename to src/main/java/xyz/nifeather/morph/backends/server/ServerDisguiseWrapper.java index e227f0cb..83eb60fb 100644 --- a/src/main/java/xiamomc/morph/backends/server/ServerDisguiseWrapper.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/ServerDisguiseWrapper.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server; +package xyz.nifeather.morph.backends.server; import com.mojang.authlib.GameProfile; import net.minecraft.nbt.CompoundTag; @@ -11,22 +11,22 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.EventWrapper; -import xiamomc.morph.backends.WrapperAttribute; -import xiamomc.morph.backends.WrapperEvent; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.AgeableMobWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.InventoryLivingWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.backends.server.renderer.utilties.WatcherUtils; -import xiamomc.morph.misc.DisguiseEquipment; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.playerList.PlayerListHandler; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.utilities.NbtUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.EventWrapper; +import xyz.nifeather.morph.backends.WrapperAttribute; +import xyz.nifeather.morph.backends.WrapperEvent; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.AgeableMobWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.InventoryLivingWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.utilties.WatcherUtils; +import xyz.nifeather.morph.misc.DisguiseEquipment; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.playerList.PlayerListHandler; +import xyz.nifeather.morph.utilities.NbtUtils; import java.util.Map; import java.util.Objects; @@ -303,14 +303,36 @@ public void setRenderParameters(@NotNull Player newBinding, @NotNull SingleWatch if (this.bindingWatcher != null) this.bindingWatcher.dispose(); + refreshRegistry(newBinding, bindingWatcher); + this.bindingWatcher = bindingWatcher; this.disguiseProperties.forEach((property, value) -> { bindingWatcher.writeProperty((SingleProperty) property, value); }); + } + + private void refreshRegistry(@NotNull Player bindingPlayer, @NotNull SingleWatcher bindingWatcher) + { + //和watcher同步我们的NBT + bindingWatcher.mergeFromCompound(getCompound(false)); + + if (getEntityType() == EntityType.PLAYER) + { + var profileOptional = readOrDefault(WrapperAttribute.profile); + profileOptional.ifPresent(p -> bindingWatcher.writeEntry(CustomEntries.PROFILE, p)); + } - refreshRegistry(); + //todo: 激活刷新时也刷新到玩家 + if (bindingWatcher instanceof InventoryLivingWatcher) + { + bindingWatcher.writeEntry(CustomEntries.DISPLAY_FAKE_EQUIPMENT, readOrDefault(WrapperAttribute.displayFakeEquip)); + bindingWatcher.writeEntry(CustomEntries.EQUIPMENT, this.equipment); + } + + if (bindingWatcher.getEntityType() == EntityType.GHAST) + bindingWatcher.writePersistent(ValueIndex.GHAST.CHARGING, aggressive); } @Override @@ -339,36 +361,4 @@ public void onPlayerJoin(Player newInstance) super.onPlayerJoin(newInstance); } - - private void refreshRegistry() - { - if (bindingPlayer == null) - return; - - if (bindingWatcher == null) - { - logger.warn("Have a bindingPlayer but no bindingWatcher?!"); - Thread.dumpStack(); - return; - } - - //和watcher同步我们的NBT - bindingWatcher.mergeFromCompound(getCompound()); - - if (getEntityType() == EntityType.PLAYER) - { - var profileOptional = readOrDefault(WrapperAttribute.profile); - profileOptional.ifPresent(p -> bindingWatcher.writeEntry(CustomEntries.PROFILE, p)); - } - - //todo: 激活刷新时也刷新到玩家 - if (bindingWatcher instanceof InventoryLivingWatcher) - { - bindingWatcher.writeEntry(CustomEntries.DISPLAY_FAKE_EQUIPMENT, readOrDefault(WrapperAttribute.displayFakeEquip)); - bindingWatcher.writeEntry(CustomEntries.EQUIPMENT, this.equipment); - } - - if (bindingWatcher.getEntityType() == EntityType.GHAST) - bindingWatcher.writePersistent(ValueIndex.GHAST.CHARGING, aggressive); - } } diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/ServerRenderer.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/ServerRenderer.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/ServerRenderer.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/ServerRenderer.java index 657287e4..f22c2c59 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/ServerRenderer.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/ServerRenderer.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer; +package xyz.nifeather.morph.backends.server.renderer; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; @@ -8,18 +8,18 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEvent; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.ProtocolHandler; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.LivingEntityWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegisterParameters; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.PacketFactory; +import xyz.nifeather.morph.backends.server.renderer.network.ProtocolHandler; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.LivingEntityWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RegisterParameters; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; import java.util.List; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/DisplayParameters.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/DisplayParameters.java similarity index 83% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/DisplayParameters.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/DisplayParameters.java index ead8a806..83ceb179 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/DisplayParameters.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/DisplayParameters.java @@ -1,11 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network; +package xyz.nifeather.morph.backends.server.renderer.network; import com.mojang.authlib.GameProfile; import org.bukkit.entity.EntityType; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.PlayerWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; public class DisplayParameters { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/PacketFactory.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/PacketFactory.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java index c3ce8e6d..5e3f645b 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/PacketFactory.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/PacketFactory.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network; +package xyz.nifeather.morph.backends.server.renderer.network; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; @@ -12,22 +12,23 @@ import net.minecraft.network.protocol.game.*; import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.level.GameType; -import org.bukkit.Bukkit; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.EntityEquipment; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.AbstractValues; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.utilties.ProtocolRegistryUtils; -import xiamomc.morph.misc.DisguiseEquipment; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.utilities.EntityTypeUtils; -import xiamomc.morph.utilities.NmsUtils; - -import java.util.*; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.AbstractValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.utilties.ProtocolRegistryUtils; +import xyz.nifeather.morph.misc.DisguiseEquipment; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.utilities.NmsUtils; + +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; import java.util.concurrent.TimeUnit; public class PacketFactory extends MorphPluginObject diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/ProtocolEquipment.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/ProtocolEquipment.java similarity index 93% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/ProtocolEquipment.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/ProtocolEquipment.java index a5c28c2a..b38b4dad 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/ProtocolEquipment.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/ProtocolEquipment.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network; +package xyz.nifeather.morph.backends.server.renderer.network; import com.mojang.datafixers.util.Pair; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -7,8 +7,8 @@ import org.bukkit.Material; import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; import org.bukkit.inventory.EntityEquipment; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.utilities.ItemUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.utilities.ItemUtils; public class ProtocolEquipment { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/ProtocolHandler.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/ProtocolHandler.java similarity index 95% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/ProtocolHandler.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/ProtocolHandler.java index cbc7494e..74e3f22a 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/ProtocolHandler.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/ProtocolHandler.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network; +package xyz.nifeather.morph.backends.server.renderer.network; import com.comphenix.protocol.ProtocolLibrary; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.listeners.*; import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.listeners.*; import java.util.List; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/TestPacketListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/TestPacketListener.java similarity index 95% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/TestPacketListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/TestPacketListener.java index 1f1e793e..6264337a 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/TestPacketListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/TestPacketListener.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network; +package xyz.nifeather.morph.backends.server.renderer.network; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.ListeningWhitelist; @@ -7,9 +7,9 @@ import com.comphenix.protocol.injector.GamePhase; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.plugin.Plugin; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; public class TestPacketListener extends MorphPluginObject implements PacketListener { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AbstractValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AbstractValues.java similarity index 87% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AbstractValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AbstractValues.java index 3db463df..15bd50a9 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AbstractValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AbstractValues.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.slf4j.Logger; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.backends.server.renderer.utilties.ProtocolRegistryUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.backends.server.renderer.utilties.ProtocolRegistryUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AllayValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AllayValues.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AllayValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AllayValues.java index 9ac4df3a..fbe74131 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AllayValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AllayValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class AllayValues extends MobValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ArmadilloValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ArmadilloValues.java similarity index 71% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ArmadilloValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ArmadilloValues.java index 6e4dd8c0..8d5a9baa 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ArmadilloValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ArmadilloValues.java @@ -1,8 +1,8 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import net.minecraft.world.entity.animal.armadillo.Armadillo; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class ArmadilloValues extends AnimalValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ArmorStandValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ArmorStandValues.java similarity index 86% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ArmorStandValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ArmorStandValues.java index 8c255af9..073090f1 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ArmorStandValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ArmorStandValues.java @@ -1,7 +1,7 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import net.minecraft.core.Rotations; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.LivingEntityValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.LivingEntityValues; public class ArmorStandValues extends LivingEntityValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AxolotlValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AxolotlValues.java similarity index 67% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AxolotlValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AxolotlValues.java index 05b79259..3c1f076d 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AxolotlValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/AxolotlValues.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class AxolotlValues extends AnimalValues { - public final SingleValue COLOR = createSingle("axolotl_color", 0).withRandom(0, 1, 2, 3, 4); + public final SingleValue COLOR = createSingle("axolotl_color", 0); public final SingleValue PLAYING_DEAD = createSingle("axolotl_playing_dead", false); public final SingleValue SPAWNED_FROM_BUCKET = createSingle("axolotl_spawned_from_bucket", false); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/CatValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/CatValues.java similarity index 81% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/CatValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/CatValues.java index 06f50d20..bb538953 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/CatValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/CatValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import net.minecraft.core.Holder; @@ -6,8 +6,8 @@ import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.resources.ResourceKey; import net.minecraft.world.entity.animal.CatVariant; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.TameableAnimalValues; -import xiamomc.morph.backends.server.renderer.utilties.HolderUtils; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.TameableAnimalValues; +import xyz.nifeather.morph.backends.server.renderer.utilties.HolderUtils; public class CatValues extends TameableAnimalValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/CreeperValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/CreeperValues.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/CreeperValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/CreeperValues.java index 3dbdfa92..6d984536 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/CreeperValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/CreeperValues.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class CreeperValues extends MonsterValues { public final SingleValue STATE = createSingle("creeper_state", 0); - public final SingleValue IS_CHARGED_CREEPER = createSingle("creeper_is_charged", false).withRandom(false, false, false, false, true); + public final SingleValue IS_CHARGED_CREEPER = createSingle("creeper_is_charged", false); public final SingleValue IGNITED = createSingle("creeper_ignited", false); public CreeperValues() diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FoxValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/FoxValues.java similarity index 71% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FoxValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/FoxValues.java index cb5d716f..40200b5d 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FoxValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/FoxValues.java @@ -1,12 +1,12 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; import java.util.UUID; public class FoxValues extends AnimalValues { - public final SingleValue FOX_VARIANT = createSingle("fox_variant", 0).withRandom(0, 1); + public final SingleValue FOX_VARIANT = createSingle("fox_variant", 0); public final SingleValue FLAGS = createSingle("fox_flags", (byte)0); public final SingleValue TRUSTED_ID_0 = createSingle("fox_trusted_0", UUID.randomUUID()); public final SingleValue TRUSTED_ID_1 = createSingle("fox_trusted_1", UUID.randomUUID()); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FrogValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/FrogValues.java similarity index 69% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FrogValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/FrogValues.java index 97c02d2f..6bb1307c 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FrogValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/FrogValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import net.minecraft.core.Holder; @@ -6,13 +6,12 @@ import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.resources.ResourceKey; import net.minecraft.world.entity.animal.FrogVariant; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; -import xiamomc.morph.backends.server.renderer.utilties.HolderUtils; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.utilties.HolderUtils; public class FrogValues extends AnimalValues { - public final SingleValue> FROG_VARIANT = createSingle("frog_variant", getFrogVariant(FrogVariant.TEMPERATE)) - .withRandom(getFrogVariant(FrogVariant.TEMPERATE), getFrogVariant(FrogVariant.COLD), getFrogVariant(FrogVariant.WARM)); + public final SingleValue> FROG_VARIANT = createSingle("frog_variant", getFrogVariant(FrogVariant.TEMPERATE)); private Holder getFrogVariant(ResourceKey key) { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GhastValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GhastValues.java similarity index 73% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GhastValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GhastValues.java index 9210e746..2e38496f 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GhastValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GhastValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class GhastValues extends MobValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GoatValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GoatValues.java similarity index 71% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GoatValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GoatValues.java index 0eae411c..83bd35a1 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GoatValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GoatValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class GoatValues extends AnimalValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GuardianValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GuardianValues.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GuardianValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GuardianValues.java index e6e38f55..dd786d6b 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GuardianValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/GuardianValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class GuardianValues extends MonsterValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/HorseValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/HorseValues.java similarity index 55% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/HorseValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/HorseValues.java index 1e7786c7..5d170b08 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/HorseValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/HorseValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractHorseValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractHorseValues; public class HorseValues extends AbstractHorseValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.java similarity index 57% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.java index 2afedbe2..ba71aa86 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.java @@ -1,11 +1,11 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.ChestedHorseValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.ChestedHorseValues; public class LlamaValues extends ChestedHorseValues { public final SingleValue SLOTS = createSingle("llama_slots", 2); - public final SingleValue VARIANT = createSingle("llama_variant", 1).withRandom(0, 1, 2, 3); + public final SingleValue VARIANT = createSingle("llama_variant", 1); public LlamaValues() { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MobValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MobValues.java similarity index 55% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MobValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MobValues.java index 698ccba0..eb65b931 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MobValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MobValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.LivingEntityValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.LivingEntityValues; public class MobValues extends LivingEntityValues { diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MonsterValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MonsterValues.java new file mode 100644 index 00000000..235a4a5e --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MonsterValues.java @@ -0,0 +1,5 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; + +public class MonsterValues extends MobValues +{ +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MooshroomValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MooshroomValues.java similarity index 57% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MooshroomValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MooshroomValues.java index bf5e814c..d3e536e2 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/MooshroomValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/MooshroomValues.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class MooshroomValues extends AnimalValues { - public final SingleValue VARIANT = createSingle("mooshroom_variant", RED).withRandom(RED, RED, RED, BROWN); + public final SingleValue VARIANT = createSingle("mooshroom_variant", RED); public static final String RED = "red"; public static final String BROWN = "brown"; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PandaValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PandaValues.java similarity index 80% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PandaValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PandaValues.java index fb5b75a1..0ef93324 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PandaValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PandaValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class PandaValues extends AnimalValues { diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ParrotValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ParrotValues.java new file mode 100644 index 00000000..d664c948 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ParrotValues.java @@ -0,0 +1,15 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; + +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.TameableAnimalValues; + +public class ParrotValues extends TameableAnimalValues +{ + public final SingleValue PARROT_VARIANT = createSingle("parrot_variant", 0); + + public ParrotValues() + { + super(); + + registerSingle(PARROT_VARIANT); + } +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PhantomValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PhantomValues.java similarity index 72% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PhantomValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PhantomValues.java index f394986c..b42a5ac0 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PhantomValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PhantomValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class PhantomValues extends MobValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PiglinValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PiglinValues.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PiglinValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PiglinValues.java index 57795383..1eb2dc3e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PiglinValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PiglinValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.BasePiglinValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.BasePiglinValues; public class PiglinValues extends BasePiglinValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PlayerValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PlayerValues.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PlayerValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PlayerValues.java index 8f5d8faf..918d828d 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PlayerValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PlayerValues.java @@ -1,7 +1,7 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import net.minecraft.nbt.CompoundTag; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.LivingEntityValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.LivingEntityValues; public class PlayerValues extends LivingEntityValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PufferfishValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PufferfishValues.java similarity index 68% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PufferfishValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PufferfishValues.java index 098b87ed..8093a593 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/PufferfishValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/PufferfishValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractFishValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractFishValues; public class PufferfishValues extends AbstractFishValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/RabbitValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/RabbitValues.java similarity index 55% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/RabbitValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/RabbitValues.java index 4727f8a9..1bae6f65 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/RabbitValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/RabbitValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class RabbitValues extends AnimalValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SheepValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SheepValues.java similarity index 55% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SheepValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SheepValues.java index 89ee824b..54585e88 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SheepValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SheepValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class SheepValues extends AnimalValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ShulkerValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ShulkerValues.java similarity index 85% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ShulkerValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ShulkerValues.java index e89aeb59..458bec78 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ShulkerValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ShulkerValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import net.minecraft.core.Direction; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SingleValue.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SingleValue.java similarity index 76% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SingleValue.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SingleValue.java index 26762647..bd7f1955 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SingleValue.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SingleValue.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -61,26 +61,6 @@ public SingleValue(String name, Class type, int index, @NotNull T defaultValu this.defaultValue = defaultValue; } - private final List randomValues = new ObjectArrayList<>(); - - public List getRandomValues() - { - return new ObjectArrayList<>(randomValues); - } - - public SingleValue withRandom(List values) - { - var newInstance = new SingleValue<>(this.name, this.type, this.index, this.defaultValue); - newInstance.randomValues.addAll(values); - - return newInstance; - } - - public SingleValue withRandom(T... randomValues) - { - return withRandom(Arrays.stream(randomValues).toList()); - } - @Override public boolean equals(Object obj) { @@ -98,7 +78,6 @@ public boolean equalsStrict(Object obj) return this.index == other.index && this.type.equals(other.type) && this.name.equals(other.name) - && this.randomValues.equals(other.randomValues) && this.defaultValue.equals(other.defaultValue); } diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SlimeValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SlimeValues.java similarity index 72% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SlimeValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SlimeValues.java index 975298cd..b3728561 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SlimeValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SlimeValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class SlimeValues extends MobValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SnifferValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SnifferValues.java similarity index 69% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SnifferValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SnifferValues.java index 5dc41c5f..5efed4fd 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SnifferValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SnifferValues.java @@ -1,7 +1,7 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import net.minecraft.world.entity.animal.sniffer.Sniffer; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AnimalValues; public class SnifferValues extends AnimalValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SnowGolemValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SnowGolemValues.java similarity index 66% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SnowGolemValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SnowGolemValues.java index 7e8143ab..df1a8fec 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/SnowGolemValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/SnowGolemValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractGolemValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractGolemValues; public class SnowGolemValues extends AbstractGolemValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/TropicalFishValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/TropicalFishValues.java similarity index 57% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/TropicalFishValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/TropicalFishValues.java index 0ef41d98..25b3171e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/TropicalFishValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/TropicalFishValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractFishValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractFishValues; public class TropicalFishValues extends AbstractFishValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/VillagerValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/VillagerValues.java similarity index 71% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/VillagerValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/VillagerValues.java index 2c8c3414..26e10038 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/VillagerValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/VillagerValues.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import net.minecraft.world.entity.npc.VillagerData; import net.minecraft.world.entity.npc.VillagerProfession; import net.minecraft.world.entity.npc.VillagerType; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractVillagerValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.AbstractVillagerValues; public class VillagerValues extends AbstractVillagerValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/WolfValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/WolfValues.java similarity index 53% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/WolfValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/WolfValues.java index 3151e119..4cf97b71 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/WolfValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/WolfValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -9,47 +9,15 @@ import net.minecraft.world.entity.animal.WolfVariant; import net.minecraft.world.entity.animal.WolfVariants; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.TameableAnimalValues; -import xiamomc.morph.backends.server.renderer.utilties.HolderUtils; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.TameableAnimalValues; +import xyz.nifeather.morph.backends.server.renderer.utilties.HolderUtils; public class WolfValues extends TameableAnimalValues { public final SingleValue BEGGING = createSingle("wolf_begging", false); public final SingleValue COLLAR_COLOR = createSingle("wolf_collar_color", 14); public final SingleValue ANGER_TIME = createSingle("wolf_anger_time", 0); - public final SingleValue> WOLF_VARIANT = createSingle("wolf_variant", getWolfVariant(WolfVariants.PALE)).withRandom(allVariants()); - - @Nullable - private Holder[] allVariants; - - private Holder[] allVariants() - { - if (this.allVariants != null) - return allVariants; - - this.allVariants = toVariantHolders( - WolfVariants.PALE, - WolfVariants.SPOTTED, - WolfVariants.SNOWY, - WolfVariants.BLACK, - WolfVariants.ASHEN, - WolfVariants.RUSTY, - WolfVariants.WOODS, - WolfVariants.CHESTNUT, - WolfVariants.STRIPED); - - return this.allVariants; - } - - public static Holder[] toVariantHolders(ResourceKey... resKeys) - { - var list = new ObjectArrayList>(); - - for (ResourceKey resKey : resKeys) - list.add(getWolfVariant(resKey)); - - return list.toArray(new Holder[]{}); - } + public final SingleValue> WOLF_VARIANT = createSingle("wolf_variant", getWolfVariant(WolfVariants.PALE)); public static Holder getWolfVariant(ResourceKey resKey) { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZoglinValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZoglinValues.java similarity index 73% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZoglinValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZoglinValues.java index cb3dceb2..ce3841bd 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZoglinValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZoglinValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class ZoglinValues extends MonsterValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZombieValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZombieValues.java similarity index 84% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZombieValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZombieValues.java index bb191056..469d8d7a 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZombieValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZombieValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; public class ZombieValues extends MonsterValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZombieVillagerValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZombieVillagerValues.java similarity index 87% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZombieVillagerValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZombieVillagerValues.java index 47c75528..9f8f6819 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/ZombieVillagerValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/ZombieVillagerValues.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values; import net.minecraft.world.entity.npc.VillagerData; import net.minecraft.world.entity.npc.VillagerProfession; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractFishValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractFishValues.java similarity index 58% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractFishValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractFishValues.java index 401999f8..3b23412d 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractFishValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractFishValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; public class AbstractFishValues extends WaterAnimalValues { diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractGolemValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractGolemValues.java new file mode 100644 index 00000000..8b960d2f --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractGolemValues.java @@ -0,0 +1,7 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; + +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.MobValues; + +public class AbstractGolemValues extends MobValues +{ +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractHorseValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractHorseValues.java similarity index 57% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractHorseValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractHorseValues.java index ef7236b7..72a9ec4e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractHorseValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractHorseValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; public class AbstractHorseValues extends AgeableMobValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractVillagerValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractVillagerValues.java similarity index 60% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractVillagerValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractVillagerValues.java index b0e2f3b0..9ce0e324 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractVillagerValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AbstractVillagerValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; public class AbstractVillagerValues extends AgeableMobValues { diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AgeableMobValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AgeableMobValues.java new file mode 100644 index 00000000..b49f487a --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AgeableMobValues.java @@ -0,0 +1,16 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; + +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.MobValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; + +public class AgeableMobValues extends MobValues +{ + public final SingleValue IS_BABY = createSingle("ageable_mob_is_baby", false); + + public AgeableMobValues() + { + super(); + + registerSingle(IS_BABY); + } +} diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AnimalValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AnimalValues.java new file mode 100644 index 00000000..fe4d41f3 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/AnimalValues.java @@ -0,0 +1,5 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; + +public class AnimalValues extends AgeableMobValues +{ +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/BasePiglinValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/BasePiglinValues.java similarity index 50% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/BasePiglinValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/BasePiglinValues.java index ee68e767..889bc718 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/BasePiglinValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/BasePiglinValues.java @@ -1,7 +1,7 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.MonsterValues; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.MonsterValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; public class BasePiglinValues extends MonsterValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/ChestedHorseValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/ChestedHorseValues.java similarity index 58% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/ChestedHorseValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/ChestedHorseValues.java index 2be94e76..366ab5bd 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/ChestedHorseValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/ChestedHorseValues.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; public class ChestedHorseValues extends AbstractHorseValues { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/EntityValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/EntityValues.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/EntityValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/EntityValues.java index 15f5ae36..b89ba8a3 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/EntityValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/EntityValues.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.Pose; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.AbstractValues; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.AbstractValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; import java.util.Optional; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/LivingEntityValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/LivingEntityValues.java similarity index 88% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/LivingEntityValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/LivingEntityValues.java index 01047e1b..d9879a3e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/LivingEntityValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/LivingEntityValues.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.network.syncher.EntityDataSerializers; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; import java.util.List; import java.util.Optional; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/TameableAnimalValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/TameableAnimalValues.java similarity index 71% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/TameableAnimalValues.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/TameableAnimalValues.java index ed37889b..96333dc5 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/basetypes/TameableAnimalValues.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/TameableAnimalValues.java @@ -1,7 +1,7 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; import net.minecraft.Util; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; import java.util.Optional; import java.util.UUID; diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/WaterAnimalValues.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/WaterAnimalValues.java new file mode 100644 index 00000000..47b0af5d --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/values/basetypes/WaterAnimalValues.java @@ -0,0 +1,7 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes; + +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.MobValues; + +public class WaterAnimalValues extends MobValues +{ +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java similarity index 86% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java index 809b6c4b..b609e142 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/SingleWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; @@ -10,18 +10,17 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.AbstractValues; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; -import xiamomc.morph.backends.server.renderer.utilties.WatcherUtils; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.PacketFactory; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.AbstractValues; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; +import xyz.nifeather.morph.backends.server.renderer.utilties.WatcherUtils; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @@ -129,52 +128,52 @@ protected void onPropertyWrite(SingleProperty property, X value) protected final Map customRegistry = Collections.synchronizedMap(new Object2ObjectOpenHashMap<>()); - public void writeEntry(RegistryKey key, X value) + public void writeEntry(CustomEntry entry, X value) { - customRegistry.put(key.name, value); + customRegistry.put(entry.name, value); if (doingInitialization) return; - var prev = readEntryOrDefault(key, null); - onEntryWrite(key, prev, value); + var prev = readEntryOrDefault(entry, null); + onEntryWrite(entry, prev, value); } - protected void onEntryWrite(RegistryKey key, @Nullable X oldVal, @Nullable X newVal) + protected void onEntryWrite(CustomEntry entry, @Nullable X oldVal, @Nullable X newVal) { } @NotNull - public X readEntryOrThrow(RegistryKey key) + public X readEntryOrThrow(CustomEntry entry) { - var val = this.readEntry(key); + var val = this.readEntry(entry); if (val == null) - throw new NullDependencyException("Custom Key '%s' not found in '%s'".formatted(key, this.getClass().getSimpleName())); + throw new NullDependencyException("Custom entry '%s' not found in '%s'".formatted(entry, this.getClass().getSimpleName())); return val; } - public X readEntryOrDefault(RegistryKey key, X defaultValue) + public X readEntryOrDefault(CustomEntry entry, X defaultValue) { - var val = readEntry(key); + var val = readEntry(entry); return val == null ? defaultValue : val; } @Nullable - public X readEntry(RegistryKey key) + public X readEntry(CustomEntry entry) { - var val = customRegistry.getOrDefault(key.name, null); + var val = customRegistry.getOrDefault(entry.name, null); if (val == null) return null; - if (key.type.isInstance(val)) + if (entry.type.isInstance(val)) { return (X)val; } else { - logger.warn("Find incompatible value '%s' for key '%s'!".formatted(val, key)); + logger.warn("Find incompatible value '%s' for custom entry '%s'!".formatted(val, entry)); return null; } @@ -182,6 +181,23 @@ public X readEntry(RegistryKey key) //endregion Custom Registry + public void resetRegistries() + { + Map registryCopy = new Object2ObjectOpenHashMap<>(registry); + + registryCopy.forEach((id, val) -> + { + var sv = this.knownValues.getOrDefault(id, null); + if (sv != null) + this.writePersistent((SingleValue) sv, sv.defaultValue()); + + this.registry.remove(id); + }); + + Map crCopy = new Object2ObjectOpenHashMap<>(customRegistry); + crCopy.clear(); + } + //region Value Registry protected final Map registry = new ConcurrentHashMap<>(); @@ -352,6 +368,7 @@ protected void onTrackerWrite(SingleValue single, @Nullable X oldVal, @Nu { } + @NotNull public X read(SingleValue singleValue) { return this.readOr(singleValue, singleValue.defaultValue()); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AgeableMobWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AgeableMobWatcher.java similarity index 69% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AgeableMobWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AgeableMobWatcher.java index 51de4172..198c3360 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AgeableMobWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AgeableMobWatcher.java @@ -1,8 +1,8 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class AgeableMobWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AllayWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AllayWatcher.java similarity index 58% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AllayWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AllayWatcher.java index 66591f7a..9faecb10 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AllayWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AllayWatcher.java @@ -1,11 +1,11 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; public class AllayWatcher extends LivingEntityWatcher { @@ -18,11 +18,11 @@ protected void initRegistry() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var id = newVal.toString(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmadilloWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmadilloWatcher.java similarity index 77% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmadilloWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmadilloWatcher.java index a5cb9419..913b0c2e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmadilloWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmadilloWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.world.entity.animal.armadillo.Armadillo; import org.bukkit.Sound; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; public class ArmadilloWatcher extends LivingEntityWatcher { @@ -25,11 +25,11 @@ protected void initRegistry() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); var player = getBindingPlayer(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmorStandWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmorStandWatcher.java similarity index 93% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmorStandWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmorStandWatcher.java index 95a9703c..78a2a6bb 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmorStandWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ArmorStandWatcher.java @@ -1,15 +1,14 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.core.Rotations; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.ArmorStandProperties; -import xiamomc.morph.misc.disguiseProperty.values.AxolotlProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.ArmorStandProperties; public class ArmorStandWatcher extends InventoryLivingWatcher { @@ -170,4 +169,4 @@ public void writeToCompound(CompoundTag nbt) nbt.put("Pose", poseCompound); } -} +} \ No newline at end of file diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AxolotlWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AxolotlWatcher.java similarity index 80% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AxolotlWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AxolotlWatcher.java index 9cf90d04..0d76d8e1 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/AxolotlWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/AxolotlWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.Axolotl; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.AxolotlProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.AxolotlProperties; public class AxolotlWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/CatWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/CatWatcher.java similarity index 85% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/CatWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/CatWatcher.java index 0f28f2d7..7f6c9689 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/CatWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/CatWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.kyori.adventure.key.Key; import net.minecraft.core.Holder; @@ -14,15 +14,13 @@ import org.bukkit.entity.Cat; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.CatProperties; - -import java.util.Arrays; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.CatProperties; public class CatWatcher extends TameableAnimalWatcher { @@ -90,11 +88,11 @@ protected void onPropertyWrite(SingleProperty property, X value) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/CreeperWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/CreeperWatcher.java similarity index 50% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/CreeperWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/CreeperWatcher.java index aca94c3b..9a8e445c 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/CreeperWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/CreeperWatcher.java @@ -1,9 +1,12 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.CreeperProperties; public class CreeperWatcher extends LivingEntityWatcher { @@ -20,6 +23,20 @@ protected void initRegistry() register(ValueIndex.CREEPER); } + @Override + protected void onPropertyWrite(SingleProperty property, X value) + { + var properties = DisguiseProperties.INSTANCE.getOrThrow(CreeperProperties.class); + + if (property.equals(properties.CHARGED)) + { + var isCharged = Boolean.TRUE.equals(value); + this.writePersistent(ValueIndex.CREEPER.IS_CHARGED_CREEPER, isCharged); + } + + super.onPropertyWrite(property, value); + } + @Override public void mergeFromCompound(CompoundTag nbt) { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/DonkeyWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/DonkeyWatcher.java similarity index 53% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/DonkeyWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/DonkeyWatcher.java index a45fccf6..e3a48e84 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/DonkeyWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/DonkeyWatcher.java @@ -1,8 +1,8 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.ChestedHorseWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.ChestedHorseWatcher; public class DonkeyWatcher extends ChestedHorseWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/EHasAttackAnimationWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/EHasAttackAnimationWatcher.java similarity index 59% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/EHasAttackAnimationWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/EHasAttackAnimationWatcher.java index c0704b43..5051b334 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/EHasAttackAnimationWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/EHasAttackAnimationWatcher.java @@ -1,12 +1,12 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import com.comphenix.protocol.events.PacketContainer; import net.minecraft.network.protocol.game.ClientboundEntityEventPacket; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; public class EHasAttackAnimationWatcher extends LivingEntityWatcher { @@ -16,11 +16,11 @@ public EHasAttackAnimationWatcher(Player bindingPlayer, EntityType entityType) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ATTACK_ANIMATION) && Boolean.TRUE.equals(newVal)) + if (entry.equals(CustomEntries.ATTACK_ANIMATION) && Boolean.TRUE.equals(newVal)) { var entity = ((CraftPlayer)getBindingPlayer()).getHandle(); sendPacketToAffectedPlayers(PacketContainer.fromPacket(new ClientboundEntityEventPacket(entity, (byte)4))); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/EntityWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/EntityWatcher.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/EntityWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/EntityWatcher.java index 3dc67e97..fc312f64 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/EntityWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/EntityWatcher.java @@ -1,15 +1,15 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.server.MinecraftServer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.NmsRecord; import java.util.Optional; @@ -72,11 +72,11 @@ protected void doSync() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.DISGUISE_NAME)) + if (entry.equals(CustomEntries.DISGUISE_NAME)) { var str = newVal.toString(); var component = str.isEmpty() ? null : Component.literal(str); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.java index ba7e34d8..4f1123c8 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.java @@ -1,16 +1,16 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Fox; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.FoxProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.FoxProperties; public class FoxWatcher extends AgeableMobWatcher { @@ -43,11 +43,11 @@ protected void onPropertyWrite(SingleProperty property, X value) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FrogWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/FrogWatcher.java similarity index 84% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FrogWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/FrogWatcher.java index 26dd399c..54414494 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FrogWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/FrogWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; @@ -15,14 +15,14 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Frog; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.FrogProperties; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.FrogProperties; public class FrogWatcher extends LivingEntityWatcher { @@ -117,11 +117,11 @@ protected void onPropertyWrite(SingleProperty property, X value) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); var player = getBindingPlayer(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.java similarity index 67% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.java index 7b63d674..7c6bbcda 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.java @@ -1,8 +1,8 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class GhastWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GoatWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GoatWatcher.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GoatWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GoatWatcher.java index cf708b9a..067e7525 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GoatWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GoatWatcher.java @@ -1,12 +1,12 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.GoatProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.GoatProperties; public class GoatWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GuardianWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GuardianWatcher.java similarity index 74% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GuardianWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GuardianWatcher.java index 9d86774f..f4c8c3f2 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GuardianWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/GuardianWatcher.java @@ -1,8 +1,8 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class GuardianWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/HoglinWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/HoglinWatcher.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/HoglinWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/HoglinWatcher.java index 5992d12d..71304624 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/HoglinWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/HoglinWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class HoglinWatcher extends EHasAttackAnimationWatcher { diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/InventoryLivingWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/InventoryLivingWatcher.java new file mode 100644 index 00000000..d4e91519 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/InventoryLivingWatcher.java @@ -0,0 +1,28 @@ +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; + +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.backends.server.renderer.network.PacketFactory; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; + +public class InventoryLivingWatcher extends LivingEntityWatcher +{ + public InventoryLivingWatcher(Player bindingPlayer, EntityType entityType) + { + super(bindingPlayer, entityType); + } + + @Resolved(shouldSolveImmediately = true) + private PacketFactory packetFactory; + + @Override + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) + { + super.onEntryWrite(entry, oldVal, newVal); + + if (entry.equals(CustomEntries.DISPLAY_FAKE_EQUIPMENT) || entry.equals(CustomEntries.EQUIPMENT)) + sendPacketToAffectedPlayers(packetFactory.getEquipmentPacket(getBindingPlayer(), this)); + } +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/LivingEntityWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/LivingEntityWatcher.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/LivingEntityWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/LivingEntityWatcher.java index 6325e8c0..03d48df6 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/LivingEntityWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/LivingEntityWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -14,8 +14,8 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.potion.PotionEffect; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.NmsRecord; import java.util.List; import java.util.Optional; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/MooshroomWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/MooshroomWatcher.java similarity index 77% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/MooshroomWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/MooshroomWatcher.java index 6aefe824..5db898b1 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/MooshroomWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/MooshroomWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.MushroomCow; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.MooshroomProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.MooshroomProperties; public class MooshroomWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PandaWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PandaWatcher.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PandaWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PandaWatcher.java index 3dfe2157..1888ff99 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PandaWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PandaWatcher.java @@ -1,16 +1,16 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Panda; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.PandaProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.PandaProperties; import java.util.Arrays; @@ -60,11 +60,11 @@ protected void onPropertyWrite(SingleProperty property, X value) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ParrotWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ParrotWatcher.java similarity index 78% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ParrotWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ParrotWatcher.java index e5a5c0a3..c6e8d9d2 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ParrotWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ParrotWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Parrot; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.ParrotProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.ParrotProperties; public class ParrotWatcher extends TameableAnimalWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PhantomWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PhantomWatcher.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PhantomWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PhantomWatcher.java index 104fd015..e0bac4a2 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PhantomWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PhantomWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class PhantomWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PiglinWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PiglinWatcher.java similarity index 71% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PiglinWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PiglinWatcher.java index 083dd62f..04f9fc3e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PiglinWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PiglinWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.Sound; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; public class PiglinWatcher extends LivingEntityWatcher { @@ -25,11 +25,11 @@ protected void initRegistry() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); var player = getBindingPlayer(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PlayerWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PlayerWatcher.java similarity index 76% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PlayerWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PlayerWatcher.java index 9c52ba26..0ecc96e3 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PlayerWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PlayerWatcher.java @@ -1,21 +1,18 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.destroystokyo.paper.ClientOption; -import com.mojang.authlib.GameProfile; import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket; import net.minecraft.world.entity.Pose; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.DisplayParameters; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.AnimationNames; - -import java.util.UUID; +import xyz.nifeather.morph.backends.server.renderer.network.DisplayParameters; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.NmsRecord; public class PlayerWatcher extends InventoryLivingWatcher { @@ -43,11 +40,11 @@ protected void doSync() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.PROFILE) && isPlayerOnline() && !isSilent()) + if (entry.equals(CustomEntries.PROFILE) && isPlayerOnline() && !isSilent()) { var player = getBindingPlayer(); var affected = getAffectedPlayers(player); @@ -69,7 +66,7 @@ protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) } } - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal + ""; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PufferfishWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PufferfishWatcher.java similarity index 72% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PufferfishWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PufferfishWatcher.java index 16128bff..ced99de7 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/PufferfishWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/PufferfishWatcher.java @@ -1,14 +1,14 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.Sound; import org.bukkit.SoundCategory; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.PufferfishValues; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.PufferfishValues; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; public class PufferfishWatcher extends LivingEntityWatcher { @@ -26,11 +26,11 @@ protected void initRegistry() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); var world = getBindingPlayer().getWorld(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/RabbitWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/RabbitWatcher.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/RabbitWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/RabbitWatcher.java index 9bf922c5..20ae1c95 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/RabbitWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/RabbitWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Rabbit; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.RabbitProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.RabbitProperties; import java.util.Arrays; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SheepWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SheepWatcher.java similarity index 82% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SheepWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SheepWatcher.java index 7a882b33..1b211b5e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SheepWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SheepWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class SheepWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ShulkerWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ShulkerWatcher.java similarity index 75% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ShulkerWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ShulkerWatcher.java index cb26e9ee..e0823b3c 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ShulkerWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ShulkerWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import org.bukkit.Sound; import org.bukkit.SoundCategory; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; public class ShulkerWatcher extends LivingEntityWatcher { @@ -25,11 +25,11 @@ protected void initRegistry() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SnifferWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SnifferWatcher.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SnifferWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SnifferWatcher.java index 1b58d192..a82f5feb 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SnifferWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SnifferWatcher.java @@ -1,14 +1,14 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.world.entity.animal.sniffer.Sniffer; import org.bukkit.Sound; import org.bukkit.SoundCategory; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; public class SnifferWatcher extends LivingEntityWatcher { @@ -26,11 +26,11 @@ protected void initRegistry() } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var bindingPlayer = getBindingPlayer(); var world = bindingPlayer.getWorld(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SnowGolemWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SnowGolemWatcher.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SnowGolemWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SnowGolemWatcher.java index b43b7787..71930906 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/SnowGolemWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/SnowGolemWatcher.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SnowGolemValues; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SnowGolemValues; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class SnowGolemWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/TameableAnimalWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/TameableAnimalWatcher.java similarity index 90% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/TameableAnimalWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/TameableAnimalWatcher.java index 293a3955..f4c88f6f 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/TameableAnimalWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/TameableAnimalWatcher.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.Util; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; import java.util.Optional; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/TropicalFishWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/TropicalFishWatcher.java similarity index 83% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/TropicalFishWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/TropicalFishWatcher.java index 838c6a67..5de34d0d 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/TropicalFishWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/TropicalFishWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class TropicalFishWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/VillagerWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/VillagerWatcher.java similarity index 92% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/VillagerWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/VillagerWatcher.java index 2e3eaf74..cd9d49cb 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/VillagerWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/VillagerWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; @@ -9,13 +9,11 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Villager; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.VillagerProperties; -import xiamomc.morph.utilities.MathUtils; - -import java.util.Arrays; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.VillagerProperties; +import xyz.nifeather.morph.utilities.MathUtils; public class VillagerWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/WardenWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/WardenWatcher.java similarity index 86% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/WardenWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/WardenWatcher.java index 52e78ad6..b9cbfb77 100755 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/WardenWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/WardenWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; @@ -10,14 +10,12 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.DisplayParameters; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.AnimationNames; - -import java.util.concurrent.atomic.AtomicBoolean; +import xyz.nifeather.morph.backends.server.renderer.network.DisplayParameters; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.NmsRecord; public class WardenWatcher extends EHasAttackAnimationWatcher { @@ -27,19 +25,19 @@ public WardenWatcher(Player bindingPlayer) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); var bindingPlayer = getBindingPlayer(); - if (key.equals(CustomEntries.WARDEN_CHARGING_ATTACK) && Boolean.TRUE.equals(newVal)) + if (entry.equals(CustomEntries.WARDEN_CHARGING_ATTACK) && Boolean.TRUE.equals(newVal)) { var entity = ((CraftPlayer)bindingPlayer).getHandle(); sendPacketToAffectedPlayers(PacketContainer.fromPacket(new ClientboundEntityEventPacket(entity, (byte)62))); } - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var id = newVal.toString(); var world = bindingPlayer.getWorld(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/WolfWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/WolfWatcher.java similarity index 86% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/WolfWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/WolfWatcher.java index 729d7ff2..a295f14d 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/WolfWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/WolfWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; @@ -12,14 +12,14 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Wolf; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RegistryKey; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.WolfProperties; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.WolfProperties; public class WolfWatcher extends TameableAnimalWatcher { @@ -66,11 +66,11 @@ protected void onPropertyWrite(SingleProperty property, X value) } @Override - protected void onEntryWrite(RegistryKey key, X oldVal, X newVal) + protected void onEntryWrite(CustomEntry entry, X oldVal, X newVal) { - super.onEntryWrite(key, oldVal, newVal); + super.onEntryWrite(entry, oldVal, newVal); - if (key.equals(CustomEntries.ANIMATION)) + if (entry.equals(CustomEntries.ANIMATION)) { var animId = newVal.toString(); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZoglinWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZoglinWatcher.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZoglinWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZoglinWatcher.java index 155209dd..7c8ee42c 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZoglinWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZoglinWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class ZoglinWatcher extends EHasAttackAnimationWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieVillagerWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieVillagerWatcher.java similarity index 92% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieVillagerWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieVillagerWatcher.java index d82e0e99..e71b0e85 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieVillagerWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieVillagerWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; @@ -6,17 +6,14 @@ import net.minecraft.world.entity.npc.VillagerData; import net.minecraft.world.entity.npc.VillagerProfession; import net.minecraft.world.entity.npc.VillagerType; -import org.bukkit.Registry; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Villager; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.VillagerProperties; -import xiamomc.morph.utilities.MathUtils; - -import java.util.Arrays; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.VillagerProperties; +import xyz.nifeather.morph.utilities.MathUtils; public class ZombieVillagerWatcher extends ZombieWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieWatcher.java similarity index 81% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieWatcher.java index 70d3bbbe..4c13cef7 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/ZombieWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class ZombieWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/AbstractHorseWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/AbstractHorseWatcher.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/AbstractHorseWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/AbstractHorseWatcher.java index de79fdb5..2d7db5e6 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/AbstractHorseWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/AbstractHorseWatcher.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.AgeableMobWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.AgeableMobWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class AbstractHorseWatcher extends AgeableMobWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ChestedHorseWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ChestedHorseWatcher.java similarity index 79% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ChestedHorseWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ChestedHorseWatcher.java index 6822ad39..535a046f 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ChestedHorseWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ChestedHorseWatcher.java @@ -1,9 +1,9 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class ChestedHorseWatcher extends AbstractHorseWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/HorseWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/HorseWatcher.java similarity index 85% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/HorseWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/HorseWatcher.java index 2db9000f..1f163079 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/HorseWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/HorseWatcher.java @@ -1,13 +1,13 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.HorseProperties; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.HorseProperties; public class HorseWatcher extends AbstractHorseWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/SkeletonHorseWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/SkeletonHorseWatcher.java similarity index 73% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/SkeletonHorseWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/SkeletonHorseWatcher.java index c0ff0f8c..23695793 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/SkeletonHorseWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/SkeletonHorseWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ZombieHorseWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ZombieHorseWatcher.java similarity index 72% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ZombieHorseWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ZombieHorseWatcher.java index b9cb482b..398838b1 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ZombieHorseWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/horses/ZombieHorseWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/LlamaWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/LlamaWatcher.java similarity index 74% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/LlamaWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/LlamaWatcher.java index f46028a0..44c51a51 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/LlamaWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/LlamaWatcher.java @@ -1,14 +1,14 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.llama; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.llama; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Llama; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.ChestedHorseWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; -import xiamomc.morph.misc.disguiseProperty.values.LlamaProperties; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.ChestedHorseWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.values.LlamaProperties; public class LlamaWatcher extends ChestedHorseWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/TraderLlamaWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/TraderLlamaWatcher.java similarity index 67% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/TraderLlamaWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/TraderLlamaWatcher.java index bea54d45..d81f4aa4 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/TraderLlamaWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/llama/TraderLlamaWatcher.java @@ -1,8 +1,8 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.llama; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.llama; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class TraderLlamaWatcher extends LlamaWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/AbstractSlimeWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/AbstractSlimeWatcher.java similarity index 75% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/AbstractSlimeWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/AbstractSlimeWatcher.java index a3421551..50155ae0 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/AbstractSlimeWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/AbstractSlimeWatcher.java @@ -1,11 +1,11 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma; import net.minecraft.nbt.CompoundTag; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.LivingEntityWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.LivingEntityWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class AbstractSlimeWatcher extends LivingEntityWatcher { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/MagmaWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/MagmaWatcher.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/MagmaWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/MagmaWatcher.java index 552570e5..3872ff46 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/MagmaWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/MagmaWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/SlimeWatcher.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/SlimeWatcher.java similarity index 70% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/SlimeWatcher.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/SlimeWatcher.java index 3ae6890f..77a5ed8b 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/SlimeWatcher.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/datawatcher/watchers/types/slimemagma/SlimeWatcher.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma; +package xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/AnimationPacketListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/AnimationPacketListener.java similarity index 93% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/AnimationPacketListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/AnimationPacketListener.java index 0c340e4b..4b3b1c45 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/AnimationPacketListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/AnimationPacketListener.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.ListeningWhitelist; @@ -6,8 +6,8 @@ import com.comphenix.protocol.injector.GamePhase; import net.minecraft.network.protocol.game.ClientboundAnimatePacket; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; public class AnimationPacketListener extends ProtocolListener { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/EquipmentPacketListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/EquipmentPacketListener.java similarity index 90% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/EquipmentPacketListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/EquipmentPacketListener.java index 30c0e41b..87b709f4 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/EquipmentPacketListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/EquipmentPacketListener.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.ListeningWhitelist; @@ -7,10 +7,9 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/MetaPacketListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/MetaPacketListener.java similarity index 90% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/MetaPacketListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/MetaPacketListener.java index 1aa5e3d5..4edd4251 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/MetaPacketListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/MetaPacketListener.java @@ -1,17 +1,15 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.ListeningWhitelist; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.injector.GamePhase; import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket; -import net.minecraft.network.syncher.SynchedEntityData; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; -import xiamomc.morph.backends.server.renderer.network.registries.ValueIndex; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; +import xyz.nifeather.morph.backends.server.renderer.network.registries.ValueIndex; public class MetaPacketListener extends ProtocolListener { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/PlayerLookPacketListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/PlayerLookPacketListener.java similarity index 96% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/PlayerLookPacketListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/PlayerLookPacketListener.java index 17081473..8d50c176 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/PlayerLookPacketListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/PlayerLookPacketListener.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.ListeningWhitelist; @@ -10,10 +10,9 @@ import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; -import xiamomc.morph.utilities.NmsUtils; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; +import xyz.nifeather.morph.utilities.NmsUtils; public class PlayerLookPacketListener extends ProtocolListener { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/ProtocolListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/ProtocolListener.java similarity index 84% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/ProtocolListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/ProtocolListener.java index 946c918c..ef47f396 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/ProtocolListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/ProtocolListener.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolManager; @@ -7,21 +7,16 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.CraftWorld; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.utilities.NmsUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; - -import java.util.Optional; -import java.util.function.Function; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.PacketFactory; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.utilities.NmsUtils; public abstract class ProtocolListener extends MorphPluginObject implements PacketListener { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/SoundListener.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java similarity index 95% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/SoundListener.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java index e67b9888..630f3190 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/SoundListener.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SoundListener.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.ListeningWhitelist; @@ -11,10 +11,9 @@ import net.minecraft.sounds.SoundEvent; import org.bukkit.entity.EntityType; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.server.renderer.network.PacketFactory; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; -import xiamomc.morph.utilities.EntityTypeUtils; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; +import xyz.nifeather.morph.utilities.EntityTypeUtils; import java.util.concurrent.atomic.AtomicReference; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/SpawnPacketHandler.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SpawnPacketHandler.java similarity index 91% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/SpawnPacketHandler.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SpawnPacketHandler.java index 5c333b5a..dd662601 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/listeners/SpawnPacketHandler.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/listeners/SpawnPacketHandler.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.listeners; +package xyz.nifeather.morph.backends.server.renderer.network.listeners; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; @@ -16,16 +16,16 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.server.renderer.network.DisplayParameters; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.PlayerWatcher; -import xiamomc.morph.backends.server.renderer.network.registries.CustomEntries; -import xiamomc.morph.backends.server.renderer.network.registries.RenderRegistry; -import xiamomc.morph.backends.server.renderer.utilties.WatcherUtils; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.skins.PlayerSkinProvider; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.backends.server.renderer.network.DisplayParameters; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.PlayerWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.registries.CustomEntries; +import xyz.nifeather.morph.backends.server.renderer.network.registries.RenderRegistry; +import xyz.nifeather.morph.backends.server.renderer.utilties.WatcherUtils; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; import java.util.List; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/queue/PacketQueue.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/queue/PacketQueue.java similarity index 95% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/queue/PacketQueue.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/queue/PacketQueue.java index d77c2d24..7535c37e 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/queue/PacketQueue.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/queue/PacketQueue.java @@ -1,12 +1,12 @@ -package xiamomc.morph.backends.server.renderer.network.queue; +package xyz.nifeather.morph.backends.server.renderer.network.queue; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolManager; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.entity.Player; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphPluginObject; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/queue/QueueEntry.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/queue/QueueEntry.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/queue/QueueEntry.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/queue/QueueEntry.java index 67f1c3c2..7134802b 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/queue/QueueEntry.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/queue/QueueEntry.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.queue; +package xyz.nifeather.morph.backends.server.renderer.network.queue; import com.comphenix.protocol.ProtocolManager; import com.comphenix.protocol.events.PacketContainer; diff --git a/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/CustomEntries.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/CustomEntries.java new file mode 100644 index 00000000..b0d007a7 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/CustomEntries.java @@ -0,0 +1,49 @@ +package xyz.nifeather.morph.backends.server.renderer.network.registries; + +import com.mojang.authlib.GameProfile; +import net.minecraft.Util; +import xyz.nifeather.morph.misc.DisguiseEquipment; + +import java.util.UUID; + +public class CustomEntries +{ + /** + * This should always present for player disguise! + */ + public static final CustomEntry PROFILE = CustomEntry.of("profile", new GameProfile(UUID.randomUUID(), "sample")).doRequireNonNull(); + + /** + * Should profile listed in the tab list? + * + * Also, 'TRUE' means the profile listing is also handled by external sources + */ + public static final CustomEntry PROFILE_LISTED = CustomEntry.of("profile_listed", false); + + public static final CustomEntry DISGUISE_NAME = CustomEntry.of("disguise_name", "").doRequireNonNull(); + + public static final CustomEntry EQUIPMENT = CustomEntry.of("equip", new DisguiseEquipment()); + public static final CustomEntry DISPLAY_FAKE_EQUIPMENT = CustomEntry.of("display_fake_equip", false); + + /** + * @deprecated UUID for player disguise now is {@link CustomEntries#SPAWN_ID} + */ + @Deprecated(since = "1.2.6", forRemoval = true) + public static final CustomEntry TABLIST_UUID = CustomEntry.of("tablist_uuid", Util.NIL_UUID); + + public static final CustomEntry WARDEN_CHARGING_ATTACK = CustomEntry.of("warden_charging_attack", false); + public static final CustomEntry ATTACK_ANIMATION = CustomEntry.of("attack_animation", false); + + public static final CustomEntry SLIME_SIZE_REAL = CustomEntry.of("slime_size_real", 0); + + public static final CustomEntry ANIMATION = CustomEntry.of("animation", "morph:unknown"); + + public static final CustomEntry SPAWN_UUID = CustomEntry.of("spawn_uuid", Util.NIL_UUID); + public static final CustomEntry SPAWN_ID = CustomEntry.of("spawn_id", -1); + + public static final CustomEntry VANISHED = CustomEntry.of("vanished", false); + + public static final CustomEntry ARMOR_STAND_SMALL = CustomEntry.of("armorstand_is_small", false); + public static final CustomEntry ARMOR_STAND_NO_BASE_PLATE = CustomEntry.of("armorstand_no_baseplate", false); + public static final CustomEntry ARMOR_STAND_SHOW_ARMS = CustomEntry.of("armorstand_show_arms", false); +} diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RegistryKey.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/CustomEntry.java similarity index 61% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RegistryKey.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/CustomEntry.java index d3d1f3b5..a3dd7487 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RegistryKey.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/CustomEntry.java @@ -1,6 +1,6 @@ -package xiamomc.morph.backends.server.renderer.network.registries; +package xyz.nifeather.morph.backends.server.renderer.network.registries; -public class RegistryKey +public class CustomEntry { public final Class type; public final String name; @@ -12,21 +12,21 @@ public boolean requireNonNull() return requireNonNull; } - public RegistryKey doRequireNonNull() + public CustomEntry doRequireNonNull() { this.requireNonNull = true; return this; } - public RegistryKey(String name, Class type) + public CustomEntry(String name, Class type) { this.name = name; this.type = type; } - public static RegistryKey of(String name, X val) + public static CustomEntry of(String name, X val) { - return new RegistryKey<>(name, (Class)val.getClass()); + return new CustomEntry<>(name, (Class)val.getClass()); } @Override @@ -39,7 +39,7 @@ public String toString() public boolean equals(Object obj) { if (this == obj) return true; - if (!(obj instanceof RegistryKey other)) return false; + if (!(obj instanceof CustomEntry other)) return false; return other.name.equals(this.name); } diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RegisterParameters.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/RegisterParameters.java similarity index 60% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RegisterParameters.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/RegisterParameters.java index c54d11de..8facedf5 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RegisterParameters.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/RegisterParameters.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.registries; +package xyz.nifeather.morph.backends.server.renderer.network.registries; import org.bukkit.entity.EntityType; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RenderRegistry.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/RenderRegistry.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RenderRegistry.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/RenderRegistry.java index 7e275019..906bd892 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/RenderRegistry.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/RenderRegistry.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.network.registries; +package xyz.nifeather.morph.backends.server.renderer.network.registries; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -7,12 +7,12 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/ValueIndex.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/ValueIndex.java similarity index 89% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/registries/ValueIndex.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/ValueIndex.java index 4106654d..ee8b9b42 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/ValueIndex.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/ValueIndex.java @@ -1,12 +1,7 @@ -package xiamomc.morph.backends.server.renderer.network.registries; +package xyz.nifeather.morph.backends.server.renderer.network.registries; -import org.bukkit.entity.EntityType; -import org.jetbrains.annotations.NotNull; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.*; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.basetypes.*; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.*; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.basetypes.*; public class ValueIndex { diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/WatcherIndex.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/WatcherIndex.java similarity index 73% rename from src/main/java/xiamomc/morph/backends/server/renderer/network/registries/WatcherIndex.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/WatcherIndex.java index e35d1e9a..21537357 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/network/registries/WatcherIndex.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/network/registries/WatcherIndex.java @@ -1,18 +1,18 @@ -package xiamomc.morph.backends.server.renderer.network.registries; +package xyz.nifeather.morph.backends.server.renderer.network.registries; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.*; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.AbstractHorseWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.HorseWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.SkeletonHorseWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.ZombieHorseWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.llama.LlamaWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.llama.TraderLlamaWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma.MagmaWatcher; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma.SlimeWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.*; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.AbstractHorseWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.HorseWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.SkeletonHorseWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.horses.ZombieHorseWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.llama.LlamaWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.llama.TraderLlamaWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma.MagmaWatcher; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.types.slimemagma.SlimeWatcher; import java.util.Map; import java.util.function.Function; @@ -21,16 +21,16 @@ public class WatcherIndex { public static WatcherIndex getInstance() { - if (instance == null) instance = new WatcherIndex(); - return instance; + return WatcherInstanceLazyHolder.instance; } - private static WatcherIndex instance; + private static class WatcherInstanceLazyHolder + { + public static final WatcherIndex instance = new WatcherIndex(); + } public WatcherIndex() { - instance = this; - setTypeWatcher(EntityType.PLAYER, PlayerWatcher::new); setTypeWatcher(EntityType.ALLAY, AllayWatcher::new); setTypeWatcher(EntityType.ARMOR_STAND, ArmorStandWatcher::new); diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/utilties/HolderUtils.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/HolderUtils.java similarity index 94% rename from src/main/java/xiamomc/morph/backends/server/renderer/utilties/HolderUtils.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/HolderUtils.java index 6c43f566..69740a83 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/utilties/HolderUtils.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/HolderUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.backends.server.renderer.utilties; +package xyz.nifeather.morph.backends.server.renderer.utilties; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/utilties/ProtocolRegistryUtils.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/ProtocolRegistryUtils.java similarity index 89% rename from src/main/java/xiamomc/morph/backends/server/renderer/utilties/ProtocolRegistryUtils.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/ProtocolRegistryUtils.java index 0911d201..c210f0b0 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/utilties/ProtocolRegistryUtils.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/ProtocolRegistryUtils.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.utilties; +package xyz.nifeather.morph.backends.server.renderer.utilties; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.backends.server.renderer.network.datawatcher.values.SingleValue; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.values.SingleValue; import java.util.Optional; diff --git a/src/main/java/xiamomc/morph/backends/server/renderer/utilties/WatcherUtils.java b/src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/WatcherUtils.java similarity index 84% rename from src/main/java/xiamomc/morph/backends/server/renderer/utilties/WatcherUtils.java rename to src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/WatcherUtils.java index 8b2e376f..7382839f 100644 --- a/src/main/java/xiamomc/morph/backends/server/renderer/utilties/WatcherUtils.java +++ b/src/main/java/xyz/nifeather/morph/backends/server/renderer/utilties/WatcherUtils.java @@ -1,10 +1,10 @@ -package xiamomc.morph.backends.server.renderer.utilties; +package xyz.nifeather.morph.backends.server.renderer.utilties; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.GameType; import org.bukkit.entity.Player; -import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.backends.server.renderer.network.datawatcher.watchers.SingleWatcher; +import xyz.nifeather.morph.misc.NmsRecord; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/AnimationCommand.java b/src/main/java/xyz/nifeather/morph/commands/AnimationCommand.java similarity index 88% rename from src/main/java/xiamomc/morph/commands/AnimationCommand.java rename to src/main/java/xyz/nifeather/morph/commands/AnimationCommand.java index 715df5d2..6c4a27b1 100644 --- a/src/main/java/xiamomc/morph/commands/AnimationCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/AnimationCommand.java @@ -1,19 +1,19 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.EmoteStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.gui.AnimSelectScreenWrapper; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.IPluginCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.EmoteStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.gui.AnimSelectScreenWrapper; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/MorphCommand.java b/src/main/java/xyz/nifeather/morph/commands/MorphCommand.java similarity index 87% rename from src/main/java/xiamomc/morph/commands/MorphCommand.java rename to src/main/java/xyz/nifeather/morph/commands/MorphCommand.java index 0dfb1dce..4208a1a6 100644 --- a/src/main/java/xiamomc/morph/commands/MorphCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/MorphCommand.java @@ -1,19 +1,19 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.gui.DisguiseSelectScreenWrapper; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.IPluginCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.gui.DisguiseSelectScreenWrapper; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/MorphCommandManager.java b/src/main/java/xyz/nifeather/morph/commands/MorphCommandManager.java similarity index 96% rename from src/main/java/xiamomc/morph/commands/MorphCommandManager.java rename to src/main/java/xyz/nifeather/morph/commands/MorphCommandManager.java index 60d9aa79..d6f4fe5f 100644 --- a/src/main/java/xiamomc/morph/commands/MorphCommandManager.java +++ b/src/main/java/xyz/nifeather/morph/commands/MorphCommandManager.java @@ -1,8 +1,8 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import it.unimi.dsi.fastutil.objects.ObjectList; import org.bukkit.Bukkit; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.CommandHelper; import xiamomc.pluginbase.Command.IPluginCommand; diff --git a/src/main/java/xiamomc/morph/commands/MorphPlayerCommand.java b/src/main/java/xyz/nifeather/morph/commands/MorphPlayerCommand.java similarity index 88% rename from src/main/java/xiamomc/morph/commands/MorphPlayerCommand.java rename to src/main/java/xyz/nifeather/morph/commands/MorphPlayerCommand.java index d63f9f29..3e9cf93f 100644 --- a/src/main/java/xiamomc/morph/commands/MorphPlayerCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/MorphPlayerCommand.java @@ -1,18 +1,18 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseTypes; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.IPluginCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseTypes; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/MorphPluginCommand.java b/src/main/java/xyz/nifeather/morph/commands/MorphPluginCommand.java similarity index 87% rename from src/main/java/xiamomc/morph/commands/MorphPluginCommand.java rename to src/main/java/xyz/nifeather/morph/commands/MorphPluginCommand.java index 92adccf3..0be6926a 100644 --- a/src/main/java/xiamomc/morph/commands/MorphPluginCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/MorphPluginCommand.java @@ -1,11 +1,11 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import it.unimi.dsi.fastutil.objects.ObjectList; -import xiamomc.morph.commands.subcommands.MorphSubCommandHandler; -import xiamomc.morph.commands.subcommands.plugin.*; -import xiamomc.morph.messages.HelpStrings; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.commands.subcommands.MorphSubCommandHandler; +import xyz.nifeather.morph.commands.subcommands.plugin.*; +import xyz.nifeather.morph.messages.HelpStrings; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/MorphTabCompleter.java b/src/main/java/xyz/nifeather/morph/commands/MorphTabCompleter.java similarity index 97% rename from src/main/java/xiamomc/morph/commands/MorphTabCompleter.java rename to src/main/java/xyz/nifeather/morph/commands/MorphTabCompleter.java index 2e10841a..b7cdcf94 100644 --- a/src/main/java/xiamomc/morph/commands/MorphTabCompleter.java +++ b/src/main/java/xyz/nifeather/morph/commands/MorphTabCompleter.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/xiamomc/morph/commands/RequestCommand.java b/src/main/java/xyz/nifeather/morph/commands/RequestCommand.java similarity index 73% rename from src/main/java/xiamomc/morph/commands/RequestCommand.java rename to src/main/java/xyz/nifeather/morph/commands/RequestCommand.java index 3e8fd883..49b17e7d 100644 --- a/src/main/java/xiamomc/morph/commands/RequestCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/RequestCommand.java @@ -1,13 +1,13 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import it.unimi.dsi.fastutil.objects.ObjectList; -import xiamomc.morph.commands.subcommands.MorphSubCommandHandler; -import xiamomc.morph.commands.subcommands.request.AcceptSubCommand; -import xiamomc.morph.commands.subcommands.request.DenySubCommand; -import xiamomc.morph.commands.subcommands.request.SendSubCommand; -import xiamomc.morph.messages.HelpStrings; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.commands.subcommands.MorphSubCommandHandler; +import xyz.nifeather.morph.commands.subcommands.request.AcceptSubCommand; +import xyz.nifeather.morph.commands.subcommands.request.DenySubCommand; +import xyz.nifeather.morph.commands.subcommands.request.SendSubCommand; +import xyz.nifeather.morph.messages.HelpStrings; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/UnMorphCommand.java b/src/main/java/xyz/nifeather/morph/commands/UnMorphCommand.java similarity index 81% rename from src/main/java/xiamomc/morph/commands/UnMorphCommand.java rename to src/main/java/xyz/nifeather/morph/commands/UnMorphCommand.java index 49cdc8c1..894245c4 100644 --- a/src/main/java/xiamomc/morph/commands/UnMorphCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/UnMorphCommand.java @@ -1,16 +1,16 @@ -package xiamomc.morph.commands; +package xyz.nifeather.morph.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.IPluginCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; public class UnMorphCommand extends MorphPluginObject implements IPluginCommand { diff --git a/src/main/java/xiamomc/morph/commands/subcommands/MorphSubCommandHandler.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/MorphSubCommandHandler.java similarity index 79% rename from src/main/java/xiamomc/morph/commands/subcommands/MorphSubCommandHandler.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/MorphSubCommandHandler.java index 9acb1613..36aa539e 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/MorphSubCommandHandler.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/MorphSubCommandHandler.java @@ -1,12 +1,12 @@ -package xiamomc.morph.commands.subcommands; +package xyz.nifeather.morph.commands.subcommands; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Command.SubCommandHandler; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.MessageUtils; public abstract class MorphSubCommandHandler extends SubCommandHandler { diff --git a/src/main/java/xiamomc/morph/commands/subcommands/SubCommandGenerator.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/SubCommandGenerator.java similarity index 96% rename from src/main/java/xiamomc/morph/commands/subcommands/SubCommandGenerator.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/SubCommandGenerator.java index 1ecc2de8..bc62c4f4 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/SubCommandGenerator.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/SubCommandGenerator.java @@ -1,11 +1,11 @@ -package xiamomc.morph.commands.subcommands; +package xyz.nifeather.morph.commands.subcommands; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; import java.util.function.BiFunction; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/BackendSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/BackendSubCommand.java similarity index 84% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/BackendSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/BackendSubCommand.java index c3218400..091f39dc 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/BackendSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/BackendSubCommand.java @@ -1,19 +1,19 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.messages.BackendStrings; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.messages.BackendStrings; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java similarity index 83% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java index cdd9f441..62f788d4 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java @@ -1,17 +1,17 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.UpdateStrings; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.updates.UpdateHandler; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.UpdateStrings; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.updates.UpdateHandler; public class CheckUpdateSubCommand extends MorphPluginObject implements ISubCommand { diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/DisguiseManageSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/DisguiseManageSubCommand.java similarity index 61% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/DisguiseManageSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/DisguiseManageSubCommand.java index 32965772..e4f7e6d4 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/DisguiseManageSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/DisguiseManageSubCommand.java @@ -1,16 +1,17 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import it.unimi.dsi.fastutil.objects.ObjectList; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.commands.subcommands.plugin.management.ForceMorphSubCommand; -import xiamomc.morph.commands.subcommands.plugin.management.ForceUnmorphSubCommand; -import xiamomc.morph.commands.subcommands.plugin.management.GrantDisguiseSubCommand; -import xiamomc.morph.commands.subcommands.plugin.management.RevokeDisguiseSubCommand; -import xiamomc.morph.messages.HelpStrings; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.commands.subcommands.plugin.management.ForceMorphSubCommand; +import xyz.nifeather.morph.commands.subcommands.plugin.management.ForceUnmorphSubCommand; +import xyz.nifeather.morph.commands.subcommands.plugin.management.GrantDisguiseSubCommand; +import xyz.nifeather.morph.commands.subcommands.plugin.management.RevokeDisguiseSubCommand; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; @@ -26,7 +27,7 @@ public class DisguiseManageSubCommand extends MorphPluginObject implements ISubC @Override public @Nullable String getPermissionRequirement() { - return "xiamomc.morph.manage"; + return CommonPermissions.MANAGE_DISGUISES; } @Override diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/HelpSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/HelpSubCommand.java similarity index 94% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/HelpSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/HelpSubCommand.java index cb4fd26d..d14d4022 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/HelpSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/HelpSubCommand.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; @@ -9,17 +9,17 @@ import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.commands.MorphCommandManager; -import xiamomc.morph.commands.subcommands.plugin.helpsections.Entry; -import xiamomc.morph.commands.subcommands.plugin.helpsections.Section; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Command.SubCommandHandler; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.commands.MorphCommandManager; +import xyz.nifeather.morph.commands.subcommands.plugin.helpsections.Entry; +import xyz.nifeather.morph.commands.subcommands.plugin.helpsections.Section; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/LookupSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/LookupSubCommand.java similarity index 86% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/LookupSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/LookupSubCommand.java index b47876e6..63c352bf 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/LookupSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/LookupSubCommand.java @@ -1,17 +1,17 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/MakeSkillItemSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/MakeSkillItemSubCommand.java similarity index 84% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/MakeSkillItemSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/MakeSkillItemSubCommand.java index a8e320f3..054f83b9 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/MakeSkillItemSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/MakeSkillItemSubCommand.java @@ -1,16 +1,16 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.utilities.ItemUtils; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.utilities.ItemUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/OptionSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/OptionSubCommand.java similarity index 96% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/OptionSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/OptionSubCommand.java index 43d41763..2575b28e 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/OptionSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/OptionSubCommand.java @@ -1,20 +1,20 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.commands.subcommands.SubCommandGenerator; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.InteractionMirrorProcessor; -import xiamomc.morph.messages.*; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.utilities.BindableUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Exceptions.NullDependencyException; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.commands.subcommands.SubCommandGenerator; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.InteractionMirrorProcessor; +import xyz.nifeather.morph.messages.*; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.utilities.BindableUtils; import java.util.List; import java.util.function.Function; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/QueryAllSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/QueryAllSubCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/QueryAllSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/QueryAllSubCommand.java index 9cfd76fa..1a1c6fe9 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/QueryAllSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/QueryAllSubCommand.java @@ -1,15 +1,16 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; public class QueryAllSubCommand extends MorphPluginObject implements ISubCommand { @@ -28,7 +29,7 @@ public FormattableMessage getHelpMessage() @Override public String getPermissionRequirement() { - return "xiamomc.morph.query"; + return CommonPermissions.QUERY_STATES; } @Resolved diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/QuerySubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/QuerySubCommand.java similarity index 87% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/QuerySubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/QuerySubCommand.java index d69b3042..8e92cf32 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/QuerySubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/QuerySubCommand.java @@ -1,18 +1,19 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; @@ -33,7 +34,7 @@ public FormattableMessage getHelpMessage() @Override public String getPermissionRequirement() { - return "xiamomc.morph.query"; + return CommonPermissions.QUERY_STATES; } @Override diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/ReloadSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/ReloadSubCommand.java similarity index 76% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/ReloadSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/ReloadSubCommand.java index 5258df58..43b051e7 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/ReloadSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/ReloadSubCommand.java @@ -1,32 +1,33 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import it.unimi.dsi.fastutil.objects.ObjectImmutableList; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.api.lifecycle.ConfigurationReloadEvent; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphMessageStore; -import xiamomc.morph.messages.vanilla.VanillaMessageStore; -import xiamomc.morph.misc.recipe.RecipeManager; -import xiamomc.morph.misc.skins.PlayerSkinProvider; -import xiamomc.morph.network.multiInstance.MultiInstanceService; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.storage.skill.SkillAbilityConfigurationStore; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; import xiamomc.pluginbase.Messages.MessageStore; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.api.lifecycle.ConfigurationReloadEvent; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphMessageStore; +import xyz.nifeather.morph.messages.vanilla.VanillaMessageStore; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.misc.recipe.RecipeManager; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; +import xyz.nifeather.morph.network.multiInstance.MultiInstanceService; +import xyz.nifeather.morph.storage.skill.SkillsConfigurationStoreNew; import java.util.List; public class ReloadSubCommand extends MorphPluginObject implements ISubCommand { @Override + @NotNull public String getCommandName() { return "reload"; @@ -36,7 +37,7 @@ public String getCommandName() @NotNull public String getPermissionRequirement() { - return "xiamomc.morph.reload"; + return CommonPermissions.DO_RELOAD; } @Override @@ -58,7 +59,7 @@ public FormattableMessage getHelpMessage() private VanillaMessageStore vanillaMessageStore; @Resolved - private SkillAbilityConfigurationStore skills; + private SkillsConfigurationStoreNew skills; @Resolved private MultiInstanceService multiInstanceService; @@ -77,9 +78,6 @@ public List onTabComplete(List args, CommandSender source) return null; } - @Resolved - private MorphClientHandler clientHandler; - @Override public boolean onCommand(@NotNull CommandSender sender, @NotNull String[] args) { @@ -101,7 +99,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull String[] args) if (reloadsData) { config.reload(); - skills.reloadConfiguration(); + skills.clearCache(); morphManager.reloadConfiguration(); PlayerSkinProvider.getInstance().reload(); diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/SkinCacheSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/SkinCacheSubCommand.java similarity index 95% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/SkinCacheSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/SkinCacheSubCommand.java index bfae411b..720ac9a6 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/SkinCacheSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/SkinCacheSubCommand.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import com.destroystokyo.paper.profile.CraftPlayerProfile; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -9,25 +9,25 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.commands.subcommands.plugin.skincache.cmdTree.CommandBuilder; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkinCacheStrings; -import xiamomc.morph.misc.CapeURL; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.MorphGameProfile; -import xiamomc.morph.misc.MorphParameters; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.misc.skins.PlayerSkinProvider; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.commands.subcommands.plugin.skincache.cmdTree.CommandBuilder; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkinCacheStrings; +import xyz.nifeather.morph.misc.CapeURL; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.MorphGameProfile; +import xyz.nifeather.morph.misc.MorphParameters; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/StatSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/StatSubCommand.java similarity index 88% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/StatSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/StatSubCommand.java index 3c9ed2c5..869a55f4 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/StatSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/StatSubCommand.java @@ -1,19 +1,20 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.abilities.AbilityManager; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.StatStrings; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.skills.MorphSkillHandler; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.abilities.AbilityManager; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.StatStrings; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.skills.MorphSkillHandler; public class StatSubCommand extends MorphPluginObject implements ISubCommand { @@ -125,6 +126,6 @@ private FormattableMessage getFormattable(String str) @Override public String getPermissionRequirement() { - return "xiamomc.morph.stat"; + return CommonPermissions.CHECK_STAT; } } diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/ToggleSelfSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/ToggleSelfSubCommand.java similarity index 81% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/ToggleSelfSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/ToggleSelfSubCommand.java index 2da0cc4a..55a6aa22 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/ToggleSelfSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/ToggleSelfSubCommand.java @@ -1,15 +1,15 @@ -package xiamomc.morph.commands.subcommands.plugin; +package xyz.nifeather.morph.commands.subcommands.plugin; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.messages.HelpStrings; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.messages.HelpStrings; public class ToggleSelfSubCommand extends MorphPluginObject implements ISubCommand { diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/helpsections/Entry.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/helpsections/Entry.java similarity index 79% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/helpsections/Entry.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/helpsections/Entry.java index 7ae5e899..2d5ca65f 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/helpsections/Entry.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/helpsections/Entry.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin.helpsections; +package xyz.nifeather.morph.commands.subcommands.plugin.helpsections; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/helpsections/Section.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/helpsections/Section.java similarity index 93% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/helpsections/Section.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/helpsections/Section.java index f2bc29e1..3c260520 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/helpsections/Section.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/helpsections/Section.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin.helpsections; +package xyz.nifeather.morph.commands.subcommands.plugin.helpsections; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java similarity index 84% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java index 99752ab5..e93c17a4 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java @@ -1,19 +1,20 @@ -package xiamomc.morph.commands.subcommands.plugin.management; +package xyz.nifeather.morph.commands.subcommands.plugin.management; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.MorphParameters; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.MorphParameters; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; @@ -28,7 +29,7 @@ public class ForceMorphSubCommand extends MorphPluginObject implements ISubComma @Override public @Nullable String getPermissionRequirement() { - return "xiamomc.morph.manage.morph"; + return CommonPermissions.MANAGE_MORPH_DISGUISE; } @Resolved diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceUnmorphSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/ForceUnmorphSubCommand.java similarity index 82% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceUnmorphSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/ForceUnmorphSubCommand.java index 0de6f3cf..cdbb9fc8 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceUnmorphSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/ForceUnmorphSubCommand.java @@ -1,19 +1,20 @@ -package xiamomc.morph.commands.subcommands.plugin.management; +package xyz.nifeather.morph.commands.subcommands.plugin.management; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; import java.util.Objects; @@ -29,7 +30,7 @@ public class ForceUnmorphSubCommand extends MorphPluginObject implements ISubCom @Override public @Nullable String getPermissionRequirement() { - return "xiamomc.morph.manage.unmorph"; + return CommonPermissions.MANAGE_UNMORPH_DISGUISE; } @Resolved diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java similarity index 91% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java index 2212ef3f..3b9abf90 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin.management; +package xyz.nifeather.morph.commands.subcommands.plugin.management; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; @@ -7,13 +7,14 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.*; -import xiamomc.morph.misc.DisguiseTypes; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.*; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; @@ -34,7 +35,7 @@ public FormattableMessage getHelpMessage() @Override public @Nullable String getPermissionRequirement() { - return "xiamomc.morph.manage.grant"; + return CommonPermissions.MANAGE_GRANT_DISGUISE; } @Override diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/RevokeDisguiseSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/RevokeDisguiseSubCommand.java similarity index 86% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/management/RevokeDisguiseSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/RevokeDisguiseSubCommand.java index 3b86dcdd..9aad5c6f 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/RevokeDisguiseSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/management/RevokeDisguiseSubCommand.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin.management; +package xyz.nifeather.morph.commands.subcommands.plugin.management; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; @@ -6,15 +6,16 @@ import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.util.List; @@ -35,7 +36,7 @@ public FormattableMessage getHelpMessage() @Override public @Nullable String getPermissionRequirement() { - return "xiamomc.morph.manage.revoke"; + return CommonPermissions.MANAGE_REVOKE_DISGUISE; } @Override diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/skincache/cmdTree/CommandBuilder.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/skincache/cmdTree/CommandBuilder.java similarity index 67% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/skincache/cmdTree/CommandBuilder.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/skincache/cmdTree/CommandBuilder.java index 7ee59441..0965052b 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/skincache/cmdTree/CommandBuilder.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/skincache/cmdTree/CommandBuilder.java @@ -1,4 +1,4 @@ -package xiamomc.morph.commands.subcommands.plugin.skincache.cmdTree; +package xyz.nifeather.morph.commands.subcommands.plugin.skincache.cmdTree; public class CommandBuilder { diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/skincache/cmdTree/TreeCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/skincache/cmdTree/TreeCommand.java similarity index 97% rename from src/main/java/xiamomc/morph/commands/subcommands/plugin/skincache/cmdTree/TreeCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/skincache/cmdTree/TreeCommand.java index 4e4223b7..f06e51fe 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/skincache/cmdTree/TreeCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/plugin/skincache/cmdTree/TreeCommand.java @@ -1,13 +1,13 @@ -package xiamomc.morph.commands.subcommands.plugin.skincache.cmdTree; +package xyz.nifeather.morph.commands.subcommands.plugin.skincache.cmdTree; import com.google.common.collect.ImmutableList; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPlugin; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/request/AcceptSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/request/AcceptSubCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/commands/subcommands/request/AcceptSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/request/AcceptSubCommand.java index 62a1445b..9a217f51 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/request/AcceptSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/request/AcceptSubCommand.java @@ -1,18 +1,18 @@ -package xiamomc.morph.commands.subcommands.request; +package xyz.nifeather.morph.commands.subcommands.request; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.interfaces.IManageRequests; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.interfaces.IManageRequests; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/request/DenySubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/request/DenySubCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/commands/subcommands/request/DenySubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/request/DenySubCommand.java index 4990f703..718c0f92 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/request/DenySubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/request/DenySubCommand.java @@ -1,18 +1,18 @@ -package xiamomc.morph.commands.subcommands.request; +package xyz.nifeather.morph.commands.subcommands.request; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.interfaces.IManageRequests; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.interfaces.IManageRequests; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/request/SendSubCommand.java b/src/main/java/xyz/nifeather/morph/commands/subcommands/request/SendSubCommand.java similarity index 86% rename from src/main/java/xiamomc/morph/commands/subcommands/request/SendSubCommand.java rename to src/main/java/xyz/nifeather/morph/commands/subcommands/request/SendSubCommand.java index ef91f9fd..f6c95a05 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/request/SendSubCommand.java +++ b/src/main/java/xyz/nifeather/morph/commands/subcommands/request/SendSubCommand.java @@ -1,20 +1,20 @@ -package xiamomc.morph.commands.subcommands.request; +package xyz.nifeather.morph.commands.subcommands.request; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.interfaces.IManageRequests; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.HelpStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.RequestStrings; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.interfaces.IManageRequests; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.HelpStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.RequestStrings; import java.util.List; diff --git a/src/main/java/xiamomc/morph/config/ConfigOption.java b/src/main/java/xyz/nifeather/morph/config/ConfigOption.java similarity index 98% rename from src/main/java/xiamomc/morph/config/ConfigOption.java rename to src/main/java/xyz/nifeather/morph/config/ConfigOption.java index 43778af6..8c486fa1 100644 --- a/src/main/java/xiamomc/morph/config/ConfigOption.java +++ b/src/main/java/xyz/nifeather/morph/config/ConfigOption.java @@ -1,13 +1,12 @@ -package xiamomc.morph.config; +package xyz.nifeather.morph.config; import org.apache.commons.lang3.RandomStringUtils; -import xiamomc.morph.MorphManager; -import xiamomc.morph.events.InteractionMirrorProcessor; -import xiamomc.morph.utilities.NbtUtils; import xiamomc.pluginbase.Configuration.ConfigNode; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.events.InteractionMirrorProcessor; +import xyz.nifeather.morph.utilities.NbtUtils; import java.util.ArrayList; -import java.util.HashMap; public enum ConfigOption { diff --git a/src/main/java/xiamomc/morph/config/MorphConfigManager.java b/src/main/java/xyz/nifeather/morph/config/MorphConfigManager.java similarity index 98% rename from src/main/java/xiamomc/morph/config/MorphConfigManager.java rename to src/main/java/xyz/nifeather/morph/config/MorphConfigManager.java index ef08aecd..fc93ef8a 100644 --- a/src/main/java/xiamomc/morph/config/MorphConfigManager.java +++ b/src/main/java/xyz/nifeather/morph/config/MorphConfigManager.java @@ -1,4 +1,4 @@ -package xiamomc.morph.config; +package xyz.nifeather.morph.config; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.bukkit.Bukkit; @@ -7,15 +7,15 @@ import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.messages.CommonStrings; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Bindables.BindableList; import xiamomc.pluginbase.Configuration.ConfigNode; import xiamomc.pluginbase.Configuration.PluginConfigManager; import xiamomc.pluginbase.Managers.DependencyManager; import xiamomc.pluginbase.Messages.MessageStore; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.messages.CommonStrings; +import xyz.nifeather.morph.messages.MessageUtils; import java.util.*; diff --git a/src/main/java/xiamomc/morph/events/CommonEventProcessor.java b/src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java similarity index 93% rename from src/main/java/xiamomc/morph/events/CommonEventProcessor.java rename to src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java index c592ad69..ae71d1e1 100644 --- a/src/main/java/xiamomc/morph/events/CommonEventProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/CommonEventProcessor.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import com.destroystokyo.paper.event.player.PlayerClientOptionsChangeEvent; import com.destroystokyo.paper.event.player.PlayerPostRespawnEvent; @@ -15,39 +15,40 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.entity.*; import org.bukkit.event.player.*; -import org.bukkit.inventory.*; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.RevealingHandler; -import xiamomc.morph.abilities.impl.AttributeModifyingAbility; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.api.gameplay.PlayerJoinedWithDisguiseEvent; -import xiamomc.morph.messages.HintStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.messages.vanilla.VanillaMessageStore; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.OfflineDisguiseResult; -import xiamomc.morph.misc.gui.AnimSelectScreenWrapper; -import xiamomc.morph.misc.gui.DisguiseSelectScreenWrapper; -import xiamomc.morph.misc.playerList.PlayerListHandler; -import xiamomc.morph.misc.permissions.CommonPermissions; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.InventoryHolder; import xiamomc.morph.network.commands.S2C.S2CSwapCommand; import xiamomc.morph.network.commands.S2C.map.S2CMapRemoveCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.network.server.ServerSetEquipCommand; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.utilities.EntityTypeUtils; -import xiamomc.morph.utilities.ItemUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.RevealingHandler; +import xyz.nifeather.morph.abilities.impl.AttributeModifyingAbility; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.api.gameplay.PlayerJoinedWithDisguiseEvent; +import xyz.nifeather.morph.messages.HintStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.messages.vanilla.VanillaMessageStore; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.OfflineDisguiseResult; +import xyz.nifeather.morph.misc.gui.AnimSelectScreenWrapper; +import xyz.nifeather.morph.misc.gui.DisguiseSelectScreenWrapper; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.misc.playerList.PlayerListHandler; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.network.server.ServerSetEquipCommand; +import xyz.nifeather.morph.skills.MorphSkillHandler; +import xyz.nifeather.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.utilities.ItemUtils; import java.util.List; import java.util.Random; -import static xiamomc.morph.utilities.DisguiseUtils.itemOrAir; +import static xyz.nifeather.morph.utilities.DisguiseUtils.itemOrAir; public class CommonEventProcessor extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/events/DisguiseAnimationProcessor.java b/src/main/java/xyz/nifeather/morph/events/DisguiseAnimationProcessor.java similarity index 90% rename from src/main/java/xiamomc/morph/events/DisguiseAnimationProcessor.java rename to src/main/java/xyz/nifeather/morph/events/DisguiseAnimationProcessor.java index be2e2dbd..05977456 100644 --- a/src/main/java/xiamomc/morph/events/DisguiseAnimationProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/DisguiseAnimationProcessor.java @@ -1,12 +1,12 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; public class DisguiseAnimationProcessor extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/events/EntityProcessor.java b/src/main/java/xyz/nifeather/morph/events/EntityProcessor.java similarity index 97% rename from src/main/java/xiamomc/morph/events/EntityProcessor.java rename to src/main/java/xyz/nifeather/morph/events/EntityProcessor.java index b0d6d39d..e9dd8758 100644 --- a/src/main/java/xiamomc/morph/events/EntityProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/EntityProcessor.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import com.destroystokyo.paper.event.entity.EntityAddToWorldEvent; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -24,19 +24,18 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityTargetEvent; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.utilities.EntityTypeUtils; -import xiamomc.morph.utilities.ReflectionUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.utilities.ReflectionUtils; import java.util.function.Predicate; diff --git a/src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java b/src/main/java/xyz/nifeather/morph/events/ForcedDisguiseProcessor.java similarity index 87% rename from src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java rename to src/main/java/xyz/nifeather/morph/events/ForcedDisguiseProcessor.java index ccf239af..02e97d39 100644 --- a/src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/ForcedDisguiseProcessor.java @@ -1,20 +1,20 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.api.gameplay.PlayerMorphEarlyEvent; -import xiamomc.morph.events.api.gameplay.PlayerUnMorphEarlyEvent; -import xiamomc.morph.misc.MorphParameters; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.api.gameplay.PlayerMorphEarlyEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerUnMorphEarlyEvent; +import xyz.nifeather.morph.misc.MorphParameters; public class ForcedDisguiseProcessor extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java b/src/main/java/xyz/nifeather/morph/events/InteractionMirrorProcessor.java similarity index 96% rename from src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java rename to src/main/java/xyz/nifeather/morph/events/InteractionMirrorProcessor.java index f3ed16c8..92737503 100644 --- a/src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/InteractionMirrorProcessor.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import ca.spottedleaf.moonrise.common.util.TickThread; import io.papermc.paper.event.player.PlayerArmSwingEvent; @@ -17,28 +17,28 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.api.gameplay.PlayerJoinedWithDisguiseEvent; -import xiamomc.morph.events.api.gameplay.PlayerMorphEvent; -import xiamomc.morph.events.api.gameplay.PlayerUnMorphEvent; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.PlayerOperationSimulator; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.morph.network.commands.S2C.set.S2CSetSneakingCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.storage.DirectoryStorage; -import xiamomc.morph.storage.mirrorlogging.MirrorSingleEntry; -import xiamomc.morph.storage.mirrorlogging.OperationType; -import xiamomc.morph.utilities.DisguiseUtils; -import xiamomc.morph.utilities.ItemUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.api.gameplay.PlayerJoinedWithDisguiseEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerMorphEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerUnMorphEvent; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.misc.PlayerOperationSimulator; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.storage.DirectoryStorage; +import xyz.nifeather.morph.storage.mirrorlogging.MirrorSingleEntry; +import xyz.nifeather.morph.storage.mirrorlogging.OperationType; +import xyz.nifeather.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.utilities.ItemUtils; import java.io.File; import java.io.FileOutputStream; diff --git a/src/main/java/xiamomc/morph/events/PlayerSkinProcessor.java b/src/main/java/xyz/nifeather/morph/events/PlayerSkinProcessor.java similarity index 77% rename from src/main/java/xiamomc/morph/events/PlayerSkinProcessor.java rename to src/main/java/xyz/nifeather/morph/events/PlayerSkinProcessor.java index d9afac1a..755e23de 100644 --- a/src/main/java/xiamomc/morph/events/PlayerSkinProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/PlayerSkinProcessor.java @@ -1,10 +1,10 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.misc.skins.PlayerSkinProvider; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; public class PlayerSkinProcessor extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/events/PlayerTracker.java b/src/main/java/xyz/nifeather/morph/events/PlayerTracker.java similarity index 99% rename from src/main/java/xiamomc/morph/events/PlayerTracker.java rename to src/main/java/xyz/nifeather/morph/events/PlayerTracker.java index d485a9d2..030b39ba 100644 --- a/src/main/java/xiamomc/morph/events/PlayerTracker.java +++ b/src/main/java/xyz/nifeather/morph/events/PlayerTracker.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import com.destroystokyo.paper.event.player.PlayerStartSpectatingEntityEvent; import com.destroystokyo.paper.event.player.PlayerStopSpectatingEntityEvent; @@ -15,8 +15,8 @@ import org.bukkit.event.player.*; import org.bukkit.inventory.EquipmentSlot; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphPluginObject; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/events/PluginEventListener.java b/src/main/java/xyz/nifeather/morph/events/PluginEventListener.java similarity index 92% rename from src/main/java/xiamomc/morph/events/PluginEventListener.java rename to src/main/java/xyz/nifeather/morph/events/PluginEventListener.java index 7715277c..8b27470f 100644 --- a/src/main/java/xiamomc/morph/events/PluginEventListener.java +++ b/src/main/java/xyz/nifeather/morph/events/PluginEventListener.java @@ -1,11 +1,11 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; -import xiamomc.morph.MorphPluginObject; +import xyz.nifeather.morph.MorphPluginObject; import java.util.List; import java.util.function.Consumer; diff --git a/src/main/java/xiamomc/morph/events/RevealingEventProcessor.java b/src/main/java/xyz/nifeather/morph/events/RevealingEventProcessor.java similarity index 92% rename from src/main/java/xiamomc/morph/events/RevealingEventProcessor.java rename to src/main/java/xyz/nifeather/morph/events/RevealingEventProcessor.java index 41a55ac0..d0795fdf 100644 --- a/src/main/java/xiamomc/morph/events/RevealingEventProcessor.java +++ b/src/main/java/xyz/nifeather/morph/events/RevealingEventProcessor.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events; +package xyz.nifeather.morph.events; import org.bukkit.craftbukkit.entity.CraftMob; import org.bukkit.entity.Player; @@ -12,17 +12,17 @@ import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.RevealingHandler; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.events.api.gameplay.PlayerMorphEvent; -import xiamomc.morph.events.api.gameplay.PlayerUnMorphEvent; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.NmsRecord; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.RevealingHandler; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.events.api.gameplay.PlayerMorphEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerUnMorphEvent; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.NmsRecord; public class RevealingEventProcessor extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerDisguisedFromOfflineStateEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerDisguisedFromOfflineStateEvent.java similarity index 90% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerDisguisedFromOfflineStateEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerDisguisedFromOfflineStateEvent.java index 92de6860..5f96dbf1 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerDisguisedFromOfflineStateEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerDisguisedFromOfflineStateEvent.java @@ -1,10 +1,10 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; public class PlayerDisguisedFromOfflineStateEvent extends PlayerEvent { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerExecuteSkillEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerExecuteSkillEvent.java similarity index 93% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerExecuteSkillEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerExecuteSkillEvent.java index 58280439..d1968388 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerExecuteSkillEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerExecuteSkillEvent.java @@ -1,11 +1,11 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; public class PlayerExecuteSkillEvent extends PlayerEvent implements Cancellable { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerJoinedWithDisguiseEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerJoinedWithDisguiseEvent.java similarity index 90% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerJoinedWithDisguiseEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerJoinedWithDisguiseEvent.java index 2e8ce483..b1c74664 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerJoinedWithDisguiseEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerJoinedWithDisguiseEvent.java @@ -1,10 +1,10 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; public class PlayerJoinedWithDisguiseEvent extends PlayerEvent { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerMorphEarlyEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerMorphEarlyEvent.java similarity index 95% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerMorphEarlyEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerMorphEarlyEvent.java index eab35f73..8b186f46 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerMorphEarlyEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerMorphEarlyEvent.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; @@ -6,7 +6,7 @@ import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; public class PlayerMorphEarlyEvent extends PlayerEvent implements Cancellable { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerMorphEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerMorphEvent.java similarity index 89% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerMorphEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerMorphEvent.java index 04d737bd..805e63e3 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerMorphEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerMorphEvent.java @@ -1,10 +1,10 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; public class PlayerMorphEvent extends PlayerEvent { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerUnMorphEarlyEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerUnMorphEarlyEvent.java similarity index 95% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerUnMorphEarlyEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerUnMorphEarlyEvent.java index 2618119c..6f14e6a5 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerUnMorphEarlyEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerUnMorphEarlyEvent.java @@ -1,11 +1,11 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; public class PlayerUnMorphEarlyEvent extends PlayerEvent implements Cancellable { diff --git a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerUnMorphEvent.java b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerUnMorphEvent.java similarity index 92% rename from src/main/java/xiamomc/morph/events/api/gameplay/PlayerUnMorphEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerUnMorphEvent.java index 985c5960..691e0e12 100644 --- a/src/main/java/xiamomc/morph/events/api/gameplay/PlayerUnMorphEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/gameplay/PlayerUnMorphEvent.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events.api.gameplay; +package xyz.nifeather.morph.events.api.gameplay; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; diff --git a/src/main/java/xiamomc/morph/events/api/lifecycle/AbilitiesFinishedInitializeEvent.java b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/AbilitiesFinishedInitializeEvent.java similarity index 84% rename from src/main/java/xiamomc/morph/events/api/lifecycle/AbilitiesFinishedInitializeEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/lifecycle/AbilitiesFinishedInitializeEvent.java index e0e59139..54fef01f 100644 --- a/src/main/java/xiamomc/morph/events/api/lifecycle/AbilitiesFinishedInitializeEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/AbilitiesFinishedInitializeEvent.java @@ -1,9 +1,9 @@ -package xiamomc.morph.events.api.lifecycle; +package xyz.nifeather.morph.events.api.lifecycle; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.abilities.AbilityManager; +import xyz.nifeather.morph.abilities.AbilityManager; public class AbilitiesFinishedInitializeEvent extends Event { diff --git a/src/main/java/xiamomc/morph/events/api/lifecycle/ConfigurationReloadEvent.java b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/ConfigurationReloadEvent.java similarity index 93% rename from src/main/java/xiamomc/morph/events/api/lifecycle/ConfigurationReloadEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/lifecycle/ConfigurationReloadEvent.java index 3a0751ce..adfdef60 100644 --- a/src/main/java/xiamomc/morph/events/api/lifecycle/ConfigurationReloadEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/ConfigurationReloadEvent.java @@ -1,4 +1,4 @@ -package xiamomc.morph.events.api.lifecycle; +package xyz.nifeather.morph.events.api.lifecycle; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; diff --git a/src/main/java/xiamomc/morph/events/api/lifecycle/ManagerFinishedInitializeEvent.java b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/ManagerFinishedInitializeEvent.java similarity index 86% rename from src/main/java/xiamomc/morph/events/api/lifecycle/ManagerFinishedInitializeEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/lifecycle/ManagerFinishedInitializeEvent.java index aeafc31e..65be2d8c 100644 --- a/src/main/java/xiamomc/morph/events/api/lifecycle/ManagerFinishedInitializeEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/ManagerFinishedInitializeEvent.java @@ -1,9 +1,9 @@ -package xiamomc.morph.events.api.lifecycle; +package xyz.nifeather.morph.events.api.lifecycle; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; +import xyz.nifeather.morph.MorphManager; public class ManagerFinishedInitializeEvent extends Event { diff --git a/src/main/java/xiamomc/morph/events/api/lifecycle/SkillsFinishedInitializeEvent.java b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/SkillsFinishedInitializeEvent.java similarity index 84% rename from src/main/java/xiamomc/morph/events/api/lifecycle/SkillsFinishedInitializeEvent.java rename to src/main/java/xyz/nifeather/morph/events/api/lifecycle/SkillsFinishedInitializeEvent.java index d2a5595e..eb32e077 100644 --- a/src/main/java/xiamomc/morph/events/api/lifecycle/SkillsFinishedInitializeEvent.java +++ b/src/main/java/xyz/nifeather/morph/events/api/lifecycle/SkillsFinishedInitializeEvent.java @@ -1,9 +1,9 @@ -package xiamomc.morph.events.api.lifecycle; +package xyz.nifeather.morph.events.api.lifecycle; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.skills.MorphSkillHandler; +import xyz.nifeather.morph.skills.MorphSkillHandler; public class SkillsFinishedInitializeEvent extends Event { diff --git a/src/main/java/xiamomc/morph/interfaces/IManageOfflineStates.java b/src/main/java/xyz/nifeather/morph/interfaces/IManageOfflineStates.java similarity index 63% rename from src/main/java/xiamomc/morph/interfaces/IManageOfflineStates.java rename to src/main/java/xyz/nifeather/morph/interfaces/IManageOfflineStates.java index 2e8a7030..a83d5ef5 100644 --- a/src/main/java/xiamomc/morph/interfaces/IManageOfflineStates.java +++ b/src/main/java/xyz/nifeather/morph/interfaces/IManageOfflineStates.java @@ -1,7 +1,7 @@ -package xiamomc.morph.interfaces; +package xyz.nifeather.morph.interfaces; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.storage.offlinestore.OfflineDisguiseState; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.storage.offlinestore.OfflineDisguiseState; import java.util.List; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/interfaces/IManagePlayerData.java b/src/main/java/xyz/nifeather/morph/interfaces/IManagePlayerData.java similarity index 91% rename from src/main/java/xiamomc/morph/interfaces/IManagePlayerData.java rename to src/main/java/xyz/nifeather/morph/interfaces/IManagePlayerData.java index df5763af..87570343 100644 --- a/src/main/java/xiamomc/morph/interfaces/IManagePlayerData.java +++ b/src/main/java/xyz/nifeather/morph/interfaces/IManagePlayerData.java @@ -1,11 +1,11 @@ -package xiamomc.morph.interfaces; +package xyz.nifeather.morph.interfaces; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.storage.playerdata.PlayerMeta; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.storage.playerdata.PlayerMeta; public interface IManagePlayerData { diff --git a/src/main/java/xiamomc/morph/interfaces/IManageRequests.java b/src/main/java/xyz/nifeather/morph/interfaces/IManageRequests.java similarity index 90% rename from src/main/java/xiamomc/morph/interfaces/IManageRequests.java rename to src/main/java/xyz/nifeather/morph/interfaces/IManageRequests.java index c1f2191e..5ea58a47 100644 --- a/src/main/java/xiamomc/morph/interfaces/IManageRequests.java +++ b/src/main/java/xyz/nifeather/morph/interfaces/IManageRequests.java @@ -1,7 +1,7 @@ -package xiamomc.morph.interfaces; +package xyz.nifeather.morph.interfaces; import org.bukkit.entity.Player; -import xiamomc.morph.misc.RequestInfo; +import xyz.nifeather.morph.misc.RequestInfo; import java.util.List; diff --git a/src/main/java/xiamomc/morph/messages/AbstractMorphStrings.java b/src/main/java/xyz/nifeather/morph/messages/AbstractMorphStrings.java similarity index 84% rename from src/main/java/xiamomc/morph/messages/AbstractMorphStrings.java rename to src/main/java/xyz/nifeather/morph/messages/AbstractMorphStrings.java index b23f0875..bcbe7e5d 100644 --- a/src/main/java/xiamomc/morph/messages/AbstractMorphStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/AbstractMorphStrings.java @@ -1,6 +1,6 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import xiamomc.pluginbase.Messages.FormattableMessage; import xiamomc.pluginbase.Messages.IStrings; diff --git a/src/main/java/xiamomc/morph/messages/BackendStrings.java b/src/main/java/xyz/nifeather/morph/messages/BackendStrings.java similarity index 96% rename from src/main/java/xiamomc/morph/messages/BackendStrings.java rename to src/main/java/xyz/nifeather/morph/messages/BackendStrings.java index ae7b8dde..bb97f275 100644 --- a/src/main/java/xiamomc/morph/messages/BackendStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/BackendStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/CapeStrings.java b/src/main/java/xyz/nifeather/morph/messages/CapeStrings.java similarity index 98% rename from src/main/java/xiamomc/morph/messages/CapeStrings.java rename to src/main/java/xyz/nifeather/morph/messages/CapeStrings.java index 3b3eb991..fc3f0cfb 100644 --- a/src/main/java/xiamomc/morph/messages/CapeStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/CapeStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/CommandNameStrings.java b/src/main/java/xyz/nifeather/morph/messages/CommandNameStrings.java similarity index 97% rename from src/main/java/xiamomc/morph/messages/CommandNameStrings.java rename to src/main/java/xyz/nifeather/morph/messages/CommandNameStrings.java index 7882d6e2..50f06bc1 100644 --- a/src/main/java/xiamomc/morph/messages/CommandNameStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/CommandNameStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/CommandStrings.java b/src/main/java/xyz/nifeather/morph/messages/CommandStrings.java similarity index 99% rename from src/main/java/xiamomc/morph/messages/CommandStrings.java rename to src/main/java/xyz/nifeather/morph/messages/CommandStrings.java index d178608b..21053be0 100644 --- a/src/main/java/xiamomc/morph/messages/CommandStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/CommandStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/CommonStrings.java b/src/main/java/xyz/nifeather/morph/messages/CommonStrings.java similarity index 96% rename from src/main/java/xiamomc/morph/messages/CommonStrings.java rename to src/main/java/xyz/nifeather/morph/messages/CommonStrings.java index 5e4cd6e5..e27d7fb4 100644 --- a/src/main/java/xiamomc/morph/messages/CommonStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/CommonStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/EmoteStrings.java b/src/main/java/xyz/nifeather/morph/messages/EmoteStrings.java similarity index 82% rename from src/main/java/xiamomc/morph/messages/EmoteStrings.java rename to src/main/java/xyz/nifeather/morph/messages/EmoteStrings.java index 152977c9..f0795583 100644 --- a/src/main/java/xiamomc/morph/messages/EmoteStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/EmoteStrings.java @@ -1,9 +1,9 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; -import xiamomc.morph.MorphPlugin; +import org.jetbrains.annotations.NotNull; +import xyz.nifeather.morph.MorphPlugin; import xiamomc.pluginbase.Messages.FormattableMessage; -import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -13,6 +13,10 @@ public static FormattableMessage notAvailable() { return getFormattable(getKey("not_available"), "当前不能使用动作"); } + public static FormattableMessage none() + { + return getFormattable(getKey("none"), "[Fallback] 无"); + } private static final Map map = new ConcurrentHashMap<>(); @@ -29,7 +33,7 @@ public static FormattableMessage Unknown() return getFormattable("unknown", "animation:unknown"); } - public static FormattableMessage get(String animationId) + public static FormattableMessage get(@NotNull String animationId) { var value = map.getOrDefault(animationId, Unknown()); diff --git a/src/main/java/xiamomc/morph/messages/GuiStrings.java b/src/main/java/xyz/nifeather/morph/messages/GuiStrings.java similarity index 96% rename from src/main/java/xiamomc/morph/messages/GuiStrings.java rename to src/main/java/xyz/nifeather/morph/messages/GuiStrings.java index 629078a2..d5e68bca 100644 --- a/src/main/java/xiamomc/morph/messages/GuiStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/GuiStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/HelpStrings.java b/src/main/java/xyz/nifeather/morph/messages/HelpStrings.java similarity index 99% rename from src/main/java/xiamomc/morph/messages/HelpStrings.java rename to src/main/java/xyz/nifeather/morph/messages/HelpStrings.java index dfa38be1..eef4a1d9 100644 --- a/src/main/java/xiamomc/morph/messages/HelpStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/HelpStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/HintStrings.java b/src/main/java/xyz/nifeather/morph/messages/HintStrings.java similarity index 97% rename from src/main/java/xiamomc/morph/messages/HintStrings.java rename to src/main/java/xyz/nifeather/morph/messages/HintStrings.java index 725ab32a..84e5c52a 100644 --- a/src/main/java/xiamomc/morph/messages/HintStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/HintStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/MessageUtils.java b/src/main/java/xyz/nifeather/morph/messages/MessageUtils.java similarity index 86% rename from src/main/java/xiamomc/morph/messages/MessageUtils.java rename to src/main/java/xyz/nifeather/morph/messages/MessageUtils.java index 1aba85e0..f40a9ce4 100644 --- a/src/main/java/xiamomc/morph/messages/MessageUtils.java +++ b/src/main/java/xyz/nifeather/morph/messages/MessageUtils.java @@ -1,15 +1,16 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.minimessage.MiniMessage; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.NmsRecord; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Managers.DependencyManager; import xiamomc.pluginbase.Messages.FormattableMessage; @@ -129,4 +130,12 @@ public static String getLocale(CommandSender sender) else return getServerLocale(); } + + public static String asParsedMiniMessageString(String locale, FormattableMessage formattable) + { + if (formattable.getLocale() == null) + formattable.withLocale(locale); + + return MiniMessage.miniMessage().serialize(formattable.toComponent()); + } } diff --git a/src/main/java/xiamomc/morph/messages/MorphMessageStore.java b/src/main/java/xyz/nifeather/morph/messages/MorphMessageStore.java similarity index 96% rename from src/main/java/xiamomc/morph/messages/MorphMessageStore.java rename to src/main/java/xyz/nifeather/morph/messages/MorphMessageStore.java index 827d2dcb..f3406d2d 100644 --- a/src/main/java/xiamomc/morph/messages/MorphMessageStore.java +++ b/src/main/java/xyz/nifeather/morph/messages/MorphMessageStore.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -6,9 +6,9 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Messages.IStrings; diff --git a/src/main/java/xiamomc/morph/messages/MorphMessageSubStore.java b/src/main/java/xyz/nifeather/morph/messages/MorphMessageSubStore.java similarity index 94% rename from src/main/java/xiamomc/morph/messages/MorphMessageSubStore.java rename to src/main/java/xyz/nifeather/morph/messages/MorphMessageSubStore.java index 0260ce8f..1aebcf4d 100644 --- a/src/main/java/xiamomc/morph/messages/MorphMessageSubStore.java +++ b/src/main/java/xyz/nifeather/morph/messages/MorphMessageSubStore.java @@ -1,8 +1,8 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.utilities.PluginAssetUtils; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.utilities.PluginAssetUtils; import xiamomc.pluginbase.Messages.IStrings; import xiamomc.pluginbase.Messages.MessageStore; diff --git a/src/main/java/xiamomc/morph/messages/MorphStrings.java b/src/main/java/xyz/nifeather/morph/messages/MorphStrings.java similarity index 99% rename from src/main/java/xiamomc/morph/messages/MorphStrings.java rename to src/main/java/xyz/nifeather/morph/messages/MorphStrings.java index b5aab642..c33ede89 100644 --- a/src/main/java/xiamomc/morph/messages/MorphStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/MorphStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/RequestStrings.java b/src/main/java/xyz/nifeather/morph/messages/RequestStrings.java similarity index 98% rename from src/main/java/xiamomc/morph/messages/RequestStrings.java rename to src/main/java/xyz/nifeather/morph/messages/RequestStrings.java index 467ddb0a..60d03984 100644 --- a/src/main/java/xiamomc/morph/messages/RequestStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/RequestStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/SkillStrings.java b/src/main/java/xyz/nifeather/morph/messages/SkillStrings.java similarity index 98% rename from src/main/java/xiamomc/morph/messages/SkillStrings.java rename to src/main/java/xyz/nifeather/morph/messages/SkillStrings.java index 6b0412af..eb22a4c3 100644 --- a/src/main/java/xiamomc/morph/messages/SkillStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/SkillStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/SkinCacheStrings.java b/src/main/java/xyz/nifeather/morph/messages/SkinCacheStrings.java similarity index 98% rename from src/main/java/xiamomc/morph/messages/SkinCacheStrings.java rename to src/main/java/xyz/nifeather/morph/messages/SkinCacheStrings.java index bb948833..108589ee 100644 --- a/src/main/java/xiamomc/morph/messages/SkinCacheStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/SkinCacheStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/StatStrings.java b/src/main/java/xyz/nifeather/morph/messages/StatStrings.java similarity index 98% rename from src/main/java/xiamomc/morph/messages/StatStrings.java rename to src/main/java/xyz/nifeather/morph/messages/StatStrings.java index 4b1e395a..f5111cdb 100644 --- a/src/main/java/xiamomc/morph/messages/StatStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/StatStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/TypesString.java b/src/main/java/xyz/nifeather/morph/messages/TypesString.java similarity index 94% rename from src/main/java/xiamomc/morph/messages/TypesString.java rename to src/main/java/xyz/nifeather/morph/messages/TypesString.java index d2f05a29..cd204162 100644 --- a/src/main/java/xiamomc/morph/messages/TypesString.java +++ b/src/main/java/xyz/nifeather/morph/messages/TypesString.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/UpdateStrings.java b/src/main/java/xyz/nifeather/morph/messages/UpdateStrings.java similarity index 96% rename from src/main/java/xiamomc/morph/messages/UpdateStrings.java rename to src/main/java/xyz/nifeather/morph/messages/UpdateStrings.java index bcd2e31a..0947b46b 100644 --- a/src/main/java/xiamomc/morph/messages/UpdateStrings.java +++ b/src/main/java/xyz/nifeather/morph/messages/UpdateStrings.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages; +package xyz.nifeather.morph.messages; import xiamomc.pluginbase.Messages.FormattableMessage; diff --git a/src/main/java/xiamomc/morph/messages/vanilla/BasicVanillaMessageStore.java b/src/main/java/xyz/nifeather/morph/messages/vanilla/BasicVanillaMessageStore.java similarity index 97% rename from src/main/java/xiamomc/morph/messages/vanilla/BasicVanillaMessageStore.java rename to src/main/java/xyz/nifeather/morph/messages/vanilla/BasicVanillaMessageStore.java index d6fb78ca..5e5fedfe 100644 --- a/src/main/java/xiamomc/morph/messages/vanilla/BasicVanillaMessageStore.java +++ b/src/main/java/xyz/nifeather/morph/messages/vanilla/BasicVanillaMessageStore.java @@ -1,7 +1,7 @@ -package xiamomc.morph.messages.vanilla; +package xyz.nifeather.morph.messages.vanilla; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import xiamomc.pluginbase.Messages.IStrings; import xiamomc.pluginbase.Messages.MessageStore; diff --git a/src/main/java/xiamomc/morph/messages/vanilla/VanillaMessageStore.java b/src/main/java/xyz/nifeather/morph/messages/vanilla/VanillaMessageStore.java similarity index 94% rename from src/main/java/xiamomc/morph/messages/vanilla/VanillaMessageStore.java rename to src/main/java/xyz/nifeather/morph/messages/vanilla/VanillaMessageStore.java index a11fac97..fd82e386 100644 --- a/src/main/java/xiamomc/morph/messages/vanilla/VanillaMessageStore.java +++ b/src/main/java/xyz/nifeather/morph/messages/vanilla/VanillaMessageStore.java @@ -1,11 +1,11 @@ -package xiamomc.morph.messages.vanilla; +package xyz.nifeather.morph.messages.vanilla; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.kyori.adventure.text.Component; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; diff --git a/src/main/java/xiamomc/morph/messages/vanilla/VanillaMessageSubStore.java b/src/main/java/xyz/nifeather/morph/messages/vanilla/VanillaMessageSubStore.java similarity index 88% rename from src/main/java/xiamomc/morph/messages/vanilla/VanillaMessageSubStore.java rename to src/main/java/xyz/nifeather/morph/messages/vanilla/VanillaMessageSubStore.java index 0733afb2..605f1e01 100644 --- a/src/main/java/xiamomc/morph/messages/vanilla/VanillaMessageSubStore.java +++ b/src/main/java/xyz/nifeather/morph/messages/vanilla/VanillaMessageSubStore.java @@ -1,4 +1,4 @@ -package xiamomc.morph.messages.vanilla; +package xyz.nifeather.morph.messages.vanilla; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/xiamomc/morph/misc/AnimationNames.java b/src/main/java/xyz/nifeather/morph/misc/AnimationNames.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/AnimationNames.java rename to src/main/java/xyz/nifeather/morph/misc/AnimationNames.java index 1dc5a13f..2f3360c3 100644 --- a/src/main/java/xiamomc/morph/misc/AnimationNames.java +++ b/src/main/java/xyz/nifeather/morph/misc/AnimationNames.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; public class AnimationNames { diff --git a/src/main/java/xiamomc/morph/misc/AnimationSequence.java b/src/main/java/xyz/nifeather/morph/misc/AnimationSequence.java similarity index 95% rename from src/main/java/xiamomc/morph/misc/AnimationSequence.java rename to src/main/java/xyz/nifeather/morph/misc/AnimationSequence.java index 8e083415..173f60fb 100644 --- a/src/main/java/xiamomc/morph/misc/AnimationSequence.java +++ b/src/main/java/xyz/nifeather/morph/misc/AnimationSequence.java @@ -1,12 +1,12 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import oshi.util.tuples.Pair; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.providers.animation.SingleAnimation; -import xiamomc.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.Collections; import java.util.List; diff --git a/src/main/java/xiamomc/morph/misc/BlockDestroyHandler.java b/src/main/java/xyz/nifeather/morph/misc/BlockDestroyHandler.java similarity index 99% rename from src/main/java/xiamomc/morph/misc/BlockDestroyHandler.java rename to src/main/java/xyz/nifeather/morph/misc/BlockDestroyHandler.java index c30cf8fe..a9f839b9 100644 --- a/src/main/java/xiamomc/morph/misc/BlockDestroyHandler.java +++ b/src/main/java/xyz/nifeather/morph/misc/BlockDestroyHandler.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; diff --git a/src/main/java/xiamomc/morph/misc/CapeURL.java b/src/main/java/xyz/nifeather/morph/misc/CapeURL.java similarity index 97% rename from src/main/java/xiamomc/morph/misc/CapeURL.java rename to src/main/java/xyz/nifeather/morph/misc/CapeURL.java index eaa41dc1..a20b59e2 100644 --- a/src/main/java/xiamomc/morph/misc/CapeURL.java +++ b/src/main/java/xyz/nifeather/morph/misc/CapeURL.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.messages.CapeStrings; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.messages.CapeStrings; public class CapeURL { diff --git a/src/main/java/xiamomc/morph/misc/CollisionBoxRecord.java b/src/main/java/xyz/nifeather/morph/misc/CollisionBoxRecord.java similarity index 94% rename from src/main/java/xiamomc/morph/misc/CollisionBoxRecord.java rename to src/main/java/xyz/nifeather/morph/misc/CollisionBoxRecord.java index 8342e5e4..8aafcee4 100644 --- a/src/main/java/xiamomc/morph/misc/CollisionBoxRecord.java +++ b/src/main/java/xyz/nifeather/morph/misc/CollisionBoxRecord.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import net.minecraft.world.phys.AABB; diff --git a/src/main/java/xiamomc/morph/misc/DisguiseBuildResult.java b/src/main/java/xyz/nifeather/morph/misc/DisguiseBuildResult.java similarity index 91% rename from src/main/java/xiamomc/morph/misc/DisguiseBuildResult.java rename to src/main/java/xyz/nifeather/morph/misc/DisguiseBuildResult.java index bddc84ef..6b5cdbe1 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseBuildResult.java +++ b/src/main/java/xyz/nifeather/morph/misc/DisguiseBuildResult.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import org.bukkit.entity.Entity; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.providers.disguise.DisguiseProvider; +import xyz.nifeather.morph.providers.disguise.DisguiseProvider; import java.util.Objects; diff --git a/src/main/java/xiamomc/morph/misc/DisguiseEquipment.java b/src/main/java/xyz/nifeather/morph/misc/DisguiseEquipment.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/DisguiseEquipment.java rename to src/main/java/xyz/nifeather/morph/misc/DisguiseEquipment.java index d292b150..d93f1882 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseEquipment.java +++ b/src/main/java/xyz/nifeather/morph/misc/DisguiseEquipment.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.apache.commons.lang3.NotImplementedException; @@ -8,8 +8,8 @@ import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.utilities.DisguiseUtils; -import xiamomc.morph.utilities.ItemUtils; +import xyz.nifeather.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.utilities.ItemUtils; import java.util.Arrays; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/misc/DisguiseMeta.java b/src/main/java/xyz/nifeather/morph/misc/DisguiseMeta.java similarity index 92% rename from src/main/java/xiamomc/morph/misc/DisguiseMeta.java rename to src/main/java/xyz/nifeather/morph/misc/DisguiseMeta.java index 074508ea..9bb29101 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseMeta.java +++ b/src/main/java/xyz/nifeather/morph/misc/DisguiseMeta.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -7,9 +7,9 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.providers.disguise.DisguiseProvider; -import xiamomc.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.providers.disguise.DisguiseProvider; +import xyz.nifeather.morph.utilities.EntityTypeUtils; public class DisguiseMeta { @@ -109,9 +109,7 @@ public boolean equals(EntityType type) public boolean equals(String rawString) { - if (!this.isValid()) return false; - - return this.disguiseType != DisguiseTypes.UNKNOWN && this.rawIdentifier.equals(rawString); + return this.rawIdentifier.equals(rawString); } /** diff --git a/src/main/java/xiamomc/morph/misc/DisguiseState.java b/src/main/java/xyz/nifeather/morph/misc/DisguiseState.java similarity index 92% rename from src/main/java/xiamomc/morph/misc/DisguiseState.java rename to src/main/java/xyz/nifeather/morph/misc/DisguiseState.java index 5e173e42..e502e2aa 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseState.java +++ b/src/main/java/xyz/nifeather/morph/misc/DisguiseState.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -13,38 +13,37 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.abilities.AbilityUpdater; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.EmoteStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.providers.animation.SingleAnimation; -import xiamomc.morph.misc.disguiseProperty.PropertyHandler; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.morph.network.PlayerOptions; import xiamomc.morph.network.commands.S2C.S2CAnimationCommand; import xiamomc.morph.network.commands.S2C.set.S2CSetAnimationDisplayNameCommand; import xiamomc.morph.network.commands.S2C.set.S2CSetSkillCooldownCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.providers.disguise.DisguiseProvider; -import xiamomc.morph.skills.IMorphSkill; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.skills.SkillCooldownInfo; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.impl.NoneMorphSkill; -import xiamomc.morph.storage.playerdata.PlayerMeta; -import xiamomc.morph.utilities.ItemUtils; -import xiamomc.morph.utilities.NbtUtils; -import xiamomc.morph.utilities.PermissionUtils; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.abilities.AbilityUpdater; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.EmoteStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.disguiseProperty.PropertyHandler; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.providers.disguise.DisguiseProvider; +import xyz.nifeather.morph.skills.*; +import xyz.nifeather.morph.skills.impl.NoneMorphSkill; +import xyz.nifeather.morph.storage.playerdata.PlayerMeta; +import xyz.nifeather.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.utilities.ItemUtils; +import xyz.nifeather.morph.utilities.NbtUtils; +import xyz.nifeather.morph.utilities.PermissionUtils; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; -import static xiamomc.morph.utilities.DisguiseUtils.itemOrAir; +import static xyz.nifeather.morph.utilities.DisguiseUtils.itemOrAir; public class DisguiseState extends MorphPluginObject { @@ -227,7 +226,7 @@ public boolean canScheduleSequence() /** * @return Whether success. */ - public boolean tryScheduleSequence(String sequenceIdentifier, + public boolean tryScheduleSequence(@NotNull String sequenceIdentifier, List sequence, boolean persistent) { @@ -556,22 +555,39 @@ public void skillLookupIdentifier(@NotNull String newSkillID) this.skillLookupIdentifier = newSkillID; } + @Nullable + private SkillAbilityConfiguration skillAbilityConfiguration; + + @Nullable + public SkillAbilityConfiguration getSkillAbilityConfiguration() + { + return skillAbilityConfiguration; + } + @NotNull private IMorphSkill skill = NoneMorphSkill.instance; /** * 设置此伪装的技能 - * @param s 目标技能 - * @apiNote 如果目标技能是null,则会fallback到 {@link NoneMorphSkill#instance} + * @param newSkill 目标技能 + * @param config 与技能对应的配置 + * @apiNote 如果目标技能是null,则会fallback到 {@link NoneMorphSkill#instance},并一并清除技能配置 */ - public void setSkill(@Nullable IMorphSkill s) + public void setSkill(@Nullable IMorphSkill newSkill, + SkillAbilityConfiguration config) { - if (s == null) s = NoneMorphSkill.instance; + if (newSkill == null) + { + this.skill = NoneMorphSkill.instance; + this.skillAbilityConfiguration = null; + return; + } this.skill.onDeEquip(this); - s.onInitialEquip(this); - this.skill = s; + this.skillAbilityConfiguration = config; + newSkill.onInitialEquip(this); + this.skill = newSkill; } /** @@ -895,7 +911,7 @@ public void reset(boolean unDisguise) this.provider.unMorph(getPlayer(), this); this.abilityUpdater.setAbilities(List.of()); - this.setSkill(null); + this.setSkill(null, null); } public void reset() diff --git a/src/main/java/xiamomc/morph/misc/DisguiseStateGenerator.java b/src/main/java/xyz/nifeather/morph/misc/DisguiseStateGenerator.java similarity index 90% rename from src/main/java/xiamomc/morph/misc/DisguiseStateGenerator.java rename to src/main/java/xyz/nifeather/morph/misc/DisguiseStateGenerator.java index cdbdd856..7fa64361 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseStateGenerator.java +++ b/src/main/java/xyz/nifeather/morph/misc/DisguiseStateGenerator.java @@ -1,17 +1,17 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.backends.DisguiseBackend; import xiamomc.morph.network.PlayerOptions; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.storage.offlinestore.OfflineDisguiseState; -import xiamomc.morph.storage.playerdata.PlayerMeta; -import xiamomc.morph.utilities.NbtUtils; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.skills.MorphSkillHandler; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.storage.offlinestore.OfflineDisguiseState; +import xyz.nifeather.morph.storage.playerdata.PlayerMeta; +import xyz.nifeather.morph.utilities.NbtUtils; public class DisguiseStateGenerator { diff --git a/src/main/java/xiamomc/morph/misc/DisguiseTypes.java b/src/main/java/xyz/nifeather/morph/misc/DisguiseTypes.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/DisguiseTypes.java rename to src/main/java/xyz/nifeather/morph/misc/DisguiseTypes.java index fa772db5..7dac5057 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseTypes.java +++ b/src/main/java/xyz/nifeather/morph/misc/DisguiseTypes.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import org.bukkit.NamespacedKey; diff --git a/src/main/java/xiamomc/morph/misc/MorphChatRenderer.java b/src/main/java/xyz/nifeather/morph/misc/MorphChatRenderer.java similarity index 90% rename from src/main/java/xiamomc/morph/misc/MorphChatRenderer.java rename to src/main/java/xyz/nifeather/morph/misc/MorphChatRenderer.java index 3fc03da4..f1593d3c 100644 --- a/src/main/java/xiamomc/morph/misc/MorphChatRenderer.java +++ b/src/main/java/xyz/nifeather/morph/misc/MorphChatRenderer.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import io.papermc.paper.chat.ChatRenderer; import net.kyori.adventure.audience.Audience; @@ -6,15 +6,15 @@ import org.bukkit.entity.Player; import org.bukkit.permissions.Permissible; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Messages.FormattableMessage; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; public class MorphChatRenderer extends MorphPluginObject implements ChatRenderer { diff --git a/src/main/java/xiamomc/morph/misc/MorphGameProfile.java b/src/main/java/xyz/nifeather/morph/misc/MorphGameProfile.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/MorphGameProfile.java rename to src/main/java/xyz/nifeather/morph/misc/MorphGameProfile.java index c8598c4a..15c6f815 100644 --- a/src/main/java/xiamomc/morph/misc/MorphGameProfile.java +++ b/src/main/java/xyz/nifeather/morph/misc/MorphGameProfile.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import com.destroystokyo.paper.profile.PlayerProfile; import com.mojang.authlib.GameProfile; diff --git a/src/main/java/xiamomc/morph/misc/MorphParameters.java b/src/main/java/xyz/nifeather/morph/misc/MorphParameters.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/MorphParameters.java rename to src/main/java/xyz/nifeather/morph/misc/MorphParameters.java index c81e4e3b..0e0470cb 100644 --- a/src/main/java/xiamomc/morph/misc/MorphParameters.java +++ b/src/main/java/xyz/nifeather/morph/misc/MorphParameters.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; diff --git a/src/main/java/xiamomc/morph/misc/NetworkingHelper.java b/src/main/java/xyz/nifeather/morph/misc/NetworkingHelper.java similarity index 91% rename from src/main/java/xiamomc/morph/misc/NetworkingHelper.java rename to src/main/java/xyz/nifeather/morph/misc/NetworkingHelper.java index 93e1d0e3..a1bf4268 100644 --- a/src/main/java/xiamomc/morph/misc/NetworkingHelper.java +++ b/src/main/java/xyz/nifeather/morph/misc/NetworkingHelper.java @@ -1,23 +1,23 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import com.mojang.authlib.GameProfile; import net.minecraft.Util; import org.bukkit.Bukkit; import org.bukkit.entity.Entity; import org.bukkit.inventory.EntityEquipment; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.WrapperAttribute; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.morph.network.commands.S2C.AbstractS2CCommand; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMapAddCommand; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMapMetaCommand; import xiamomc.morph.network.commands.S2C.clientrender.S2CRenderMeta; import xiamomc.morph.network.commands.S2C.map.S2CPartialMapCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.utilities.MapMetaUtils; -import xiamomc.morph.utilities.NbtUtils; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.WrapperAttribute; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.utilities.MapMetaUtils; +import xyz.nifeather.morph.utilities.NbtUtils; import java.util.HashMap; diff --git a/src/main/java/xiamomc/morph/misc/NilCommandSource.java b/src/main/java/xyz/nifeather/morph/misc/NilCommandSource.java similarity index 97% rename from src/main/java/xiamomc/morph/misc/NilCommandSource.java rename to src/main/java/xyz/nifeather/morph/misc/NilCommandSource.java index 49874b37..235f30fe 100644 --- a/src/main/java/xiamomc/morph/misc/NilCommandSource.java +++ b/src/main/java/xyz/nifeather/morph/misc/NilCommandSource.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import net.kyori.adventure.text.Component; import org.bukkit.craftbukkit.command.ServerCommandSender; diff --git a/src/main/java/xiamomc/morph/misc/NmsRecord.java b/src/main/java/xyz/nifeather/morph/misc/NmsRecord.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/NmsRecord.java rename to src/main/java/xyz/nifeather/morph/misc/NmsRecord.java index 6efdd0d4..bc6f0635 100644 --- a/src/main/java/xiamomc/morph/misc/NmsRecord.java +++ b/src/main/java/xyz/nifeather/morph/misc/NmsRecord.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; diff --git a/src/main/java/xiamomc/morph/misc/OfflineDisguiseResult.java b/src/main/java/xyz/nifeather/morph/misc/OfflineDisguiseResult.java similarity index 68% rename from src/main/java/xiamomc/morph/misc/OfflineDisguiseResult.java rename to src/main/java/xyz/nifeather/morph/misc/OfflineDisguiseResult.java index 6b026d82..ce74c67b 100644 --- a/src/main/java/xiamomc/morph/misc/OfflineDisguiseResult.java +++ b/src/main/java/xyz/nifeather/morph/misc/OfflineDisguiseResult.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; public enum OfflineDisguiseResult { diff --git a/src/main/java/xiamomc/morph/misc/PlayerOperationSimulator.java b/src/main/java/xyz/nifeather/morph/misc/PlayerOperationSimulator.java similarity index 98% rename from src/main/java/xiamomc/morph/misc/PlayerOperationSimulator.java rename to src/main/java/xyz/nifeather/morph/misc/PlayerOperationSimulator.java index 025bb883..29efa032 100644 --- a/src/main/java/xiamomc/morph/misc/PlayerOperationSimulator.java +++ b/src/main/java/xyz/nifeather/morph/misc/PlayerOperationSimulator.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.core.Direction; @@ -26,11 +26,11 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.util.RayTraceResult; import org.bukkit.util.Vector; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/xiamomc/morph/misc/RequestInfo.java b/src/main/java/xyz/nifeather/morph/misc/RequestInfo.java similarity index 91% rename from src/main/java/xiamomc/morph/misc/RequestInfo.java rename to src/main/java/xyz/nifeather/morph/misc/RequestInfo.java index 2eed6216..25dbc5bc 100644 --- a/src/main/java/xiamomc/morph/misc/RequestInfo.java +++ b/src/main/java/xyz/nifeather/morph/misc/RequestInfo.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/misc/SoundHandler.java b/src/main/java/xyz/nifeather/morph/misc/SoundHandler.java similarity index 93% rename from src/main/java/xiamomc/morph/misc/SoundHandler.java rename to src/main/java/xyz/nifeather/morph/misc/SoundHandler.java index 4338a334..dd5e917a 100644 --- a/src/main/java/xiamomc/morph/misc/SoundHandler.java +++ b/src/main/java/xyz/nifeather/morph/misc/SoundHandler.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc; +package xyz.nifeather.morph.misc; import net.kyori.adventure.sound.Sound; import net.minecraft.sounds.SoundEvents; @@ -8,11 +8,11 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.utilities.EntityTypeUtils; -import xiamomc.morph.utilities.MathUtils; -import xiamomc.morph.utilities.SoundUtils; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.utilities.MathUtils; +import xyz.nifeather.morph.utilities.SoundUtils; import java.util.Random; diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/DisguiseProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/DisguiseProperties.java similarity index 94% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/DisguiseProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/DisguiseProperties.java index 88d79dfd..555280fe 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/DisguiseProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/DisguiseProperties.java @@ -1,11 +1,11 @@ -package xiamomc.morph.misc.disguiseProperty; +package xyz.nifeather.morph.misc.disguiseProperty; import org.bukkit.entity.EntityType; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import xiamomc.morph.misc.disguiseProperty.values.*; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.misc.disguiseProperty.values.*; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -34,6 +34,7 @@ public DisguiseProperties() register(EntityType.VILLAGER, new VillagerProperties()); register(EntityType.ZOMBIE_VILLAGER, new VillagerProperties()); register(EntityType.ARMOR_STAND, new ArmorStandProperties()); + register(EntityType.CREEPER, new CreeperProperties()); } public void register(EntityType type, AbstractProperties properties) diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/PropertyHandler.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/PropertyHandler.java similarity index 94% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/PropertyHandler.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/PropertyHandler.java index a2ea73f4..f24966aa 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/PropertyHandler.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/PropertyHandler.java @@ -1,12 +1,12 @@ -package xiamomc.morph.misc.disguiseProperty; +package xyz.nifeather.morph.misc.disguiseProperty; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.misc.disguiseProperty.values.AbstractProperties; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.misc.disguiseProperty.values.AbstractProperties; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/SingleProperty.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/SingleProperty.java similarity index 96% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/SingleProperty.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/SingleProperty.java index 3bc8da41..374d18b4 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/SingleProperty.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/SingleProperty.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.disguiseProperty; +package xyz.nifeather.morph.misc.disguiseProperty; import it.unimi.dsi.fastutil.objects.ObjectArrayList; diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/AbstractProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/AbstractProperties.java similarity index 87% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/AbstractProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/AbstractProperties.java index 2996fc20..02f7fd76 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/AbstractProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/AbstractProperties.java @@ -1,9 +1,9 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.slf4j.Logger; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; import java.util.List; diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/ArmorStandProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/ArmorStandProperties.java similarity index 65% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/ArmorStandProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/ArmorStandProperties.java index a59eb664..1ed6f086 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/ArmorStandProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/ArmorStandProperties.java @@ -1,6 +1,6 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class ArmorStandProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/AxolotlProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/AxolotlProperties.java similarity index 73% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/AxolotlProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/AxolotlProperties.java index 0ac4a9ce..f726ae98 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/AxolotlProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/AxolotlProperties.java @@ -1,7 +1,7 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Axolotl; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class AxolotlProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/CatProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/CatProperties.java similarity index 77% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/CatProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/CatProperties.java index b26e9181..62040c71 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/CatProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/CatProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.Registry; import org.bukkit.entity.Cat; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class CatProperties extends AbstractProperties { diff --git a/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/CreeperProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/CreeperProperties.java new file mode 100644 index 00000000..f8a9bc8e --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/CreeperProperties.java @@ -0,0 +1,13 @@ +package xyz.nifeather.morph.misc.disguiseProperty.values; + +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; + +public class CreeperProperties extends AbstractProperties +{ + public final SingleProperty CHARGED = getSingle("charged", false).withRandom(false, false, false, true); + + public CreeperProperties() + { + registerSingle(CHARGED); + } +} diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/DefaultProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/DefaultProperties.java similarity index 52% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/DefaultProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/DefaultProperties.java index 90c6e336..7a260d6e 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/DefaultProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/DefaultProperties.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; public class DefaultProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/FoxProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/FoxProperties.java similarity index 70% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/FoxProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/FoxProperties.java index 23034d66..477c5f43 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/FoxProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/FoxProperties.java @@ -1,7 +1,7 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Fox; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class FoxProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/FrogProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/FrogProperties.java similarity index 75% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/FrogProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/FrogProperties.java index fb368ce5..bfc4c6b0 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/FrogProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/FrogProperties.java @@ -1,7 +1,7 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Frog; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class FrogProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/GoatProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/GoatProperties.java similarity index 78% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/GoatProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/GoatProperties.java index 810374bb..89c6b13b 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/GoatProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/GoatProperties.java @@ -1,6 +1,6 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class GoatProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/HorseProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/HorseProperties.java similarity index 78% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/HorseProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/HorseProperties.java index 6491a1f9..517353a0 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/HorseProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/HorseProperties.java @@ -1,7 +1,7 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Horse; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class HorseProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/LlamaProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/LlamaProperties.java similarity index 73% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/LlamaProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/LlamaProperties.java index 283d94c3..c1163c50 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/LlamaProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/LlamaProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Llama; import org.bukkit.entity.Llama.Color; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class LlamaProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/MooshroomProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/MooshroomProperties.java similarity index 77% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/MooshroomProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/MooshroomProperties.java index 5038632d..bfbb0adc 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/MooshroomProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/MooshroomProperties.java @@ -1,7 +1,7 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.MushroomCow; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class MooshroomProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/PandaProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/PandaProperties.java similarity index 80% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/PandaProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/PandaProperties.java index 6f388ecc..06bf8421 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/PandaProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/PandaProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Panda; import org.bukkit.entity.Panda.Gene; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class PandaProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/ParrotProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/ParrotProperties.java similarity index 74% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/ParrotProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/ParrotProperties.java index fdedda23..be78e46e 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/ParrotProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/ParrotProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Parrot; import org.bukkit.entity.Parrot.Variant; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class ParrotProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/RabbitProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/RabbitProperties.java similarity index 73% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/RabbitProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/RabbitProperties.java index 59fa0f23..dd8bbcca 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/RabbitProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/RabbitProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Rabbit; import org.bukkit.entity.Rabbit.Type; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class RabbitProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/VillagerProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/VillagerProperties.java similarity index 85% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/VillagerProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/VillagerProperties.java index 760be4f6..0080e352 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/VillagerProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/VillagerProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.Registry; import org.bukkit.entity.Villager; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class VillagerProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/WolfProperties.java b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/WolfProperties.java similarity index 84% rename from src/main/java/xiamomc/morph/misc/disguiseProperty/values/WolfProperties.java rename to src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/WolfProperties.java index 6f0e814d..27c3a77e 100644 --- a/src/main/java/xiamomc/morph/misc/disguiseProperty/values/WolfProperties.java +++ b/src/main/java/xyz/nifeather/morph/misc/disguiseProperty/values/WolfProperties.java @@ -1,8 +1,8 @@ -package xiamomc.morph.misc.disguiseProperty.values; +package xyz.nifeather.morph.misc.disguiseProperty.values; import org.bukkit.entity.Wolf; import org.bukkit.entity.Wolf.Variant; -import xiamomc.morph.misc.disguiseProperty.SingleProperty; +import xyz.nifeather.morph.misc.disguiseProperty.SingleProperty; public class WolfProperties extends AbstractProperties { diff --git a/src/main/java/xiamomc/morph/misc/gui/AnimSelectScreenWrapper.java b/src/main/java/xyz/nifeather/morph/misc/gui/AnimSelectScreenWrapper.java similarity index 63% rename from src/main/java/xiamomc/morph/misc/gui/AnimSelectScreenWrapper.java rename to src/main/java/xyz/nifeather/morph/misc/gui/AnimSelectScreenWrapper.java index 7a28228b..b6ba1c4b 100644 --- a/src/main/java/xiamomc/morph/misc/gui/AnimSelectScreenWrapper.java +++ b/src/main/java/xyz/nifeather/morph/misc/gui/AnimSelectScreenWrapper.java @@ -1,28 +1,41 @@ -package xiamomc.morph.misc.gui; +package xyz.nifeather.morph.misc.gui; import de.themoep.inventorygui.DynamicGuiElement; import de.themoep.inventorygui.InventoryGui; import de.themoep.inventorygui.StaticGuiElement; +import io.papermc.paper.adventure.providers.MiniMessageProviderImpl; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; -import org.bukkit.Bukkit; +import net.kyori.adventure.text.minimessage.MiniMessage; +import net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer; +import net.kyori.adventure.text.serializer.json.JSONComponentSerializer; import org.bukkit.Material; import org.bukkit.block.data.Levelled; import org.bukkit.inventory.ItemRarity; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BlockDataMeta; -import xiamomc.morph.messages.EmoteStrings; -import xiamomc.morph.messages.GuiStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.DisguiseState; +import org.jetbrains.annotations.Nullable; import xiamomc.pluginbase.Bindables.BindableList; +import xyz.nifeather.morph.messages.EmoteStrings; +import xyz.nifeather.morph.messages.GuiStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.DisguiseState; import java.util.List; +import java.util.function.Consumer; public class AnimSelectScreenWrapper extends ScreenWrapper { + /* + // 如果要启用这个,记得手动设置 capacity + private final BindableList pattern = new BindableList<>( + List.of( + " " + getCurrentIndexChar(0) + " ", + getCurrentIndexChar(3) + "E" + getCurrentIndexChar(1), + " " + getCurrentIndexChar(2) + " " + ));*/ + private final BindableList pattern = new BindableList<>(List.of( "XXXXE" )); @@ -102,22 +115,32 @@ private InventoryGui preparePage() capacity += lineCapacity; } - return new InventoryGui(plugin, GuiStrings.selectAnimation().toString(playerLocale), rows.toArray(new String[]{})); + var gui = new InventoryGui(plugin, + GuiStrings.selectAnimation().toString(playerLocale), + rows.toArray(new String[]{})); + + gui.setItemNameSetter((meta, string) -> meta.itemName(defaultMiniMessage.deserialize(string))); + + return gui; } private void initElements(InventoryGui gui) { - var actionItemBase = IconLookup.instance().lookup(state.getDisguiseIdentifier()); //new ItemStack(Material.LIGHT); + var defaultIcon = IconLookup.instance().lookup(state.getDisguiseIdentifier()); //new ItemStack(Material.LIGHT); if (IconLookup.instance().lookup(state.getDisguiseIdentifier()).getType() == Material.PLAYER_HEAD) this.isDynamic.set(true); - for (int i = 0; i < Math.min(capacity, availableSequences.size()); i++) + for (int i = 0; i < capacity; i++) { + @Nullable + var sequenceId = i >= availableSequences.size() ? null : availableSequences.get(i); + var guiChar = this.getCurrentIndexChar(i); - var itemClone = actionItemBase.clone(); + var icon = sequenceId == null ? new ItemStack(Material.GRAY_STAINED_GLASS_PANE) : defaultIcon.clone(); int finalIndex = i; - itemClone.editMeta(meta -> + + icon.editMeta(meta -> { meta.setRarity(ItemRarity.COMMON); @@ -130,12 +153,18 @@ private void initElements(InventoryGui gui) } }); - var sequenceId = availableSequences.get(i); + // String(Raw) -> Component(Parsed) -> String(Parsed MiniMessage format) -> Component(Parsed again) + // So terrible, couldn't we just use Component instead String to set the item name? + Component sequenceDisplayNameComponent = sequenceId == null + ? EmoteStrings.none().toComponent(playerLocale) + : EmoteStrings.get(sequenceId).toComponent(playerLocale); - var sequenceDisplayName = EmoteStrings.get(sequenceId).withLocale(playerLocale).toString(); + String sequenceDisplayName = defaultMiniMessage.serialize(sequenceDisplayNameComponent); - var element = new StaticGuiElement(guiChar, itemClone, 1 + i, click -> + var element = new StaticGuiElement(guiChar, icon, 1 + i, click -> { + if (sequenceId == null) return true; + var animationSet = state.getProvider() .getAnimationProvider() .getAnimationSetFor(state.getDisguiseIdentifier()); @@ -145,9 +174,10 @@ private void initElements(InventoryGui gui) getBindingPlayer().playSound(clickSound); state.tryScheduleSequence(sequenceId, sequencePair.left(), sequencePair.right()); guiInstance.close(); + return true; }, - "§r" + sequenceDisplayName); + "" + sequenceDisplayName); gui.addElement(element); } @@ -156,9 +186,9 @@ private void initElements(InventoryGui gui) new ItemStack(Material.PINK_STAINED_GLASS_PANE), 1, click -> true, - "§r")); + "")); - var closeElementItem = new ItemStack(Material.BARRIER); + var closeElementItem = new ItemStack(Material.MAGENTA_GLAZED_TERRACOTTA); closeElementItem.editMeta(meta -> meta.setRarity(ItemRarity.COMMON)); gui.addElement(new StaticGuiElement('E', @@ -170,13 +200,13 @@ private void initElements(InventoryGui gui) guiInstance.close(); return true; }, - "§r" + GuiStrings.close().toString(playerLocale))); + "" + GuiStrings.close().toString(playerLocale))); var disguiseElement = new StaticGuiElement('D', IconLookup.instance().lookup(state.getDisguiseIdentifier()), 1, click -> true, - "§r" + MorphStrings.disguisingAsString().resolve("what", state.getPlayerDisplay()) + "" + MorphStrings.disguisingAsString().resolve("what", state.getPlayerDisplay()) .toString(playerLocale)); if (isDynamic.get()) diff --git a/src/main/java/xiamomc/morph/misc/gui/DisguiseSelectScreenWrapper.java b/src/main/java/xyz/nifeather/morph/misc/gui/DisguiseSelectScreenWrapper.java similarity index 93% rename from src/main/java/xiamomc/morph/misc/gui/DisguiseSelectScreenWrapper.java rename to src/main/java/xyz/nifeather/morph/misc/gui/DisguiseSelectScreenWrapper.java index 3cd9baa8..0b347233 100644 --- a/src/main/java/xiamomc/morph/misc/gui/DisguiseSelectScreenWrapper.java +++ b/src/main/java/xyz/nifeather/morph/misc/gui/DisguiseSelectScreenWrapper.java @@ -1,31 +1,24 @@ -package xiamomc.morph.misc.gui; +package xyz.nifeather.morph.misc.gui; import de.themoep.inventorygui.DynamicGuiElement; import de.themoep.inventorygui.InventoryGui; import de.themoep.inventorygui.StaticGuiElement; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import net.kyori.adventure.key.Key; -import net.kyori.adventure.sound.Sound; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.messages.GuiStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.messages.GuiStrings; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseState; import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; public class DisguiseSelectScreenWrapper extends ScreenWrapper { diff --git a/src/main/java/xiamomc/morph/misc/gui/IconLookup.java b/src/main/java/xyz/nifeather/morph/misc/gui/IconLookup.java similarity index 97% rename from src/main/java/xiamomc/morph/misc/gui/IconLookup.java rename to src/main/java/xyz/nifeather/morph/misc/gui/IconLookup.java index 9930f24d..7bc61a13 100644 --- a/src/main/java/xiamomc/morph/misc/gui/IconLookup.java +++ b/src/main/java/xyz/nifeather/morph/misc/gui/IconLookup.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.gui; +package xyz.nifeather.morph.misc.gui; import com.destroystokyo.paper.profile.CraftPlayerProfile; import org.bukkit.Material; @@ -9,8 +9,8 @@ import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.skins.PlayerSkinProvider; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/xiamomc/morph/misc/gui/ScreenWrapper.java b/src/main/java/xyz/nifeather/morph/misc/gui/ScreenWrapper.java similarity index 88% rename from src/main/java/xiamomc/morph/misc/gui/ScreenWrapper.java rename to src/main/java/xyz/nifeather/morph/misc/gui/ScreenWrapper.java index 1f0d5645..48f5fa19 100644 --- a/src/main/java/xiamomc/morph/misc/gui/ScreenWrapper.java +++ b/src/main/java/xyz/nifeather/morph/misc/gui/ScreenWrapper.java @@ -1,14 +1,14 @@ -package xiamomc.morph.misc.gui; +package xyz.nifeather.morph.misc.gui; import de.themoep.inventorygui.InventoryGui; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; +import net.kyori.adventure.text.minimessage.MiniMessage; import org.bukkit.entity.Player; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.MessageUtils; import xiamomc.pluginbase.Bindables.Bindable; -import xiamomc.pluginbase.Exceptions.NullDependencyException; import xiamomc.pluginbase.ScheduleInfo; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.MessageUtils; public class ScreenWrapper extends MorphPluginObject { @@ -21,6 +21,8 @@ public class ScreenWrapper extends MorphPluginObject public static final Sound clickSound = Sound.sound().type(Key.key("ui.button.click")).volume(0.45f).build(); public static final Sound openSound = Sound.sound().type(Key.key("entity.experience_orb.pickup")).volume(0.55f).build(); + protected static final MiniMessage defaultMiniMessage = MiniMessage.miniMessage(); + protected Player getBindingPlayer() { return bindingPlayer; diff --git a/src/main/java/xiamomc/morph/misc/integrations/modelengine/ModelEngineHelper.java b/src/main/java/xyz/nifeather/morph/misc/integrations/modelengine/ModelEngineHelper.java similarity index 75% rename from src/main/java/xiamomc/morph/misc/integrations/modelengine/ModelEngineHelper.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/modelengine/ModelEngineHelper.java index bf76a86e..329c947f 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/modelengine/ModelEngineHelper.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/modelengine/ModelEngineHelper.java @@ -1,11 +1,11 @@ -package xiamomc.morph.misc.integrations.modelengine; +package xyz.nifeather.morph.misc.integrations.modelengine; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.modelengine.MEBackend; -import xiamomc.morph.events.api.lifecycle.ManagerFinishedInitializeEvent; -import xiamomc.morph.providers.disguise.ModelEngineProvider; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.modelengine.MEBackend; +import xyz.nifeather.morph.events.api.lifecycle.ManagerFinishedInitializeEvent; +import xyz.nifeather.morph.providers.disguise.ModelEngineProvider; public class ModelEngineHelper extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/IPlaceholderProvider.java b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/IPlaceholderProvider.java similarity index 91% rename from src/main/java/xiamomc/morph/misc/integrations/placeholderapi/IPlaceholderProvider.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/IPlaceholderProvider.java index 5dcbd299..f94b3875 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/IPlaceholderProvider.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/IPlaceholderProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.integrations.placeholderapi; +package xyz.nifeather.morph.misc.integrations.placeholderapi; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/MatchMode.java b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/MatchMode.java similarity index 74% rename from src/main/java/xiamomc/morph/misc/integrations/placeholderapi/MatchMode.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/MatchMode.java index 3d8ab01b..a9621e4e 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/MatchMode.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/MatchMode.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.integrations.placeholderapi; +package xyz.nifeather.morph.misc.integrations.placeholderapi; /** * ID匹配模式 diff --git a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/PlaceholderIntegration.java b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/PlaceholderIntegration.java similarity index 91% rename from src/main/java/xiamomc/morph/misc/integrations/placeholderapi/PlaceholderIntegration.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/PlaceholderIntegration.java index f7596d71..a8347843 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/PlaceholderIntegration.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/PlaceholderIntegration.java @@ -1,13 +1,13 @@ -package xiamomc.morph.misc.integrations.placeholderapi; +package xyz.nifeather.morph.misc.integrations.placeholderapi; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import me.clip.placeholderapi.expansion.PlaceholderExpansion; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.misc.integrations.placeholderapi.builtin.AvaliableDisguisesProvider; -import xiamomc.morph.misc.integrations.placeholderapi.builtin.StateNameProvider; import xiamomc.pluginbase.Managers.DependencyManager; +import xyz.nifeather.morph.misc.integrations.placeholderapi.builtin.AvaliableDisguisesProvider; +import xyz.nifeather.morph.misc.integrations.placeholderapi.builtin.StateNameProvider; import java.util.List; diff --git a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/builtin/AvaliableDisguisesProvider.java b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/builtin/AvaliableDisguisesProvider.java similarity index 79% rename from src/main/java/xiamomc/morph/misc/integrations/placeholderapi/builtin/AvaliableDisguisesProvider.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/builtin/AvaliableDisguisesProvider.java index e720aabd..20f361f0 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/builtin/AvaliableDisguisesProvider.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/builtin/AvaliableDisguisesProvider.java @@ -1,15 +1,15 @@ -package xiamomc.morph.misc.integrations.placeholderapi.builtin; +package xyz.nifeather.morph.misc.integrations.placeholderapi.builtin; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.misc.integrations.placeholderapi.IPlaceholderProvider; -import xiamomc.morph.misc.integrations.placeholderapi.MatchMode; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.misc.integrations.placeholderapi.IPlaceholderProvider; +import xyz.nifeather.morph.misc.integrations.placeholderapi.MatchMode; public class AvaliableDisguisesProvider extends MorphPluginObject implements IPlaceholderProvider { diff --git a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/builtin/StateNameProvider.java b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/builtin/StateNameProvider.java similarity index 80% rename from src/main/java/xiamomc/morph/misc/integrations/placeholderapi/builtin/StateNameProvider.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/builtin/StateNameProvider.java index c01b98df..bd8f264f 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/placeholderapi/builtin/StateNameProvider.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/placeholderapi/builtin/StateNameProvider.java @@ -1,14 +1,14 @@ -package xiamomc.morph.misc.integrations.placeholderapi.builtin; +package xyz.nifeather.morph.misc.integrations.placeholderapi.builtin; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.misc.integrations.placeholderapi.IPlaceholderProvider; -import xiamomc.morph.misc.integrations.placeholderapi.MatchMode; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.misc.integrations.placeholderapi.IPlaceholderProvider; +import xyz.nifeather.morph.misc.integrations.placeholderapi.MatchMode; public class StateNameProvider extends MorphPluginObject implements IPlaceholderProvider { diff --git a/src/main/java/xiamomc/morph/misc/integrations/residence/ResidenceEventProcessor.java b/src/main/java/xyz/nifeather/morph/misc/integrations/residence/ResidenceEventProcessor.java similarity index 91% rename from src/main/java/xiamomc/morph/misc/integrations/residence/ResidenceEventProcessor.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/residence/ResidenceEventProcessor.java index be09c3e0..68b9ad86 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/residence/ResidenceEventProcessor.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/residence/ResidenceEventProcessor.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.integrations.residence; +package xyz.nifeather.morph.misc.integrations.residence; import com.bekvon.bukkit.residence.containers.Flags; import com.bekvon.bukkit.residence.event.ResidenceChangedEvent; @@ -6,8 +6,8 @@ import com.bekvon.bukkit.residence.protection.FlagPermissions; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.abilities.impl.FlyAbility; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.abilities.impl.FlyAbility; public class ResidenceEventProcessor extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/misc/integrations/tab/TabAdapter.java b/src/main/java/xyz/nifeather/morph/misc/integrations/tab/TabAdapter.java similarity index 84% rename from src/main/java/xiamomc/morph/misc/integrations/tab/TabAdapter.java rename to src/main/java/xyz/nifeather/morph/misc/integrations/tab/TabAdapter.java index 42affe22..9bc437fb 100644 --- a/src/main/java/xiamomc/morph/misc/integrations/tab/TabAdapter.java +++ b/src/main/java/xyz/nifeather/morph/misc/integrations/tab/TabAdapter.java @@ -1,16 +1,16 @@ -package xiamomc.morph.misc.integrations.tab; +package xyz.nifeather.morph.misc.integrations.tab; import com.google.common.io.ByteStreams; import me.neznamy.tab.shared.TAB; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.events.api.gameplay.PlayerDisguisedFromOfflineStateEvent; -import xiamomc.morph.events.api.gameplay.PlayerJoinedWithDisguiseEvent; -import xiamomc.morph.events.api.gameplay.PlayerMorphEvent; -import xiamomc.morph.events.api.gameplay.PlayerUnMorphEvent; import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.events.api.gameplay.PlayerDisguisedFromOfflineStateEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerJoinedWithDisguiseEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerMorphEvent; +import xyz.nifeather.morph.events.api.gameplay.PlayerUnMorphEvent; public class TabAdapter extends MorphPluginObject implements Listener { diff --git a/src/main/java/xiamomc/morph/misc/mobs/MorphBukkitVexModifier.java b/src/main/java/xyz/nifeather/morph/misc/mobs/MorphBukkitVexModifier.java similarity index 99% rename from src/main/java/xiamomc/morph/misc/mobs/MorphBukkitVexModifier.java rename to src/main/java/xyz/nifeather/morph/misc/mobs/MorphBukkitVexModifier.java index 00430e4c..bde331cd 100644 --- a/src/main/java/xiamomc/morph/misc/mobs/MorphBukkitVexModifier.java +++ b/src/main/java/xyz/nifeather/morph/misc/mobs/MorphBukkitVexModifier.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.mobs; +package xyz.nifeather.morph.misc.mobs; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.goal.target.TargetGoal; diff --git a/src/main/java/xiamomc/morph/misc/permissions/CommonPermissions.java b/src/main/java/xyz/nifeather/morph/misc/permissions/CommonPermissions.java similarity index 79% rename from src/main/java/xiamomc/morph/misc/permissions/CommonPermissions.java rename to src/main/java/xyz/nifeather/morph/misc/permissions/CommonPermissions.java index 80417a77..94eb12d0 100644 --- a/src/main/java/xiamomc/morph/misc/permissions/CommonPermissions.java +++ b/src/main/java/xyz/nifeather/morph/misc/permissions/CommonPermissions.java @@ -1,10 +1,10 @@ -package xiamomc.morph.misc.permissions; +package xyz.nifeather.morph.misc.permissions; -import xiamomc.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.DisguiseTypes; public class CommonPermissions { - private final static String PERM_ROOT = "xiamomc.morph."; + private final static String PERM_ROOT = "feathermorph."; public final static String SEND_REQUEST = PERM_ROOT + "request.send"; public final static String ACCEPT_REQUEST = PERM_ROOT + "request.accept"; @@ -36,6 +36,16 @@ public class CommonPermissions public final static String SET_OPTIONS = PERM_ROOT + "toggle"; + public final static String QUERY_STATES = PERM_ROOT + "query"; + public final static String CHECK_STAT = PERM_ROOT + "stat"; + public final static String DO_RELOAD = PERM_ROOT + "reload"; + + public final static String MANAGE_DISGUISES = PERM_ROOT + "manage"; + public final static String MANAGE_GRANT_DISGUISE = MANAGE_DISGUISES + ".grant"; + public final static String MANAGE_REVOKE_DISGUISE = MANAGE_DISGUISES + ".revoke"; + public final static String MANAGE_UNMORPH_DISGUISE = MANAGE_DISGUISES + ".unmorph"; + public final static String MANAGE_MORPH_DISGUISE = MANAGE_DISGUISES + ".morph"; + public final static String CAN_FLY = PERM_ROOT + "can_fly"; public final static String ALWAYS_CAN_FLY = PERM_ROOT + "can_fly.always"; diff --git a/src/main/java/xiamomc/morph/misc/playerList/PlayerListHandler.java b/src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java similarity index 97% rename from src/main/java/xiamomc/morph/misc/playerList/PlayerListHandler.java rename to src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java index 60fb66e8..a87a4ea6 100644 --- a/src/main/java/xiamomc/morph/misc/playerList/PlayerListHandler.java +++ b/src/main/java/xyz/nifeather/morph/misc/playerList/PlayerListHandler.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.playerList; +package xyz.nifeather.morph.misc.playerList; import com.mojang.authlib.GameProfile; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -9,8 +9,8 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.misc.NmsRecord; import java.util.*; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/xiamomc/morph/misc/recipe/RecipeManager.java b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java similarity index 96% rename from src/main/java/xiamomc/morph/misc/recipe/RecipeManager.java rename to src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java index dd65aa93..dd2290d7 100644 --- a/src/main/java/xiamomc/morph/misc/recipe/RecipeManager.java +++ b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.recipe; +package xyz.nifeather.morph.misc.recipe; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -10,12 +10,12 @@ import org.bukkit.inventory.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.utilities.ItemUtils; import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.utilities.ItemUtils; -import java.io.*; +import java.io.File; import java.util.Arrays; import java.util.List; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/misc/recipe/RecipeOptions.java b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeOptions.java similarity index 97% rename from src/main/java/xiamomc/morph/misc/recipe/RecipeOptions.java rename to src/main/java/xyz/nifeather/morph/misc/recipe/RecipeOptions.java index bfaa553d..42c5873a 100644 --- a/src/main/java/xiamomc/morph/misc/recipe/RecipeOptions.java +++ b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeOptions.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.recipe; +package xyz.nifeather.morph.misc.recipe; import xiamomc.pluginbase.Configuration.ConfigNode; import xiamomc.pluginbase.Configuration.ConfigOption; diff --git a/src/main/java/xiamomc/morph/misc/recipe/RecipeProperty.java b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeProperty.java similarity index 93% rename from src/main/java/xiamomc/morph/misc/recipe/RecipeProperty.java rename to src/main/java/xyz/nifeather/morph/misc/recipe/RecipeProperty.java index a0a70196..4ab68718 100644 --- a/src/main/java/xiamomc/morph/misc/recipe/RecipeProperty.java +++ b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeProperty.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.recipe; +package xyz.nifeather.morph.misc.recipe; import net.kyori.adventure.text.Component; import org.bukkit.Material; diff --git a/src/main/java/xiamomc/morph/misc/recipe/RecipeYamlConfigManager.java b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeYamlConfigManager.java similarity index 95% rename from src/main/java/xiamomc/morph/misc/recipe/RecipeYamlConfigManager.java rename to src/main/java/xyz/nifeather/morph/misc/recipe/RecipeYamlConfigManager.java index c7daba54..7f88b1db 100644 --- a/src/main/java/xiamomc/morph/misc/recipe/RecipeYamlConfigManager.java +++ b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeYamlConfigManager.java @@ -1,10 +1,10 @@ -package xiamomc.morph.misc.recipe; +package xyz.nifeather.morph.misc.recipe; import com.google.common.base.Charsets; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.utilities.PluginAssetUtils; import xiamomc.pluginbase.Configuration.ConfigOption; +import xyz.nifeather.morph.utilities.PluginAssetUtils; import java.io.File; import java.io.FileOutputStream; diff --git a/src/main/java/xiamomc/morph/misc/recipe/StandaloneYamlConfigManager.java b/src/main/java/xyz/nifeather/morph/misc/recipe/StandaloneYamlConfigManager.java similarity index 97% rename from src/main/java/xiamomc/morph/misc/recipe/StandaloneYamlConfigManager.java rename to src/main/java/xyz/nifeather/morph/misc/recipe/StandaloneYamlConfigManager.java index d66b69f5..07f3e973 100644 --- a/src/main/java/xiamomc/morph/misc/recipe/StandaloneYamlConfigManager.java +++ b/src/main/java/xyz/nifeather/morph/misc/recipe/StandaloneYamlConfigManager.java @@ -1,15 +1,17 @@ -package xiamomc.morph.misc.recipe; +package xyz.nifeather.morph.misc.recipe; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; import xiamomc.pluginbase.Configuration.ConfigNode; import xiamomc.pluginbase.Configuration.ConfigOption; +import xyz.nifeather.morph.MorphPluginObject; import java.io.File; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Map; public abstract class StandaloneYamlConfigManager extends MorphPluginObject { diff --git a/src/main/java/xiamomc/morph/misc/skins/PlayerSkinProvider.java b/src/main/java/xyz/nifeather/morph/misc/skins/PlayerSkinProvider.java similarity index 63% rename from src/main/java/xiamomc/morph/misc/skins/PlayerSkinProvider.java rename to src/main/java/xyz/nifeather/morph/misc/skins/PlayerSkinProvider.java index 6a503299..96a4f688 100644 --- a/src/main/java/xiamomc/morph/misc/skins/PlayerSkinProvider.java +++ b/src/main/java/xyz/nifeather/morph/misc/skins/PlayerSkinProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.skins; +package xyz.nifeather.morph.misc.skins; import com.destroystokyo.paper.profile.PlayerProfile; import com.mojang.authlib.GameProfile; @@ -6,61 +6,152 @@ import com.mojang.authlib.ProfileLookupCallback; import com.mojang.authlib.exceptions.AuthenticationUnavailableException; import com.mojang.authlib.yggdrasil.ProfileNotFoundException; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectLists; import net.minecraft.Util; import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.misc.MorphGameProfile; -import xiamomc.morph.misc.NmsRecord; +import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.misc.MorphGameProfile; +import xyz.nifeather.morph.misc.NmsRecord; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.TimeUnit; +import java.util.function.BiConsumer; public class PlayerSkinProvider extends MorphPluginObject { - private static PlayerSkinProvider instance; - public static PlayerSkinProvider getInstance() { - if (instance == null) - { - instance = new PlayerSkinProvider(); - instance.skinCache.initializeStorage(); - } + return PlayerSkinProviderLazyHolder.instance; + } - return instance; + private static class PlayerSkinProviderLazyHolder + { + public static final PlayerSkinProvider instance = new PlayerSkinProvider(); + } + + public PlayerSkinProvider() + { + this.skinCache.initializeStorage(); + } + + @Initializer + private void load() + { + Bukkit.getAsyncScheduler().runAtFixedRate(plugin, + task -> this.batchPlayerInfo(), + 1500, 1500, + TimeUnit.MILLISECONDS); } private final SkinCache skinCache = new SkinCache(); + // region Info Request Batching + + private final List namesToLookup = new ObjectArrayList<>(); + private final Map> batchResults = new ConcurrentHashMap<>(); + + // name <-> lock + private final Map nameLockMap = new ConcurrentHashMap<>(); + private CompletableFuture> fetchPlayerInfoAsync(String name) { - var executor = Util.PROFILE_EXECUTOR; + var executor = ProfileLookupExecutor.executor(); - return CompletableFuture.supplyAsync(() -> this.fetchPlayerInfo(name), executor); + return CompletableFuture.supplyAsync(() -> this.schedulePlayerInfo(name), executor); + } + + private Optional schedulePlayerInfo(String name) + { + synchronized (namesToLookup) + { + this.namesToLookup.add(name); + } + + var lock = new Object(); + nameLockMap.put(name.toUpperCase(), lock); + + try + { + synchronized (lock) + { + lock.wait(); + } + + if (!this.batchResults.containsKey(name)) + return Optional.empty(); + else + return this.batchResults.remove(name); + } + catch (InterruptedException e) + { + logger.info("Skin lookup request for '%s' canceled by external source".formatted(name)); + return Optional.empty(); + } } + private static final Object batchLock = new Object(); + /** - * 根据给定的名称搜索对应的Profile(不包含皮肤) - * @apiNote 此方法返回的GameProfile不包含皮肤,若要获取于此对应的皮肤,请使用 {@link PlayerSkinProvider#fetchSkin(GameProfile)} - * @param name - * @return + * 批量处理玩家信息请求 */ - private Optional fetchPlayerInfo(String name) + public void batchPlayerInfo() + { + synchronized (batchLock) + { + startBatchPlayerInfo(); + } + } + + private void startBatchPlayerInfo() { - var profileRef = new AtomicReference(null); + if (namesToLookup.isEmpty()) return; + + List list; + synchronized (namesToLookup) + { + list = namesToLookup.stream().map(String::toUpperCase).toList(); + namesToLookup.clear(); + } + + List remainingNames = new ObjectArrayList<>(list); + + BiConsumer onRequestFinish = (n, profile) -> + { + var nameUpper = n.toUpperCase(); + + Optional optional = profile == null ? Optional.empty() : Optional.of(profile); + this.batchResults.put(n, optional); + + remainingNames.remove(nameUpper); + + var lock = nameLockMap.remove(nameUpper); + if (lock == null) + { + //logger.warn(nameUpper + ": Don't have a lock?!"); + return; + } + + synchronized (lock) + { + lock.notifyAll(); + } + }; var lookupCallback = new ProfileLookupCallback() { public void onProfileLookupSucceeded(GameProfile gameprofile) { - profileRef.set(gameprofile); + onRequestFinish.accept(gameprofile.getName(), gameprofile); } public void onProfileLookupFailed(String profileName, Exception exception) @@ -77,16 +168,17 @@ else if (exception instanceof AuthenticationUnavailableException) { logger.info("Failed to lookup '%s': '%s'".formatted(profileName, exception.getMessage())); } + + onRequestFinish.accept(profileName, null); } }; GameProfileRepository profileRepo = MinecraftServer.getServer().getProfileRepository(); - profileRepo.findProfilesByNames(new String[]{name}, lookupCallback); - - var profile = profileRef.get(); - return profile == null ? Optional.empty() : Optional.of(profile); + profileRepo.findProfilesByNames(remainingNames.toArray(new String[0]), lookupCallback); } + // endregion Info Request Batching + @Nullable public GameProfile getCachedProfile(String name) { @@ -222,5 +314,10 @@ public void invalidate(String name) skin.expiresAt = 0; } + public void shutdown() + { + ProfileLookupExecutor.executor().shutdownNow(); + } + //endregion } diff --git a/src/main/java/xyz/nifeather/morph/misc/skins/ProfileLookupExecutor.java b/src/main/java/xyz/nifeather/morph/misc/skins/ProfileLookupExecutor.java new file mode 100644 index 00000000..1298151b --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/misc/skins/ProfileLookupExecutor.java @@ -0,0 +1,60 @@ +package xyz.nifeather.morph.misc.skins; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import xyz.nifeather.morph.MorphPlugin; + +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; + +public class ProfileLookupExecutor +{ + @NotNull + public static ExecutorService executor() + { + var executor = EXECUTOR; + if (executor == null || executor.isShutdown()) + { + EXECUTOR = executor = createExecutor(); + + MorphPlugin.getInstance() + .getSLF4JLogger() + .info("Creating new executor with a maximum of " + getMaximumThreadCount() + " thread(s) for profile lookup."); + } + + return executor; + } + + private static int getMaximumThreadCount() + { + return Math.min(16, Math.max(4, Runtime.getRuntime().availableProcessors() / 2)); + } + + private static ExecutorService createExecutor() + { + return Executors.newFixedThreadPool(getMaximumThreadCount(), new ThreadFactory() + { + private final AtomicInteger threadCount = new AtomicInteger(0); + + @Override + public Thread newThread(@NotNull Runnable runnable) + { + Thread thread = new Thread(runnable); + var threadId = this.threadCount.getAndIncrement(); + thread.setName("FeatherMorph Profile Executor #" + threadId); + + thread.setUncaughtExceptionHandler((Thread t, Throwable error) -> + { + MorphPlugin.getInstance() + .getSLF4JLogger() + .error("Error occurred in thread " + t.getName(), error); + }); + + return thread; + } + }); + } + + @Nullable + private static volatile ExecutorService EXECUTOR; +} diff --git a/src/main/java/xiamomc/morph/misc/skins/SingleSkin.java b/src/main/java/xyz/nifeather/morph/misc/skins/SingleSkin.java similarity index 92% rename from src/main/java/xiamomc/morph/misc/skins/SingleSkin.java rename to src/main/java/xyz/nifeather/morph/misc/skins/SingleSkin.java index c45de3ed..882d3abb 100644 --- a/src/main/java/xiamomc/morph/misc/skins/SingleSkin.java +++ b/src/main/java/xyz/nifeather/morph/misc/skins/SingleSkin.java @@ -1,10 +1,10 @@ -package xiamomc.morph.misc.skins; +package xyz.nifeather.morph.misc.skins; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.mojang.authlib.GameProfile; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.utilities.NbtUtils; +import xyz.nifeather.morph.utilities.NbtUtils; public class SingleSkin { diff --git a/src/main/java/xiamomc/morph/misc/skins/SkinCache.java b/src/main/java/xyz/nifeather/morph/misc/skins/SkinCache.java similarity index 95% rename from src/main/java/xiamomc/morph/misc/skins/SkinCache.java rename to src/main/java/xyz/nifeather/morph/misc/skins/SkinCache.java index 038dba2b..4fe10daa 100644 --- a/src/main/java/xiamomc/morph/misc/skins/SkinCache.java +++ b/src/main/java/xyz/nifeather/morph/misc/skins/SkinCache.java @@ -1,10 +1,10 @@ -package xiamomc.morph.misc.skins; +package xyz.nifeather.morph.misc.skins; import com.mojang.authlib.GameProfile; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.storage.MorphJsonBasedStorage; +import xyz.nifeather.morph.storage.MorphJsonBasedStorage; import java.util.List; import java.util.Optional; diff --git a/src/main/java/xiamomc/morph/misc/skins/SkinCacheRoot.java b/src/main/java/xyz/nifeather/morph/misc/skins/SkinCacheRoot.java similarity index 88% rename from src/main/java/xiamomc/morph/misc/skins/SkinCacheRoot.java rename to src/main/java/xyz/nifeather/morph/misc/skins/SkinCacheRoot.java index d6384455..a026808a 100644 --- a/src/main/java/xiamomc/morph/misc/skins/SkinCacheRoot.java +++ b/src/main/java/xyz/nifeather/morph/misc/skins/SkinCacheRoot.java @@ -1,4 +1,4 @@ -package xiamomc.morph.misc.skins; +package xyz.nifeather.morph.misc.skins; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; diff --git a/src/main/java/xiamomc/morph/network/ReasonCodes.java b/src/main/java/xyz/nifeather/morph/network/ReasonCodes.java similarity index 65% rename from src/main/java/xiamomc/morph/network/ReasonCodes.java rename to src/main/java/xyz/nifeather/morph/network/ReasonCodes.java index 8b1c1e2a..a0f9eda3 100644 --- a/src/main/java/xiamomc/morph/network/ReasonCodes.java +++ b/src/main/java/xyz/nifeather/morph/network/ReasonCodes.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network; +package xyz.nifeather.morph.network; public class ReasonCodes { diff --git a/src/main/java/xiamomc/morph/network/modrinthapi/ModrinthVersionResponse.java b/src/main/java/xyz/nifeather/morph/network/modrinthapi/ModrinthVersionResponse.java similarity index 95% rename from src/main/java/xiamomc/morph/network/modrinthapi/ModrinthVersionResponse.java rename to src/main/java/xyz/nifeather/morph/network/modrinthapi/ModrinthVersionResponse.java index 3232dc18..3154ef39 100644 --- a/src/main/java/xiamomc/morph/network/modrinthapi/ModrinthVersionResponse.java +++ b/src/main/java/xyz/nifeather/morph/network/modrinthapi/ModrinthVersionResponse.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.modrinthapi; +package xyz.nifeather.morph.network.modrinthapi; import com.google.gson.annotations.SerializedName; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/IInstanceService.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/IInstanceService.java similarity index 73% rename from src/main/java/xiamomc/morph/network/multiInstance/IInstanceService.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/IInstanceService.java index 8653ebea..9e0434be 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/IInstanceService.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/IInstanceService.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.multiInstance; +package xyz.nifeather.morph.network.multiInstance; public interface IInstanceService { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/MultiInstanceService.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/MultiInstanceService.java similarity index 83% rename from src/main/java/xiamomc/morph/network/multiInstance/MultiInstanceService.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/MultiInstanceService.java index 25391949..4e577297 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/MultiInstanceService.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/MultiInstanceService.java @@ -1,19 +1,19 @@ -package xiamomc.morph.network.multiInstance; +package xyz.nifeather.morph.network.multiInstance; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.network.multiInstance.master.MasterInstance; -import xiamomc.morph.network.multiInstance.protocol.Operation; -import xiamomc.morph.network.multiInstance.protocol.SocketDisguiseMeta; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; -import xiamomc.morph.network.multiInstance.protocol.s2c.MIS2CSyncMetaCommand; -import xiamomc.morph.network.multiInstance.slave.SlaveInstance; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.network.multiInstance.master.MasterInstance; +import xyz.nifeather.morph.network.multiInstance.protocol.Operation; +import xyz.nifeather.morph.network.multiInstance.protocol.SocketDisguiseMeta; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.MIS2CSyncMetaCommand; +import xyz.nifeather.morph.network.multiInstance.slave.SlaveInstance; import java.util.Arrays; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/master/InstanceServer.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/master/InstanceServer.java similarity index 95% rename from src/main/java/xiamomc/morph/network/multiInstance/master/InstanceServer.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/master/InstanceServer.java index 8360e167..820e0a07 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/master/InstanceServer.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/master/InstanceServer.java @@ -1,12 +1,12 @@ -package xiamomc.morph.network.multiInstance.master; +package xyz.nifeather.morph.network.multiInstance.master; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.java_websocket.WebSocket; import org.java_websocket.handshake.ClientHandshake; import org.java_websocket.server.WebSocketServer; import org.slf4j.Logger; -import xiamomc.morph.network.multiInstance.protocol.IClientHandler; import xiamomc.pluginbase.XiaMoJavaPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IClientHandler; import java.net.InetSocketAddress; import java.util.List; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/master/MasterInstance.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/master/MasterInstance.java similarity index 92% rename from src/main/java/xiamomc/morph/network/multiInstance/master/MasterInstance.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/master/MasterInstance.java index 0163c929..6020851a 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/master/MasterInstance.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/master/MasterInstance.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.multiInstance.master; +package xyz.nifeather.morph.network.multiInstance.master; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -7,24 +7,24 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.network.ReasonCodes; import xiamomc.morph.network.commands.CommandRegistries; -import xiamomc.morph.network.multiInstance.IInstanceService; -import xiamomc.morph.network.multiInstance.protocol.IClientHandler; -import xiamomc.morph.network.multiInstance.protocol.Operation; -import xiamomc.morph.network.multiInstance.protocol.ProtocolLevel; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SCommand; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SLoginCommand; -import xiamomc.morph.network.multiInstance.protocol.s2c.*; -import xiamomc.morph.network.multiInstance.slave.SlaveInstance; -import xiamomc.morph.storage.playerdata.PlayerMeta; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.network.ReasonCodes; +import xyz.nifeather.morph.network.multiInstance.IInstanceService; +import xyz.nifeather.morph.network.multiInstance.protocol.IClientHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.Operation; +import xyz.nifeather.morph.network.multiInstance.protocol.ProtocolLevel; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SLoginCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.*; +import xyz.nifeather.morph.network.multiInstance.slave.SlaveInstance; +import xyz.nifeather.morph.storage.playerdata.PlayerMeta; import java.lang.ref.WeakReference; import java.net.ConnectException; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/master/NetworkDisguiseManager.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/master/NetworkDisguiseManager.java similarity index 88% rename from src/main/java/xiamomc/morph/network/multiInstance/master/NetworkDisguiseManager.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/master/NetworkDisguiseManager.java index 82465ca9..836753fd 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/master/NetworkDisguiseManager.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/master/NetworkDisguiseManager.java @@ -1,11 +1,11 @@ -package xiamomc.morph.network.multiInstance.master; +package xyz.nifeather.morph.network.multiInstance.master; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.OfflinePlayer; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.storage.playerdata.PlayerMeta; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.storage.playerdata.PlayerMeta; import java.util.List; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/IClientHandler.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/IClientHandler.java similarity index 58% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/IClientHandler.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/IClientHandler.java index de91bb03..a98d21e2 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/IClientHandler.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/IClientHandler.java @@ -1,9 +1,9 @@ -package xiamomc.morph.network.multiInstance.protocol; +package xyz.nifeather.morph.network.multiInstance.protocol; import org.java_websocket.WebSocket; -import xiamomc.morph.network.multiInstance.master.InstanceServer; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SLoginCommand; +import xyz.nifeather.morph.network.multiInstance.master.InstanceServer; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SLoginCommand; public interface IClientHandler { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/IMasterHandler.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/IMasterHandler.java similarity index 52% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/IMasterHandler.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/IMasterHandler.java index f0a62c53..37918f74 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/IMasterHandler.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/IMasterHandler.java @@ -1,10 +1,10 @@ -package xiamomc.morph.network.multiInstance.protocol; +package xyz.nifeather.morph.network.multiInstance.protocol; -import xiamomc.morph.network.multiInstance.protocol.s2c.MIS2CDisconnectCommand; -import xiamomc.morph.network.multiInstance.protocol.s2c.MIS2CLoginResultCommand; -import xiamomc.morph.network.multiInstance.protocol.s2c.MIS2CStateCommand; -import xiamomc.morph.network.multiInstance.protocol.s2c.MIS2CSyncMetaCommand; -import xiamomc.morph.network.multiInstance.slave.InstanceClient; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.MIS2CDisconnectCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.MIS2CLoginResultCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.MIS2CStateCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.MIS2CSyncMetaCommand; +import xyz.nifeather.morph.network.multiInstance.slave.InstanceClient; public interface IMasterHandler { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/Operation.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/Operation.java similarity index 53% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/Operation.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/Operation.java index 6c9fbde3..f8e25a7c 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/Operation.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/Operation.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.multiInstance.protocol; +package xyz.nifeather.morph.network.multiInstance.protocol; public enum Operation { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/ProtocolLevel.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/ProtocolLevel.java similarity index 93% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/ProtocolLevel.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/ProtocolLevel.java index 5bc3db7c..860c988c 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/ProtocolLevel.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/ProtocolLevel.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.multiInstance.protocol; +package xyz.nifeather.morph.network.multiInstance.protocol; public enum ProtocolLevel { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/SocketDisguiseMeta.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/SocketDisguiseMeta.java similarity index 96% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/SocketDisguiseMeta.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/SocketDisguiseMeta.java index 7652e803..bc5860e2 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/SocketDisguiseMeta.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/SocketDisguiseMeta.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.multiInstance.protocol; +package xyz.nifeather.morph.network.multiInstance.protocol; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SCommand.java index 5a4ba786..11b79a3f 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SCommand.java @@ -1,13 +1,13 @@ -package xiamomc.morph.network.multiInstance.protocol.c2s; +package xyz.nifeather.morph.network.multiInstance.protocol.c2s; import org.java_websocket.WebSocket; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; -import xiamomc.morph.MorphPlugin; import xiamomc.morph.network.BasicClientHandler; import xiamomc.morph.network.commands.C2S.AbstractC2SCommand; -import xiamomc.morph.network.multiInstance.protocol.IClientHandler; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IClientHandler; public abstract class MIC2SCommand extends AbstractC2SCommand { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SDisguiseMetaCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SDisguiseMetaCommand.java similarity index 81% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SDisguiseMetaCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SDisguiseMetaCommand.java index 54c501e3..cd189eed 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SDisguiseMetaCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SDisguiseMetaCommand.java @@ -1,11 +1,11 @@ -package xiamomc.morph.network.multiInstance.protocol.c2s; +package xyz.nifeather.morph.network.multiInstance.protocol.c2s; import com.google.gson.GsonBuilder; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.network.multiInstance.protocol.IClientHandler; -import xiamomc.morph.network.multiInstance.protocol.Operation; -import xiamomc.morph.network.multiInstance.protocol.SocketDisguiseMeta; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IClientHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.Operation; +import xyz.nifeather.morph.network.multiInstance.protocol.SocketDisguiseMeta; import java.util.List; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SLoginCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SLoginCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SLoginCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SLoginCommand.java index c2b5d72a..83fb2e76 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/c2s/MIC2SLoginCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/c2s/MIC2SLoginCommand.java @@ -1,10 +1,10 @@ -package xiamomc.morph.network.multiInstance.protocol.c2s; +package xyz.nifeather.morph.network.multiInstance.protocol.c2s; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.network.multiInstance.protocol.IClientHandler; -import xiamomc.morph.network.multiInstance.protocol.ProtocolLevel; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IClientHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.ProtocolLevel; public class MIC2SLoginCommand extends MIC2SCommand { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CCommand.java index 96263df4..f615fba2 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CCommand.java @@ -1,13 +1,13 @@ -package xiamomc.morph.network.multiInstance.protocol.s2c; +package xyz.nifeather.morph.network.multiInstance.protocol.s2c; import org.java_websocket.WebSocket; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; -import xiamomc.morph.MorphPlugin; import xiamomc.morph.network.BasicServerHandler; import xiamomc.morph.network.commands.S2C.AbstractS2CCommand; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; public abstract class MIS2CCommand extends AbstractS2CCommand { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CDisconnectCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CDisconnectCommand.java similarity index 88% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CDisconnectCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CDisconnectCommand.java index 9e60972e..32e3545a 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CDisconnectCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CDisconnectCommand.java @@ -1,7 +1,7 @@ -package xiamomc.morph.network.multiInstance.protocol.s2c; +package xyz.nifeather.morph.network.multiInstance.protocol.s2c; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; public class MIS2CDisconnectCommand extends MIS2CCommand { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CLoginResultCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CLoginResultCommand.java similarity index 79% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CLoginResultCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CLoginResultCommand.java index 4ce78c2c..cc0fcd11 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CLoginResultCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CLoginResultCommand.java @@ -1,6 +1,6 @@ -package xiamomc.morph.network.multiInstance.protocol.s2c; +package xyz.nifeather.morph.network.multiInstance.protocol.s2c; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; public class MIS2CLoginResultCommand extends MIS2CCommand { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CStateCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CStateCommand.java similarity index 85% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CStateCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CStateCommand.java index 02243e9d..5f48b50c 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CStateCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CStateCommand.java @@ -1,6 +1,6 @@ -package xiamomc.morph.network.multiInstance.protocol.s2c; +package xyz.nifeather.morph.network.multiInstance.protocol.s2c; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; import java.util.Arrays; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CSyncMetaCommand.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CSyncMetaCommand.java similarity index 78% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CSyncMetaCommand.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CSyncMetaCommand.java index 54494568..f585c02d 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/MIS2CSyncMetaCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/MIS2CSyncMetaCommand.java @@ -1,10 +1,10 @@ -package xiamomc.morph.network.multiInstance.protocol.s2c; +package xyz.nifeather.morph.network.multiInstance.protocol.s2c; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; -import xiamomc.morph.network.multiInstance.protocol.Operation; -import xiamomc.morph.network.multiInstance.protocol.SocketDisguiseMeta; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.Operation; +import xyz.nifeather.morph.network.multiInstance.protocol.SocketDisguiseMeta; import java.util.List; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/ProtocolState.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/ProtocolState.java similarity index 84% rename from src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/ProtocolState.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/ProtocolState.java index 502fa6ae..36b394f4 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/protocol/s2c/ProtocolState.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/protocol/s2c/ProtocolState.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.multiInstance.protocol.s2c; +package xyz.nifeather.morph.network.multiInstance.protocol.s2c; public enum ProtocolState { diff --git a/src/main/java/xiamomc/morph/network/multiInstance/slave/InstanceClient.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/slave/InstanceClient.java similarity index 94% rename from src/main/java/xiamomc/morph/network/multiInstance/slave/InstanceClient.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/slave/InstanceClient.java index e537e66f..5f473527 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/slave/InstanceClient.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/slave/InstanceClient.java @@ -1,10 +1,10 @@ -package xiamomc.morph.network.multiInstance.slave; +package xyz.nifeather.morph.network.multiInstance.slave; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; import org.slf4j.Logger; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; import xiamomc.pluginbase.XiaMoJavaPlugin; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; import java.net.ConnectException; import java.net.URI; diff --git a/src/main/java/xiamomc/morph/network/multiInstance/slave/SlaveInstance.java b/src/main/java/xyz/nifeather/morph/network/multiInstance/slave/SlaveInstance.java similarity index 90% rename from src/main/java/xiamomc/morph/network/multiInstance/slave/SlaveInstance.java rename to src/main/java/xyz/nifeather/morph/network/multiInstance/slave/SlaveInstance.java index 3d416262..a3c886c6 100644 --- a/src/main/java/xiamomc/morph/network/multiInstance/slave/SlaveInstance.java +++ b/src/main/java/xyz/nifeather/morph/network/multiInstance/slave/SlaveInstance.java @@ -1,30 +1,30 @@ -package xiamomc.morph.network.multiInstance.slave; +package xyz.nifeather.morph.network.multiInstance.slave; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Bukkit; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.network.ReasonCodes; import xiamomc.morph.network.commands.C2S.AbstractC2SCommand; import xiamomc.morph.network.commands.CommandRegistries; -import xiamomc.morph.network.multiInstance.IInstanceService; -import xiamomc.morph.network.multiInstance.master.MasterInstance; -import xiamomc.morph.network.multiInstance.protocol.IMasterHandler; -import xiamomc.morph.network.multiInstance.protocol.Operation; -import xiamomc.morph.network.multiInstance.protocol.ProtocolLevel; -import xiamomc.morph.network.multiInstance.protocol.SocketDisguiseMeta; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; -import xiamomc.morph.network.multiInstance.protocol.c2s.MIC2SLoginCommand; -import xiamomc.morph.network.multiInstance.protocol.s2c.*; -import xiamomc.morph.network.server.MorphClientHandler; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.network.ReasonCodes; +import xyz.nifeather.morph.network.multiInstance.IInstanceService; +import xyz.nifeather.morph.network.multiInstance.master.MasterInstance; +import xyz.nifeather.morph.network.multiInstance.protocol.IMasterHandler; +import xyz.nifeather.morph.network.multiInstance.protocol.Operation; +import xyz.nifeather.morph.network.multiInstance.protocol.ProtocolLevel; +import xyz.nifeather.morph.network.multiInstance.protocol.SocketDisguiseMeta; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SDisguiseMetaCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.c2s.MIC2SLoginCommand; +import xyz.nifeather.morph.network.multiInstance.protocol.s2c.*; +import xyz.nifeather.morph.network.server.MorphClientHandler; import java.net.URI; import java.util.List; diff --git a/src/main/java/xiamomc/morph/network/server/MorphClientHandler.java b/src/main/java/xyz/nifeather/morph/network/server/MorphClientHandler.java similarity index 97% rename from src/main/java/xiamomc/morph/network/server/MorphClientHandler.java rename to src/main/java/xyz/nifeather/morph/network/server/MorphClientHandler.java index 8e52a5c3..aaca413f 100644 --- a/src/main/java/xiamomc/morph/network/server/MorphClientHandler.java +++ b/src/main/java/xyz/nifeather/morph/network/server/MorphClientHandler.java @@ -1,4 +1,4 @@ -package xiamomc.morph.network.server; +package xyz.nifeather.morph.network.server; import com.google.common.io.ByteStreams; import io.netty.buffer.Unpooled; @@ -14,18 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.interfaces.IManageRequests; -import xiamomc.morph.messages.EmoteStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.NetworkingHelper; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.morph.network.*; import xiamomc.morph.network.commands.C2S.*; import xiamomc.morph.network.commands.CommandRegistries; @@ -40,6 +28,18 @@ import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.interfaces.IManageRequests; +import xyz.nifeather.morph.messages.EmoteStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.NetworkingHelper; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.nio.charset.StandardCharsets; import java.util.Collection; diff --git a/src/main/java/xiamomc/morph/network/server/ServerSetEquipCommand.java b/src/main/java/xyz/nifeather/morph/network/server/ServerSetEquipCommand.java similarity index 92% rename from src/main/java/xiamomc/morph/network/server/ServerSetEquipCommand.java rename to src/main/java/xyz/nifeather/morph/network/server/ServerSetEquipCommand.java index 297a03c0..99198289 100644 --- a/src/main/java/xiamomc/morph/network/server/ServerSetEquipCommand.java +++ b/src/main/java/xyz/nifeather/morph/network/server/ServerSetEquipCommand.java @@ -1,9 +1,9 @@ -package xiamomc.morph.network.server; +package xyz.nifeather.morph.network.server; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import xiamomc.morph.network.commands.S2C.set.S2CSetFakeEquipCommand; -import xiamomc.morph.utilities.ItemUtils; +import xyz.nifeather.morph.utilities.ItemUtils; public class ServerSetEquipCommand extends S2CSetFakeEquipCommand { diff --git a/src/main/java/xyz/nifeather/morph/providers/animation/AnimationProvider.java b/src/main/java/xyz/nifeather/morph/providers/animation/AnimationProvider.java new file mode 100644 index 00000000..6e5038c8 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/providers/animation/AnimationProvider.java @@ -0,0 +1,15 @@ +package xyz.nifeather.morph.providers.animation; + +import org.jetbrains.annotations.NotNull; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.providers.animation.bundled.FallbackAnimationSet; + +public abstract class AnimationProvider extends MorphPluginObject +{ + /** + * @param disguiseID + * @return The sequence of the given parameters, {@link FallbackAnimationSet} if invalid. + */ + @NotNull + public abstract AnimationSet getAnimationSetFor(String disguiseID); +} diff --git a/src/main/java/xiamomc/morph/providers/animation/AnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/AnimationSet.java similarity index 94% rename from src/main/java/xiamomc/morph/providers/animation/AnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/AnimationSet.java index 12d9d06e..6d0dbfdd 100644 --- a/src/main/java/xiamomc/morph/providers/animation/AnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/AnimationSet.java @@ -1,9 +1,9 @@ -package xiamomc.morph.providers.animation; +package xyz.nifeather.morph.providers.animation; import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.AnimationNames; +import xyz.nifeather.morph.misc.AnimationNames; import java.util.List; import java.util.Map; @@ -67,7 +67,7 @@ protected void register(String sequenceID, List sequence, boole * @return A pair, left is the sequence, right is whether the sequence is persistent */ @NotNull - public Pair, Boolean> sequenceOf(String animationId) + public Pair, Boolean> sequenceOf(@NotNull String animationId) { return animationMap.getOrDefault(animationId, Pair.of(List.of(), false)); } diff --git a/src/main/java/xiamomc/morph/providers/animation/SingleAnimation.java b/src/main/java/xyz/nifeather/morph/providers/animation/SingleAnimation.java similarity index 84% rename from src/main/java/xiamomc/morph/providers/animation/SingleAnimation.java rename to src/main/java/xyz/nifeather/morph/providers/animation/SingleAnimation.java index 91207a97..474f2519 100644 --- a/src/main/java/xiamomc/morph/providers/animation/SingleAnimation.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/SingleAnimation.java @@ -1,4 +1,4 @@ -package xiamomc.morph.providers.animation; +package xyz.nifeather.morph.providers.animation; /** * diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/AllayAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/AllayAnimationSet.java similarity index 67% rename from src/main/java/xiamomc/morph/providers/animation/bundled/AllayAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/AllayAnimationSet.java index 30440fe9..5537658d 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/AllayAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/AllayAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/ArmadilloAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/ArmadilloAnimationSet.java similarity index 78% rename from src/main/java/xiamomc/morph/providers/animation/bundled/ArmadilloAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/ArmadilloAnimationSet.java index 4654b214..7b7606ef 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/ArmadilloAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/ArmadilloAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/CatAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/CatAnimationSet.java similarity index 72% rename from src/main/java/xiamomc/morph/providers/animation/bundled/CatAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/CatAnimationSet.java index 42cf8017..c220a579 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/CatAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/CatAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FallbackAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FallbackAnimationSet.java new file mode 100644 index 00000000..2ae88e0d --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FallbackAnimationSet.java @@ -0,0 +1,7 @@ +package xyz.nifeather.morph.providers.animation.bundled; + +import xyz.nifeather.morph.providers.animation.AnimationSet; + +public class FallbackAnimationSet extends AnimationSet +{ +} diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/FoxAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FoxAnimationSet.java similarity index 73% rename from src/main/java/xiamomc/morph/providers/animation/bundled/FoxAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/FoxAnimationSet.java index 0cbcc7cf..8897b5b1 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/FoxAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FoxAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/FrogAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FrogAnimationSet.java similarity index 54% rename from src/main/java/xiamomc/morph/providers/animation/bundled/FrogAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/FrogAnimationSet.java index c3f715e9..c374ab60 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/FrogAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/FrogAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/PandaAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PandaAnimationSet.java similarity index 66% rename from src/main/java/xiamomc/morph/providers/animation/bundled/PandaAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/PandaAnimationSet.java index c6998acb..fc16d7f6 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/PandaAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PandaAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/ParrotAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/ParrotAnimationSet.java similarity index 67% rename from src/main/java/xiamomc/morph/providers/animation/bundled/ParrotAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/ParrotAnimationSet.java index eecd0abd..d33a8f3f 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/ParrotAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/ParrotAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/PiglinAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PiglinAnimationSet.java similarity index 67% rename from src/main/java/xiamomc/morph/providers/animation/bundled/PiglinAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/PiglinAnimationSet.java index 2d5009f5..b0c74c45 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/PiglinAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PiglinAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/PlayerAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PlayerAnimationSet.java similarity index 72% rename from src/main/java/xiamomc/morph/providers/animation/bundled/PlayerAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/PlayerAnimationSet.java index 3c40afbb..b6cf2eb2 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/PlayerAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PlayerAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/PufferfishAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PufferfishAnimationSet.java similarity index 67% rename from src/main/java/xiamomc/morph/providers/animation/bundled/PufferfishAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/PufferfishAnimationSet.java index 6bec17f6..74fa9616 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/PufferfishAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/PufferfishAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/ShulkerAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/ShulkerAnimationSet.java similarity index 75% rename from src/main/java/xiamomc/morph/providers/animation/bundled/ShulkerAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/ShulkerAnimationSet.java index c888ab55..7777ff2e 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/ShulkerAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/ShulkerAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/SnifferAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/SnifferAnimationSet.java similarity index 56% rename from src/main/java/xiamomc/morph/providers/animation/bundled/SnifferAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/SnifferAnimationSet.java index 2c43d510..716dee94 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/SnifferAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/SnifferAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/WardenAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/WardenAnimationSet.java similarity index 87% rename from src/main/java/xiamomc/morph/providers/animation/bundled/WardenAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/WardenAnimationSet.java index 20386fcf..ef86f72e 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/WardenAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/WardenAnimationSet.java @@ -1,10 +1,10 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; import net.minecraft.world.entity.ai.behavior.warden.Sniffing; import net.minecraft.world.entity.monster.warden.WardenAi; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/bundled/WolfAnimationSet.java b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/WolfAnimationSet.java similarity index 65% rename from src/main/java/xiamomc/morph/providers/animation/bundled/WolfAnimationSet.java rename to src/main/java/xyz/nifeather/morph/providers/animation/bundled/WolfAnimationSet.java index bf6fab89..9480b4fd 100644 --- a/src/main/java/xiamomc/morph/providers/animation/bundled/WolfAnimationSet.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/bundled/WolfAnimationSet.java @@ -1,8 +1,8 @@ -package xiamomc.morph.providers.animation.bundled; +package xyz.nifeather.morph.providers.animation.bundled; -import xiamomc.morph.misc.AnimationNames; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.SingleAnimation; +import xyz.nifeather.morph.misc.AnimationNames; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.SingleAnimation; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/animation/provider/DefaultAnimationProvider.java b/src/main/java/xyz/nifeather/morph/providers/animation/provider/DefaultAnimationProvider.java similarity index 73% rename from src/main/java/xiamomc/morph/providers/animation/provider/DefaultAnimationProvider.java rename to src/main/java/xyz/nifeather/morph/providers/animation/provider/DefaultAnimationProvider.java index b6799575..2f4765e5 100644 --- a/src/main/java/xiamomc/morph/providers/animation/provider/DefaultAnimationProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/provider/DefaultAnimationProvider.java @@ -1,9 +1,9 @@ -package xiamomc.morph.providers.animation.provider; +package xyz.nifeather.morph.providers.animation.provider; import org.bukkit.entity.EntityType; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.bundled.FallbackAnimationSet; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.bundled.FallbackAnimationSet; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/xiamomc/morph/providers/animation/provider/FallbackAnimationProvider.java b/src/main/java/xyz/nifeather/morph/providers/animation/provider/FallbackAnimationProvider.java similarity index 52% rename from src/main/java/xiamomc/morph/providers/animation/provider/FallbackAnimationProvider.java rename to src/main/java/xyz/nifeather/morph/providers/animation/provider/FallbackAnimationProvider.java index f231c72b..5508358b 100644 --- a/src/main/java/xiamomc/morph/providers/animation/provider/FallbackAnimationProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/provider/FallbackAnimationProvider.java @@ -1,10 +1,9 @@ -package xiamomc.morph.providers.animation.provider; +package xyz.nifeather.morph.providers.animation.provider; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.bundled.FallbackAnimationSet; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.bundled.FallbackAnimationSet; public class FallbackAnimationProvider extends AnimationProvider { diff --git a/src/main/java/xiamomc/morph/providers/animation/provider/PlayerAnimationProvider.java b/src/main/java/xyz/nifeather/morph/providers/animation/provider/PlayerAnimationProvider.java similarity index 53% rename from src/main/java/xiamomc/morph/providers/animation/provider/PlayerAnimationProvider.java rename to src/main/java/xyz/nifeather/morph/providers/animation/provider/PlayerAnimationProvider.java index fe68df2d..70bde37c 100644 --- a/src/main/java/xiamomc/morph/providers/animation/provider/PlayerAnimationProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/provider/PlayerAnimationProvider.java @@ -1,10 +1,9 @@ -package xiamomc.morph.providers.animation.provider; +package xyz.nifeather.morph.providers.animation.provider; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.bundled.PlayerAnimationSet; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.bundled.PlayerAnimationSet; public class PlayerAnimationProvider extends AnimationProvider { diff --git a/src/main/java/xiamomc/morph/providers/animation/provider/VanillaAnimationProvider.java b/src/main/java/xyz/nifeather/morph/providers/animation/provider/VanillaAnimationProvider.java similarity index 87% rename from src/main/java/xiamomc/morph/providers/animation/provider/VanillaAnimationProvider.java rename to src/main/java/xyz/nifeather/morph/providers/animation/provider/VanillaAnimationProvider.java index cce7d5c0..10c5964c 100644 --- a/src/main/java/xiamomc/morph/providers/animation/provider/VanillaAnimationProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/animation/provider/VanillaAnimationProvider.java @@ -1,10 +1,9 @@ -package xiamomc.morph.providers.animation.provider; +package xyz.nifeather.morph.providers.animation.provider; import org.bukkit.entity.EntityType; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import xiamomc.morph.providers.animation.AnimationSet; -import xiamomc.morph.providers.animation.bundled.*; +import xyz.nifeather.morph.providers.animation.AnimationSet; +import xyz.nifeather.morph.providers.animation.bundled.*; public class VanillaAnimationProvider extends DefaultAnimationProvider { diff --git a/src/main/java/xiamomc/morph/providers/disguise/DefaultDisguiseProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/DefaultDisguiseProvider.java similarity index 86% rename from src/main/java/xiamomc/morph/providers/disguise/DefaultDisguiseProvider.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/DefaultDisguiseProvider.java index 64165029..5b27ee43 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/DefaultDisguiseProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/DefaultDisguiseProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; @@ -10,19 +10,20 @@ import org.bukkit.inventory.EquipmentSlot; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.RevealingHandler; -import xiamomc.morph.abilities.AbilityManager; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.RevealingHandler; +import xyz.nifeather.morph.abilities.AbilityManager; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.DisguiseState; import xiamomc.morph.network.commands.S2C.AbstractS2CCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.network.server.ServerSetEquipCommand; -import xiamomc.morph.skills.MorphSkillHandler; -import xiamomc.morph.skills.SkillType; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.network.server.ServerSetEquipCommand; +import xyz.nifeather.morph.skills.MorphSkillHandler; +import xyz.nifeather.morph.skills.SkillType; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Messages.MessageStore; +import xyz.nifeather.morph.storage.skill.ISkillOption; import java.util.List; @@ -198,6 +199,12 @@ public void postConstructDisguise(DisguiseState state, @Nullable Entity targetEn //被动技能 var abilities = abilityHandler.getAbilitiesFor(state.skillLookupIdentifier()); state.getAbilityUpdater().setAbilities(abilities); - state.setSkill(skillHandler.getSkill(state.skillLookupIdentifier())); + + var abilityOptions = abilityHandler.getOptionsFor(state.skillLookupIdentifier()); + abilityOptions.forEach((id, config) -> state.getAbilityUpdater().setAbilityConfig(id.asString(), config)); + + var skillEntry = skillHandler.getSkillEntry(state.skillLookupIdentifier()); + if (skillEntry != null) + state.setSkill(skillEntry.value(), skillEntry.key()); } } diff --git a/src/main/java/xiamomc/morph/providers/disguise/DisguiseProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/DisguiseProvider.java similarity index 93% rename from src/main/java/xiamomc/morph/providers/disguise/DisguiseProvider.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/DisguiseProvider.java index febc61dd..f7ec76ff 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/DisguiseProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/DisguiseProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; @@ -6,20 +6,19 @@ import org.bukkit.craftbukkit.entity.CraftLivingEntity; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseState; import xiamomc.morph.network.commands.S2C.AbstractS2CCommand; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.utilities.NbtUtils; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.utilities.NbtUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.BindableList; @@ -222,10 +221,10 @@ protected DisguiseResult constructFromEntity(DisguiseMeta info, @Nullable Entity var backend = getPreferredBackend(); DisguiseWrapper ourDisguise; - DisguiseWrapper theirDisguise = backend.getWrapper(target); DisguiseState theirState = morphs.getDisguiseStateFor(target); + DisguiseWrapper theirDisguise = theirState != null ? theirState.getDisguiseWrapper() : null; - if (theirState != null && theirDisguise != null) + if (theirState != null) { var key = theirState.getDisguiseIdentifier(); diff --git a/src/main/java/xiamomc/morph/providers/disguise/DisguiseResult.java b/src/main/java/xyz/nifeather/morph/providers/disguise/DisguiseResult.java similarity index 90% rename from src/main/java/xiamomc/morph/providers/disguise/DisguiseResult.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/DisguiseResult.java index 329e0d53..6482bec2 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/DisguiseResult.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/DisguiseResult.java @@ -1,7 +1,7 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.DisguiseWrapper; /** * @param wrapperInstance Wrapper实例,在失败时为空 diff --git a/src/main/java/xiamomc/morph/providers/disguise/FallbackDisguiseProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/FallbackDisguiseProvider.java similarity index 86% rename from src/main/java/xiamomc/morph/providers/disguise/FallbackDisguiseProvider.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/FallbackDisguiseProvider.java index e608fb26..8d9760b6 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/FallbackDisguiseProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/FallbackDisguiseProvider.java @@ -1,15 +1,15 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import net.kyori.adventure.text.Component; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.provider.FallbackAnimationProvider; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.provider.FallbackAnimationProvider; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/disguise/ModelEngineProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/ModelEngineProvider.java similarity index 92% rename from src/main/java/xiamomc/morph/providers/disguise/ModelEngineProvider.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/ModelEngineProvider.java index 863b1404..ae8a257a 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/ModelEngineProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/ModelEngineProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import com.ticxo.modelengine.api.ModelEngineAPI; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -7,16 +7,15 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseBackend; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.modelengine.MEBackend; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.backends.DisguiseBackend; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.modelengine.MEBackend; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseTypes; import xiamomc.morph.network.commands.S2C.AbstractS2CCommand; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.provider.FallbackAnimationProvider; -import xiamomc.morph.providers.animation.provider.VanillaAnimationProvider; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.provider.FallbackAnimationProvider; import xiamomc.pluginbase.Exceptions.NullDependencyException; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/disguise/PlayerDisguiseProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/PlayerDisguiseProvider.java similarity index 91% rename from src/main/java/xiamomc/morph/providers/disguise/PlayerDisguiseProvider.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/PlayerDisguiseProvider.java index a6c9270a..c001d594 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/PlayerDisguiseProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/PlayerDisguiseProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import com.mojang.authlib.GameProfile; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -13,19 +13,19 @@ import org.bukkit.inventory.meta.SkullMeta; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.backends.WrapperEvent; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.MorphGameProfile; -import xiamomc.morph.misc.skins.PlayerSkinProvider; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.backends.WrapperEvent; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.MorphGameProfile; +import xyz.nifeather.morph.misc.skins.PlayerSkinProvider; import xiamomc.morph.network.commands.S2C.set.S2CSetProfileCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.provider.PlayerAnimationProvider; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.provider.PlayerAnimationProvider; import xiamomc.pluginbase.Annotations.Resolved; import java.util.List; diff --git a/src/main/java/xiamomc/morph/providers/disguise/VanillaDisguiseProvider.java b/src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java similarity index 94% rename from src/main/java/xiamomc/morph/providers/disguise/VanillaDisguiseProvider.java rename to src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java index c288c31e..f1e87cb9 100644 --- a/src/main/java/xiamomc/morph/providers/disguise/VanillaDisguiseProvider.java +++ b/src/main/java/xyz/nifeather/morph/providers/disguise/VanillaDisguiseProvider.java @@ -1,4 +1,4 @@ -package xiamomc.morph.providers.disguise; +package xyz.nifeather.morph.providers.disguise; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; @@ -13,25 +13,25 @@ import org.bukkit.inventory.EquipmentSlotGroup; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.backends.DisguiseWrapper; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.messages.vanilla.VanillaMessageStore; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.disguiseProperty.DisguiseProperties; -import xiamomc.morph.misc.disguiseProperty.values.ArmorStandProperties; -import xiamomc.morph.providers.animation.AnimationProvider; -import xiamomc.morph.providers.animation.provider.VanillaAnimationProvider; -import xiamomc.morph.utilities.*; +import xyz.nifeather.morph.backends.DisguiseWrapper; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.messages.vanilla.VanillaMessageStore; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.misc.disguiseProperty.DisguiseProperties; +import xyz.nifeather.morph.misc.disguiseProperty.values.ArmorStandProperties; +import xyz.nifeather.morph.providers.animation.AnimationProvider; +import xyz.nifeather.morph.providers.animation.provider.VanillaAnimationProvider; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Exceptions.NullDependencyException; +import xyz.nifeather.morph.utilities.*; import java.lang.reflect.Field; import java.util.List; diff --git a/src/main/java/xiamomc/morph/skills/DefaultConfigGenerator.java b/src/main/java/xyz/nifeather/morph/skills/DefaultConfigGenerator.java similarity index 89% rename from src/main/java/xiamomc/morph/skills/DefaultConfigGenerator.java rename to src/main/java/xyz/nifeather/morph/skills/DefaultConfigGenerator.java index 8f6ddc29..e04ad4a8 100644 --- a/src/main/java/xiamomc/morph/skills/DefaultConfigGenerator.java +++ b/src/main/java/xyz/nifeather/morph/skills/DefaultConfigGenerator.java @@ -1,5 +1,6 @@ -package xiamomc.morph.skills; +package xyz.nifeather.morph.skills; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.bossbar.BossBar; import org.bukkit.NamespacedKey; @@ -7,21 +8,22 @@ import org.bukkit.entity.EntityType; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.abilities.AbilityType; -import xiamomc.morph.abilities.options.*; -import xiamomc.morph.skills.impl.SonicBoomMorphSkill; -import xiamomc.morph.skills.options.EffectConfiguration; -import xiamomc.morph.skills.options.ExplosionConfiguration; -import xiamomc.morph.skills.options.ProjectileConfiguration; -import xiamomc.morph.skills.options.TeleportConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfigurationContainer; -import xiamomc.morph.utilities.DisguiseUtils; -import xiamomc.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.abilities.AbilityType; +import xyz.nifeather.morph.abilities.options.*; +import xyz.nifeather.morph.skills.impl.SonicBoomMorphSkill; +import xyz.nifeather.morph.skills.options.EffectConfiguration; +import xyz.nifeather.morph.skills.options.ExplosionConfiguration; +import xyz.nifeather.morph.skills.options.ProjectileConfiguration; +import xyz.nifeather.morph.skills.options.TeleportConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfigurationContainer; +import xyz.nifeather.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.utilities.EntityTypeUtils; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.Set; public class DefaultConfigGenerator @@ -31,21 +33,18 @@ public static DefaultConfigGenerator createInstance() return new DefaultConfigGenerator(); } - private List configurations = new ObjectArrayList<>(); + private Map configurations = new Object2ObjectOpenHashMap<>(); private SkillAbilityConfiguration getConfiguration(String mobId) { - var cfg = configurations.stream() - .filter(c -> c.getIdentifier().equalsIgnoreCase(mobId)) - .findFirst().orElse(null); + var cfg = configurations.getOrDefault(mobId, null); if (cfg != null) return cfg; var newConfig = new SkillAbilityConfiguration(); - newConfig.setIdentifier(mobId) - .setSkillIdentifier(SkillType.NONE); + newConfig.setSkillIdentifier(SkillType.NONE); - configurations.add(newConfig); + configurations.put(mobId, newConfig); return newConfig; } @@ -55,28 +54,12 @@ private SkillAbilityConfiguration getConfiguration(EntityType entityType) return getConfiguration(entityType.key().asString()); } - @Nullable - private SkillAbilityConfigurationContainer cachedContainer; - - public SkillAbilityConfigurationContainer generateConfiguration() + public Map generateConfiguration() { - if (cachedContainer != null) return cachedContainer; - - var container = new SkillAbilityConfigurationContainer(); - this.generateSkills(); this.generateAbilities(); - container.configurations.addAll(this.configurations); - - cachedContainer = container; - - return container; - } - - public void setConfigurationList(List newConfigurations) - { - this.configurations = newConfigurations; + return this.configurations; } public void generateSkills() diff --git a/src/main/java/xiamomc/morph/skills/IMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/IMorphSkill.java similarity index 87% rename from src/main/java/xiamomc/morph/skills/IMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/IMorphSkill.java index 776a20dd..ff083784 100644 --- a/src/main/java/xiamomc/morph/skills/IMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/IMorphSkill.java @@ -1,14 +1,14 @@ -package xiamomc.morph.skills; +package xyz.nifeather.morph.skills; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.storage.skill.ISkillOption; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public interface IMorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/MorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/MorphSkill.java similarity index 92% rename from src/main/java/xiamomc/morph/skills/MorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/MorphSkill.java index 980f7fb9..775e7722 100644 --- a/src/main/java/xiamomc/morph/skills/MorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/MorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills; +package xyz.nifeather.morph.skills; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; @@ -11,11 +11,11 @@ import org.bukkit.entity.*; import org.bukkit.event.entity.CreatureSpawnEvent; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.storage.skill.ISkillOption; -import xiamomc.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.utilities.DisguiseUtils; import java.util.List; diff --git a/src/main/java/xiamomc/morph/skills/MorphSkillHandler.java b/src/main/java/xyz/nifeather/morph/skills/MorphSkillHandler.java similarity index 76% rename from src/main/java/xiamomc/morph/skills/MorphSkillHandler.java rename to src/main/java/xyz/nifeather/morph/skills/MorphSkillHandler.java index 18dba0fe..badf7e72 100644 --- a/src/main/java/xiamomc/morph/skills/MorphSkillHandler.java +++ b/src/main/java/xyz/nifeather/morph/skills/MorphSkillHandler.java @@ -1,8 +1,10 @@ -package xiamomc.morph.skills; +package xyz.nifeather.morph.skills; +import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; +import it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; import org.bukkit.Bukkit; @@ -12,26 +14,28 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.events.api.gameplay.PlayerExecuteSkillEvent; -import xiamomc.morph.events.api.lifecycle.SkillsFinishedInitializeEvent; -import xiamomc.morph.messages.CommandStrings; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.permissions.CommonPermissions; -import xiamomc.morph.skills.impl.*; -import xiamomc.morph.storage.skill.ISkillOption; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfigurationStore; -import xiamomc.morph.utilities.PermissionUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.events.api.gameplay.PlayerExecuteSkillEvent; +import xyz.nifeather.morph.events.api.lifecycle.SkillsFinishedInitializeEvent; +import xyz.nifeather.morph.messages.CommandStrings; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.MorphStrings; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; +import xyz.nifeather.morph.providers.disguise.DefaultDisguiseProvider; +import xyz.nifeather.morph.skills.impl.*; +import xyz.nifeather.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.storage.skill.SkillsConfigurationStoreNew; +import xyz.nifeather.morph.utilities.PermissionUtils; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; public class MorphSkillHandler extends MorphPluginObject @@ -39,7 +43,7 @@ public class MorphSkillHandler extends MorphPluginObject /** * 已注册的技能 */ - private final List> skills = new ObjectArrayList<>(); + private final Map> skills = new ConcurrentHashMap<>(); /** * 获取已注册的技能 @@ -48,7 +52,7 @@ public class MorphSkillHandler extends MorphPluginObject */ public List> getRegistedSkills() { - return skills; + return skills.values().stream().toList(); } /** @@ -65,7 +69,7 @@ public List> getRegistedSkills() private MorphManager manager; @Resolved - private SkillAbilityConfigurationStore store; + private SkillsConfigurationStoreNew store; @Initializer private void load() @@ -114,7 +118,7 @@ public boolean registerSkill(IMorphSkill skill) { //logger.info("Registering skill: " + skill.getIdentifier().asString()); - if (skills.contains(skill)) + if (skills.containsKey(skill.getIdentifier().asString())) { logger.error("Can't register skill: Another skill instance has already registered as " + skill.getIdentifier().asString() + " !"); return false; @@ -126,7 +130,7 @@ public boolean registerSkill(IMorphSkill skill) return false; } - skills.add(skill); + skills.put(skill.getIdentifier().asString(), skill); return true; } @@ -142,32 +146,45 @@ private void update() /** * 获取某个ID对应的技能和技能配置 - * @param identifier ID + * @param identifier 伪装ID * @return 对应的技能和技能配置,如果没找到则是null */ @Nullable - private Map.Entry> getSkillEntry(String identifier) + public Pair> getSkillEntry(String identifier) { if (identifier == null) return null; - return store.getConfiguredSkills().entrySet().stream() - .filter(d -> identifier.equals(d.getKey().getIdentifier())).findFirst().orElse(null); + var configuration = store.get(identifier); + if (configuration == null) return null; + + var skillID = configuration.getSkillIdentifier(); + var skillInstance = this.getSkill(skillID.asString()); + + return new ObjectObjectImmutablePair<>(configuration, skillInstance); + } + + @NotNull + public IMorphSkill lookupDisguiseSkill(String disguiseIdentifier) + { + var configuration = store.get(disguiseIdentifier); + if (configuration == null) return NoneMorphSkill.instance; + + return this.getSkill(configuration.getSkillIdentifier().asString()); } /** * 获取和identifier匹配的技能 * - * @param identifier 技能ID + * @param skillIdentifier 技能ID * @return {@link IMorphSkill} * @apiNote 如果未找到则返回 {@link NoneMorphSkill#instance} */ @NotNull - public IMorphSkill getSkill(String identifier) + public IMorphSkill getSkill(String skillIdentifier) { - var entry = getSkillEntry(identifier); + var skillInstance = this.skills.getOrDefault(skillIdentifier, NoneMorphSkill.instance); - if (entry != null) return entry.getValue(); - else return NoneMorphSkill.instance; + return skillInstance; } public void executeDisguiseSkill(Player player) @@ -199,11 +216,9 @@ public void executeDisguiseSkill(Player player, boolean bypassPermission) return; } - var skillEntry= getSkillEntry(state.skillLookupIdentifier()); + var skill = state.getSkill(); - if (player.getGameMode() == GameMode.SPECTATOR - || skillEntry == null - || skillEntry.getKey().getSkillIdentifier().equals(SkillType.NONE)) + if (player.getGameMode() == GameMode.SPECTATOR || skill == NoneMorphSkill.instance) { player.sendMessage(MessageUtils.prefixes(player, SkillStrings.skillNotAvaliableString())); @@ -214,11 +229,9 @@ public void executeDisguiseSkill(Player player, boolean bypassPermission) } var cdInfo = getCooldownInfo(player.getUniqueId(), state.skillLookupIdentifier()); - assert cdInfo != null; - //logger.info("Permission is " + CommonPermissions.skillPermissionOf(skillEntry.getKey().getSkillIdentifier().asString(), state.getDisguiseIdentifier())); - var singleSkillPerm = CommonPermissions.skillPermissionOf(skillEntry.getKey().getSkillIdentifier().asString(), state.getDisguiseIdentifier()); + var singleSkillPerm = CommonPermissions.skillPermissionOf(skill.getIdentifier().asString(), state.getDisguiseIdentifier()); var hasSkillPerm = PermissionUtils.hasPermission(player, singleSkillPerm, true); if (!bypassPermission && !hasSkillPerm) @@ -253,28 +266,18 @@ public void executeDisguiseSkill(Player player, boolean bypassPermission) return; } - var skill = skillEntry.getValue(); - var config = skillEntry.getKey(); - - ISkillOption option; - - try - { - option = skill.getOptionInstance().fromMap(config.getSkillOptions(skill)); - } - catch (Throwable t) + SkillAbilityConfiguration config = state.getSkillAbilityConfiguration(); + if (config == null) { - if (t instanceof ClassCastException) - logger.error(config.getIdentifier() + " -> " + skill.getIdentifier() + " has an invalid setting, please check your skill configurations."); - else - logger.error("Error occurred while parsing skill configuration"); - - t.printStackTrace(); - + logger.warn("Disguise have a skill but don't have a skill configuration?!"); player.sendMessage(MessageUtils.prefixes(player, SkillStrings.exceptionOccurredString())); + state.setSkillCooldown(20, true); + return; } + var option = skill.getOptionInstance().fromMap(config.getSkillOptions(skill)); + var cd = skill.executeSkillGeneric(player, state, config, option); cdInfo.setLastInvoke(plugin.getCurrentTick()); @@ -365,8 +368,8 @@ public boolean hasSkill(String id) { var entry = getSkillEntry(id); return entry != null - && !SkillType.UNKNOWN.equals(entry.getKey().getSkillIdentifier()) - && !SkillType.NONE.equals(entry.getKey().getSkillIdentifier()); + && !SkillType.UNKNOWN.equals(entry.left().getSkillIdentifier()) + && !SkillType.NONE.equals(entry.left().getSkillIdentifier()); } /** @@ -379,9 +382,9 @@ public boolean hasSpeficSkill(String id, NamespacedKey skillKey) { var entry = getSkillEntry(id); - if (entry == null || SkillType.UNKNOWN.equals(entry.getKey().getSkillIdentifier())) return false; + if (entry == null || SkillType.UNKNOWN.equals(entry.left().getSkillIdentifier())) return false; - return entry.getValue().getIdentifier().equals(skillKey); + return entry.right().getIdentifier().equals(skillKey); } /** diff --git a/src/main/java/xiamomc/morph/skills/SkillCooldownInfo.java b/src/main/java/xyz/nifeather/morph/skills/SkillCooldownInfo.java similarity index 96% rename from src/main/java/xiamomc/morph/skills/SkillCooldownInfo.java rename to src/main/java/xyz/nifeather/morph/skills/SkillCooldownInfo.java index a01b48a2..3ba27976 100644 --- a/src/main/java/xiamomc/morph/skills/SkillCooldownInfo.java +++ b/src/main/java/xyz/nifeather/morph/skills/SkillCooldownInfo.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills; +package xyz.nifeather.morph.skills; public class SkillCooldownInfo { diff --git a/src/main/java/xiamomc/morph/skills/SkillType.java b/src/main/java/xyz/nifeather/morph/skills/SkillType.java similarity index 97% rename from src/main/java/xiamomc/morph/skills/SkillType.java rename to src/main/java/xyz/nifeather/morph/skills/SkillType.java index 267b0bf9..ca97c9c9 100644 --- a/src/main/java/xiamomc/morph/skills/SkillType.java +++ b/src/main/java/xyz/nifeather/morph/skills/SkillType.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills; +package xyz.nifeather.morph.skills; import org.bukkit.NamespacedKey; diff --git a/src/main/java/xiamomc/morph/skills/impl/ApplyEffectMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/ApplyEffectMorphSkill.java similarity index 85% rename from src/main/java/xiamomc/morph/skills/impl/ApplyEffectMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/ApplyEffectMorphSkill.java index 98c91b8a..3b4a21e1 100644 --- a/src/main/java/xiamomc/morph/skills/impl/ApplyEffectMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/ApplyEffectMorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; @@ -8,13 +8,13 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.EffectConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.EffectConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public class ApplyEffectMorphSkill extends MorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/impl/DelayedMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/DelayedMorphSkill.java similarity index 89% rename from src/main/java/xiamomc/morph/skills/impl/DelayedMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/DelayedMorphSkill.java index 979a6c87..ebdc975c 100644 --- a/src/main/java/xiamomc/morph/skills/impl/DelayedMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/DelayedMorphSkill.java @@ -1,12 +1,12 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import org.bukkit.entity.Player; -import xiamomc.morph.MorphManager; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.storage.skill.ISkillOption; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public abstract class DelayedMorphSkill extends MorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/impl/ExplodeMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/ExplodeMorphSkill.java similarity index 88% rename from src/main/java/xiamomc/morph/skills/impl/ExplodeMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/ExplodeMorphSkill.java index 993ea633..8ebf9f5d 100644 --- a/src/main/java/xiamomc/morph/skills/impl/ExplodeMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/ExplodeMorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; @@ -10,15 +10,15 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; import xiamomc.morph.network.commands.S2C.set.S2CSetSNbtCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.ExplosionConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.ExplosionConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public class ExplodeMorphSkill extends DelayedMorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/impl/InventoryMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/InventoryMorphSkill.java similarity index 79% rename from src/main/java/xiamomc/morph/skills/impl/InventoryMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/InventoryMorphSkill.java index 254207c7..f350762a 100644 --- a/src/main/java/xiamomc/morph/skills/impl/InventoryMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/InventoryMorphSkill.java @@ -1,19 +1,19 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.MorphManager; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; import xiamomc.morph.network.commands.S2C.set.S2CSetDisplayingFakeEquipCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.NoOpConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.NoOpConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public class InventoryMorphSkill extends MorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/impl/LaunchProjectileMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/LaunchProjectileMorphSkill.java similarity index 86% rename from src/main/java/xiamomc/morph/skills/impl/LaunchProjectileMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/LaunchProjectileMorphSkill.java index d2dd6898..bda3e63b 100644 --- a/src/main/java/xiamomc/morph/skills/impl/LaunchProjectileMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/LaunchProjectileMorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; @@ -8,16 +8,16 @@ import org.bukkit.entity.ShulkerBullet; import org.bukkit.entity.WitherSkull; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; import xiamomc.morph.network.commands.S2C.set.S2CSetAggressiveCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.ProjectileConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; -import xiamomc.morph.utilities.EntityTypeUtils; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.ProjectileConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.utilities.EntityTypeUtils; public class LaunchProjectileMorphSkill extends DelayedMorphSkill { @@ -43,7 +43,7 @@ protected ExecuteResult preExecute(Player player, DisguiseState state, SkillAbil if (type == null) { - printErrorMessage(player, "Invalid projective entity for configuration " + configuration.getIdentifier()); + printErrorMessage(player, "Invalid projective entity for " + state.getDisguiseIdentifier()); return ExecuteResult.fail(10); } diff --git a/src/main/java/xiamomc/morph/skills/impl/NoneMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/NoneMorphSkill.java similarity index 68% rename from src/main/java/xiamomc/morph/skills/impl/NoneMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/NoneMorphSkill.java index 00f056a3..6f76b140 100644 --- a/src/main/java/xiamomc/morph/skills/impl/NoneMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/NoneMorphSkill.java @@ -1,13 +1,13 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.NoOpConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.NoOpConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public final class NoneMorphSkill extends MorphSkill { @@ -16,7 +16,7 @@ public final class NoneMorphSkill extends MorphSkill @Override public int executeSkill(Player player, DisguiseState state, SkillAbilityConfiguration configuration, NoOpConfiguration option) { - logger.warn(configuration.getIdentifier() + "没有技能,但却被调用了executeSkill"); + logger.warn(state.getDisguiseIdentifier() + "没有技能,但却被调用了executeSkill"); Thread.dumpStack(); return Integer.MAX_VALUE; diff --git a/src/main/java/xiamomc/morph/skills/impl/SonicBoomMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/SonicBoomMorphSkill.java similarity index 89% rename from src/main/java/xiamomc/morph/skills/impl/SonicBoomMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/SonicBoomMorphSkill.java index f26593f8..f14827c2 100644 --- a/src/main/java/xiamomc/morph/skills/impl/SonicBoomMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/SonicBoomMorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; @@ -9,15 +9,15 @@ import org.bukkit.craftbukkit.entity.CraftLivingEntity; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.NmsRecord; import xiamomc.morph.network.commands.S2C.set.S2CSetAggressiveCommand; -import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.NoOpConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; -import xiamomc.morph.utilities.DamageSourceUtils; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.network.server.MorphClientHandler; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.NoOpConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.utilities.DamageSourceUtils; public class SonicBoomMorphSkill extends DelayedMorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/SplashPotionSkill.java similarity index 91% rename from src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/SplashPotionSkill.java index c714e19c..a0577e44 100644 --- a/src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/SplashPotionSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; @@ -12,12 +12,12 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.NoOpConfiguration; -import xiamomc.morph.storage.skill.ISkillOption; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.NoOpConfiguration; +import xyz.nifeather.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; diff --git a/src/main/java/xiamomc/morph/skills/impl/SummonFangsMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/SummonFangsMorphSkill.java similarity index 89% rename from src/main/java/xiamomc/morph/skills/impl/SummonFangsMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/SummonFangsMorphSkill.java index 12465d49..2723f243 100644 --- a/src/main/java/xiamomc/morph/skills/impl/SummonFangsMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/SummonFangsMorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import org.bukkit.Difficulty; import org.bukkit.FluidCollisionMode; @@ -12,15 +12,15 @@ import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.NmsRecord; -import xiamomc.morph.misc.mobs.MorphBukkitVexModifier; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.NoOpConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.NmsRecord; +import xyz.nifeather.morph.misc.mobs.MorphBukkitVexModifier; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.NoOpConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public class SummonFangsMorphSkill extends MorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/impl/TeleportMorphSkill.java b/src/main/java/xyz/nifeather/morph/skills/impl/TeleportMorphSkill.java similarity index 88% rename from src/main/java/xiamomc/morph/skills/impl/TeleportMorphSkill.java rename to src/main/java/xyz/nifeather/morph/skills/impl/TeleportMorphSkill.java index f7482495..f3e682fe 100644 --- a/src/main/java/xiamomc/morph/skills/impl/TeleportMorphSkill.java +++ b/src/main/java/xyz/nifeather/morph/skills/impl/TeleportMorphSkill.java @@ -1,4 +1,4 @@ -package xiamomc.morph.skills.impl; +package xyz.nifeather.morph.skills.impl; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; @@ -9,13 +9,13 @@ import org.bukkit.entity.Player; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.SkillStrings; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.skills.MorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.TeleportConfiguration; -import xiamomc.morph.storage.skill.SkillAbilityConfiguration; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.SkillStrings; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.skills.MorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.TeleportConfiguration; +import xyz.nifeather.morph.storage.skill.SkillAbilityConfiguration; public class TeleportMorphSkill extends MorphSkill { diff --git a/src/main/java/xiamomc/morph/skills/options/EffectConfiguration.java b/src/main/java/xyz/nifeather/morph/skills/options/EffectConfiguration.java similarity index 95% rename from src/main/java/xiamomc/morph/skills/options/EffectConfiguration.java rename to src/main/java/xyz/nifeather/morph/skills/options/EffectConfiguration.java index 28f6bd21..42fdd26d 100644 --- a/src/main/java/xiamomc/morph/skills/options/EffectConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/skills/options/EffectConfiguration.java @@ -1,10 +1,10 @@ -package xiamomc.morph.skills.options; +package xyz.nifeather.morph.skills.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class EffectConfiguration implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/skills/options/ExplosionConfiguration.java b/src/main/java/xyz/nifeather/morph/skills/options/ExplosionConfiguration.java similarity index 92% rename from src/main/java/xiamomc/morph/skills/options/ExplosionConfiguration.java rename to src/main/java/xyz/nifeather/morph/skills/options/ExplosionConfiguration.java index b45038c4..b902437a 100644 --- a/src/main/java/xiamomc/morph/skills/options/ExplosionConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/skills/options/ExplosionConfiguration.java @@ -1,8 +1,8 @@ -package xiamomc.morph.skills.options; +package xyz.nifeather.morph.skills.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class ExplosionConfiguration implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/skills/options/NoOpConfiguration.java b/src/main/java/xyz/nifeather/morph/skills/options/NoOpConfiguration.java similarity index 86% rename from src/main/java/xiamomc/morph/skills/options/NoOpConfiguration.java rename to src/main/java/xyz/nifeather/morph/skills/options/NoOpConfiguration.java index 15eac399..bc20421e 100644 --- a/src/main/java/xiamomc/morph/skills/options/NoOpConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/skills/options/NoOpConfiguration.java @@ -1,7 +1,7 @@ -package xiamomc.morph.skills.options; +package xyz.nifeather.morph.skills.options; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/skills/options/ProjectileConfiguration.java b/src/main/java/xyz/nifeather/morph/skills/options/ProjectileConfiguration.java similarity index 96% rename from src/main/java/xiamomc/morph/skills/options/ProjectileConfiguration.java rename to src/main/java/xyz/nifeather/morph/skills/options/ProjectileConfiguration.java index 65625a20..f3ca4e66 100644 --- a/src/main/java/xiamomc/morph/skills/options/ProjectileConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/skills/options/ProjectileConfiguration.java @@ -1,9 +1,9 @@ -package xiamomc.morph.skills.options; +package xyz.nifeather.morph.skills.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.bukkit.entity.EntityType; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class ProjectileConfiguration implements ISkillOption { diff --git a/src/main/java/xiamomc/morph/skills/options/SummonConfiguration.java b/src/main/java/xyz/nifeather/morph/skills/options/SummonConfiguration.java similarity index 79% rename from src/main/java/xiamomc/morph/skills/options/SummonConfiguration.java rename to src/main/java/xyz/nifeather/morph/skills/options/SummonConfiguration.java index 79a72fe0..54d185a4 100644 --- a/src/main/java/xiamomc/morph/skills/options/SummonConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/skills/options/SummonConfiguration.java @@ -1,8 +1,8 @@ -package xiamomc.morph.skills.options; +package xyz.nifeather.morph.skills.options; import com.google.gson.annotations.Expose; import org.bukkit.entity.EntityType; -import xiamomc.morph.utilities.EntityTypeUtils; +import xyz.nifeather.morph.utilities.EntityTypeUtils; public class SummonConfiguration { diff --git a/src/main/java/xiamomc/morph/skills/options/TeleportConfiguration.java b/src/main/java/xyz/nifeather/morph/skills/options/TeleportConfiguration.java similarity index 84% rename from src/main/java/xiamomc/morph/skills/options/TeleportConfiguration.java rename to src/main/java/xyz/nifeather/morph/skills/options/TeleportConfiguration.java index f7559ad8..9ac34c60 100644 --- a/src/main/java/xiamomc/morph/skills/options/TeleportConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/skills/options/TeleportConfiguration.java @@ -1,8 +1,8 @@ -package xiamomc.morph.skills.options; +package xyz.nifeather.morph.skills.options; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.storage.skill.ISkillOption; +import xyz.nifeather.morph.storage.skill.ISkillOption; public class TeleportConfiguration implements ISkillOption { diff --git a/src/main/java/xyz/nifeather/morph/storage/DirectoryJsonBasedStorage.java b/src/main/java/xyz/nifeather/morph/storage/DirectoryJsonBasedStorage.java new file mode 100644 index 00000000..4813e0e7 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/storage/DirectoryJsonBasedStorage.java @@ -0,0 +1,159 @@ +package xyz.nifeather.morph.storage; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.apache.commons.io.FileUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import xyz.nifeather.morph.MorphPluginObject; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +public abstract class DirectoryJsonBasedStorage extends MorphPluginObject +{ + protected final DirectoryStorage directoryStorage; + + protected abstract T getDefault(); + + protected Gson createGson() + { + return new GsonBuilder() + .excludeFieldsWithoutExposeAnnotation() + .setPrettyPrinting() + .disableHtmlEscaping() + .create(); + } + + protected final Gson gson; + + protected DirectoryJsonBasedStorage(String dirBaseName) + { + this.directoryStorage = new DirectoryStorage(dirBaseName); + + this.gson = createGson(); + + if (this.directoryStorage.initializeFailed()) + logger.warn("Failed initializing directory storage, please see errors above."); + } + + private final Map instancesMap = new ConcurrentHashMap<>(); + + protected Map instanceMap() + { + return this.instancesMap; + } + + public void clearCache() + { + this.instancesMap.clear(); + } + + private final AtomicInteger packageVersion = new AtomicInteger(-3); + + public void setPackageVersion(int version) + { + if (version == -3) + throw new IllegalArgumentException("Cannot set package version to -3"); + + var file = directoryStorage.getFile("package_version.txt", true); + this.packageVersion.set(version); + + if (file == null) + { + logger.warn("Can't write package version to file, it will not be saved across sessions."); + return; + } + + try + { + FileUtils.writeStringToFile(file, "" + version, StandardCharsets.UTF_8); + } + catch (Throwable t) + { + logger.warn("Can't write package version to file, it will not be saved across sessions: " + t.getMessage()); + } + } + + public int getPackageVersion() + { + if (packageVersion.get() != -3) + return packageVersion.get(); + + var file = directoryStorage.getFile("package_version.txt", false); + if (file == null) return -1; + + try + { + String content = FileUtils.readFileToString(file, StandardCharsets.UTF_8); + + int version = Integer.parseInt(content); + packageVersion.set(version); + return version; + } + catch (Throwable t) + { + logger.error("Can't get package version: " + t.getMessage()); + t.printStackTrace(); + + return -1; + } + } + + /** + * Gets the path to the key + * @apiNote You may need to manually add the file extension after calling this + * @return NULL if the given identifier is illegal, for example, contains multiple ":" + */ + @Nullable + public String getPath(String key) + { + return key.replace(":", "/") + .replaceAll("[^a-zA-Z0-9\\-]]", "_"); + } + + /** + * @param key The file name + * @return NULL if the file does not exist or cannot be read, or there's an error during convert + */ + @Nullable + public T get(String key) + { + key = getPath(key); + + var cached = instancesMap.getOrDefault(key, null); + if (cached != null) return cached == getDefault() ? null : (T) cached; + + var file = directoryStorage.getFile(key + ".json", false); + if (file == null) return null; + + if (!file.canRead()) + { + logger.warn("The file '%s' cannnot be read.".formatted(file.getPath())); + return null; + } + + Object obj; + + try (InputStreamReader fileStream = new InputStreamReader(new FileInputStream(file))) + { + obj = gson.fromJson(fileStream, getDefault().getClass()); + } + catch (Throwable t) + { + logger.warn("Can't convert from JSON: " + t.getMessage()); + return null; + } + + if (obj == null) + obj = getDefault(); + + this.instancesMap.put(key, (T) obj); + return obj == getDefault() ? null : (T) obj; + } +} diff --git a/src/main/java/xiamomc/morph/storage/DirectoryStorage.java b/src/main/java/xyz/nifeather/morph/storage/DirectoryStorage.java similarity index 77% rename from src/main/java/xiamomc/morph/storage/DirectoryStorage.java rename to src/main/java/xyz/nifeather/morph/storage/DirectoryStorage.java index 5a3cb930..968c597f 100755 --- a/src/main/java/xiamomc/morph/storage/DirectoryStorage.java +++ b/src/main/java/xyz/nifeather/morph/storage/DirectoryStorage.java @@ -1,9 +1,10 @@ -package xiamomc.morph.storage; +package xyz.nifeather.morph.storage; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPluginObject; +import xyz.nifeather.morph.MorphPluginObject; import java.io.File; +import java.io.IOException; import java.net.URI; import java.nio.file.Path; @@ -18,7 +19,7 @@ public boolean initializeFailed() return initializeFailed; } - private boolean initializeFailed; + private boolean initializeFailed = false; private URI getAbsoulteURI(String path) { @@ -52,6 +53,8 @@ public DirectoryStorage(String directoryBaseName) this.initializeFailed = true; } } + + this.initializeFailed = false; } public File[] getFiles(String pattern) @@ -106,19 +109,34 @@ public File getDirectory(String relativePath, boolean createIfNotExist) return file; } + /** + * @return NULL if the file does not exist. + */ @Nullable public File getFile(String fileName, boolean createIfNotExist) { var file = new File(this.getAbsoulteURI(absoluteDirectoryPath.getPath() + separator + fileName)); if (!file.toPath().toUri().getPath().startsWith(absoluteDirectoryPath.getPath())) - throw new RuntimeException("Trying to access a file that does not belongs to this plugin: %s".formatted(file.toURI())); + { + logger.error("Trying to access a file that does not belongs to this plugin: %s".formatted(file.toURI())); + return null; + } - if (!file.exists() && createIfNotExist) + if (!file.exists()) { + if (!createIfNotExist) return null; + try { - var success = file.createNewFile(); + boolean success = true; + + var parent = file.getParentFile(); + if (!parent.exists()) + success = parent.mkdirs(); + + success = success && file.createNewFile(); + if (!success) { logger.warn("Unable to create file: Unknown error"); @@ -136,4 +154,23 @@ public File getFile(String fileName, boolean createIfNotExist) return file; } + + /** + * @return 操作是否成功 + */ + private boolean ensureParentAlwaysPresent(File baseFile, boolean isDirectory) + { + var parent = baseFile.getParentFile(); + if (!parent.exists()) ensureParentAlwaysPresent(parent, true); + + try + { + return baseFile.createNewFile(); + } + catch (IOException e) + { + logger.warn("Can't create file: " + e.getMessage()); + return false; + } + } } diff --git a/src/main/java/xiamomc/morph/storage/MorphJsonBasedStorage.java b/src/main/java/xyz/nifeather/morph/storage/MorphJsonBasedStorage.java similarity index 76% rename from src/main/java/xiamomc/morph/storage/MorphJsonBasedStorage.java rename to src/main/java/xyz/nifeather/morph/storage/MorphJsonBasedStorage.java index dfc83e32..60edaea0 100644 --- a/src/main/java/xiamomc/morph/storage/MorphJsonBasedStorage.java +++ b/src/main/java/xyz/nifeather/morph/storage/MorphJsonBasedStorage.java @@ -1,7 +1,7 @@ -package xiamomc.morph.storage; +package xyz.nifeather.morph.storage; -import xiamomc.morph.MorphPlugin; import xiamomc.pluginbase.JsonBasedStorage; +import xyz.nifeather.morph.MorphPlugin; public abstract class MorphJsonBasedStorage extends JsonBasedStorage { diff --git a/src/main/java/xiamomc/morph/storage/mirrorlogging/MirrorSingleEntry.java b/src/main/java/xyz/nifeather/morph/storage/mirrorlogging/MirrorSingleEntry.java similarity index 96% rename from src/main/java/xiamomc/morph/storage/mirrorlogging/MirrorSingleEntry.java rename to src/main/java/xyz/nifeather/morph/storage/mirrorlogging/MirrorSingleEntry.java index f02a6c44..efd1bb25 100644 --- a/src/main/java/xiamomc/morph/storage/mirrorlogging/MirrorSingleEntry.java +++ b/src/main/java/xyz/nifeather/morph/storage/mirrorlogging/MirrorSingleEntry.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.mirrorlogging; +package xyz.nifeather.morph.storage.mirrorlogging; import com.google.gson.annotations.Expose; diff --git a/src/main/java/xiamomc/morph/storage/mirrorlogging/OperationType.java b/src/main/java/xyz/nifeather/morph/storage/mirrorlogging/OperationType.java similarity index 74% rename from src/main/java/xiamomc/morph/storage/mirrorlogging/OperationType.java rename to src/main/java/xyz/nifeather/morph/storage/mirrorlogging/OperationType.java index fa664700..e8ca03ad 100644 --- a/src/main/java/xiamomc/morph/storage/mirrorlogging/OperationType.java +++ b/src/main/java/xyz/nifeather/morph/storage/mirrorlogging/OperationType.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.mirrorlogging; +package xyz.nifeather.morph.storage.mirrorlogging; public enum OperationType { diff --git a/src/main/java/xyz/nifeather/morph/storage/offlinestore/IOfflineState.java b/src/main/java/xyz/nifeather/morph/storage/offlinestore/IOfflineState.java new file mode 100644 index 00000000..8341008f --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/storage/offlinestore/IOfflineState.java @@ -0,0 +1,5 @@ +package xyz.nifeather.morph.storage.offlinestore; + +public interface IOfflineState +{ +} diff --git a/src/main/java/xiamomc/morph/storage/offlinestore/OfflineDisguiseState.java b/src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineDisguiseState.java similarity index 96% rename from src/main/java/xiamomc/morph/storage/offlinestore/OfflineDisguiseState.java rename to src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineDisguiseState.java index 1d1b2e16..150417f3 100644 --- a/src/main/java/xiamomc/morph/storage/offlinestore/OfflineDisguiseState.java +++ b/src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineDisguiseState.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.offlinestore; +package xyz.nifeather.morph.storage.offlinestore; import com.google.gson.annotations.Expose; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/xiamomc/morph/storage/offlinestore/OfflineStateContainer.java b/src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineStateContainer.java similarity index 83% rename from src/main/java/xiamomc/morph/storage/offlinestore/OfflineStateContainer.java rename to src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineStateContainer.java index c3242545..2dff07aa 100644 --- a/src/main/java/xiamomc/morph/storage/offlinestore/OfflineStateContainer.java +++ b/src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineStateContainer.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.offlinestore; +package xyz.nifeather.morph.storage.offlinestore; import com.google.gson.annotations.Expose; import it.unimi.dsi.fastutil.objects.ObjectArrayList; diff --git a/src/main/java/xiamomc/morph/storage/offlinestore/OfflineStateStore.java b/src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineStateStore.java similarity index 89% rename from src/main/java/xiamomc/morph/storage/offlinestore/OfflineStateStore.java rename to src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineStateStore.java index e0c247bc..61c28109 100644 --- a/src/main/java/xiamomc/morph/storage/offlinestore/OfflineStateStore.java +++ b/src/main/java/xyz/nifeather/morph/storage/offlinestore/OfflineStateStore.java @@ -1,11 +1,11 @@ -package xiamomc.morph.storage.offlinestore; +package xyz.nifeather.morph.storage.offlinestore; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.interfaces.IManageOfflineStates; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.DisguiseStateGenerator; -import xiamomc.morph.storage.MorphJsonBasedStorage; +import xyz.nifeather.morph.interfaces.IManageOfflineStates; +import xyz.nifeather.morph.misc.DisguiseState; +import xyz.nifeather.morph.misc.DisguiseStateGenerator; +import xyz.nifeather.morph.storage.MorphJsonBasedStorage; import java.util.List; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/storage/playerdata/PlayerDataStore.java b/src/main/java/xyz/nifeather/morph/storage/playerdata/LegacyPlayerDataStore.java similarity index 78% rename from src/main/java/xiamomc/morph/storage/playerdata/PlayerDataStore.java rename to src/main/java/xyz/nifeather/morph/storage/playerdata/LegacyPlayerDataStore.java index 65a78341..8a91b830 100644 --- a/src/main/java/xiamomc/morph/storage/playerdata/PlayerDataStore.java +++ b/src/main/java/xyz/nifeather/morph/storage/playerdata/LegacyPlayerDataStore.java @@ -1,30 +1,30 @@ -package xiamomc.morph.storage.playerdata; +package xyz.nifeather.morph.storage.playerdata; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import net.kyori.adventure.text.Component; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; -import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.misc.DisguiseTypes; -import xiamomc.morph.storage.MorphJsonBasedStorage; import xiamomc.pluginbase.Annotations.Resolved; +import xyz.nifeather.morph.MorphManager; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.storage.MorphJsonBasedStorage; +import java.io.File; import java.util.List; import java.util.Objects; -public class PlayerDataStore extends MorphJsonBasedStorage implements IManagePlayerData +@Deprecated(forRemoval = true) +public class LegacyPlayerDataStore extends MorphJsonBasedStorage implements IManagePlayerData { private final List cachedMetas = new ObjectArrayList<>(); - @Resolved - private MorphManager morphs; + public File file() + { + return this.configurationFile; + } @Override protected @NotNull String getFileName() @@ -191,14 +191,6 @@ public boolean grantMorphToPlayer(Player player, String disguiseIdentifier) } else return false; - var locale = MessageUtils.getLocale(player); - - sendMorphAcquiredNotification(player, morphs.getDisguiseStateFor(player), - MorphStrings.morphUnlockedString() - .withLocale(locale) - .resolve("what", meta.asComponent(locale)) - .toComponent(locale)); - return true; } @@ -213,16 +205,6 @@ public boolean revokeMorphFromPlayer(Player player, String disguiseIdentifier) getPlayerMeta(player).removeDisguise(meta); saveConfiguration(); - var state = morphs.getDisguiseStateFor(player); - if (state != null && meta.getKey().equals(state.getDisguiseIdentifier())) - morphs.unMorph(player, true); - - var locale = MessageUtils.getLocale(player); - sendMorphAcquiredNotification(player, morphs.getDisguiseStateFor(player), - MorphStrings.morphLockedString() - .resolve("what", meta.asComponent(locale)) - .toComponent(locale)); - return true; } @@ -246,14 +228,6 @@ public ObjectArrayList getAvaliableDisguisesFor(Player player) //endregion Implementation of IManagePlayerData - private void sendMorphAcquiredNotification(Player player, @Nullable DisguiseState state, Component text) - { - if (state == null) - player.sendActionBar(text); - else - player.sendMessage(MessageUtils.prefixes(player, text)); - } - public synchronized List getAll() { return new ObjectArrayList<>(storingObject.playerMetas); diff --git a/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerDataStoreNew.java b/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerDataStoreNew.java new file mode 100644 index 00000000..5336aee6 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerDataStoreNew.java @@ -0,0 +1,338 @@ +package xyz.nifeather.morph.storage.playerdata; + +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import org.apache.commons.io.FileUtils; +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.Nullable; +import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.interfaces.IManagePlayerData; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.storage.DirectoryJsonBasedStorage; +import xyz.nifeather.morph.storage.skill.SkillsConfigurationStoreNew; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +public class PlayerDataStoreNew extends DirectoryJsonBasedStorage implements IManagePlayerData +{ + private static final PlayerMeta defaultMeta = new PlayerMeta(); + + public PlayerDataStoreNew() + { + super("playerdata"); + + var packageVersion = this.getPackageVersion(); + + if (packageVersion < TARGET_PACKAGE_VERSION) + update(packageVersion); + } + + private static final int TARGET_PACKAGE_VERSION = SkillsConfigurationStoreNew.PackageVersions.INITIAL; + + private void update(int currentVersion) + { + if (currentVersion < PackageVersions.INITIAL) + { + var legacyDataFile = new File(this.plugin.getDataFolder(), "data.json"); + + if (legacyDataFile.exists()) + migrateFromLegacyStorage(); + } + + setPackageVersion(TARGET_PACKAGE_VERSION); + } + + @SuppressWarnings("removal") + private void migrateFromLegacyStorage() + { + logger.info("Migrating player data..."); + + var legacyStorage = new LegacyPlayerDataStore(); + legacyStorage.initializeStorage(); + + legacyStorage.getAll().forEach(this::save); + + var file = legacyStorage.file(); + var success = file.renameTo(new File(file.getParent(), "data.json.old")); + + if (!success) + logger.info("Can't rename 'data.json' to 'data.json.old', but it's not a big deal, I guess..."); + + + logger.info("Done migrating player data!"); + } + + public void save(PlayerMeta playerMeta) + { + var uuid = playerMeta.uniqueId; + + if (uuid == null) + { + logger.warn("Found a PlayerMeta that doesn't have an UUID! Ignoring..."); + return; + } + + var path = this.getPath(playerMeta.uniqueId.toString()) + ".json"; + + var file = this.directoryStorage.getFile(path, true); + if (file == null) + { + logger.warn("Cannot save disguise configuration for " + uuid); + return; + } + + String json = gson.toJson(playerMeta); + try + { + FileUtils.writeStringToFile(file, json, StandardCharsets.UTF_8); + } + catch (Throwable t) + { + logger.error("Can't write content to file: " + t.getMessage()); + } + } + + @Override + protected PlayerMeta getDefault() + { + return defaultMeta; + } + + //region IManagePlayerData + + private final Map cachedMetas = new ConcurrentHashMap<>(); + + /** + * 获取包含某一玩家的玩家名的伪装信息 + * + * @param rawString 原始ID + * @return 伪装信息 + * @apiNote 如果原始ID不是有效ID,则会返回null + */ + @Override + public @Nullable DisguiseMeta getDisguiseMeta(String rawString) + { + var cached = cachedMetas.getOrDefault(rawString, null); + if (cached != null) return cached; + + var type = DisguiseTypes.fromId(rawString); + + var meta = new DisguiseMeta(rawString, type); + cachedMetas.put(rawString, meta); + + return meta; + } + + /** + * 获取某一玩家所有可用的伪装 + * + * @param player 目标玩家 + * @return 目标玩家拥有的伪装 + */ + @Override + public ObjectArrayList getAvaliableDisguisesFor(Player player) + { + return getPlayerMeta(player).getUnlockedDisguises(); + } + + /** + * 将伪装授予某一玩家 + * + * @param player 要授予的玩家 + * @param disguiseIdentifier 伪装ID + * @return 添加是否成功(伪装是否可用或玩家是否已经拥有目标伪装) + */ + @Override + public boolean grantMorphToPlayer(Player player, String disguiseIdentifier) + { + var playerMeta = this.getPlayerMeta(player); + var disguiseMeta = this.getDisguiseMeta(disguiseIdentifier); + + if (disguiseMeta == null) return false; + + if (playerMeta.getUnlockedDisguiseIdentifiers() + .stream() + .anyMatch(str -> str.equalsIgnoreCase(disguiseIdentifier))) + { + return false; + } + + playerMeta.addDisguise(disguiseMeta); + save(playerMeta); + + return true; + } + + /** + * 从某一玩家剥离伪装 + * + * @param player 要授予的玩家 + * @param disguiseIdentifier 伪装ID + * @return 添加是否成功(伪装是否可用或玩家是否已经拥有目标伪装) + */ + @Override + public boolean revokeMorphFromPlayer(Player player, String disguiseIdentifier) + { + var playerMeta = getPlayerMeta(player); + var match = playerMeta.getUnlockedDisguises() + .stream() + .filter(meta -> meta.equals(disguiseIdentifier)) + .findFirst() + .orElse(null); + + if (match == null) return false; + + playerMeta.removeDisguise(match); + + return true; + } + + private final Map trackedPlayerMetaMap = new ConcurrentHashMap<>(); + + /** + * 获取玩家的伪装配置 + * + * @param player 目标玩家 + * @return 伪装信息 + */ + @Override + public PlayerMeta getPlayerMeta(OfflinePlayer player) + { + var uuid = player.getUniqueId(); + + var tracked = trackedPlayerMetaMap.getOrDefault(uuid, null); + if (tracked != null) return tracked; + + var storedMeta = this.get(uuid.toString()); + if (storedMeta != null) + { + initializePlayerMeta(storedMeta, uuid); + trackedPlayerMetaMap.put(uuid, storedMeta); + + return storedMeta; + } + + var metaInstance = new PlayerMeta(); + metaInstance.uniqueId = player.getUniqueId(); + metaInstance.playerName = player.getName(); + + trackedPlayerMetaMap.put(uuid, metaInstance); + + return metaInstance; + } + + private void initializePlayerMeta(PlayerMeta meta, UUID matchingUUID) + { + meta.uniqueId = matchingUUID; + + //要设置给c.unlockedDisguises的列表 + var list = new ObjectArrayList(); + + //原始列表 + var unlockedDisguiseIdentifiers = meta.getUnlockedDisguiseIdentifiers(); + + //先对原始列表排序 + unlockedDisguiseIdentifiers.sort(null); + + //然后逐个添加 + unlockedDisguiseIdentifiers.forEach(disguiseId -> + { + var type = DisguiseTypes.fromId(disguiseId); + + if (type != null) + list.add(new DisguiseMeta(disguiseId, DisguiseTypes.fromId(disguiseId))); + else + logger.warn("Unknown disguise identifier data '%s' owned by '%s'".formatted(disguiseId, matchingUUID)); + }); + + //设置可用的伪装列表并对其加锁 + meta.setUnlockedDisguises(list); + meta.lockDisguiseList(); + } + + @Override + public boolean reloadConfiguration() + { + clearCache(); + trackedPlayerMetaMap.clear(); + + if (noLazyLoad.get()) + loadAll(); + + return true; + } + + @Override + public boolean saveConfiguration() + { + this.trackedPlayerMetaMap.forEach((uuid, meta) -> this.save(meta)); + + return true; + } + + //endregion IManagePlayerData + + private final AtomicBoolean noLazyLoad = new AtomicBoolean(false); + + public void shouldLoadAllData(boolean val) + { + noLazyLoad.set(val); + + if (val) + loadAll(); + } + + public List getAll() + { + return this.trackedPlayerMetaMap.values().stream().toList(); + } + + public void loadAll() + { + logger.info("Force loading all player data..."); + var files = this.directoryStorage.getFiles(); + + int count = 0; + for (File file : files) + { + if (file.isDirectory()) continue; + + var fileName = file.getName(); + fileName = fileName.substring(0, fileName.lastIndexOf(".")); + + UUID uuid = null; + + try + { + uuid = UUID.fromString(fileName); + } + catch (Throwable ignored) + { + } + + if (uuid == null || this.trackedPlayerMetaMap.containsKey(uuid)) continue; + + var meta = this.get(fileName); + if (meta == null) continue; + + initializePlayerMeta(meta, uuid); + + this.trackedPlayerMetaMap.put(uuid, meta); + count++; + } + + logger.info("Loaded %s player data".formatted(count)); + } + + public static class PackageVersions + { + public static final int INITIAL = 1; + } +} diff --git a/src/main/java/xiamomc/morph/storage/playerdata/PlayerMeta.java b/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerMeta.java similarity index 94% rename from src/main/java/xiamomc/morph/storage/playerdata/PlayerMeta.java rename to src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerMeta.java index 83324405..d7d09563 100644 --- a/src/main/java/xiamomc/morph/storage/playerdata/PlayerMeta.java +++ b/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerMeta.java @@ -1,10 +1,10 @@ -package xiamomc.morph.storage.playerdata; +package xyz.nifeather.morph.storage.playerdata; import com.google.gson.annotations.Expose; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.utilities.DisguiseUtils; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.utilities.DisguiseUtils; import java.util.UUID; @@ -13,7 +13,7 @@ public class PlayerMeta /** * 玩家的UUID */ - @Expose + @Expose(serialize = false) public UUID uniqueId; /** diff --git a/src/main/java/xiamomc/morph/storage/playerdata/PlayerMetaContainer.java b/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerMetaContainer.java similarity index 88% rename from src/main/java/xiamomc/morph/storage/playerdata/PlayerMetaContainer.java rename to src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerMetaContainer.java index adba29a5..f2c42c08 100644 --- a/src/main/java/xiamomc/morph/storage/playerdata/PlayerMetaContainer.java +++ b/src/main/java/xyz/nifeather/morph/storage/playerdata/PlayerMetaContainer.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.playerdata; +package xyz.nifeather.morph.storage.playerdata; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; diff --git a/src/main/java/xyz/nifeather/morph/storage/skill/IAbilityConfigLookup.java b/src/main/java/xyz/nifeather/morph/storage/skill/IAbilityConfigLookup.java new file mode 100644 index 00000000..b34fc07d --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/storage/skill/IAbilityConfigLookup.java @@ -0,0 +1,11 @@ +package xyz.nifeather.morph.storage.skill; + +import org.jetbrains.annotations.Nullable; + +public interface IAbilityConfigLookup +{ + @Nullable + public X lookupAbilityConfig(String identifier, Class expectedClass); + + public void setAbilityConfig(String identifier, Object config); +} diff --git a/src/main/java/xiamomc/morph/storage/skill/ISkillOption.java b/src/main/java/xyz/nifeather/morph/storage/skill/ISkillOption.java similarity index 99% rename from src/main/java/xiamomc/morph/storage/skill/ISkillOption.java rename to src/main/java/xyz/nifeather/morph/storage/skill/ISkillOption.java index c6dbbcf1..dc000b39 100644 --- a/src/main/java/xiamomc/morph/storage/skill/ISkillOption.java +++ b/src/main/java/xyz/nifeather/morph/storage/skill/ISkillOption.java @@ -1,10 +1,10 @@ -package xiamomc.morph.storage.skill; +package xyz.nifeather.morph.storage.skill; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import java.util.Arrays; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfiguration.java b/src/main/java/xyz/nifeather/morph/storage/skill/SkillAbilityConfiguration.java similarity index 80% rename from src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfiguration.java rename to src/main/java/xyz/nifeather/morph/storage/skill/SkillAbilityConfiguration.java index 3b602e73..20f716da 100644 --- a/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfiguration.java +++ b/src/main/java/xyz/nifeather/morph/storage/skill/SkillAbilityConfiguration.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.skill; +package xyz.nifeather.morph.storage.skill; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -8,13 +8,13 @@ import org.bukkit.entity.EntityType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.abilities.IMorphAbility; -import xiamomc.morph.skills.IMorphSkill; -import xiamomc.morph.skills.SkillType; -import xiamomc.morph.skills.options.EffectConfiguration; -import xiamomc.morph.skills.options.ExplosionConfiguration; -import xiamomc.morph.skills.options.ProjectileConfiguration; -import xiamomc.morph.skills.options.TeleportConfiguration; +import xyz.nifeather.morph.abilities.IMorphAbility; +import xyz.nifeather.morph.skills.IMorphSkill; +import xyz.nifeather.morph.skills.SkillType; +import xyz.nifeather.morph.skills.options.EffectConfiguration; +import xyz.nifeather.morph.skills.options.ExplosionConfiguration; +import xyz.nifeather.morph.skills.options.ProjectileConfiguration; +import xyz.nifeather.morph.skills.options.TeleportConfiguration; import java.util.List; import java.util.Map; @@ -28,69 +28,19 @@ public SkillAbilityConfiguration() /** * 创建一个技能配置 * - * @param mobId 生物ID * @param cd CD时间 * @param skillIdentifier 技能ID */ - public SkillAbilityConfiguration(String mobId, int cd, NamespacedKey skillIdentifier) + public SkillAbilityConfiguration(int cd, NamespacedKey skillIdentifier) { - this.identifier = mobId; this.cooldown = cd; setSkillIdentifier(skillIdentifier); } - /** - * 创建一个技能配置 - * - * @param type 生物类型 - * @param cd CD时间 - * @param skillIdentifier 技能ID - */ - public SkillAbilityConfiguration(EntityType type, int cd, NamespacedKey skillIdentifier) - { - this(type.getKey(), cd, skillIdentifier); - } - - /** - * 创建一个技能配置 - * - * @param key 生物ID - * @param cd CD时间 - * @param skillIdentifier 技能ID - */ - public SkillAbilityConfiguration(NamespacedKey key, int cd, NamespacedKey skillIdentifier) - { - this.cooldown = cd; - setSkillIdentifier(skillIdentifier); - setIdentifier(key); - } - - @Expose + @Nullable + @Expose(serialize = false) @SerializedName("mobId") - private String identifier; - - /** - * 获取和配置对应的伪装ID - * - * @return 伪装ID - */ - @NotNull - public String getIdentifier() - { - return identifier; - } - - public void setIdentifier(NamespacedKey key) - { - this.identifier = key.asString(); - } - - public SkillAbilityConfiguration setIdentifier(String id) - { - this.identifier = id; - - return this; - } + public String legacy_MobID; //region 主动技能 @@ -303,13 +253,6 @@ public SkillAbilityConfiguration setOption(String identifier, ISkillOption optio //endregion 技能设置 - @Override - public String toString() - { - return "Skill configuration for disguise " + this.identifier; - } - - @Expose(serialize = false) @SerializedName("projective") private ProjectileConfiguration projectileConfiguration; diff --git a/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfigurationContainer.java b/src/main/java/xyz/nifeather/morph/storage/skill/SkillAbilityConfigurationContainer.java similarity index 87% rename from src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfigurationContainer.java rename to src/main/java/xyz/nifeather/morph/storage/skill/SkillAbilityConfigurationContainer.java index fe5fd047..cdaf33a4 100644 --- a/src/main/java/xiamomc/morph/storage/skill/SkillAbilityConfigurationContainer.java +++ b/src/main/java/xyz/nifeather/morph/storage/skill/SkillAbilityConfigurationContainer.java @@ -1,4 +1,4 @@ -package xiamomc.morph.storage.skill; +package xyz.nifeather.morph.storage.skill; import com.google.gson.annotations.Expose; import it.unimi.dsi.fastutil.objects.ObjectArrayList; diff --git a/src/main/java/xyz/nifeather/morph/storage/skill/SkillsConfigurationStoreNew.java b/src/main/java/xyz/nifeather/morph/storage/skill/SkillsConfigurationStoreNew.java new file mode 100644 index 00000000..2a850ba8 --- /dev/null +++ b/src/main/java/xyz/nifeather/morph/storage/skill/SkillsConfigurationStoreNew.java @@ -0,0 +1,170 @@ +package xyz.nifeather.morph.storage.skill; + +import org.apache.commons.io.FileUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import xiamomc.pluginbase.Annotations.Initializer; +import xyz.nifeather.morph.skills.DefaultConfigGenerator; +import xyz.nifeather.morph.storage.DirectoryJsonBasedStorage; +import xyz.nifeather.morph.storage.MorphJsonBasedStorage; + +import java.io.File; +import java.net.URI; +import java.nio.charset.StandardCharsets; + +public class SkillsConfigurationStoreNew extends DirectoryJsonBasedStorage +{ + public SkillsConfigurationStoreNew() + { + super("skills"); + } + + @Initializer + private void load() + { + var packageVersion = this.getPackageVersion(); + + if (packageVersion < TARGET_PACKAGE_VERSION) + update(packageVersion); + } + + private static final int TARGET_PACKAGE_VERSION = PackageVersions.INITIAL; + + private void update(int currentVersion) + { + if (currentVersion < PackageVersions.INITIAL) + { + var legacySkillFile = new File(this.plugin.getDataFolder(), "skills.json"); + + if (legacySkillFile.exists()) + migrateFromLegacyStorage(); + else + saveDefaultGeneratedConfigurations(); + } + + setPackageVersion(TARGET_PACKAGE_VERSION); + } + + private void migrateFromLegacyStorage() + { + try + { + logger.info("Migrating from legacy skill configuration..."); + var storage = new LegacyReadonlyConfigurationStorage(); + + storage.initializeStorage(); + + var file = storage.file(); + + var storing = storage.getStoring(); + if (storing == null) + { + logger.warn("Can't migrate from legacy skill configuration: Null storing object, is everything all right?"); + return; + } + + storing.configurations.forEach(this::save); + + var success = file.renameTo(new File(file.getParent(), "skills.json.old")); + + if (!success) + logger.info("Can't rename 'skills.json' to 'skills.json.old', but it's not a big deal, I guess..."); + + logger.info("Done migrating legacy skill configuration!"); + } + catch (Throwable t) + { + logger.warn("Can't migrate from legacy skill configuration: " + t.getMessage()); + t.printStackTrace(); + } + } + + private void saveDefaultGeneratedConfigurations() + { + logger.info("Saving default generated skill configurations..."); + + var generatedConfiguration = DefaultConfigGenerator.createInstance().generateConfiguration(); + generatedConfiguration.forEach((id, config) -> + { + config.legacy_MobID = id; + this.save(config); + }); + + logger.info("Done saving default generated skill configurations!"); + } + + public void save(SkillAbilityConfiguration configuration) + { + var identifier = configuration.legacy_MobID; + + if (identifier == null) + { + logger.warn("Found a configuration from legacy store that doesn't have a mobId! Ignoring..."); + return; + } + + var path = this.getPath(identifier) + ".json"; + + var file = this.directoryStorage.getFile(path, true); + if (file == null) + { + logger.warn("Cannot save disguise configuration for " + identifier); + return; + } + + String json = gson.toJson(configuration); + try + { + FileUtils.writeStringToFile(file, json, StandardCharsets.UTF_8); + } + catch (Throwable t) + { + logger.error("Can't write content to file: " + t.getMessage()); + } + } + + private static final SkillAbilityConfiguration defaultConfig = new SkillAbilityConfiguration(); + + @Override + protected SkillAbilityConfiguration getDefault() + { + return defaultConfig; + } + + private static class LegacyReadonlyConfigurationStorage extends MorphJsonBasedStorage + { + @Override + protected @NotNull String getFileName() + { + return "skills.json"; + } + + public File file() + { + return this.configurationFile; + } + + @Nullable + public SkillAbilityConfigurationContainer getStoring() + { + return this.storingObject; + } + + @Override + protected @NotNull SkillAbilityConfigurationContainer createDefault() + { + return new SkillAbilityConfigurationContainer(); + } + + @Override + protected @NotNull String getDisplayName() + { + return "Legacy skill configuration store"; + } + } + + public static class PackageVersions + { + public static final int INITIAL = 1; + } +} diff --git a/src/main/java/xiamomc/morph/transforms/BindableTransform.java b/src/main/java/xyz/nifeather/morph/transforms/BindableTransform.java similarity index 90% rename from src/main/java/xiamomc/morph/transforms/BindableTransform.java rename to src/main/java/xyz/nifeather/morph/transforms/BindableTransform.java index c5a41884..bfa985d9 100644 --- a/src/main/java/xiamomc/morph/transforms/BindableTransform.java +++ b/src/main/java/xyz/nifeather/morph/transforms/BindableTransform.java @@ -1,6 +1,6 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; -import xiamomc.morph.transforms.easings.Easing; +import xyz.nifeather.morph.transforms.easings.Easing; import xiamomc.pluginbase.Bindables.Bindable; public class BindableTransform extends Transform diff --git a/src/main/java/xiamomc/morph/transforms/DelayTransform.java b/src/main/java/xyz/nifeather/morph/transforms/DelayTransform.java similarity index 83% rename from src/main/java/xiamomc/morph/transforms/DelayTransform.java rename to src/main/java/xyz/nifeather/morph/transforms/DelayTransform.java index 11e3e464..f23fd6bd 100644 --- a/src/main/java/xiamomc/morph/transforms/DelayTransform.java +++ b/src/main/java/xyz/nifeather/morph/transforms/DelayTransform.java @@ -1,6 +1,6 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; -import xiamomc.morph.transforms.easings.Easing; +import xyz.nifeather.morph.transforms.easings.Easing; public class DelayTransform extends Transform { diff --git a/src/main/java/xiamomc/morph/transforms/GenericTransform.java b/src/main/java/xyz/nifeather/morph/transforms/GenericTransform.java similarity index 90% rename from src/main/java/xiamomc/morph/transforms/GenericTransform.java rename to src/main/java/xyz/nifeather/morph/transforms/GenericTransform.java index e59337d1..5fbac519 100644 --- a/src/main/java/xiamomc/morph/transforms/GenericTransform.java +++ b/src/main/java/xyz/nifeather/morph/transforms/GenericTransform.java @@ -1,6 +1,6 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; -import xiamomc.morph.transforms.easings.Easing; +import xyz.nifeather.morph.transforms.easings.Easing; public class GenericTransform extends Transform { diff --git a/src/main/java/xiamomc/morph/transforms/Recorder.java b/src/main/java/xyz/nifeather/morph/transforms/Recorder.java similarity index 92% rename from src/main/java/xiamomc/morph/transforms/Recorder.java rename to src/main/java/xyz/nifeather/morph/transforms/Recorder.java index 163aa0b9..bf3da785 100644 --- a/src/main/java/xiamomc/morph/transforms/Recorder.java +++ b/src/main/java/xyz/nifeather/morph/transforms/Recorder.java @@ -1,4 +1,4 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; import java.util.function.Consumer; diff --git a/src/main/java/xiamomc/morph/transforms/Transform.java b/src/main/java/xyz/nifeather/morph/transforms/Transform.java similarity index 93% rename from src/main/java/xiamomc/morph/transforms/Transform.java rename to src/main/java/xyz/nifeather/morph/transforms/Transform.java index 28701960..dccc2051 100644 --- a/src/main/java/xiamomc/morph/transforms/Transform.java +++ b/src/main/java/xyz/nifeather/morph/transforms/Transform.java @@ -1,7 +1,7 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import xiamomc.morph.transforms.easings.Easing; +import xyz.nifeather.morph.transforms.easings.Easing; import java.util.List; diff --git a/src/main/java/xiamomc/morph/transforms/TransformUtils.java b/src/main/java/xyz/nifeather/morph/transforms/TransformUtils.java similarity index 96% rename from src/main/java/xiamomc/morph/transforms/TransformUtils.java rename to src/main/java/xyz/nifeather/morph/transforms/TransformUtils.java index 07edd94b..8c107cfc 100644 --- a/src/main/java/xiamomc/morph/transforms/TransformUtils.java +++ b/src/main/java/xyz/nifeather/morph/transforms/TransformUtils.java @@ -1,8 +1,8 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import org.apache.commons.lang3.NotImplementedException; -import xiamomc.morph.transforms.easings.Easing; +import xyz.nifeather.morph.transforms.easings.Easing; import java.lang.reflect.Method; import java.util.Arrays; diff --git a/src/main/java/xiamomc/morph/transforms/Transformer.java b/src/main/java/xyz/nifeather/morph/transforms/Transformer.java similarity index 94% rename from src/main/java/xiamomc/morph/transforms/Transformer.java rename to src/main/java/xyz/nifeather/morph/transforms/Transformer.java index dabf1ad2..45c002dd 100644 --- a/src/main/java/xiamomc/morph/transforms/Transformer.java +++ b/src/main/java/xyz/nifeather/morph/transforms/Transformer.java @@ -1,9 +1,9 @@ -package xiamomc.morph.transforms; +package xyz.nifeather.morph.transforms; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.transforms.easings.Easing; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.transforms.easings.Easing; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; diff --git a/src/main/java/xiamomc/morph/transforms/easings/Easing.java b/src/main/java/xyz/nifeather/morph/transforms/easings/Easing.java similarity index 84% rename from src/main/java/xiamomc/morph/transforms/easings/Easing.java rename to src/main/java/xyz/nifeather/morph/transforms/easings/Easing.java index 42c693cb..07d94cbc 100644 --- a/src/main/java/xiamomc/morph/transforms/easings/Easing.java +++ b/src/main/java/xyz/nifeather/morph/transforms/easings/Easing.java @@ -1,6 +1,6 @@ -package xiamomc.morph.transforms.easings; +package xyz.nifeather.morph.transforms.easings; -import xiamomc.morph.transforms.easings.impl.EasingImpl; +import xyz.nifeather.morph.transforms.easings.impl.EasingImpl; /** * easings.net diff --git a/src/main/java/xiamomc/morph/transforms/easings/IEasing.java b/src/main/java/xyz/nifeather/morph/transforms/easings/IEasing.java similarity index 60% rename from src/main/java/xiamomc/morph/transforms/easings/IEasing.java rename to src/main/java/xyz/nifeather/morph/transforms/easings/IEasing.java index bfaff702..a3ff1035 100644 --- a/src/main/java/xiamomc/morph/transforms/easings/IEasing.java +++ b/src/main/java/xyz/nifeather/morph/transforms/easings/IEasing.java @@ -1,4 +1,4 @@ -package xiamomc.morph.transforms.easings; +package xyz.nifeather.morph.transforms.easings; public interface IEasing { diff --git a/src/main/java/xiamomc/morph/transforms/easings/impl/EasingImpl.java b/src/main/java/xyz/nifeather/morph/transforms/easings/impl/EasingImpl.java similarity index 96% rename from src/main/java/xiamomc/morph/transforms/easings/impl/EasingImpl.java rename to src/main/java/xyz/nifeather/morph/transforms/easings/impl/EasingImpl.java index 8b2471c6..906ade5d 100644 --- a/src/main/java/xiamomc/morph/transforms/easings/impl/EasingImpl.java +++ b/src/main/java/xyz/nifeather/morph/transforms/easings/impl/EasingImpl.java @@ -1,7 +1,7 @@ -package xiamomc.morph.transforms.easings.impl; +package xyz.nifeather.morph.transforms.easings.impl; -import xiamomc.morph.transforms.easings.Easing; -import xiamomc.morph.transforms.easings.IEasing; +import xyz.nifeather.morph.transforms.easings.Easing; +import xyz.nifeather.morph.transforms.easings.IEasing; public class EasingImpl implements IEasing { diff --git a/src/main/java/xiamomc/morph/updates/Platforms.java b/src/main/java/xyz/nifeather/morph/updates/Platforms.java similarity index 93% rename from src/main/java/xiamomc/morph/updates/Platforms.java rename to src/main/java/xyz/nifeather/morph/updates/Platforms.java index d6acf4b5..715fb27a 100644 --- a/src/main/java/xiamomc/morph/updates/Platforms.java +++ b/src/main/java/xyz/nifeather/morph/updates/Platforms.java @@ -1,4 +1,4 @@ -package xiamomc.morph.updates; +package xyz.nifeather.morph.updates; import java.util.Arrays; diff --git a/src/main/java/xiamomc/morph/updates/SingleUpdateInfoMeta.java b/src/main/java/xyz/nifeather/morph/updates/SingleUpdateInfoMeta.java similarity index 96% rename from src/main/java/xiamomc/morph/updates/SingleUpdateInfoMeta.java rename to src/main/java/xyz/nifeather/morph/updates/SingleUpdateInfoMeta.java index 5e38c305..c72d1fc8 100644 --- a/src/main/java/xiamomc/morph/updates/SingleUpdateInfoMeta.java +++ b/src/main/java/xyz/nifeather/morph/updates/SingleUpdateInfoMeta.java @@ -1,7 +1,7 @@ -package xiamomc.morph.updates; +package xyz.nifeather.morph.updates; import com.google.gson.annotations.SerializedName; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import java.lang.reflect.Field; import java.util.List; diff --git a/src/main/java/xiamomc/morph/updates/UpdateHandler.java b/src/main/java/xyz/nifeather/morph/updates/UpdateHandler.java similarity index 96% rename from src/main/java/xiamomc/morph/updates/UpdateHandler.java rename to src/main/java/xyz/nifeather/morph/updates/UpdateHandler.java index 5db2b728..c0ea6d5e 100644 --- a/src/main/java/xiamomc/morph/updates/UpdateHandler.java +++ b/src/main/java/xyz/nifeather/morph/updates/UpdateHandler.java @@ -1,4 +1,4 @@ -package xiamomc.morph.updates; +package xyz.nifeather.morph.updates; import com.google.gson.GsonBuilder; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -7,19 +7,19 @@ import org.bukkit.command.ConsoleCommandSender; import org.bukkit.craftbukkit.command.ServerCommandSender; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.config.ConfigOption; -import xiamomc.morph.config.MorphConfigManager; -import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.UpdateStrings; -import xiamomc.morph.misc.permissions.CommonPermissions; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; import xiamomc.pluginbase.Exceptions.NullDependencyException; import xiamomc.pluginbase.Messages.FormattableMessage; import xiamomc.pluginbase.ScheduleInfo; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPluginObject; +import xyz.nifeather.morph.config.ConfigOption; +import xyz.nifeather.morph.config.MorphConfigManager; +import xyz.nifeather.morph.messages.MessageUtils; +import xyz.nifeather.morph.messages.UpdateStrings; +import xyz.nifeather.morph.misc.permissions.CommonPermissions; import java.net.URL; import java.net.http.HttpClient; diff --git a/src/main/java/xiamomc/morph/updates/VersionHandling.java b/src/main/java/xyz/nifeather/morph/updates/VersionHandling.java similarity index 98% rename from src/main/java/xiamomc/morph/updates/VersionHandling.java rename to src/main/java/xyz/nifeather/morph/updates/VersionHandling.java index 003f6297..8de10184 100644 --- a/src/main/java/xiamomc/morph/updates/VersionHandling.java +++ b/src/main/java/xyz/nifeather/morph/updates/VersionHandling.java @@ -1,4 +1,4 @@ -package xiamomc.morph.updates; +package xyz.nifeather.morph.updates; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/xiamomc/morph/utilities/BindableUtils.java b/src/main/java/xyz/nifeather/morph/utilities/BindableUtils.java similarity index 92% rename from src/main/java/xiamomc/morph/utilities/BindableUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/BindableUtils.java index 8e8412e7..0246fc0c 100644 --- a/src/main/java/xiamomc/morph/utilities/BindableUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/BindableUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import xiamomc.pluginbase.Bindables.BindableList; diff --git a/src/main/java/xiamomc/morph/utilities/CollisionUtils.java b/src/main/java/xyz/nifeather/morph/utilities/CollisionUtils.java similarity index 95% rename from src/main/java/xiamomc/morph/utilities/CollisionUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/CollisionUtils.java index b8ab6ad6..848b9620 100644 --- a/src/main/java/xiamomc/morph/utilities/CollisionUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/CollisionUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.shapes.BooleanOp; diff --git a/src/main/java/xiamomc/morph/utilities/DamageSourceUtils.java b/src/main/java/xyz/nifeather/morph/utilities/DamageSourceUtils.java similarity index 98% rename from src/main/java/xiamomc/morph/utilities/DamageSourceUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/DamageSourceUtils.java index 969785d9..e89de996 100644 --- a/src/main/java/xiamomc/morph/utilities/DamageSourceUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/DamageSourceUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.core.Holder; diff --git a/src/main/java/xiamomc/morph/utilities/DisguiseUtils.java b/src/main/java/xyz/nifeather/morph/utilities/DisguiseUtils.java similarity index 94% rename from src/main/java/xiamomc/morph/utilities/DisguiseUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/DisguiseUtils.java index 640a2116..be10aa6a 100644 --- a/src/main/java/xiamomc/morph/utilities/DisguiseUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/DisguiseUtils.java @@ -1,11 +1,11 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import xiamomc.morph.misc.DisguiseMeta; -import xiamomc.morph.misc.NmsRecord; +import xyz.nifeather.morph.misc.DisguiseMeta; +import xyz.nifeather.morph.misc.NmsRecord; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java b/src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java similarity index 99% rename from src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java index 25b021b4..546c0f19 100644 --- a/src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/EntityTypeUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; @@ -18,8 +18,8 @@ import org.bukkit.entity.EntityType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.misc.DisguiseTypes; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.misc.DisguiseTypes; import java.util.Arrays; import java.util.Map; diff --git a/src/main/java/xiamomc/morph/utilities/ItemUtils.java b/src/main/java/xyz/nifeather/morph/utilities/ItemUtils.java similarity index 97% rename from src/main/java/xiamomc/morph/utilities/ItemUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/ItemUtils.java index cc8688e1..546d615a 100644 --- a/src/main/java/xiamomc/morph/utilities/ItemUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/ItemUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -11,8 +11,7 @@ import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; public class ItemUtils { diff --git a/src/main/java/xiamomc/morph/utilities/MapMetaUtils.java b/src/main/java/xyz/nifeather/morph/utilities/MapMetaUtils.java similarity index 98% rename from src/main/java/xiamomc/morph/utilities/MapMetaUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/MapMetaUtils.java index 45955cee..5067963e 100644 --- a/src/main/java/xiamomc/morph/utilities/MapMetaUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/MapMetaUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/xiamomc/morph/utilities/MathUtils.java b/src/main/java/xyz/nifeather/morph/utilities/MathUtils.java similarity index 95% rename from src/main/java/xiamomc/morph/utilities/MathUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/MathUtils.java index 0e19eb65..59a84a33 100644 --- a/src/main/java/xiamomc/morph/utilities/MathUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/MathUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import org.bukkit.util.Vector; diff --git a/src/main/java/xiamomc/morph/utilities/NbtUtils.java b/src/main/java/xyz/nifeather/morph/utilities/NbtUtils.java similarity index 98% rename from src/main/java/xiamomc/morph/utilities/NbtUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/NbtUtils.java index 29493f7f..8269860b 100644 --- a/src/main/java/xiamomc/morph/utilities/NbtUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/NbtUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; @@ -11,8 +11,8 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; -import xiamomc.morph.misc.MorphGameProfile; +import xyz.nifeather.morph.MorphPlugin; +import xyz.nifeather.morph.misc.MorphGameProfile; import java.util.List; import java.util.UUID; diff --git a/src/main/java/xiamomc/morph/utilities/NmsUtils.java b/src/main/java/xyz/nifeather/morph/utilities/NmsUtils.java similarity index 98% rename from src/main/java/xiamomc/morph/utilities/NmsUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/NmsUtils.java index 1f7a5ce9..f9d8482b 100644 --- a/src/main/java/xiamomc/morph/utilities/NmsUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/NmsUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; @@ -17,7 +17,7 @@ import org.jetbrains.annotations.Unmodifiable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import java.lang.reflect.Modifier; import java.util.List; diff --git a/src/main/java/xiamomc/morph/utilities/PermissionUtils.java b/src/main/java/xyz/nifeather/morph/utilities/PermissionUtils.java similarity index 88% rename from src/main/java/xiamomc/morph/utilities/PermissionUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/PermissionUtils.java index 659e9434..98d5b67d 100644 --- a/src/main/java/xiamomc/morph/utilities/PermissionUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/PermissionUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/utilities/PluginAssetUtils.java b/src/main/java/xyz/nifeather/morph/utilities/PluginAssetUtils.java similarity index 94% rename from src/main/java/xiamomc/morph/utilities/PluginAssetUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/PluginAssetUtils.java index 52235fd4..39a03157 100644 --- a/src/main/java/xiamomc/morph/utilities/PluginAssetUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/PluginAssetUtils.java @@ -1,8 +1,8 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; +import xyz.nifeather.morph.MorphPlugin; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/xiamomc/morph/utilities/ReflectionUtils.java b/src/main/java/xyz/nifeather/morph/utilities/ReflectionUtils.java similarity index 99% rename from src/main/java/xiamomc/morph/utilities/ReflectionUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/ReflectionUtils.java index 852860b9..8f43ec9b 100644 --- a/src/main/java/xiamomc/morph/utilities/ReflectionUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/ReflectionUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; diff --git a/src/main/java/xiamomc/morph/utilities/SoundUtils.java b/src/main/java/xyz/nifeather/morph/utilities/SoundUtils.java similarity index 96% rename from src/main/java/xiamomc/morph/utilities/SoundUtils.java rename to src/main/java/xyz/nifeather/morph/utilities/SoundUtils.java index d8b22ed4..fed7d514 100644 --- a/src/main/java/xiamomc/morph/utilities/SoundUtils.java +++ b/src/main/java/xyz/nifeather/morph/utilities/SoundUtils.java @@ -1,4 +1,4 @@ -package xiamomc.morph.utilities; +package xyz.nifeather.morph.utilities; import net.kyori.adventure.key.Key; import net.kyori.adventure.sound.Sound; diff --git a/src/main/resources/assets/feathermorph/lang/en_us.json b/src/main/resources/assets/feathermorph/lang/en_us.json index 03b4b86b..dc9cfa21 100644 --- a/src/main/resources/assets/feathermorph/lang/en_us.json +++ b/src/main/resources/assets/feathermorph/lang/en_us.json @@ -222,6 +222,7 @@ "emote.morphclient.crawl": "Crawl", "emote.morphclient.digdown": "Dig Down", "emote.morphclient.appear": "Appear", + "emote.morphclient.none": "None", "emote.morphclient.not_available": "Can't play action while the skill is still in cooldown", "emote.morphclient.unknown": "Unknown", "chestui.next_page": "Next page", diff --git a/src/main/resources/assets/feathermorph/lang/zh_cn.json b/src/main/resources/assets/feathermorph/lang/zh_cn.json index 0f0f8d6a..29f5df98 100644 --- a/src/main/resources/assets/feathermorph/lang/zh_cn.json +++ b/src/main/resources/assets/feathermorph/lang/zh_cn.json @@ -222,6 +222,7 @@ "emote.morphclient.crawl": "趴下", "emote.morphclient.digdown": "掘地", "emote.morphclient.appear": "出现", + "emote.morphclient.none": "", "emote.morphclient.not_available": "技能冷却时不能播放动作", "emote.morphclient.unknown": "未知", "chestui.next_page": "下一页", diff --git a/src/main/resources/recipes.yml b/src/main/resources/recipes.yml index bcb086f3..106abd00 100644 --- a/src/main/resources/recipes.yml +++ b/src/main/resources/recipes.yml @@ -1,7 +1,20 @@ +# - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - +# +# Please note that we only provide a very basic crafting recipe support. +# We recommend using other recipe plugins to get more advanced management experience! +# +# - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - root: # Item crafting options item_crafting: # Options for the Disguise Tool + # + # PS: + # You can make an item a disguise tool by executing `/fm make_disguise_tool` command + # while holding it on your main hand. + # + # You can also give yourself a disguise tool by setting its custom data: + # `/give @s minecraft:feather[minecraft:custom_data={"feathermorph:is_disguise_tool": true}]` disguise_tool: enabled: true