9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-21 16:09:24 +00:00

Updated to 1.17 and Java 16

This commit is contained in:
Auxilor
2021-06-11 12:29:35 +01:00
parent 3e384dbeea
commit 6b3ff0c88d
9 changed files with 102 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
plugins { plugins {
id 'java-library' 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 'maven-publish'
id 'java' id 'java'
} }
@@ -16,7 +16,6 @@ allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
jcenter()
mavenLocal() mavenLocal()
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' } maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
@@ -51,11 +50,11 @@ allprojects {
compileOnly 'org.jetbrains:annotations:19.0.0' compileOnly 'org.jetbrains:annotations:19.0.0'
compileOnly 'org.projectlombok:lombok:1.18.16' compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.16' annotationProcessor 'org.projectlombok:lombok:1.18.20'
testCompileOnly 'org.projectlombok:lombok:1.18.16' testCompileOnly 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.16' testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
@@ -92,16 +91,8 @@ jar {
group = 'com.willfp' group = 'com.willfp'
archivesBaseName = project.name archivesBaseName = project.name
version = findProperty("version") version = findProperty("version")
java.sourceCompatibility = JavaVersion.VERSION_1_8 java.sourceCompatibility = JavaVersion.VERSION_16
compileJava.options.encoding = 'UTF-8' compileJava.options.encoding = 'UTF-8'
build.dependsOn shadowJar build.dependsOn shadowJar
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}

View File

@@ -0,0 +1,6 @@
group 'com.willfp'
version rootProject.version
dependencies {
compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT'
}

View File

@@ -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 <T extends LivingEntity> @Nullable T spawnCustomEntity(final Class<? extends CustomEntity<? extends LivingEntity>> entityClass,
@NotNull final Location location) {
if (entityClass.equals(CustomIllusionerProxy.class)) {
return (T) CustomIllusioner.spawn(location);
}
return null;
}
}

View File

@@ -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();
}
}

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

0
gradlew vendored Normal file → Executable file
View File

21
gradlew.bat vendored
View File

@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 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_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,21 +64,6 @@ echo location of your Java installation.
goto fail 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 :execute
@rem Setup the command line @rem Setup the command line
@@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @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 :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

View File

@@ -6,5 +6,6 @@ include ':eco-core:core-nms'
include ':eco-core:core-nms:v1_16_R1' include ':eco-core:core-nms:v1_16_R1'
include ':eco-core:core-nms:v1_16_R2' include ':eco-core:core-nms:v1_16_R2'
include ':eco-core:core-nms:v1_16_R3' 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-proxy'
include ':eco-core:core-plugin' include ':eco-core:core-plugin'