Compare commits

...

2 Commits

Author SHA1 Message Date
ceze88 7a3980555f Release v3.1.8 2024-04-01 17:48:23 +02:00
ceze88 7214bb3013 Fix console spam in 1.20.4 2024-04-01 17:48:13 +02:00
4 changed files with 10 additions and 6 deletions

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.craftaro</groupId> <groupId>com.craftaro</groupId>
<artifactId>UltimateStacker-Parent</artifactId> <artifactId>UltimateStacker-Parent</artifactId>
<version>3.1.7</version> <version>3.1.8</version>
</parent> </parent>
<artifactId>UltimateStacker-API</artifactId> <artifactId>UltimateStacker-API</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.craftaro</groupId> <groupId>com.craftaro</groupId>
<artifactId>UltimateStacker-Parent</artifactId> <artifactId>UltimateStacker-Parent</artifactId>
<version>3.1.7</version> <version>3.1.8</version>
</parent> </parent>
<artifactId>UltimateStacker-Plugin</artifactId> <artifactId>UltimateStacker-Plugin</artifactId>

View File

@ -30,18 +30,22 @@ import java.util.UUID;
public class EntityStackImpl implements EntityStack { public class EntityStackImpl implements EntityStack {
private final UltimateStacker plugin = UltimateStacker.getInstance(); private final UltimateStacker plugin = UltimateStacker.getInstance();
private Object STACKED_ENTITY_KEY; private static Object STACKED_ENTITY_KEY;
private int amount; private int amount;
private LivingEntity hostEntity; private LivingEntity hostEntity;
static {
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_14)) {
STACKED_ENTITY_KEY = new org.bukkit.NamespacedKey(UltimateStacker.getInstance(), "US_AMOUNT");
}
}
/** /**
* Gets an existing stack from an entity or creates a new one if it doesn't exist. * Gets an existing stack from an entity or creates a new one if it doesn't exist.
* *
* @param entity The entity to get the stack from. * @param entity The entity to get the stack from.
*/ */
public EntityStackImpl(LivingEntity entity) { public EntityStackImpl(LivingEntity entity) {
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_14))
this.STACKED_ENTITY_KEY = new org.bukkit.NamespacedKey(plugin, "US_AMOUNT");
if (entity == null) return; if (entity == null) return;
if (!UltimateStacker.getInstance().getEntityStackManager().isStackedEntity(entity)) { if (!UltimateStacker.getInstance().getEntityStackManager().isStackedEntity(entity)) {
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_14)) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_14)) {

View File

@ -7,7 +7,7 @@
<groupId>com.craftaro</groupId> <groupId>com.craftaro</groupId>
<artifactId>UltimateStacker-Parent</artifactId> <artifactId>UltimateStacker-Parent</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>3.1.7</version> <version>3.1.8</version>
<modules> <modules>
<module>UltimateStacker-API</module> <module>UltimateStacker-API</module>