Fixed an error in certain versions on chunk load

This commit is contained in:
LOOHP committed 2025-01-18 14:21:16 +00:00
1 parent cdfc2b480b
commit 1b2f47f8db
24 files changed
+36 -24

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_16</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_16_2</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_16_4</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_17</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_18</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_18_2</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_19</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_19_3</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_19_4</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_20</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_20_2</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_20_3</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_20_5</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_20_6</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_21</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_21_1</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_21_2</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_21_3</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-V1_21_4</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
</parent>
<artifactId>ImageFrame-Abstraction</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>com.loohp</groupId>
<artifactId>ImageFrame</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
<packaging>jar</packaging>
<name>ImageFrame</name>
@@ -24,6 +24,7 @@ import com.loohp.imageframe.ImageFrame;
import com.loohp.imageframe.nms.NMS;
import com.loohp.imageframe.objectholders.Scheduler;
import com.loohp.imageframe.utils.MapUtils;
import com.loohp.imageframe.utils.ModernEventsUtils;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
@@ -276,6 +277,9 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.NORMAL)
public void onChunkLoad(ChunkLoadEvent event) {
if (ModernEventsUtils.modernEventsExists()) {
return;
}
for (Entity entity : event.getChunk().getEntities()) {
if (entity instanceof ItemFrame) {
ItemFrame itemFrame = (ItemFrame) entity;
@@ -22,12 +22,20 @@ package com.loohp.imageframe.utils;
public class ModernEventsUtils {
private static boolean init = false;
private static boolean modernEventsExist = false;
public static boolean modernEventsExists() {
if (init) {
return modernEventsExist;
}
try {
Class.forName("org.bukkit.event.world.EntitiesLoadEvent");
return true;
return modernEventsExist = true;
} catch (ClassNotFoundException e) {
return false;
return modernEventsExist = false;
} finally {
init = true;
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
<groupId>com.loohp</groupId>
<artifactId>ImageFrame-Parent</artifactId>
<version>1.7.13.2</version>
<version>1.7.14.0</version>
<packaging>pom</packaging>
<properties>