mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-03 14:38:53 +00:00
.
This commit is contained in:
1 parent
ffc0e58172
commit
54a754b4e7
4 files changed
+5
-7
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -310,9 +310,6 @@ public class CrunchSiegeCore extends JavaPlugin {
|
|||||||
|
|
||||||
l.setDirection(player.getFacing().getDirection());
|
l.setDirection(player.getFacing().getDirection());
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
ItemStack item = new ItemStack(Material.CARVED_PUMPKIN);
|
ItemStack item = new ItemStack(Material.CARVED_PUMPKIN);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
String id = "";
|
String id = "";
|
||||||
@@ -344,7 +341,6 @@ public class CrunchSiegeCore extends JavaPlugin {
|
|||||||
Entity entity2 = player.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
|
Entity entity2 = player.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
|
||||||
if (id != "") {
|
if (id != "") {
|
||||||
entity2.getPersistentDataContainer().set(key, PersistentDataType.STRING, id);
|
entity2.getPersistentDataContainer().set(key, PersistentDataType.STRING, id);
|
||||||
|
|
||||||
}
|
}
|
||||||
meta.setCustomModelData(equip.ReadyModelNumber);
|
meta.setCustomModelData(equip.ReadyModelNumber);
|
||||||
meta.setDisplayName("§e" + equip.EquipmentName +" spawn item");
|
meta.setDisplayName("§e" + equip.EquipmentName +" spawn item");
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class RotationHandler implements Listener {
|
public class RotationHandler implements Listener {
|
||||||
NamespacedKey key = new NamespacedKey(CrunchSiegeCore.plugin, "cannons");
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void playerMove(PlayerMoveEvent event) {
|
public void playerMove(PlayerMoveEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
NamespacedKey key = new NamespacedKey(CrunchSiegeCore.plugin, "cannons");
|
||||||
if (CrunchSiegeCore.TrackedStands.containsKey(player.getUniqueId())) {
|
if (CrunchSiegeCore.TrackedStands.containsKey(player.getUniqueId())) {
|
||||||
ItemStack itemInHand = player.getInventory().getItemInMainHand();
|
ItemStack itemInHand = player.getInventory().getItemInMainHand();
|
||||||
if (itemInHand != null) {
|
if (itemInHand != null) {
|
||||||
@@ -39,7 +39,9 @@ public class RotationHandler implements Listener {
|
|||||||
for (Entity ent : CrunchSiegeCore.TrackedStands.get(player.getUniqueId())) {
|
for (Entity ent : CrunchSiegeCore.TrackedStands.get(player.getUniqueId())) {
|
||||||
if (ent != null) {
|
if (ent != null) {
|
||||||
SiegeEquipment equipment = CrunchSiegeCore.equipment.get(ent.getUniqueId());
|
SiegeEquipment equipment = CrunchSiegeCore.equipment.get(ent.getUniqueId());
|
||||||
|
if (ent.isDead()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
double distance = player.getLocation().distance(ent.getLocation());
|
double distance = player.getLocation().distance(ent.getLocation());
|
||||||
if (distance <= 250) {
|
if (distance <= 250) {
|
||||||
// player.sendMessage("got id");
|
// player.sendMessage("got id");
|
||||||
|
|||||||
Reference in new issue
Block a user