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:
21
build.gradle
21
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
6
eco-core/core-nms/v1_17_R1/build.gradle
Normal file
6
eco-core/core-nms/v1_17_R1/build.gradle
Normal file
@@ -0,0 +1,6 @@
|
||||
group 'com.willfp'
|
||||
version rootProject.version
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT'
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -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
|
||||
|
||||
2
gradlew
vendored
Normal file → Executable file
2
gradlew
vendored
Normal file → Executable file
@@ -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
|
||||
|
||||
21
gradlew.bat
vendored
21
gradlew.bat
vendored
@@ -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
|
||||
|
||||
@@ -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'
|
||||
Reference in New Issue
Block a user