mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 14:38:55 +00:00
Incr Version (0.8.3)
+ Fixed Piloting Siege Engines
This commit is contained in:
1 parent
cd9fb5d651
commit
40c7e39024
5 files changed
+13
-9
No files matched your search
@@ -1,13 +1,12 @@
|
||||
package com.github.alathra.siegeengines.api;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import com.github.alathra.siegeengines.SiegeEngine;
|
||||
import com.github.alathra.siegeengines.SiegeEngines;
|
||||
import com.github.alathra.siegeengines.config.Config;
|
||||
|
||||
public class SiegeEnginesAPI {
|
||||
@@ -59,4 +58,4 @@ public class SiegeEnginesAPI {
|
||||
breachCannonItem.setItemMeta(meta);
|
||||
return breachCannonItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ public class Config {
|
||||
public static boolean craftingRecipes = true;
|
||||
public static boolean doDebug = false;
|
||||
|
||||
|
||||
public static HashSet<World> disabledWorlds = new HashSet<>();
|
||||
|
||||
// Siege Engine Options - Defaults
|
||||
|
||||
@@ -702,6 +702,9 @@ public class ClickHandler implements Listener {
|
||||
if (SiegeEngines.siegeEngineEntitiesPerPlayer.containsKey(player.getUniqueId())) {
|
||||
List<Entity> entities = SiegeEngines.siegeEngineEntitiesPerPlayer.get(player.getUniqueId());
|
||||
if (entities.contains(entity)) {
|
||||
if (player instanceof Player) {
|
||||
((Player) player).sendMessage("§eYou are already commanding this Siege Engine!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -712,7 +715,11 @@ public class ClickHandler implements Listener {
|
||||
if (uuid.equals(player.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
numPilots++;
|
||||
if (SiegeEngines.siegeEngineEntitiesPerPlayer.containsKey(uuid)) {
|
||||
if (SiegeEngines.siegeEngineEntitiesPerPlayer.get(uuid).contains(entity)) {
|
||||
numPilots++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (numPilots > 1) {
|
||||
if (player instanceof Player) ((Player) player).sendMessage("§eOnly one Player may command this Siege Engine!");
|
||||
|
||||
Reference in new issue
Block a user