diff --git a/build.gradle b/build.gradle index 8ca6c4e..5ea3903 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,10 @@ plugins { } dependencies { - implementation project(":eco-core").getSubprojects() + implementation project(":eco-core:core-plugin") + implementation project(":eco-core:core-proxy") + implementation project(":eco-core:core-nms:v1_16_R3") + implementation project(path: ":eco-core:core-nms:v1_17_R1", configuration: 'mapped') } allprojects { @@ -46,7 +49,7 @@ allprojects { } dependencies { - compileOnly 'com.willfp:eco:6.0.0' + compileOnly 'com.willfp:eco:6.3.0' compileOnly 'org.jetbrains:annotations:19.0.0' diff --git a/eco-core/core-nms/v1_16_R1/build.gradle b/eco-core/core-nms/v1_16_R1/build.gradle deleted file mode 100644 index 4962362..0000000 --- a/eco-core/core-nms/v1_16_R1/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -group 'com.willfp' -version rootProject.version - -dependencies { - compileOnly 'org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT' -} \ No newline at end of file diff --git a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomEntitySpawner.java b/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomEntitySpawner.java deleted file mode 100644 index 1d844d3..0000000 --- a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomEntitySpawner.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.willfp.ecobosses.proxy.v1_16_R1; - -import com.willfp.ecobosses.proxy.proxies.CustomEntitySpawnerProxy; -import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; -import com.willfp.ecobosses.proxy.util.CustomEntity; -import org.bukkit.Location; -import org.bukkit.entity.LivingEntity; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -@SuppressWarnings("unchecked") -public class CustomEntitySpawner implements CustomEntitySpawnerProxy { - @Override - public @Nullable T spawnCustomEntity(final Class> entityClass, - @NotNull final Location location) { - if (entityClass.equals(CustomIllusionerProxy.class)) { - return (T) CustomIllusioner.spawn(location); - } - - return null; - } -} diff --git a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomIllusioner.java b/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomIllusioner.java deleted file mode 100644 index b4d596c..0000000 --- a/eco-core/core-nms/v1_16_R1/src/main/java/com/willfp/ecobosses/proxy/v1_16_R1/CustomIllusioner.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.willfp.ecobosses.proxy.v1_16_R1; - -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; -import net.minecraft.server.v1_16_R1.EntityInsentient; -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.PathfinderGoalBowShoot; -import net.minecraft.server.v1_16_R1.PathfinderGoalFloat; -import net.minecraft.server.v1_16_R1.PathfinderGoalHurtByTarget; -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.Location; -import org.bukkit.craftbukkit.v1_16_R1.CraftWorld; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { - /** - * Instantiate a new custom illusioner entity. - * - * @param location The location to spawn it at. - */ - public CustomIllusioner(@NotNull final Location location) { - super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - - this.setPosition(location.getX(), location.getY(), location.getZ()); - - this.goalSelector.a(0, new PathfinderGoalFloat(this)); - this.goalSelector.a(1, new EntityIllagerWizard.b()); - this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.goalSelector.a(2, new PathfinderGoalBowShoot<>(this, 1.0D, 20, 15.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); - this.goalSelector.a(6, new PathfinderGoalBowShoot<>(this, 0.5D, 20, 15.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); - this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); - this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); - this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false)).a(300)); - } - - /** - * Spawn illusioner. - * - * @param location The location. - * @return The illusioner. - */ - public static Illusioner spawn(@NotNull final Location location) { - CustomIllusioner illusioner = new CustomIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); - return (Illusioner) illusioner.getBukkitEntity(); - } -} diff --git a/eco-core/core-nms/v1_16_R2/build.gradle b/eco-core/core-nms/v1_16_R2/build.gradle deleted file mode 100644 index 3f4d50c..0000000 --- a/eco-core/core-nms/v1_16_R2/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -group 'com.willfp' -version rootProject.version - -dependencies { - compileOnly 'org.spigotmc:spigot:1.16.3-R0.1-SNAPSHOT' -} \ No newline at end of file diff --git a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomEntitySpawner.java b/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomEntitySpawner.java deleted file mode 100644 index 778bc29..0000000 --- a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomEntitySpawner.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.willfp.ecobosses.proxy.v1_16_R2; - -import com.willfp.ecobosses.proxy.proxies.CustomEntitySpawnerProxy; -import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; -import com.willfp.ecobosses.proxy.util.CustomEntity; -import org.bukkit.Location; -import org.bukkit.entity.LivingEntity; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -@SuppressWarnings("unchecked") -public class CustomEntitySpawner implements CustomEntitySpawnerProxy { - @Override - public @Nullable T spawnCustomEntity(final Class> entityClass, - @NotNull final Location location) { - if (entityClass.equals(CustomIllusionerProxy.class)) { - return (T) CustomIllusioner.spawn(location); - } - - return null; - } -} diff --git a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomIllusioner.java b/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomIllusioner.java deleted file mode 100644 index 59768db..0000000 --- a/eco-core/core-nms/v1_16_R2/src/main/java/com/willfp/ecobosses/proxy/v1_16_R2/CustomIllusioner.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.willfp.ecobosses.proxy.v1_16_R2; - -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; -import net.minecraft.server.v1_16_R2.EntityInsentient; -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.PathfinderGoalBowShoot; -import net.minecraft.server.v1_16_R2.PathfinderGoalFloat; -import net.minecraft.server.v1_16_R2.PathfinderGoalHurtByTarget; -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.Location; -import org.bukkit.craftbukkit.v1_16_R2.CraftWorld; -import org.bukkit.entity.Illusioner; -import org.jetbrains.annotations.NotNull; - -public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { - /** - * Instantiate a new custom illusioner entity. - * - * @param location The location to spawn it at. - */ - public CustomIllusioner(@NotNull final Location location) { - super(EntityTypes.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - - this.setPosition(location.getX(), location.getY(), location.getZ()); - - this.goalSelector.a(0, new PathfinderGoalFloat(this)); - this.goalSelector.a(1, new EntityIllagerWizard.b()); - this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.goalSelector.a(2, new PathfinderGoalBowShoot<>(this, 1.0D, 20, 15.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); - this.goalSelector.a(6, new PathfinderGoalBowShoot<>(this, 0.5D, 20, 15.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); - this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); - this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); - this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false)).a(300)); - } - - /** - * Spawn illusioner. - * - * @param location The location. - * @return The illusioner. - */ - public static Illusioner spawn(@NotNull final Location location) { - CustomIllusioner illusioner = new CustomIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); - return (Illusioner) illusioner.getBukkitEntity(); - } -} diff --git a/eco-core/core-nms/v1_17_R1/build.gradle b/eco-core/core-nms/v1_17_R1/build.gradle index e732641..516f18e 100644 --- a/eco-core/core-nms/v1_17_R1/build.gradle +++ b/eco-core/core-nms/v1_17_R1/build.gradle @@ -1,6 +1,28 @@ +plugins { + id 'xyz.jpenilla.special-gradle' version '1.0.0-SNAPSHOT' +} + group 'com.willfp' version rootProject.version dependencies { - compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT' -} \ No newline at end of file + compileOnly 'org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:remapped-mojang' +} + +specialGradle { + minecraftVersion.set("1.17") + specialSourceVersion.set("1.10.0") +} + +buildTools { + quiet.set(true); +} + +configurations.create('mapped') + +artifacts { + mapped jar.outputs.files.files.toArray()[0] +} + +productionMappedJar.mustRunAfter(clean) +build.dependsOn productionMappedJar \ No newline at end of file diff --git a/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomIllusioner.java b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomIllusioner.java index e692a5f..fe14c34 100644 --- a/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomIllusioner.java +++ b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomIllusioner.java @@ -1,51 +1,48 @@ package com.willfp.ecobosses.proxy.v1_17_R1; import com.willfp.ecobosses.proxy.proxies.CustomIllusionerProxy; -import net.minecraft.world.entity.EntityInsentient; -import net.minecraft.world.entity.EntityTypes; -import net.minecraft.world.entity.ai.goal.PathfinderGoalBowShoot; -import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; -import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer; -import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack; -import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll; -import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget; -import net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget; -import net.minecraft.world.entity.animal.EntityIronGolem; -import net.minecraft.world.entity.monster.EntityIllagerIllusioner; -import net.minecraft.world.entity.monster.EntityIllagerWizard; -import net.minecraft.world.entity.npc.EntityVillagerAbstract; -import net.minecraft.world.entity.player.EntityHuman; -import net.minecraft.world.entity.raid.EntityRaider; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.goal.FloatGoal; +import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal; +import net.minecraft.world.entity.ai.goal.MeleeAttackGoal; +import net.minecraft.world.entity.ai.goal.RandomStrollGoal; +import net.minecraft.world.entity.ai.goal.RangedBowAttackGoal; +import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal; +import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal; +import net.minecraft.world.entity.animal.IronGolem; +import net.minecraft.world.entity.npc.AbstractVillager; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.raid.Raider; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_17_R1.CraftWorld; import org.bukkit.entity.Illusioner; +import org.bukkit.event.entity.CreatureSpawnEvent; import org.jetbrains.annotations.NotNull; -public class CustomIllusioner extends EntityIllagerIllusioner implements CustomIllusionerProxy { +public class CustomIllusioner extends net.minecraft.world.entity.monster.Illusioner implements CustomIllusionerProxy { /** * Instantiate a new custom illusioner entity. * * @param location The location to spawn it at. */ public CustomIllusioner(@NotNull final Location location) { - super(EntityTypes.O, ((CraftWorld) location.getWorld()).getHandle()); + super(EntityType.ILLUSIONER, ((CraftWorld) location.getWorld()).getHandle()); - this.setPosition(location.getX(), location.getY(), location.getZ()); + this.setPos(location.getX(), location.getY(), location.getZ()); - this.bO.a(0, new PathfinderGoalFloat(this)); - this.bO.a(1, new EntityIllagerWizard.b()); - this.bO.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.bO.a(2, new PathfinderGoalBowShoot<>(this, 1.0D, 20, 15.0F)); - this.bO.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.bO.a(0, new PathfinderGoalFloat(this)); - this.bO.a(6, new PathfinderGoalBowShoot<>(this, 0.5D, 20, 15.0F)); - this.bO.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.bO.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); - this.bO.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); - this.bP.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); - this.bP.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); - this.bP.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); - this.bP.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false)).a(300)); + this.goalSelector.addGoal(0, new FloatGoal(this)); + this.goalSelector.addGoal(1, new Raider.HoldGroundAttackGoal(this, 25)); + this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false)); + this.goalSelector.addGoal(2, new RangedBowAttackGoal<>(this, 1.0D, 20, 15.0F)); + this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); + this.goalSelector.addGoal(0, new FloatGoal(this)); + this.goalSelector.addGoal(6, new RangedBowAttackGoal<>(this, 0.5D, 20, 15.0F)); + this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); + this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F)); + this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Raider.class)).setAlertOthers()); + this.targetSelector.addGoal(2, (new NearestAttackableTargetGoal<>(this, Player.class, true)).setUnseenMemoryTicks(300)); + this.targetSelector.addGoal(3, (new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)).setUnseenMemoryTicks(300)); + this.targetSelector.addGoal(3, (new NearestAttackableTargetGoal<>(this, IronGolem.class, false)).setUnseenMemoryTicks(300)); } /** @@ -56,7 +53,7 @@ public class CustomIllusioner extends EntityIllagerIllusioner implements CustomI */ public static Illusioner spawn(@NotNull final Location location) { CustomIllusioner illusioner = new CustomIllusioner(location); - ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner); + ((CraftWorld) location.getWorld()).getHandle().addEntity(illusioner, CreatureSpawnEvent.SpawnReason.CUSTOM); return (Illusioner) illusioner.getBukkitEntity(); } } diff --git a/settings.gradle b/settings.gradle index f78317e..f388743 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,15 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { url "https://repo.jpenilla.xyz/snapshots/" } + } +} + rootProject.name = 'EcoBosses' // Core include ':eco-core' include ':eco-core:core-nms' -include ':eco-core:core-nms:v1_16_R1' -include ':eco-core:core-nms:v1_16_R2' include ':eco-core:core-nms:v1_16_R3' include ':eco-core:core-nms:v1_17_R1' include ':eco-core:core-proxy'