Ejemplo n.º 1
0
  @Override
  public void spawn(Location loc) {
    List<fArmorStand> asList = new ArrayList<fArmorStand>();
    fArmorStand stand = spawnArmorStand(getRelative(getCenter(), 0, 0).add(0, -1.9, 0));
    stand.setHelmet(new ItemStack(Material.IRON_TRAPDOOR));
    asList.add(stand);

    Location location = getRelative(getCenter(), 0, .04).add(0, -1.8, 0);
    location.setYaw(getYaw() + 90);
    stand = spawnArmorStand(location);
    stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
    stand.setHelmet(new ItemStack(Material.IRON_FENCE));
    stand.setName("#IRON1#");
    stand1 = stand;
    asList.add(stand);

    location = getRelative(getCenter(), 0, -.04).add(0, -1.8, 0);
    location.setYaw(getYaw() + 90);
    stand = spawnArmorStand(location);
    stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(-90, 0, 0)));
    stand.setHelmet(new ItemStack(Material.IRON_FENCE));
    stand.setName("#IRON2#");
    stand2 = stand;
    asList.add(stand);

    for (fArmorStand packet : asList) {
      packet.setInvisible(true);
      packet.setGravity(false);
    }
    send();
    Bukkit.getPluginManager().registerEvents(this, getPlugin());
  }
Ejemplo n.º 2
0
 private void setStatus(boolean b) {
   if (b) {
     stand1.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
     stand2.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
     getWorld().playSound(getLocation(), Sound.ITEM_BREAK, 5, 1);
   } else {
     stand1.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
     stand2.setHeadPose(getLutil().degresstoRad(new EulerAngle(-90, 0, 0)));
   }
   this.b = b;
   update();
 }