Remove the need for AllSpigotNMS

I removed the need for AllSpigotNMS by separating each version implementation in its own maven module. Each of the implementations depend on the NMS version that their implementing for.
This commit is contained in:
SeanOMik 2021-06-23 18:06:43 -04:00
parent fd7812ee31
commit f68aeaa99b
No known key found for this signature in database
GPG Key ID: CA09E5BE1F32728A
56 changed files with 310 additions and 73 deletions

5
.gitignore vendored
View File

@ -1,6 +1,11 @@
# Don't track content of these folders
.idea/*
target/*
1_14_R1/target/*
1_15_R1/target/*
1_16_R1/target/*
1_16_R2/target/*
1_16_R3/target/*
1_17_R1/target/*
Plugin/target/*
Utility/target/*

45
1_14_R1/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>tamablefoxes-parent</artifactId>
<groupId>net.seanomik</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>tamablefoxes_v1_14_R1</artifactId>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_14_R1;
import net.minecraft.server.v1_14_R1.*;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
@ -80,7 +79,7 @@ public class EntityTamableFox extends EntityFox {
return !isTamed() && !((EntityLiving) entityliving).isSneaking() && IEntitySelector.e.test((EntityLiving) entityliving) && !this.isDefending();
}));
this.goalSelector.a(4, new PathfinderGoalAvoidTarget(this, EntityWolf.class, 8.0F, 1.6D, 1.4D, (entityliving) -> {
return !((net.minecraft.server.v1_16_R1.EntityWolf)entityliving).isTamed() && !this.isDefending();
return !((EntityWolf)entityliving).isTamed() && !this.isDefending();
}));
this.goalSelector.a(5, getFoxInnerPathfinderGoal("u")); // StalkPreyGoal
@ -287,7 +286,7 @@ public class EntityTamableFox extends EntityFox {
// Run this task async to make sure to not slow the server down.
// This is needed due to the item being remove as soon as its put in the foxes mouth.
Bukkit.getScheduler().runTaskLaterAsynchronously(TamableFoxes.getPlugin(), ()-> {
Bukkit.getScheduler().runTaskLaterAsynchronously(Utils.tamableFoxesPlugin, ()-> {
// Put item in mouth
if (item != Items.AIR) {
ItemStack c = itemstack.cloneItemStack();
@ -318,7 +317,7 @@ public class EntityTamableFox extends EntityFox {
itemstack.subtract(1);
}
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
@ -365,7 +364,7 @@ public class EntityTamableFox extends EntityFox {
return AnvilGUI.Response.close();
})
.text("Fox name") // Sets the text the GUI should start with
.plugin(TamableFoxes.getPlugin()) // Set the plugin instance
.plugin(Utils.tamableFoxesPlugin) // Set the plugin instance
.open(player); // Opens the GUI for the player provided
}
} else {
@ -499,7 +498,7 @@ public class EntityTamableFox extends EntityFox {
// Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
}

View File

@ -1,6 +1,5 @@
package net.seanomik.tamablefoxes.versions.version_1_14_R1.pathfinding;
import net.seanomik.tamablefoxes.versions.version_1_14_R1.EntityTamableFox;
import net.minecraft.server.v1_14_R1.*;
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_14_R1.pathfinding;
import net.minecraft.server.v1_14_R1.EntityLiving;
import net.minecraft.server.v1_14_R1.EntityTameableAnimal;
import net.minecraft.server.v1_14_R1.PathfinderGoalTarget;
import net.minecraft.server.v1_14_R1.PathfinderTargetCondition;
import net.seanomik.tamablefoxes.versions.version_1_14_R1.EntityTamableFox;

View File

@ -1,11 +1,8 @@
package net.seanomik.tamablefoxes.versions.version_1_14_R1.pathfinding;
import net.minecraft.server.v1_14_R1.EntityFox;
import net.minecraft.server.v1_14_R1.PathfinderGoalPanic;
import net.seanomik.tamablefoxes.versions.version_1_14_R1.EntityTamableFox;
import java.lang.reflect.Method;
public class FoxPathfinderGoalPanic extends PathfinderGoalPanic {
EntityTamableFox tamableFox;

View File

@ -1,6 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_14_R1.pathfinding;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.versions.version_1_14_R1.EntityTamableFox;
import net.minecraft.server.v1_14_R1.EntityLiving;
import net.minecraft.server.v1_14_R1.PathfinderGoal;
@ -39,7 +39,7 @@ public class FoxPathfinderGoalSit extends PathfinderGoal {
this.entity.setGoalTarget(null);
// For some reason it needs to be ran later.
Bukkit.getScheduler().runTaskLater(TamableFoxes.getPlugin(), () -> {
Bukkit.getScheduler().runTaskLater(Utils.tamableFoxesPlugin, () -> {
this.entity.setSitting(true);
}, 1L);
}

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_14_R1.pathfinding;
import net.minecraft.server.v1_14_R1.*;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.versions.version_1_14_R1.EntityTamableFox;
import java.util.Iterator;

45
1_15_R1/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>tamablefoxes-parent</artifactId>
<groupId>net.seanomik</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>tamablefoxes_v1_15_R1</artifactId>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_15_R1;
import net.minecraft.server.v1_15_R1.*;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
@ -287,7 +286,7 @@ public class EntityTamableFox extends EntityFox {
// Run this task async to make sure to not slow the server down.
// This is needed due to the item being remove as soon as its put in the foxes mouth.
Bukkit.getScheduler().runTaskLaterAsynchronously(TamableFoxes.getPlugin(), ()-> {
Bukkit.getScheduler().runTaskLaterAsynchronously(Utils.tamableFoxesPlugin, ()-> {
// Put item in mouth
if (item != Items.AIR) {
ItemStack c = itemstack.cloneItemStack();
@ -318,7 +317,7 @@ public class EntityTamableFox extends EntityFox {
itemstack.subtract(1);
}
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
@ -365,7 +364,7 @@ public class EntityTamableFox extends EntityFox {
return AnvilGUI.Response.close();
})
.text("Fox name") // Sets the text the GUI should start with
.plugin(TamableFoxes.getPlugin()) // Set the plugin instance
.plugin(Utils.tamableFoxesPlugin) // Set the plugin instance
.open(player); // Opens the GUI for the player provided
}
} else {
@ -499,7 +498,7 @@ public class EntityTamableFox extends EntityFox {
// Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
}

View File

@ -1,6 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_15_R1.pathfinding;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.versions.version_1_15_R1.EntityTamableFox;
import net.minecraft.server.v1_15_R1.EntityLiving;
import net.minecraft.server.v1_15_R1.PathfinderGoal;
@ -40,7 +40,7 @@ public class FoxPathfinderGoalSit extends PathfinderGoal {
this.entity.setGoalTarget(null);
// For some reason it needs to be ran later.
Bukkit.getScheduler().runTaskLater(TamableFoxes.getPlugin(), () -> {
Bukkit.getScheduler().runTaskLater(Utils.tamableFoxesPlugin, () -> {
this.entity.setSitting(true);
}, 1L);
}

45
1_16_R1/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>tamablefoxes-parent</artifactId>
<groupId>net.seanomik</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>tamablefoxes_v1_16_R1</artifactId>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_16_R1;
import net.minecraft.server.v1_16_R1.*;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
@ -289,7 +288,7 @@ public class EntityTamableFox extends EntityFox {
// Run this task async to make sure to not slow the server down.
// This is needed due to the item being remove as soon as its put in the foxes mouth.
Bukkit.getScheduler().runTaskLaterAsynchronously(TamableFoxes.getPlugin(), ()-> {
Bukkit.getScheduler().runTaskLaterAsynchronously(Utils.tamableFoxesPlugin, ()-> {
// Put item in mouth
if (item != Items.AIR) {
ItemStack c = itemstack.cloneItemStack();
@ -321,7 +320,7 @@ public class EntityTamableFox extends EntityFox {
itemstack.subtract(1);
}
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
@ -368,7 +367,7 @@ public class EntityTamableFox extends EntityFox {
return AnvilGUI.Response.close();
})
.text("Fox name") // Sets the text the GUI should start with
.plugin(TamableFoxes.getPlugin()) // Set the plugin instance
.plugin(Utils.tamableFoxesPlugin) // Set the plugin instance
.open(player); // Opens the GUI for the player provided
}
} else {
@ -503,7 +502,7 @@ public class EntityTamableFox extends EntityFox {
// Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
}

View File

@ -2,7 +2,7 @@ package net.seanomik.tamablefoxes.versions.version_1_16_R1.pathfinding;
import net.minecraft.server.v1_16_R1.PathfinderGoal;
import net.minecraft.server.v1_16_R1.EntityLiving;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.versions.version_1_16_R1.EntityTamableFox;
import org.bukkit.Bukkit;
@ -39,7 +39,7 @@ public class FoxPathfinderGoalSit extends PathfinderGoal {
this.entity.setGoalTarget(null);
// For some reason it needs to be ran later.
Bukkit.getScheduler().runTaskLater(TamableFoxes.getPlugin(), () -> {
Bukkit.getScheduler().runTaskLater(Utils.tamableFoxesPlugin, () -> {
this.entity.setSitting(true);
}, 1L);
}

45
1_16_R2/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>tamablefoxes-parent</artifactId>
<groupId>net.seanomik</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>tamablefoxes_v1_16_R2</artifactId>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_16_R2;
import net.minecraft.server.v1_16_R2.*;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
@ -286,7 +285,7 @@ public class EntityTamableFox extends EntityFox {
// Run this task async to make sure to not slow the server down.
// This is needed due to the item being remove as soon as its put in the foxes mouth.
Bukkit.getScheduler().runTaskLaterAsynchronously(TamableFoxes.getPlugin(), ()-> {
Bukkit.getScheduler().runTaskLaterAsynchronously(Utils.tamableFoxesPlugin, ()-> {
// Put item in mouth
if (item != Items.AIR) {
ItemStack c = itemstack.cloneItemStack();
@ -318,7 +317,7 @@ public class EntityTamableFox extends EntityFox {
itemstack.subtract(1);
}
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
@ -365,7 +364,7 @@ public class EntityTamableFox extends EntityFox {
return AnvilGUI.Response.close();
})
.text("Fox name") // Sets the text the GUI should start with
.plugin(TamableFoxes.getPlugin()) // Set the plugin instance
.plugin(Utils.tamableFoxesPlugin) // Set the plugin instance
.open(player); // Opens the GUI for the player provided
}
} else {
@ -500,7 +499,7 @@ public class EntityTamableFox extends EntityFox {
// Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
}

View File

@ -2,7 +2,7 @@ package net.seanomik.tamablefoxes.versions.version_1_16_R2.pathfinding;
import net.minecraft.server.v1_16_R2.EntityLiving;
import net.minecraft.server.v1_16_R2.PathfinderGoal;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.versions.version_1_16_R2.EntityTamableFox;
import org.bukkit.Bukkit;
@ -39,7 +39,7 @@ public class FoxPathfinderGoalSit extends PathfinderGoal {
this.entity.setGoalTarget(null);
// For some reason it needs to be ran later.
Bukkit.getScheduler().runTaskLater(TamableFoxes.getPlugin(), () -> {
Bukkit.getScheduler().runTaskLater(Utils.tamableFoxesPlugin, () -> {
this.entity.setSitting(true);
}, 1L);
}

45
1_16_R3/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>tamablefoxes_v1_16_R3</artifactId>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +1,6 @@
package net.seanomik.tamablefoxes.versions.version_1_16_R3;
import net.minecraft.server.v1_16_R3.*;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
@ -287,7 +286,7 @@ public class EntityTamableFox extends EntityFox {
// Run this task async to make sure to not slow the server down.
// This is needed due to the item being remove as soon as its put in the foxes mouth.
Bukkit.getScheduler().runTaskLaterAsynchronously(TamableFoxes.getPlugin(), ()-> {
Bukkit.getScheduler().runTaskLaterAsynchronously(Utils.tamableFoxesPlugin, ()-> {
// Put item in mouth
if (item != Items.AIR) {
ItemStack c = itemstack.cloneItemStack();
@ -319,7 +318,7 @@ public class EntityTamableFox extends EntityFox {
itemstack.subtract(1);
}
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
@ -366,7 +365,7 @@ public class EntityTamableFox extends EntityFox {
return AnvilGUI.Response.close();
})
.text("Fox name") // Sets the text the GUI should start with
.plugin(TamableFoxes.getPlugin()) // Set the plugin instance
.plugin(Utils.tamableFoxesPlugin) // Set the plugin instance
.open(player); // Opens the GUI for the player provided
}
} else {
@ -501,7 +500,7 @@ public class EntityTamableFox extends EntityFox {
// Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(TamableFoxes.getPlugin());
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
}

View File

@ -2,16 +2,11 @@ package net.seanomik.tamablefoxes.versions.version_1_16_R3.pathfinding;
import net.minecraft.server.v1_16_R3.EntityLiving;
import net.minecraft.server.v1_16_R3.PathfinderGoal;
import net.minecraft.server.v1_16_R3.Vec3D;
import net.seanomik.tamablefoxes.TamableFoxes;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.versions.version_1_16_R3.EntityTamableFox;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.util.Vector;
import java.util.EnumSet;
import java.util.LinkedList;
import java.util.List;
public class FoxPathfinderGoalSit extends PathfinderGoal {
private final EntityTamableFox entity;
@ -44,7 +39,7 @@ public class FoxPathfinderGoalSit extends PathfinderGoal {
this.entity.setGoalTarget(null);
// For some reason it needs to be ran later.
Bukkit.getScheduler().runTaskLater(TamableFoxes.getPlugin(), () -> {
Bukkit.getScheduler().runTaskLater(Utils.tamableFoxesPlugin, () -> {
this.entity.setSitting(true);
}, 1L);
}

Binary file not shown.

Binary file not shown.

View File

@ -2,30 +2,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Tamablefoxes</name>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<server.version>1.17</server.version>
</properties>
<build>
<plugins>
<plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
@ -33,11 +30,10 @@
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
@ -45,7 +41,7 @@
<goal>shade</goal>
</goals>
<configuration>
<outputFile>D:\Code\java\spigotPlugins\servers\${server.version}\plugins\TamableFoxes_v${project.version}.jar</outputFile>
<outputFile>D:\Code\java\spigotPlugins\servers\${server.version}\plugins\TamableFoxes_v${project.parent.version}.jar</outputFile>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
@ -84,9 +80,34 @@
</repositories>
<dependencies>
<!-- Entity implementations -->
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<artifactId>tamablefoxes_v1_14_R1</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes_v1_15_R1</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes_v1_16_R1</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes_v1_16_R2</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes_v1_16_R3</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
@ -96,15 +117,14 @@
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<!-- End of entity implementations -->
<dependency>
<groupId>local.spigot.nms</groupId>
<artifactId>AllSpigotNMS</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/Spigot_v14_v15_v16-v165.jar</systemPath>
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes-util</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<!-- We need to do this so we get the spigot api without nms. -->
<dependency>
<dependency> <!-- We need to do this so we get the spigot api without nms. -->
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14-R0.1-SNAPSHOT</version>

View File

@ -1,6 +1,5 @@
package net.seanomik.tamablefoxes;
import net.seanomik.tamablefoxes.versions.version_1_17_R1.NMSInterface_1_17_R1;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
import net.seanomik.tamablefoxes.util.io.Config;
@ -10,6 +9,7 @@ import net.seanomik.tamablefoxes.versions.version_1_15_R1.NMSInterface_1_15_R1;
import net.seanomik.tamablefoxes.versions.version_1_16_R1.NMSInterface_1_16_R1;
import net.seanomik.tamablefoxes.versions.version_1_16_R2.NMSInterface_1_16_R2;
import net.seanomik.tamablefoxes.versions.version_1_16_R3.NMSInterface_1_16_R3;
import net.seanomik.tamablefoxes.versions.version_1_17_R1.NMSInterface_1_17_R1;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.*;
import org.bukkit.event.Listener;

21
pom.xml
View File

@ -13,13 +13,14 @@
<module>Plugin</module>
<module>Utility</module>
<module>1_17_R1</module>
<module>1_16_R3</module>
<module>1_16_R2</module>
<module>1_16_R1</module>
<module>1_15_R1</module>
<module>1_14_R1</module>
</modules>
<properties>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>16</maven.compiler.source>
<!--<java.version.source>16</java.version.source>
<java.version.target>16</java.version.target>-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@ -30,10 +31,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<!--<configuration>
<source>${java.version.source}</source>
<target>${java.version.target}</target>
</configuration>-->
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -51,5 +55,4 @@
</plugins>
</pluginManagement>
</build>
</project>