From 6d8b7405f742b5a5b43f7a20cfd193cb9fdcc70c Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 11 Mar 2021 13:44:14 +0000 Subject: [PATCH] Began conversion into ecobosses --- .../proxy/v1_15_R1/CustomIllusioner.java} | 75 +----- .../proxy/v1_15_R1/IllusionerHelper.java | 31 --- .../proxy/v1_16_R1/CustomIllusioner.java} | 75 +----- .../proxy/v1_16_R1/IllusionerHelper.java | 31 --- .../proxy/v1_16_R2/CustomIllusioner.java} | 75 +----- .../proxy/v1_16_R2/IllusionerHelper.java | 31 --- .../proxy/v1_16_R3/CustomIllusioner.java} | 75 +----- .../proxy/v1_16_R3/IllusionerHelper.java | 31 --- .../EcoBossesPlugin.java} | 29 ++- .../com/willfp/ecobosses/bosses/EcoBoss.java | 5 + .../bosses}/listeners/AttackListeners.java | 5 +- .../bosses}/listeners/DeathListeners.java | 6 +- .../bosses}/listeners/SpawnListeners.java | 16 +- .../bosses/options/GameplayOptions.java | 157 ++++++++++++ .../bosses}/options/IllusionerOptions.java | 36 +-- .../ecobosses/bosses/util/BossbarUtils.java | 48 ++++ .../ecobosses/bosses/util/EffectOption.java | 49 ++++ .../bosses/util}/OptionedSound.java | 13 +- .../ecobosses/bosses/util/SpawnTotem.java | 59 +++++ .../ecobosses/bosses/util/SummonsOption.java | 31 +++ .../ecobosses/commands/CommandEbdrop.java | 30 +++ .../commands/CommandEbreload.java} | 13 +- .../ecobosses/config/EcoBossesConfigs.java | 15 ++ .../util/ProxyUtils.java | 8 +- .../illusioner/commands/CommandIldrop.java | 42 ---- .../illusioner/config/IllusionerConfigs.java | 35 --- .../illusioner/config/configs/Attacks.java | 13 - .../illusioner/config/configs/Drops.java | 26 -- .../illusioner/config/configs/Sounds.java | 13 - .../illusioner/illusioner/BlockStructure.java | 52 ---- .../illusioner/IllusionerManager.java | 11 - .../illusioner/options/GameplayOptions.java | 226 ------------------ .../src/main/resources/attacks.yml | 34 --- .../src/main/resources/bosses/illusioner.yml | 85 +++++++ .../core-plugin/src/main/resources/config.yml | 36 +-- .../core-plugin/src/main/resources/drops.yml | 1 - .../core-plugin/src/main/resources/lang.yml | 6 +- .../core-plugin/src/main/resources/plugin.yml | 31 +-- .../core-plugin/src/main/resources/sounds.yml | 53 ---- .../proxy/proxies/CustomIllusionerProxy.java | 17 ++ .../proxy/util/ProxyFactory.java | 2 +- .../proxy/proxies/EntityIllusionerProxy.java | 16 -- .../proxy/proxies/IllusionerHelperProxy.java | 24 -- 43 files changed, 613 insertions(+), 1054 deletions(-) rename eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/{illusioner/proxy/v1_15_R1/EntityIllusioner.java => ecobosses/proxy/v1_15_R1/CustomIllusioner.java} (50%) delete mode 100644 eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/IllusionerHelper.java rename eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/{illusioner/proxy/v1_16_R1/EntityIllusioner.java => ecobosses/proxy/v1_16_R1/CustomIllusioner.java} (50%) delete mode 100644 eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/IllusionerHelper.java rename eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/{illusioner/proxy/v1_16_R2/EntityIllusioner.java => ecobosses/proxy/v1_16_R2/CustomIllusioner.java} (50%) delete mode 100644 eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/IllusionerHelper.java rename eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/{illusioner/proxy/v1_16_R3/EntityIllusioner.java => ecobosses/proxy/v1_16_R3/CustomIllusioner.java} (50%) delete mode 100644 eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/IllusionerHelper.java rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/IllusionerPlugin.java => ecobosses/EcoBossesPlugin.java} (76%) create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/illusioner => ecobosses/bosses}/listeners/AttackListeners.java (97%) rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/illusioner => ecobosses/bosses}/listeners/DeathListeners.java (90%) rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/illusioner => ecobosses/bosses}/listeners/SpawnListeners.java (84%) create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/GameplayOptions.java rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/illusioner => ecobosses/bosses}/options/IllusionerOptions.java (71%) create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/BossbarUtils.java create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/EffectOption.java rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/illusioner => ecobosses/bosses/util}/OptionedSound.java (66%) create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SpawnTotem.java create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SummonsOption.java create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbdrop.java rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner/commands/CommandIlreload.java => ecobosses/commands/CommandEbreload.java} (59%) create mode 100644 eco-core/core-plugin/src/main/java/com/willfp/ecobosses/config/EcoBossesConfigs.java rename eco-core/core-plugin/src/main/java/com/willfp/{illusioner => ecobosses}/util/ProxyUtils.java (68%) delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIldrop.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/IllusionerConfigs.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Attacks.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Drops.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Sounds.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/BlockStructure.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/IllusionerManager.java delete mode 100644 eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/GameplayOptions.java delete mode 100644 eco-core/core-plugin/src/main/resources/attacks.yml create mode 100644 eco-core/core-plugin/src/main/resources/bosses/illusioner.yml delete mode 100644 eco-core/core-plugin/src/main/resources/drops.yml delete mode 100644 eco-core/core-plugin/src/main/resources/sounds.yml create mode 100644 eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/proxies/CustomIllusionerProxy.java rename eco-core/core-proxy/src/main/java/com/willfp/{illusioner => ecobosses}/proxy/util/ProxyFactory.java (98%) delete mode 100644 eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/EntityIllusionerProxy.java delete mode 100644 eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/IllusionerHelperProxy.java diff --git a/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/EntityIllusioner.java b/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/ecobosses/proxy/v1_15_R1/CustomIllusioner.java similarity index 50% rename from eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/EntityIllusioner.java rename to eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/ecobosses/proxy/v1_15_R1/CustomIllusioner.java index 7e615ce..f45fe96 100644 --- a/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/EntityIllusioner.java +++ b/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/ecobosses/proxy/v1_15_R1/CustomIllusioner.java @@ -1,8 +1,6 @@ -package com.willfp.illusioner.proxy.v1_15_R1; +package com.willfp.ecobosses.proxy.v1_15_R1; -import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; +import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; import net.minecraft.server.v1_15_R1.EntityHuman; import net.minecraft.server.v1_15_R1.EntityIllagerIllusioner; import net.minecraft.server.v1_15_R1.EntityIllagerWizard; @@ -11,7 +9,6 @@ import net.minecraft.server.v1_15_R1.EntityIronGolem; import net.minecraft.server.v1_15_R1.EntityRaider; import net.minecraft.server.v1_15_R1.EntityTypes; import net.minecraft.server.v1_15_R1.EntityVillagerAbstract; -import net.minecraft.server.v1_15_R1.GenericAttributes; import net.minecraft.server.v1_15_R1.PathfinderGoalBowShoot; import net.minecraft.server.v1_15_R1.PathfinderGoalFloat; import net.minecraft.server.v1_15_R1.PathfinderGoalHurtByTarget; @@ -19,48 +16,25 @@ import net.minecraft.server.v1_15_R1.PathfinderGoalLookAtPlayer; import net.minecraft.server.v1_15_R1.PathfinderGoalMeleeAttack; import net.minecraft.server.v1_15_R1.PathfinderGoalNearestAttackableTarget; import net.minecraft.server.v1_15_R1.PathfinderGoalRandomStroll; -import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.attribute.Attribute; -import org.bukkit.boss.BarFlag; -import org.bukkit.boss.BossBar; import org.bukkit.craftbukkit.v1_15_R1.CraftWorld; import org.bukkit.craftbukkit.v1_15_R1.util.CraftNamespacedKey; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.persistence.PersistentDataType; import org.jetbrains.annotations.NotNull; -public class EntityIllusioner extends EntityIllagerIllusioner implements EntityIllusionerProxy { +public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { /** - * The display name for the illusioner. - */ - private final String displayName; - - /** - * The boss bar linked to the illusioner. - */ - private BossBar bossBar = null; - - /** - * Instantiate a new illusioner entity. + * Instantiate a new custom illusioner entity. * * @param location The location to spawn it at. */ - public EntityIllusioner(@NotNull final Location location) { + public CustomIllusioner(@NotNull final Location location) { super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("illusioner:illusioner"), PersistentDataType.INTEGER, 1); - - this.displayName = IllusionerManager.OPTIONS.getName(); + this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("ecobosses:type"), PersistentDataType.STRING, "custom_illusioner"); this.setPosition(location.getX(), location.getY(), location.getZ()); - this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(IllusionerManager.OPTIONS.getMaxHealth()); - this.setHealth((float) IllusionerManager.OPTIONS.getMaxHealth()); - - this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(IllusionerManager.OPTIONS.getAttackDamage()); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new EntityIllagerWizard.b()); this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); @@ -78,38 +52,9 @@ public class EntityIllusioner extends EntityIllagerIllusioner implements EntityI } @Override - public BossBar createBossbar(@NotNull final AbstractEcoPlugin plugin) { - if (bossBar != null) { - return bossBar; - } - BossBar bossBar = Bukkit.getServer().createBossBar(this.displayName, IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle(), (BarFlag) null); - this.bossBar = bossBar; - - LivingEntity entity = (LivingEntity) this.getBukkitEntity(); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.getPlayers().forEach(bossBar::removePlayer); - entity.getNearbyEntities(50, 50, 50).forEach(entity1 -> { - if (entity1 instanceof Player) { - bossBar.addPlayer((Player) entity1); - } - }); - } else { - runnable.cancel(); - } - }).runTaskTimer(0, 40); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.setProgress(entity.getHealth() / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); - } else { - bossBar.getPlayers().forEach(bossBar::removePlayer); - bossBar.setVisible(false); - runnable.cancel(); - } - }).runTaskTimer(0, 1); - - return bossBar; + public CustomIllusionerProxy spawn(@NotNull final Location location) { + CustomIllusioner illusioner = new CustomIllusioner(location); + ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); + return illusioner; } } diff --git a/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/IllusionerHelper.java b/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/IllusionerHelper.java deleted file mode 100644 index bbae6d6..0000000 --- a/eco-core/core-nms/v1_15_R1/src/main/java/com/willfp/illusioner/proxy/v1_15_R1/IllusionerHelper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.willfp.illusioner.proxy.v1_15_R1; - -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; -import com.willfp.illusioner.proxy.proxies.IllusionerHelperProxy; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_15_R1.CraftWorld; -import org.bukkit.craftbukkit.v1_15_R1.entity.CraftIllusioner; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public class IllusionerHelper implements IllusionerHelperProxy { - @Override - public EntityIllusionerProxy spawn(@NotNull final Location location) { - EntityIllusioner illusioner = new EntityIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); - return illusioner; - } - - @Override - public EntityIllusionerProxy adapt(@NotNull final Illusioner illusioner) { - if (illusioner instanceof CraftIllusioner) { - if (((CraftIllusioner) illusioner).getHandle() instanceof EntityIllusionerProxy) { - return null; - } - } else { - return null; - } - illusioner.remove(); - return spawn(illusioner.getLocation()); - } -} diff --git a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/EntityIllusioner.java b/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomIllusioner.java similarity index 50% rename from eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/EntityIllusioner.java rename to eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomIllusioner.java index 352660a..36ced13 100644 --- a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/EntityIllusioner.java +++ b/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomIllusioner.java @@ -1,8 +1,6 @@ -package com.willfp.illusioner.proxy.v1_16_R1; +package com.willfp.ecobosses.proxy.v1_16_R1; -import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; +import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; import net.minecraft.server.v1_16_R1.EntityHuman; import net.minecraft.server.v1_16_R1.EntityIllagerIllusioner; import net.minecraft.server.v1_16_R1.EntityIllagerWizard; @@ -11,7 +9,6 @@ import net.minecraft.server.v1_16_R1.EntityIronGolem; import net.minecraft.server.v1_16_R1.EntityRaider; import net.minecraft.server.v1_16_R1.EntityTypes; import net.minecraft.server.v1_16_R1.EntityVillagerAbstract; -import net.minecraft.server.v1_16_R1.GenericAttributes; import net.minecraft.server.v1_16_R1.PathfinderGoalBowShoot; import net.minecraft.server.v1_16_R1.PathfinderGoalFloat; import net.minecraft.server.v1_16_R1.PathfinderGoalHurtByTarget; @@ -19,48 +16,25 @@ import net.minecraft.server.v1_16_R1.PathfinderGoalLookAtPlayer; import net.minecraft.server.v1_16_R1.PathfinderGoalMeleeAttack; import net.minecraft.server.v1_16_R1.PathfinderGoalNearestAttackableTarget; import net.minecraft.server.v1_16_R1.PathfinderGoalRandomStroll; -import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.attribute.Attribute; -import org.bukkit.boss.BarFlag; -import org.bukkit.boss.BossBar; import org.bukkit.craftbukkit.v1_16_R1.CraftWorld; import org.bukkit.craftbukkit.v1_16_R1.util.CraftNamespacedKey; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.persistence.PersistentDataType; import org.jetbrains.annotations.NotNull; -public class EntityIllusioner extends EntityIllagerIllusioner implements EntityIllusionerProxy { +public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { /** - * The display name for the illusioner. - */ - private final String displayName; - - /** - * The boss bar linked to the illusioner. - */ - private BossBar bossBar = null; - - /** - * Instantiate a new illusioner entity. + * Instantiate a new custom illusioner entity. * * @param location The location to spawn it at. */ - public EntityIllusioner(@NotNull final Location location) { + public CustomIllusioner(@NotNull final Location location) { super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("illusioner:illusioner"), PersistentDataType.INTEGER, 1); - - this.displayName = IllusionerManager.OPTIONS.getName(); + this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("ecobosses:type"), PersistentDataType.STRING, "custom_illusioner"); this.setPosition(location.getX(), location.getY(), location.getZ()); - this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(IllusionerManager.OPTIONS.getMaxHealth()); - this.setHealth((float) IllusionerManager.OPTIONS.getMaxHealth()); - - this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(IllusionerManager.OPTIONS.getAttackDamage()); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new EntityIllagerWizard.b()); this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); @@ -78,38 +52,9 @@ public class EntityIllusioner extends EntityIllagerIllusioner implements EntityI } @Override - public BossBar createBossbar(@NotNull final AbstractEcoPlugin plugin) { - if (bossBar != null) { - return bossBar; - } - BossBar bossBar = Bukkit.getServer().createBossBar(this.displayName, IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle(), (BarFlag) null); - this.bossBar = bossBar; - - LivingEntity entity = (LivingEntity) this.getBukkitEntity(); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.getPlayers().forEach(bossBar::removePlayer); - entity.getNearbyEntities(50, 50, 50).forEach(entity1 -> { - if (entity1 instanceof Player) { - bossBar.addPlayer((Player) entity1); - } - }); - } else { - runnable.cancel(); - } - }).runTaskTimer(0, 40); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.setProgress(entity.getHealth() / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); - } else { - bossBar.getPlayers().forEach(bossBar::removePlayer); - bossBar.setVisible(false); - runnable.cancel(); - } - }).runTaskTimer(0, 1); - - return bossBar; + public CustomIllusionerProxy spawn(@NotNull final Location location) { + CustomIllusioner illusioner = new CustomIllusioner(location); + ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); + return illusioner; } } diff --git a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/IllusionerHelper.java b/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/IllusionerHelper.java deleted file mode 100644 index 8997b1b..0000000 --- a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/illusioner/proxy/v1_16_R1/IllusionerHelper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.willfp.illusioner.proxy.v1_16_R1; - -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; -import com.willfp.illusioner.proxy.proxies.IllusionerHelperProxy; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_16_R1.CraftWorld; -import org.bukkit.craftbukkit.v1_16_R1.entity.CraftIllusioner; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public class IllusionerHelper implements IllusionerHelperProxy { - @Override - public EntityIllusionerProxy spawn(@NotNull final Location location) { - EntityIllusioner illusioner = new EntityIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); - return illusioner; - } - - @Override - public EntityIllusionerProxy adapt(@NotNull final Illusioner illusioner) { - if (illusioner instanceof CraftIllusioner) { - if (((CraftIllusioner) illusioner).getHandle() instanceof EntityIllusionerProxy) { - return null; - } - } else { - return null; - } - illusioner.remove(); - return spawn(illusioner.getLocation()); - } -} diff --git a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/EntityIllusioner.java b/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomIllusioner.java similarity index 50% rename from eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/EntityIllusioner.java rename to eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomIllusioner.java index c53f9c8..c924c7f 100644 --- a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/EntityIllusioner.java +++ b/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomIllusioner.java @@ -1,8 +1,6 @@ -package com.willfp.illusioner.proxy.v1_16_R2; +package com.willfp.ecobosses.proxy.v1_16_R2; -import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; +import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; import net.minecraft.server.v1_16_R2.EntityHuman; import net.minecraft.server.v1_16_R2.EntityIllagerIllusioner; import net.minecraft.server.v1_16_R2.EntityIllagerWizard; @@ -11,7 +9,6 @@ import net.minecraft.server.v1_16_R2.EntityIronGolem; import net.minecraft.server.v1_16_R2.EntityRaider; import net.minecraft.server.v1_16_R2.EntityTypes; import net.minecraft.server.v1_16_R2.EntityVillagerAbstract; -import net.minecraft.server.v1_16_R2.GenericAttributes; import net.minecraft.server.v1_16_R2.PathfinderGoalBowShoot; import net.minecraft.server.v1_16_R2.PathfinderGoalFloat; import net.minecraft.server.v1_16_R2.PathfinderGoalHurtByTarget; @@ -19,48 +16,25 @@ import net.minecraft.server.v1_16_R2.PathfinderGoalLookAtPlayer; import net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack; import net.minecraft.server.v1_16_R2.PathfinderGoalNearestAttackableTarget; import net.minecraft.server.v1_16_R2.PathfinderGoalRandomStroll; -import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.attribute.Attribute; -import org.bukkit.boss.BarFlag; -import org.bukkit.boss.BossBar; import org.bukkit.craftbukkit.v1_16_R2.CraftWorld; import org.bukkit.craftbukkit.v1_16_R2.util.CraftNamespacedKey; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.persistence.PersistentDataType; import org.jetbrains.annotations.NotNull; -public class EntityIllusioner extends EntityIllagerIllusioner implements EntityIllusionerProxy { +public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { /** - * The display name for the illusioner. - */ - private final String displayName; - - /** - * The boss bar linked to the illusioner. - */ - private BossBar bossBar = null; - - /** - * Instantiate a new illusioner entity. + * Instantiate a new custom illusioner entity. * * @param location The location to spawn it at. */ - public EntityIllusioner(@NotNull final Location location) { + public CustomIllusioner(@NotNull final Location location) { super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("illusioner:illusioner"), PersistentDataType.INTEGER, 1); - - this.displayName = IllusionerManager.OPTIONS.getName(); + this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("ecobosses:type"), PersistentDataType.STRING, "custom_illusioner"); this.setPosition(location.getX(), location.getY(), location.getZ()); - this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(IllusionerManager.OPTIONS.getMaxHealth()); - this.setHealth((float) IllusionerManager.OPTIONS.getMaxHealth()); - - this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(IllusionerManager.OPTIONS.getAttackDamage()); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new EntityIllagerWizard.b()); this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); @@ -78,38 +52,9 @@ public class EntityIllusioner extends EntityIllagerIllusioner implements EntityI } @Override - public BossBar createBossbar(@NotNull final AbstractEcoPlugin plugin) { - if (bossBar != null) { - return bossBar; - } - BossBar bossBar = Bukkit.getServer().createBossBar(this.displayName, IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle(), (BarFlag) null); - this.bossBar = bossBar; - - LivingEntity entity = (LivingEntity) this.getBukkitEntity(); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.getPlayers().forEach(bossBar::removePlayer); - entity.getNearbyEntities(50, 50, 50).forEach(entity1 -> { - if (entity1 instanceof Player) { - bossBar.addPlayer((Player) entity1); - } - }); - } else { - runnable.cancel(); - } - }).runTaskTimer(0, 40); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.setProgress(entity.getHealth() / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); - } else { - bossBar.getPlayers().forEach(bossBar::removePlayer); - bossBar.setVisible(false); - runnable.cancel(); - } - }).runTaskTimer(0, 1); - - return bossBar; + public CustomIllusionerProxy spawn(@NotNull final Location location) { + CustomIllusioner illusioner = new CustomIllusioner(location); + ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); + return illusioner; } } diff --git a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/IllusionerHelper.java b/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/IllusionerHelper.java deleted file mode 100644 index 19dce11..0000000 --- a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/illusioner/proxy/v1_16_R2/IllusionerHelper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.willfp.illusioner.proxy.v1_16_R2; - -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; -import com.willfp.illusioner.proxy.proxies.IllusionerHelperProxy; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_16_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_16_R2.entity.CraftIllusioner; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public class IllusionerHelper implements IllusionerHelperProxy { - @Override - public EntityIllusionerProxy spawn(@NotNull final Location location) { - EntityIllusioner illusioner = new EntityIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); - return illusioner; - } - - @Override - public EntityIllusionerProxy adapt(@NotNull final Illusioner illusioner) { - if (illusioner instanceof CraftIllusioner) { - if (((CraftIllusioner) illusioner).getHandle() instanceof EntityIllusionerProxy) { - return null; - } - } else { - return null; - } - illusioner.remove(); - return spawn(illusioner.getLocation()); - } -} diff --git a/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/EntityIllusioner.java b/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/ecobosses/proxy/v1_16_R3/CustomIllusioner.java similarity index 50% rename from eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/EntityIllusioner.java rename to eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/ecobosses/proxy/v1_16_R3/CustomIllusioner.java index 936215c..3ee59f5 100644 --- a/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/EntityIllusioner.java +++ b/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/ecobosses/proxy/v1_16_R3/CustomIllusioner.java @@ -1,8 +1,6 @@ -package com.willfp.illusioner.proxy.v1_16_R3; +package com.willfp.ecobosses.proxy.v1_16_R3; -import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; +import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; import net.minecraft.server.v1_16_R3.EntityHuman; import net.minecraft.server.v1_16_R3.EntityIllagerIllusioner; import net.minecraft.server.v1_16_R3.EntityIllagerWizard; @@ -11,7 +9,6 @@ import net.minecraft.server.v1_16_R3.EntityIronGolem; import net.minecraft.server.v1_16_R3.EntityRaider; import net.minecraft.server.v1_16_R3.EntityTypes; import net.minecraft.server.v1_16_R3.EntityVillagerAbstract; -import net.minecraft.server.v1_16_R3.GenericAttributes; import net.minecraft.server.v1_16_R3.PathfinderGoalBowShoot; import net.minecraft.server.v1_16_R3.PathfinderGoalFloat; import net.minecraft.server.v1_16_R3.PathfinderGoalHurtByTarget; @@ -19,48 +16,25 @@ import net.minecraft.server.v1_16_R3.PathfinderGoalLookAtPlayer; import net.minecraft.server.v1_16_R3.PathfinderGoalMeleeAttack; import net.minecraft.server.v1_16_R3.PathfinderGoalNearestAttackableTarget; import net.minecraft.server.v1_16_R3.PathfinderGoalRandomStroll; -import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.attribute.Attribute; -import org.bukkit.boss.BarFlag; -import org.bukkit.boss.BossBar; import org.bukkit.craftbukkit.v1_16_R3.CraftWorld; import org.bukkit.craftbukkit.v1_16_R3.util.CraftNamespacedKey; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.persistence.PersistentDataType; import org.jetbrains.annotations.NotNull; -public class EntityIllusioner extends EntityIllagerIllusioner implements EntityIllusionerProxy { +public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { /** - * The display name for the illusioner. - */ - private final String displayName; - - /** - * The boss bar linked to the illusioner. - */ - private BossBar bossBar = null; - - /** - * Instantiate a new illusioner entity. + * Instantiate a new custom illusioner entity. * * @param location The location to spawn it at. */ - public EntityIllusioner(@NotNull final Location location) { + public CustomIllusioner(@NotNull final Location location) { super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("illusioner:illusioner"), PersistentDataType.INTEGER, 1); - - this.displayName = IllusionerManager.OPTIONS.getName(); + this.getBukkitEntity().getPersistentDataContainer().set(CraftNamespacedKey.fromString("ecobosses:type"), PersistentDataType.STRING, "custom_illusioner"); this.setPosition(location.getX(), location.getY(), location.getZ()); - this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(IllusionerManager.OPTIONS.getMaxHealth()); - this.setHealth((float) IllusionerManager.OPTIONS.getMaxHealth()); - - this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(IllusionerManager.OPTIONS.getAttackDamage()); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new EntityIllagerWizard.b()); this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); @@ -78,38 +52,9 @@ public class EntityIllusioner extends EntityIllagerIllusioner implements EntityI } @Override - public BossBar createBossbar(@NotNull final AbstractEcoPlugin plugin) { - if (bossBar != null) { - return bossBar; - } - BossBar bossBar = Bukkit.getServer().createBossBar(this.displayName, IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle(), (BarFlag) null); - this.bossBar = bossBar; - - LivingEntity entity = (LivingEntity) this.getBukkitEntity(); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.getPlayers().forEach(bossBar::removePlayer); - entity.getNearbyEntities(50, 50, 50).forEach(entity1 -> { - if (entity1 instanceof Player) { - bossBar.addPlayer((Player) entity1); - } - }); - } else { - runnable.cancel(); - } - }).runTaskTimer(0, 40); - - plugin.getRunnableFactory().create(runnable -> { - if (!entity.isDead()) { - bossBar.setProgress(entity.getHealth() / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); - } else { - bossBar.getPlayers().forEach(bossBar::removePlayer); - bossBar.setVisible(false); - runnable.cancel(); - } - }).runTaskTimer(0, 1); - - return bossBar; + public CustomIllusionerProxy spawn(@NotNull final Location location) { + CustomIllusioner illusioner = new CustomIllusioner(location); + ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); + return illusioner; } } diff --git a/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/IllusionerHelper.java b/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/IllusionerHelper.java deleted file mode 100644 index 416f975..0000000 --- a/eco-core/core-nms/v1_16_R3/src/main/java/com/willfp/illusioner/proxy/v1_16_R3/IllusionerHelper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.willfp.illusioner.proxy.v1_16_R3; - -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; -import com.willfp.illusioner.proxy.proxies.IllusionerHelperProxy; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_16_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_16_R3.entity.CraftIllusioner; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public class IllusionerHelper implements IllusionerHelperProxy { - @Override - public EntityIllusionerProxy spawn(@NotNull final Location location) { - EntityIllusioner illusioner = new EntityIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); - return illusioner; - } - - @Override - public EntityIllusionerProxy adapt(@NotNull final Illusioner illusioner) { - if (illusioner instanceof CraftIllusioner) { - if (((CraftIllusioner) illusioner).getHandle() instanceof EntityIllusionerProxy) { - return null; - } - } else { - return null; - } - illusioner.remove(); - return spawn(illusioner.getLocation()); - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/IllusionerPlugin.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/EcoBossesPlugin.java similarity index 76% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/IllusionerPlugin.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/EcoBossesPlugin.java index 2e8cc3b..cbe4705 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/IllusionerPlugin.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/EcoBossesPlugin.java @@ -1,17 +1,16 @@ -package com.willfp.illusioner; +package com.willfp.ecobosses; import com.willfp.eco.util.command.AbstractCommand; import com.willfp.eco.util.display.DisplayModule; import com.willfp.eco.util.integrations.IntegrationLoader; import com.willfp.eco.util.plugin.AbstractEcoPlugin; import com.willfp.eco.util.protocollib.AbstractPacketAdapter; -import com.willfp.illusioner.commands.CommandIldrop; -import com.willfp.illusioner.commands.CommandIlreload; -import com.willfp.illusioner.config.IllusionerConfigs; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.illusioner.listeners.AttackListeners; -import com.willfp.illusioner.illusioner.listeners.DeathListeners; -import com.willfp.illusioner.illusioner.listeners.SpawnListeners; +import com.willfp.ecobosses.commands.CommandEbdrop; +import com.willfp.ecobosses.commands.CommandEbreload; +import com.willfp.ecobosses.config.EcoBossesConfigs; +import com.willfp.ecobosses.bosses.listeners.AttackListeners; +import com.willfp.ecobosses.bosses.listeners.DeathListeners; +import com.willfp.ecobosses.bosses.listeners.SpawnListeners; import lombok.Getter; import org.bukkit.event.Listener; import org.jetbrains.annotations.Nullable; @@ -21,18 +20,18 @@ import java.util.Arrays; import java.util.List; @SuppressWarnings("unused") -public class IllusionerPlugin extends AbstractEcoPlugin { +public class EcoBossesPlugin extends AbstractEcoPlugin { /** * Instance of the plugin. */ @Getter - private static IllusionerPlugin instance; + private static EcoBossesPlugin instance; /** * Internal constructor called by bukkit on plugin load. */ - public IllusionerPlugin() { - super("Illusioner", 86576, 9596, "com.willfp.illusioner.proxy", "&9"); + public EcoBossesPlugin() { + super("EcoBosses", 86576, 9596, "com.willfp.ecobosses.proxy", "&9"); instance = this; } @@ -94,8 +93,8 @@ public class IllusionerPlugin extends AbstractEcoPlugin { @Override public List getCommands() { return Arrays.asList( - new CommandIlreload(this), - new CommandIldrop(this) + new CommandEbreload(this), + new CommandEbdrop(this) ); } @@ -126,7 +125,7 @@ public class IllusionerPlugin extends AbstractEcoPlugin { @Override public List> getUpdatableClasses() { return Arrays.asList( - IllusionerConfigs.class + EcoBossesConfigs.class ); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java new file mode 100644 index 0000000..727dfd4 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/EcoBoss.java @@ -0,0 +1,5 @@ +package com.willfp.ecobosses.bosses; + +public class EcoBoss { + +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/AttackListeners.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/AttackListeners.java similarity index 97% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/AttackListeners.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/AttackListeners.java index bb742c2..54aa6d0 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/AttackListeners.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/AttackListeners.java @@ -1,8 +1,7 @@ -package com.willfp.illusioner.illusioner.listeners; +package com.willfp.ecobosses.bosses.listeners; import com.willfp.eco.util.NumberUtils; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.illusioner.OptionedSound; +import com.willfp.ecobosses.bosses.util.OptionedSound; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/DeathListeners.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/DeathListeners.java similarity index 90% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/DeathListeners.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/DeathListeners.java index 0d71283..5e44ebc 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/DeathListeners.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/DeathListeners.java @@ -1,10 +1,8 @@ -package com.willfp.illusioner.illusioner.listeners; +package com.willfp.ecobosses.bosses.listeners; -import com.willfp.eco.util.drops.DropQueue; import com.willfp.eco.util.events.entitydeathbyentity.EntityDeathByEntityEvent; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.illusioner.OptionedSound; +import com.willfp.ecobosses.bosses.util.OptionedSound; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/SpawnListeners.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/SpawnListeners.java similarity index 84% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/SpawnListeners.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/SpawnListeners.java index 0c795e2..7bc55ac 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/listeners/SpawnListeners.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/listeners/SpawnListeners.java @@ -1,11 +1,9 @@ -package com.willfp.illusioner.illusioner.listeners; +package com.willfp.ecobosses.bosses.listeners; import com.willfp.eco.util.internal.PluginDependent; import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.illusioner.illusioner.BlockStructure; -import com.willfp.illusioner.illusioner.IllusionerManager; -import com.willfp.illusioner.proxy.proxies.EntityIllusionerProxy; -import com.willfp.illusioner.proxy.proxies.IllusionerHelperProxy; -import com.willfp.illusioner.util.ProxyUtils; +import com.willfp.ecobosses.bosses.util.SpawnTotem; +import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; +import com.willfp.ecobosses.util.ProxyUtils; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Illusioner; @@ -56,7 +54,7 @@ public class SpawnListeners extends PluginDependent implements Listener { block3 = event.getBlock().getRelative(0, 1, 0); } - matches = BlockStructure.matches(new BlockStructure(block1.getType(), block2.getType(), block3.getType())); + matches = SpawnTotem.matches(new SpawnTotem(block1.getType(), block2.getType(), block3.getType())); if (matches) { match.add(block1); match.add(block2); @@ -78,7 +76,7 @@ public class SpawnListeners extends PluginDependent implements Listener { } }); - EntityIllusionerProxy illusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).spawn(event.getBlock().getLocation()); + CustomIllusionerProxy illusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).spawn(event.getBlock().getLocation()); illusioner.createBossbar(this.getPlugin()); } @@ -99,7 +97,7 @@ public class SpawnListeners extends PluginDependent implements Listener { Illusioner illusioner = (Illusioner) event.getEntity(); - EntityIllusionerProxy internalIllusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).adapt(illusioner); + CustomIllusionerProxy internalIllusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).adapt(illusioner); if (internalIllusioner == null) { return; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/GameplayOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/GameplayOptions.java new file mode 100644 index 0000000..632f56d --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/GameplayOptions.java @@ -0,0 +1,157 @@ +package com.willfp.ecobosses.bosses.options; + +import com.willfp.eco.util.internal.PluginDependent; +import com.willfp.eco.util.plugin.AbstractEcoPlugin; +import com.willfp.ecobosses.bosses.util.EffectOption; +import com.willfp.ecobosses.bosses.util.OptionedSound; +import com.willfp.ecobosses.config.EcoBossesConfigs; +import lombok.Getter; +import lombok.ToString; +import org.bukkit.Sound; +import org.bukkit.entity.EntityType; +import org.bukkit.potion.PotionEffectType; +import org.jetbrains.annotations.NotNull; + +import java.util.HashSet; +import java.util.Set; + +@ToString +public class GameplayOptions extends PluginDependent { + /** + * The sound played when the illusioner takes damage. + */ + @Getter + private OptionedSound hitSound; + + /** + * The sound played when the illusioner spawns. + */ + @Getter + private OptionedSound summonSound; + + /** + * The potion effect options. + */ + @Getter + private final Set effectOptions = new HashSet<>(); + + /** + * The mob summon options. + */ + @Getter + private final Set summonerOptions = new HashSet<>(); + + /** + * If the illusioner should shuffle hotbars. + */ + @Getter + private boolean shuffle; + + /** + * The chance of the illusioner shuffling a hotbar. + */ + @Getter + private double shuffleChance; + + /** + * If the illusioner is immune to explosion damage. + */ + @Getter + private boolean ignoreExplosionDamage; + + /** + * If the illusioner is immune to fire damage. + */ + @Getter + private boolean ignoreFire; + + /** + * If the illusioner is immune to suffocation damage. + */ + @Getter + private boolean ignoreSuffocation; + + /** + * If the illusioner can teleport. + */ + @Getter + private boolean teleport; + + /** + * Teleport range. + */ + @Getter + private int teleportRange; + + /** + * Teleport chance. + */ + @Getter + private double teleportChance; + + /** + * Teleport sound. + */ + @Getter + private OptionedSound teleportSound; + + /** + * Gameplay options. + * + * @param plugin The plugin. + */ + public GameplayOptions(@NotNull final AbstractEcoPlugin plugin) { + super(plugin); + } + + /** + * Reload the options. + */ + public void reload() { + hitSound = new OptionedSound( + Sound.valueOf(EcoBossesConfigs.SOUNDS.getString("hit.sound")), + (float) EcoBossesConfigs.SOUNDS.getDouble("hit.volume"), + (float) EcoBossesConfigs.SOUNDS.getDouble("hit.pitch"), + EcoBossesConfigs.SOUNDS.getBool("hit.broadcast") + ); + + summonSound = new OptionedSound( + Sound.valueOf(EcoBossesConfigs.SOUNDS.getString("summon.sound")), + (float) EcoBossesConfigs.SOUNDS.getDouble("summon.volume"), + (float) EcoBossesConfigs.SOUNDS.getDouble("summon.pitch"), + EcoBossesConfigs.SOUNDS.getBool("summon.broadcast") + ); + + shuffle = EcoBossesConfigs.ATTACKS.getBool("shuffle.enabled"); + shuffleChance = EcoBossesConfigs.ATTACKS.getDouble("shuffle.chance"); + + ignoreExplosionDamage = this.getPlugin().getConfigYml().getBool("ignore-explosion-damage"); + ignoreFire = this.getPlugin().getConfigYml().getBool("ignore-fire-damage"); + ignoreSuffocation = this.getPlugin().getConfigYml().getBool("ignore-suffocation-damage"); + + teleport = this.getPlugin().getConfigYml().getBool("teleport-on-damage.enabled"); + teleportRange = this.getPlugin().getConfigYml().getInt("teleport-on-damage.range"); + teleportChance = this.getPlugin().getConfigYml().getDouble("teleport-on-damage.chance"); + + Sound sound = Sound.valueOf(EcoBossesConfigs.SOUNDS.getString("teleport.sound")); + float volume = (float) EcoBossesConfigs.SOUNDS.getDouble("teleport.volume"); + float pitch = (float) EcoBossesConfigs.SOUNDS.getDouble("teleport.pitch"); + teleportSound = new OptionedSound(sound, volume, pitch, true); + + effectOptions.clear(); + EcoBossesConfigs.ATTACKS.getConfig().getConfigurationSection("effects").getKeys(false).forEach(key -> { + PotionEffectType type = PotionEffectType.getByName(EcoBossesConfigs.ATTACKS.getString("effects." + key + ".type")); + int level = EcoBossesConfigs.ATTACKS.getInt("effects." + key + ".level"); + int duration = EcoBossesConfigs.ATTACKS.getInt("effects." + key + ".duration"); + double chance = EcoBossesConfigs.ATTACKS.getDouble("effects." + key + ".chance"); + effectOptions.add(new EffectOption(chance, level, duration, type)); + }); + + summonerOptions.clear(); + EcoBossesConfigs.ATTACKS.getConfig().getConfigurationSection("summons").getKeys(false).forEach(key -> { + EntityType type = EntityType.valueOf(EcoBossesConfigs.ATTACKS.getString("summons." + key + ".type")); + double chance = EcoBossesConfigs.ATTACKS.getDouble("summons." + key + ".chance"); + summonerOptions.add(new SummonerOption(chance, type)); + }); + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/IllusionerOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/IllusionerOptions.java similarity index 71% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/IllusionerOptions.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/IllusionerOptions.java index 26f5452..0f1f2c4 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/IllusionerOptions.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/options/IllusionerOptions.java @@ -1,12 +1,12 @@ -package com.willfp.illusioner.illusioner.options; +package com.willfp.ecobosses.bosses.options; import com.willfp.eco.util.NumberUtils; import com.willfp.eco.util.internal.PluginDependent; import com.willfp.eco.util.plugin.AbstractEcoPlugin; import com.willfp.eco.util.tuples.Pair; -import com.willfp.illusioner.config.IllusionerConfigs; -import com.willfp.illusioner.illusioner.BlockStructure; -import com.willfp.illusioner.illusioner.OptionedSound; +import com.willfp.ecobosses.config.EcoBossesConfigs; +import com.willfp.ecobosses.bosses.util.SpawnTotem; +import com.willfp.ecobosses.bosses.util.OptionedSound; import lombok.Getter; import lombok.ToString; import org.bukkit.Material; @@ -62,7 +62,7 @@ public class IllusionerOptions extends PluginDependent { * The spawn block structure. */ @Getter - private BlockStructure spawnStructure; + private SpawnTotem spawnStructure; /** * The max health. @@ -117,24 +117,24 @@ public class IllusionerOptions extends PluginDependent { override = this.getPlugin().getConfigYml().getBool("override"); spawnSounds = new HashSet<>(); - IllusionerConfigs.SOUNDS.getConfig().getConfigurationSection("spawn").getKeys(false).forEach(key -> { - Sound sound = Sound.valueOf(IllusionerConfigs.SOUNDS.getString("spawn." + key + ".sound")); - boolean broadcast = IllusionerConfigs.SOUNDS.getBool("spawn." + key + ".broadcast"); - float volume = (float) IllusionerConfigs.SOUNDS.getDouble("spawn." + key + ".volume"); - float pitch = (float) IllusionerConfigs.SOUNDS.getDouble("spawn." + key + ".pitch"); + EcoBossesConfigs.SOUNDS.getConfig().getConfigurationSection("spawn").getKeys(false).forEach(key -> { + Sound sound = Sound.valueOf(EcoBossesConfigs.SOUNDS.getString("spawn." + key + ".sound")); + boolean broadcast = EcoBossesConfigs.SOUNDS.getBool("spawn." + key + ".broadcast"); + float volume = (float) EcoBossesConfigs.SOUNDS.getDouble("spawn." + key + ".volume"); + float pitch = (float) EcoBossesConfigs.SOUNDS.getDouble("spawn." + key + ".pitch"); spawnSounds.add(new OptionedSound(sound, volume, pitch, broadcast)); }); deathSounds = new HashSet<>(); - IllusionerConfigs.SOUNDS.getConfig().getConfigurationSection("death").getKeys(false).forEach(key -> { - Sound sound = Sound.valueOf(IllusionerConfigs.SOUNDS.getString("death." + key + ".sound")); - boolean broadcast = IllusionerConfigs.SOUNDS.getBool("death." + key + ".broadcast"); - float volume = (float) IllusionerConfigs.SOUNDS.getDouble("death." + key + ".volume"); - float pitch = (float) IllusionerConfigs.SOUNDS.getDouble("death." + key + ".pitch"); + EcoBossesConfigs.SOUNDS.getConfig().getConfigurationSection("death").getKeys(false).forEach(key -> { + Sound sound = Sound.valueOf(EcoBossesConfigs.SOUNDS.getString("death." + key + ".sound")); + boolean broadcast = EcoBossesConfigs.SOUNDS.getBool("death." + key + ".broadcast"); + float volume = (float) EcoBossesConfigs.SOUNDS.getDouble("death." + key + ".volume"); + float pitch = (float) EcoBossesConfigs.SOUNDS.getDouble("death." + key + ".pitch"); deathSounds.add(new OptionedSound(sound, volume, pitch, broadcast)); }); - spawnStructure = new BlockStructure( + spawnStructure = new SpawnTotem( Material.valueOf(this.getPlugin().getConfigYml().getString("spawn.bottom-block")), Material.valueOf(this.getPlugin().getConfigYml().getString("spawn.middle-block")), Material.valueOf(this.getPlugin().getConfigYml().getString("spawn.top-block")) @@ -143,8 +143,8 @@ public class IllusionerOptions extends PluginDependent { gameplayOptions.reload(); drops = new ArrayList<>(); - for (String key : IllusionerConfigs.DROPS.getConfig().getKeys(false)) { - ItemStack itemStack = IllusionerConfigs.DROPS.getConfig().getItemStack(key); + for (String key : EcoBossesConfigs.DROPS.getConfig().getKeys(false)) { + ItemStack itemStack = EcoBossesConfigs.DROPS.getConfig().getItemStack(key); if (itemStack == null || itemStack.getType() == Material.AIR) { continue; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/BossbarUtils.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/BossbarUtils.java new file mode 100644 index 0000000..5ba1fb3 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/BossbarUtils.java @@ -0,0 +1,48 @@ +package com.willfp.ecobosses.bosses.util; + +import lombok.experimental.UtilityClass; +import org.bukkit.Bukkit; +import org.bukkit.attribute.Attribute; +import org.bukkit.boss.BarFlag; +import org.bukkit.boss.BossBar; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; + +@UtilityClass +public class BossbarUtils { + public BossBar createBossBar(@NotNull final LivingEntity entity) { + if (bossBar != null) { + return bossBar; + } + BossBar bossBar = Bukkit.getServer().createBossBar(this.displayName, IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle(), (BarFlag) null); + this.bossBar = bossBar; + + LivingEntity entity = (LivingEntity) this.getBukkitEntity(); + + plugin.getRunnableFactory().create(runnable -> { + if (!entity.isDead()) { + bossBar.getPlayers().forEach(bossBar::removePlayer); + entity.getNearbyEntities(50, 50, 50).forEach(entity1 -> { + if (entity1 instanceof Player) { + bossBar.addPlayer((Player) entity1); + } + }); + } else { + runnable.cancel(); + } + }).runTaskTimer(0, 40); + + plugin.getRunnableFactory().create(runnable -> { + if (!entity.isDead()) { + bossBar.setProgress(entity.getHealth() / entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()); + } else { + bossBar.getPlayers().forEach(bossBar::removePlayer); + bossBar.setVisible(false); + runnable.cancel(); + } + }).runTaskTimer(0, 1); + + return bossBar; + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/EffectOption.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/EffectOption.java new file mode 100644 index 0000000..5ce2797 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/EffectOption.java @@ -0,0 +1,49 @@ +package com.willfp.ecobosses.bosses.util; + +import lombok.Getter; +import org.bukkit.potion.PotionEffectType; +import org.jetbrains.annotations.NotNull; + +public class EffectOption { + /** + * The chance of the effect being applied. + */ + @Getter + private final double chance; + + /** + * The level of the effect. + */ + @Getter + private final int level; + + /** + * The potion effect type. + */ + @Getter + private final PotionEffectType effectType; + + /** + * The duration, in ticks. + */ + @Getter + private final int duration; + + /** + * Create a new effect option. + * + * @param chance The chance. + * @param level The level. + * @param duration The duration in ticks. + * @param effectType The effect. + */ + public EffectOption(final double chance, + final int level, + final int duration, + @NotNull final PotionEffectType effectType) { + this.chance = chance; + this.level = level; + this.effectType = effectType; + this.duration = duration; + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/OptionedSound.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/OptionedSound.java similarity index 66% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/OptionedSound.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/OptionedSound.java index 60ee02c..a79ab1f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/OptionedSound.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/OptionedSound.java @@ -1,4 +1,4 @@ -package com.willfp.illusioner.illusioner; +package com.willfp.ecobosses.bosses.util; import lombok.Getter; import org.bukkit.Sound; @@ -23,27 +23,18 @@ public class OptionedSound { @Getter private final float pitch; - /** - * If the sound should be played to the whole server. - */ - @Getter - private final boolean broadcast; - /** * Create a new optioned sound. * * @param sound The sound. * @param volume The volume. * @param pitch The pitch, from 0.5 to 2. - * @param broadcast If the sound should be played to the whole server. */ public OptionedSound(@NotNull final Sound sound, final float volume, - final float pitch, - final boolean broadcast) { + final float pitch) { this.sound = sound; this.volume = volume; this.pitch = pitch; - this.broadcast = broadcast; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SpawnTotem.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SpawnTotem.java new file mode 100644 index 0000000..619dea7 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SpawnTotem.java @@ -0,0 +1,59 @@ +package com.willfp.ecobosses.bosses.util; + +import lombok.Getter; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public class SpawnTotem { + /** + * The bottom block. + */ + @Getter + private final Material bottom; + + /** + * The middle block. + */ + @Getter + private final Material middle; + + /** + * The top block. + */ + @Getter + private final Material top; + + /** + * Create a new spawn totem. + * + * @param bottom The bottom block. + * @param middle The middle block. + * @param top The top block. + */ + public SpawnTotem(@NotNull final Material bottom, + @NotNull final Material middle, + @NotNull final Material top) { + this.bottom = bottom; + this.middle = middle; + this.top = top; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof SpawnTotem)) { + return false; + } + SpawnTotem that = (SpawnTotem) o; + return getBottom() == that.getBottom() && getMiddle() == that.getMiddle() && getTop() == that.getTop(); + } + + @Override + public int hashCode() { + return Objects.hash(getBottom(), getMiddle(), getTop()); + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SummonsOption.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SummonsOption.java new file mode 100644 index 0000000..a4a3a3b --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/bosses/util/SummonsOption.java @@ -0,0 +1,31 @@ +package com.willfp.ecobosses.bosses.util; + +import lombok.Getter; +import org.bukkit.entity.EntityType; +import org.jetbrains.annotations.NotNull; + +public class SummonsOption { + /** + * The chance of a mob being spawned. + */ + @Getter + private final double chance; + + /** + * The type of entity to summon. + */ + @Getter + private final EntityType type; + + /** + * Create a new summons option. + * + * @param chance The chance. + * @param type The entity type. + */ + public SummonsOption(final double chance, + @NotNull final EntityType type) { + this.chance = chance; + this.type = type; + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbdrop.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbdrop.java new file mode 100644 index 0000000..1514f86 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbdrop.java @@ -0,0 +1,30 @@ +package com.willfp.ecobosses.commands; + +import com.willfp.eco.util.command.AbstractCommand; +import com.willfp.ecobosses.EcoBossesPlugin; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class CommandEbdrop extends AbstractCommand { + /** + * Instantiate a new executor for /ebdrop. + * + * @param plugin The plugin to manage the execution for. + */ + public CommandEbdrop(@NotNull final EcoBossesPlugin plugin) { + super(plugin, "ebdrop", "ecobosses.ebdrop", true); + } + + @Override + public void onExecute(@NotNull final CommandSender sender, + @NotNull final List args) { + Player player = (Player) sender; + ItemStack itemStack = player.getInventory().getItemInMainHand(); + + player.sendMessage(this.getPlugin().getLangYml().getMessage("sent-drop")); + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIlreload.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbreload.java similarity index 59% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIlreload.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbreload.java index 1958e27..7cd81bf 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIlreload.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/commands/CommandEbreload.java @@ -1,26 +1,27 @@ -package com.willfp.illusioner.commands; +package com.willfp.ecobosses.commands; import com.willfp.eco.util.command.AbstractCommand; -import com.willfp.illusioner.IllusionerPlugin; +import com.willfp.ecobosses.EcoBossesPlugin; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import java.util.List; -public class CommandIlreload extends AbstractCommand { +public class CommandEbreload extends AbstractCommand { /** - * Instantiate a new executor for /ilreload. + * Instantiate a new executor for /ebreload. * * @param plugin The plugin to manage the execution for. */ - public CommandIlreload(@NotNull final IllusionerPlugin plugin) { - super(plugin, "ilreload", "illusioner.reload", false); + public CommandEbreload(@NotNull final EcoBossesPlugin plugin) { + super(plugin, "ebreload", "ecobosses.reload", false); } @Override public void onExecute(@NotNull final CommandSender sender, @NotNull final List args) { this.getPlugin().reload(); + this.getPlugin().reload(); sender.sendMessage(this.getPlugin().getLangYml().getMessage("reloaded")); } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/config/EcoBossesConfigs.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/config/EcoBossesConfigs.java new file mode 100644 index 0000000..ebe0110 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/config/EcoBossesConfigs.java @@ -0,0 +1,15 @@ +package com.willfp.ecobosses.config; + +import com.willfp.eco.util.config.updating.annotations.ConfigUpdater; +import lombok.experimental.UtilityClass; + +@UtilityClass +public class EcoBossesConfigs { + /** + * Update all configs. + */ + @ConfigUpdater + public void updateConfigs() { + + } +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/util/ProxyUtils.java b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/util/ProxyUtils.java similarity index 68% rename from eco-core/core-plugin/src/main/java/com/willfp/illusioner/util/ProxyUtils.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecobosses/util/ProxyUtils.java index bb9f2fc..e19f1e2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/util/ProxyUtils.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecobosses/util/ProxyUtils.java @@ -1,8 +1,8 @@ -package com.willfp.illusioner.util; +package com.willfp.ecobosses.util; import com.willfp.eco.util.proxy.AbstractProxy; -import com.willfp.illusioner.IllusionerPlugin; -import com.willfp.illusioner.proxy.util.ProxyFactory; +import com.willfp.ecobosses.EcoBossesPlugin; +import com.willfp.ecobosses.proxy.util.ProxyFactory; import lombok.experimental.UtilityClass; import org.jetbrains.annotations.NotNull; @@ -16,6 +16,6 @@ public class ProxyUtils { * @return The proxy implementation. */ public @NotNull T getProxy(@NotNull final Class proxyClass) { - return new ProxyFactory<>(IllusionerPlugin.getInstance(), proxyClass).getProxy(); + return new ProxyFactory<>(EcoBossesPlugin.getInstance(), proxyClass).getProxy(); } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIldrop.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIldrop.java deleted file mode 100644 index 1bf90b1..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/commands/CommandIldrop.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.willfp.illusioner.commands; - -import com.willfp.eco.util.NumberUtils; -import com.willfp.eco.util.command.AbstractCommand; -import com.willfp.illusioner.IllusionerPlugin; -import com.willfp.illusioner.config.IllusionerConfigs; -import org.bukkit.Material; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.NotNull; - -import java.util.List; - -public class CommandIldrop extends AbstractCommand { - /** - * Instantiate a new executor for /ildrop. - * - * @param plugin The plugin to manage the execution for. - */ - public CommandIldrop(@NotNull final IllusionerPlugin plugin) { - super(plugin, "ildrop", "illusioner.drop", true); - } - - @Override - public void onExecute(@NotNull final CommandSender sender, - @NotNull final List args) { - Player player = (Player) sender; - ItemStack itemStack = player.getInventory().getItemInMainHand(); - if (itemStack.getType() == Material.AIR) { - player.sendMessage(this.getPlugin().getLangYml().getMessage("no-item-held")); - return; - } - - IllusionerConfigs.DROPS.getConfig().set(String.valueOf(NumberUtils.randInt(0, 100000)), itemStack); - IllusionerConfigs.DROPS.save(); - IllusionerConfigs.DROPS.clearCache(); - player.sendMessage(this.getPlugin().getLangYml().getMessage("added-drop")); - - this.getPlugin().reload(); - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/IllusionerConfigs.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/IllusionerConfigs.java deleted file mode 100644 index 6b40892..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/IllusionerConfigs.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.willfp.illusioner.config; - -import com.willfp.eco.util.config.updating.annotations.ConfigUpdater; -import com.willfp.illusioner.config.configs.Attacks; -import com.willfp.illusioner.config.configs.Drops; -import com.willfp.illusioner.config.configs.Sounds; -import lombok.experimental.UtilityClass; - -@UtilityClass -public class IllusionerConfigs { - /** - * drops.yml. - */ - public static final Drops DROPS = new Drops(); - - /** - * sounds.yml. - */ - public static final Sounds SOUNDS = new Sounds(); - - /** - * attacks.yml. - */ - public static final Attacks ATTACKS = new Attacks(); - - /** - * Update all configs. - */ - @ConfigUpdater - public void updateConfigs() { - DROPS.save(); - SOUNDS.update(); - ATTACKS.update(); - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Attacks.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Attacks.java deleted file mode 100644 index 9a86154..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Attacks.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.willfp.illusioner.config.configs; - -import com.willfp.eco.util.config.BaseConfig; -import com.willfp.illusioner.IllusionerPlugin; - -public class Attacks extends BaseConfig { - /** - * Instantiate attacks.yml. - */ - public Attacks() { - super("attacks", false, IllusionerPlugin.getInstance(), "effects.", "summons."); - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Drops.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Drops.java deleted file mode 100644 index f9afb70..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Drops.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.willfp.illusioner.config.configs; - -import com.willfp.eco.util.config.BaseConfig; -import com.willfp.illusioner.IllusionerPlugin; - -import java.io.IOException; - -public class Drops extends BaseConfig { - /** - * Instantiate drops.yml. - */ - public Drops() { - super("drops", false, IllusionerPlugin.getInstance()); - } - - /** - * Save config to drops.yml. - */ - public void save() { - try { - this.getConfig().save(this.getConfigFile()); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Sounds.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Sounds.java deleted file mode 100644 index 605ccc6..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/config/configs/Sounds.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.willfp.illusioner.config.configs; - -import com.willfp.eco.util.config.BaseConfig; -import com.willfp.illusioner.IllusionerPlugin; - -public class Sounds extends BaseConfig { - /** - * Instantiate sounds.yml. - */ - public Sounds() { - super("sounds", false, IllusionerPlugin.getInstance()); - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/BlockStructure.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/BlockStructure.java deleted file mode 100644 index 93281bd..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/BlockStructure.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.willfp.illusioner.illusioner; - -import lombok.Getter; -import org.bukkit.Material; -import org.jetbrains.annotations.NotNull; - -public class BlockStructure { - /** - * The bottom block. - */ - @Getter - private final Material bottom; - - /** - * The middle block. - */ - @Getter - private final Material middle; - - /** - * The top block. - */ - @Getter - private final Material top; - - /** - * Create a new block structure. - * - * @param bottom The bottom block. - * @param middle The middle block. - * @param top The top block. - */ - public BlockStructure(@NotNull final Material bottom, - @NotNull final Material middle, - @NotNull final Material top) { - this.bottom = bottom; - this.middle = middle; - this.top = top; - } - - /** - * If a block structure matches the specified structure in illusioner options. - * - * @param structure The block structure to test against. - * @return If the structures match. - */ - public static boolean matches(@NotNull final BlockStructure structure) { - return structure.getBottom().equals(IllusionerManager.OPTIONS.getSpawnStructure().getBottom()) - && structure.getMiddle().equals(IllusionerManager.OPTIONS.getSpawnStructure().getMiddle()) - && structure.getTop().equals(IllusionerManager.OPTIONS.getSpawnStructure().getTop()); - } -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/IllusionerManager.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/IllusionerManager.java deleted file mode 100644 index 04e60c9..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/IllusionerManager.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.willfp.illusioner.illusioner; - -import com.willfp.illusioner.IllusionerPlugin; -import com.willfp.illusioner.illusioner.options.IllusionerOptions; - -public class IllusionerManager { - /** - * The options related to the illusioner. - */ - public static final IllusionerOptions OPTIONS = new IllusionerOptions(IllusionerPlugin.getInstance()); -} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/GameplayOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/GameplayOptions.java deleted file mode 100644 index d1e7099..0000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/illusioner/illusioner/options/GameplayOptions.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.willfp.illusioner.illusioner.options; - -import com.willfp.eco.util.internal.PluginDependent; -import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.illusioner.config.IllusionerConfigs; -import com.willfp.illusioner.illusioner.OptionedSound; -import lombok.Getter; -import lombok.ToString; -import org.bukkit.Sound; -import org.bukkit.entity.EntityType; -import org.bukkit.potion.PotionEffectType; -import org.jetbrains.annotations.NotNull; - -import java.util.HashSet; -import java.util.Set; - -@ToString -public class GameplayOptions extends PluginDependent { - /** - * The sound played when the illusioner takes damage. - */ - @Getter - private OptionedSound hitSound; - - /** - * The sound played when the illusioner spawns. - */ - @Getter - private OptionedSound summonSound; - - /** - * The potion effect options. - */ - @Getter - private final Set effectOptions = new HashSet<>(); - - /** - * The mob summon options. - */ - @Getter - private final Set summonerOptions = new HashSet<>(); - - /** - * If the illusioner should shuffle hotbars. - */ - @Getter - private boolean shuffle; - - /** - * The chance of the illusioner shuffling a hotbar. - */ - @Getter - private double shuffleChance; - - /** - * If the illusioner is immune to explosion damage. - */ - @Getter - private boolean ignoreExplosionDamage; - - /** - * If the illusioner is immune to fire damage. - */ - @Getter - private boolean ignoreFire; - - /** - * If the illusioner is immune to suffocation damage. - */ - @Getter - private boolean ignoreSuffocation; - - /** - * If the illusioner can teleport. - */ - @Getter - private boolean teleport; - - /** - * Teleport range. - */ - @Getter - private int teleportRange; - - /** - * Teleport chance. - */ - @Getter - private double teleportChance; - - /** - * Teleport sound. - */ - @Getter - private OptionedSound teleportSound; - - /** - * Gameplay options. - * - * @param plugin The plugin. - */ - public GameplayOptions(@NotNull final AbstractEcoPlugin plugin) { - super(plugin); - } - - /** - * Reload the options. - */ - public void reload() { - hitSound = new OptionedSound( - Sound.valueOf(IllusionerConfigs.SOUNDS.getString("hit.sound")), - (float) IllusionerConfigs.SOUNDS.getDouble("hit.volume"), - (float) IllusionerConfigs.SOUNDS.getDouble("hit.pitch"), - IllusionerConfigs.SOUNDS.getBool("hit.broadcast") - ); - - summonSound = new OptionedSound( - Sound.valueOf(IllusionerConfigs.SOUNDS.getString("summon.sound")), - (float) IllusionerConfigs.SOUNDS.getDouble("summon.volume"), - (float) IllusionerConfigs.SOUNDS.getDouble("summon.pitch"), - IllusionerConfigs.SOUNDS.getBool("summon.broadcast") - ); - - shuffle = IllusionerConfigs.ATTACKS.getBool("shuffle.enabled"); - shuffleChance = IllusionerConfigs.ATTACKS.getDouble("shuffle.chance"); - - ignoreExplosionDamage = this.getPlugin().getConfigYml().getBool("ignore-explosion-damage"); - ignoreFire = this.getPlugin().getConfigYml().getBool("ignore-fire-damage"); - ignoreSuffocation = this.getPlugin().getConfigYml().getBool("ignore-suffocation-damage"); - - teleport = this.getPlugin().getConfigYml().getBool("teleport-on-damage.enabled"); - teleportRange = this.getPlugin().getConfigYml().getInt("teleport-on-damage.range"); - teleportChance = this.getPlugin().getConfigYml().getDouble("teleport-on-damage.chance"); - - Sound sound = Sound.valueOf(IllusionerConfigs.SOUNDS.getString("teleport.sound")); - float volume = (float) IllusionerConfigs.SOUNDS.getDouble("teleport.volume"); - float pitch = (float) IllusionerConfigs.SOUNDS.getDouble("teleport.pitch"); - teleportSound = new OptionedSound(sound, volume, pitch, true); - - effectOptions.clear(); - IllusionerConfigs.ATTACKS.getConfig().getConfigurationSection("effects").getKeys(false).forEach(key -> { - PotionEffectType type = PotionEffectType.getByName(IllusionerConfigs.ATTACKS.getString("effects." + key + ".type")); - int level = IllusionerConfigs.ATTACKS.getInt("effects." + key + ".level"); - int duration = IllusionerConfigs.ATTACKS.getInt("effects." + key + ".duration"); - double chance = IllusionerConfigs.ATTACKS.getDouble("effects." + key + ".chance"); - effectOptions.add(new EffectOption(chance, level, duration, type)); - }); - - summonerOptions.clear(); - IllusionerConfigs.ATTACKS.getConfig().getConfigurationSection("summons").getKeys(false).forEach(key -> { - EntityType type = EntityType.valueOf(IllusionerConfigs.ATTACKS.getString("summons." + key + ".type")); - double chance = IllusionerConfigs.ATTACKS.getDouble("summons." + key + ".chance"); - summonerOptions.add(new SummonerOption(chance, type)); - }); - } - - public static class EffectOption { - /** - * The chance of the effect being applied. - */ - @Getter - private final double chance; - - /** - * The level of the effect. - */ - @Getter - private final int level; - - /** - * The potion effect type. - */ - @Getter - private final PotionEffectType effectType; - - /** - * The duration, in ticks. - */ - @Getter - private final int duration; - - /** - * Create a new effect option. - * - * @param chance The chance. - * @param level The level. - * @param duration The duration in ticks. - * @param effectType The effect. - */ - public EffectOption(final double chance, - final int level, - final int duration, - @NotNull final PotionEffectType effectType) { - this.chance = chance; - this.level = level; - this.effectType = effectType; - this.duration = duration; - } - } - - public static class SummonerOption { - /** - * The chance of a mob being spawned. - */ - @Getter - private final double chance; - - /** - * The type of entity to summon. - */ - @Getter - private final EntityType type; - - /** - * Create a new summoner option. - * - * @param chance The chance. - * @param type The entity type. - */ - public SummonerOption(final double chance, - @NotNull final EntityType type) { - this.chance = chance; - this.type = type; - } - } -} diff --git a/eco-core/core-plugin/src/main/resources/attacks.yml b/eco-core/core-plugin/src/main/resources/attacks.yml deleted file mode 100644 index 7624bd8..0000000 --- a/eco-core/core-plugin/src/main/resources/attacks.yml +++ /dev/null @@ -1,34 +0,0 @@ -# All chances are percentages and can include decimals - -shuffle: # Shuffles the items around in your hotbar - enabled: true - chance: 5 - -effects: - # Types can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html - # Duration is in ticks, there are 20 ticks in a second - 1: - type: BLINDNESS - level: 1 - duration: 40 - chance: 20 - 2: - type: CONFUSION - level: 10 - duration: 200 - chance: 10 - 3: - type: SLOW - level: 3 - duration: 60 - chance: 10 - -summons: - # Entity Types can be found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html - # Entities are summoned close to the player - 1: - type: VINDICATOR - chance: 10 - 2: - type: EVOKER - chance: 10 \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml new file mode 100644 index 0000000..ddc2b86 --- /dev/null +++ b/eco-core/core-plugin/src/main/resources/bosses/illusioner.yml @@ -0,0 +1,85 @@ +enabled: true + +name: "Illusioner" # Display name +base-mob: custom_illusioner # Any existing mob - custom_illusioner is also accepted (like in the old Illusioner plugin) + +spawn-egg: + mob-type: illusioner + display-name: "Illusioner Spawn Egg" + lore: [] + +bossbar: + enabled: true + color: BLUE # Choose from: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW + style: SOLID # Choose from: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20 + +max-health: 600 +attack-damage: 50 + +spawn-totem: + enabled: true + top: carved_pumpkin + middle: beacon + bottom: diamond + +rewards: + xp: + minimum: 20000 + maximum: 25000 + drops: + # Get items to add here by copying the console output for /ebdrop + +defence: + immunities: + explosion: true + fire: false + drowning: true + projectiles: false + suffocation: true + + # If the boss should teleport when damaged + teleport: + enabled: false + range: 7 + chance: 15 # As a percentage + +attacks: + # Potion effects are formatted like this: + # effect:level:duration:chance + # Duration is in ticks, chance is as a percentage + potion-effects: + - "confusion:10:200:10" + - "blindness:1:40:20" + + # Bonus enemies that spawn to fight you + # entity:chance + # Chance is as a percentage + summons: + - "evoker:10" + - "vindicator:10" + + # Chance to shuffle your hotbar as a percentage - set to 0 to disable. + shuffle-chance: 10 + +sounds: + # Sounds are formatted like this: + # sound:volume:pitch + + # Sound is the sound ID + # Volume is the distance that it can be heard from + # Pitch is 0.5-2 + + spawn: # On spawn + - "entity_illusioner_mirror_move:1000:0.5" + - "entity_wither_spawn:1000L:2" + + death: # On death + - "entity_evoker_prepare_wololo:50:0.8" + - "entity_illusioner_prepare_blindness:50:1" + - "entity_wither_death:50:2" + + summon: # On summon enemy + - "entity_evoker_prepare_attack:1:2" + + injure: # On take damage + - "entity_illusioner_cast_spell:1:2" \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index c63eefe..820db9d 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -1,36 +1,4 @@ # -# Illusioner +# EcoBosses # by Auxilor -# - -name: "Illusioner" # What should the display name of the Illusioner be? - -override: true # Should the illusioner override all "vanilla" illusioners (adds support for /spawn but may cause issues with other custom mob plugins) - -bossbar: - color: BLUE # Choose from: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW - style: SOLID # Choose from: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20 - -xp: - # Chosen at random between a minimum and maximum - minimum: 20000 # Xp points, not levels - maximum: 25000 - -max-health: 600 # Hearts is this number divided by 2, eg 600 is 300 hearts -attack-damage: 50 # This isn't an easy boss. Recommend to keep this high - -ignore-explosion-damage: true -ignore-fire-damage: false -ignore-suffocation-damage: true - -teleport-on-damage: - enabled: true - range: 7 - chance: 15 # As a percentage - -spawn: - # Configure a 3x1 tall column of blocks to summon an illusioner - # Plan to add support for other shapes in the future - top-block: CARVED_PUMPKIN - middle-block: BEACON - bottom-block: DIAMOND_BLOCK \ No newline at end of file +# \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/drops.yml b/eco-core/core-plugin/src/main/resources/drops.yml deleted file mode 100644 index cbdb4d5..0000000 --- a/eco-core/core-plugin/src/main/resources/drops.yml +++ /dev/null @@ -1 +0,0 @@ -# Add drops with /ildrop diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index cb09dc9..d19884a 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -1,8 +1,6 @@ messages: - prefix: "&9&lIllusioner &f» " + prefix: "&9&lEcoBosses &f» " no-permission: "&cYou don't have permission to do this!" not-player: "&cThis command must be run by a player" reloaded: "Reloaded!" - no-item-held: "&cYou aren't holding an item!" - added-drop: "Added drop to Illusioner" - reload-plugin: "Run /ilreload to reload illusioner!" \ No newline at end of file + sent-drop: "Check console for the drop!" \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/plugin.yml b/eco-core/core-plugin/src/main/resources/plugin.yml index ed3920c..4a1d676 100644 --- a/eco-core/core-plugin/src/main/resources/plugin.yml +++ b/eco-core/core-plugin/src/main/resources/plugin.yml @@ -1,30 +1,31 @@ -name: Illusioner +name: EcoBosses version: ${projectVersion} -main: com.willfp.illusioner.IllusionerPlugin +main: com.willfp.ecobosses.EcoBossesPlugin api-version: 1.15 authors: [Auxilor] website: willfp.com load: STARTUP commands: - ilreload: + ebreload: description: Reloads config - permission: illusioner.reload - ildrop: - description: Adds the item in your hand as a drop - permission: illusioner.drop + permission: ecobosses.reload + ebdrop: + description: Sends the held item to console to be added as a drop + permission: ecobosses.ebdrop permissions: - illusioner.*: - description: All illusioner permissions + ecobosses.*: + description: All ecobosses permissions default: op children: - illusioner.reload: true - illusioner.updateannounce: true + ecobosses.reload: true + ecobosses.ebdrop: true - illusioner.updateannounce: - description: Informs admins of a new update - default: op - illusioner.reload: + ecobosses.reload: description: Allows reloading the config + default: op + + ecobosses.ebdrop: + description: Allows the use of /ebdrop default: op \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/sounds.yml b/eco-core/core-plugin/src/main/resources/sounds.yml deleted file mode 100644 index 4f06120..0000000 --- a/eco-core/core-plugin/src/main/resources/sounds.yml +++ /dev/null @@ -1,53 +0,0 @@ -# A sound is defined as follows: -# broadcast - Should the whole server hear this or just the player? -# volume - How far away should people be able to hear this? -# pitch - Range is 0.5 to 2, 0.5 is lower pitch and half speed, 2 is higher pitch and double speed -# Add as many sounds as you want - -hit: - # When the player attacks the illusioner - broadcast: false - sound: ENTITY_ILLUSIONER_CAST_SPELL - volume: 1 - pitch: 2 - -summon: - # When an entity is summoned by the illusioner - broadcast: false - sound: ENTITY_EVOKER_PREPARE_ATTACK - volume: 1 - pitch: 2 - -teleport: - # When the illusioner teleports - sound: ENTITY_ENDERMAN_TELEPORT - volume: 1 - pitch: 0.7 - -spawn: - 1: - broadcast: true - sound: ENTITY_ILLUSIONER_MIRROR_MOVE - volume: 1000 - pitch: 0.5 - 2: - broadcast: true - sound: ENTITY_WITHER_SPAWN - volume: 1000 - pitch: 2 -death: - 1: - broadcast: true - sound: ENTITY_EVOKER_PREPARE_WOLOLO - volume: 50 - pitch: 0.8 - 2: - broadcast: true - sound: ENTITY_ILLUSIONER_PREPARE_BLINDNESS - volume: 50 - pitch: 1 - 3: - broadcast: true - sound: ENTITY_WITHER_DEATH - volume: 50 - pitch: 2 \ No newline at end of file diff --git a/eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/proxies/CustomIllusionerProxy.java b/eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/proxies/CustomIllusionerProxy.java new file mode 100644 index 0000000..f511289 --- /dev/null +++ b/eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/proxies/CustomIllusionerProxy.java @@ -0,0 +1,17 @@ +package com.willfp.ecobosses.proxy.proxies; + +import com.willfp.eco.util.plugin.AbstractEcoPlugin; +import com.willfp.eco.util.proxy.AbstractProxy; +import org.bukkit.Location; +import org.bukkit.boss.BossBar; +import org.jetbrains.annotations.NotNull; + +public interface CustomIllusionerProxy extends AbstractProxy { + /** + * Spawn an illusioner. + * + * @param location The location to spawn it at. + * @return The created illusioner. + */ + CustomIllusionerProxy spawn(@NotNull Location location); +} diff --git a/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/util/ProxyFactory.java b/eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/util/ProxyFactory.java similarity index 98% rename from eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/util/ProxyFactory.java rename to eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/util/ProxyFactory.java index 4066638..b9b19f1 100644 --- a/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/util/ProxyFactory.java +++ b/eco-core/core-proxy/src/main/java/com/willfp/ecobosses/proxy/util/ProxyFactory.java @@ -1,4 +1,4 @@ -package com.willfp.illusioner.proxy.util; +package com.willfp.ecobosses.proxy.util; import com.willfp.eco.util.internal.PluginDependent; import com.willfp.eco.util.plugin.AbstractEcoPlugin; diff --git a/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/EntityIllusionerProxy.java b/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/EntityIllusionerProxy.java deleted file mode 100644 index 56a0c24..0000000 --- a/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/EntityIllusionerProxy.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.willfp.illusioner.proxy.proxies; - -import com.willfp.eco.util.plugin.AbstractEcoPlugin; -import com.willfp.eco.util.proxy.AbstractProxy; -import org.bukkit.boss.BossBar; -import org.jetbrains.annotations.NotNull; - -public interface EntityIllusionerProxy extends AbstractProxy { - /** - * Create boss bar for an illusioner. - * - * @param plugin The plugin that owns the boss bar. - * @return The created boss bar. - */ - BossBar createBossbar(@NotNull AbstractEcoPlugin plugin); -} diff --git a/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/IllusionerHelperProxy.java b/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/IllusionerHelperProxy.java deleted file mode 100644 index a592d29..0000000 --- a/eco-core/core-proxy/src/main/java/com/willfp/illusioner/proxy/proxies/IllusionerHelperProxy.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.willfp.illusioner.proxy.proxies; - -import com.willfp.eco.util.proxy.AbstractProxy; -import org.bukkit.Location; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public interface IllusionerHelperProxy extends AbstractProxy { - /** - * Spawn an illusioner. - * - * @param location The location to spawn it at. - * @return The created illusioner. - */ - EntityIllusionerProxy spawn(@NotNull Location location); - - /** - * Convert a normal illusioner to a plugin-based one. - * - * @param illusioner The illusioner to convert. - * @return The created illusioner. - */ - EntityIllusionerProxy adapt(@NotNull Illusioner illusioner); -}