diff --git a/build.gradle b/build.gradle index ab22bf2..5362e7a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java-library' - id 'com.github.johnrengelman.shadow' version '5.2.0' + id 'com.github.johnrengelman.shadow' version '7.0.0' id 'maven-publish' id 'java' } @@ -16,7 +16,6 @@ allprojects { repositories { mavenCentral() - jcenter() mavenLocal() maven { url 'https://jitpack.io' } maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' } @@ -51,11 +50,11 @@ allprojects { compileOnly 'org.jetbrains:annotations:19.0.0' - compileOnly 'org.projectlombok:lombok:1.18.16' - annotationProcessor 'org.projectlombok:lombok:1.18.16' + compileOnly 'org.projectlombok:lombok:1.18.20' + annotationProcessor 'org.projectlombok:lombok:1.18.20' - testCompileOnly 'org.projectlombok:lombok:1.18.16' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.16' + testCompileOnly 'org.projectlombok:lombok:1.18.20' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.20' } tasks.withType(JavaCompile) { @@ -92,16 +91,8 @@ jar { group = 'com.willfp' archivesBaseName = project.name version = findProperty("version") -java.sourceCompatibility = JavaVersion.VERSION_1_8 +java.sourceCompatibility = JavaVersion.VERSION_16 compileJava.options.encoding = 'UTF-8' build.dependsOn shadowJar - -publishing { - publications { - maven(MavenPublication) { - from(components.java) - } - } -} \ No newline at end of file diff --git a/eco-core/core-nms/v1_17_R1/build.gradle b/eco-core/core-nms/v1_17_R1/build.gradle new file mode 100644 index 0000000..e732641 --- /dev/null +++ b/eco-core/core-nms/v1_17_R1/build.gradle @@ -0,0 +1,6 @@ +group 'com.willfp' +version rootProject.version + +dependencies { + compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT' +} \ 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/CustomEntitySpawner.java b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomEntitySpawner.java new file mode 100644 index 0000000..df34713 --- /dev/null +++ b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomEntitySpawner.java @@ -0,0 +1,22 @@ +package com.willfp.ecobosses.proxy.v1_17_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_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 new file mode 100644 index 0000000..e692a5f --- /dev/null +++ b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecobosses/proxy/v1_17_R1/CustomIllusioner.java @@ -0,0 +1,62 @@ +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 org.bukkit.Location; +import org.bukkit.craftbukkit.v1_17_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.O, ((CraftWorld) location.getWorld()).getHandle()); + + this.setPosition(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)); + } + + /** + * 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/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c05..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 622ab64..0f80bbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index fbd7c51..4f906e0 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 5093609..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index ba67f89..f78317e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,5 +6,6 @@ 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' include ':eco-core:core-plugin' \ No newline at end of file