mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-03 06:28:55 +00:00
fix: 1.20.4 update patch
This commit is contained in:
1 parent
d588bd6a8b
commit
ca045b38ae
3 files changed
+7
-5
No files matched your search
@@ -52,7 +52,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.19.4-R0.1-SNAPSHOT</version>
|
<version>1.20.4-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ public class SiegeEngines extends JavaPlugin {
|
|||||||
public static HashMap<UUID, SiegeEngine> activeSiegeEngines = new HashMap<UUID, SiegeEngine>();
|
public static HashMap<UUID, SiegeEngine> activeSiegeEngines = new HashMap<UUID, SiegeEngine>();
|
||||||
// Player UUID, SiegeEngine entity
|
// Player UUID, SiegeEngine entity
|
||||||
public static HashMap<UUID, List<Entity>> siegeEngineEntitiesPerPlayer = new HashMap<UUID, List<Entity>>();
|
public static HashMap<UUID, List<Entity>> siegeEngineEntitiesPerPlayer = new HashMap<UUID, List<Entity>>();
|
||||||
// Namespace key
|
|
||||||
public static NamespacedKey key = new NamespacedKey(SiegeEngines.getInstance(), "siege_engines");
|
|
||||||
|
|
||||||
public static SiegeEngines getInstance() {
|
public static SiegeEngines getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
|
|||||||
+6
-2
@@ -5,6 +5,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@@ -21,12 +22,15 @@ public class SiegeEngineDeathListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onSiegeEngineDeathEvent(EntityDeathEvent event) {
|
public void onSiegeEngineDeathEvent(EntityDeathEvent event) {
|
||||||
|
|
||||||
boolean removeStands = false;
|
boolean removeStands = false;
|
||||||
List<ItemStack> items = event.getDrops();
|
List<ItemStack> items = event.getDrops();
|
||||||
if (event.getEntity() instanceof ArmorStand) {
|
if (event.getEntity() instanceof ArmorStand) {
|
||||||
if (event.getEntity().getPersistentDataContainer().has(SiegeEngines.key, PersistentDataType.STRING)) {
|
// Namespace key
|
||||||
|
NamespacedKey key = new NamespacedKey(SiegeEngines.getInstance(), "siege_engines");
|
||||||
|
if (event.getEntity().getPersistentDataContainer().has(key, PersistentDataType.STRING)) {
|
||||||
Entity base = Bukkit.getEntity(UUID.fromString(
|
Entity base = Bukkit.getEntity(UUID.fromString(
|
||||||
event.getEntity().getPersistentDataContainer().get(SiegeEngines.key, PersistentDataType.STRING)));
|
event.getEntity().getPersistentDataContainer().get(key, PersistentDataType.STRING)));
|
||||||
base.remove();
|
base.remove();
|
||||||
}
|
}
|
||||||
if (SiegeEngines.activeSiegeEngines.containsKey(event.getEntity().getUniqueId())) {
|
if (SiegeEngines.activeSiegeEngines.containsKey(event.getEntity().getUniqueId())) {
|
||||||
|
|||||||
Reference in new issue
Block a user