Package org.bukkit.block

Examples of org.bukkit.block.BlockState.update()


        if (modify instanceof Sign) {
          final String[] lines = query.getString("metadata").split("\n");
          for (int i = 0; i < lines.length; i++) {
            ((Sign) modify).setLine(i, lines[i]);
          }
          modify.update(true, false);
        }
       
        // Containers
        if (modify instanceof InventoryHolder) {
          YamlConfiguration config = new YamlConfiguration();
View Full Code Here


          for (Object obj : config.getList("items")) {
            if (obj instanceof ItemStack) {
              ((InventoryHolder) modify).getInventory().addItem((ItemStack) obj);
            }
          }
          modify.update(true, false);
        }

        // Notes
        if (modify instanceof NoteBlock) {
          String[] split = query.getString("metadata").split("\n");
View Full Code Here

        // Notes
        if (modify instanceof NoteBlock) {
          String[] split = query.getString("metadata").split("\n");
          Note note = new Note(Integer.parseInt(split[1]), Tone.valueOf(split[0]), Boolean.parseBoolean(split[2]));
          ((NoteBlock) modify).setNote(note);
          modify.update(true, false);
        }

        // Records
        if (modify instanceof Jukebox) {
          ((Jukebox) modify).setPlaying(Material.valueOf(query.getString("metadata")));
View Full Code Here

        }

        // Records
        if (modify instanceof Jukebox) {
          ((Jukebox) modify).setPlaying(Material.valueOf(query.getString("metadata")));
          modify.update(true, false);
        }
       
        // Skulls
        if (modify instanceof Skull) {
          String[] opts = query.getString("metadata").split("\n");
View Full Code Here

          if (!opts[0].isEmpty()) {
            ((Skull) modify).setOwner(opts[0]);
          }
          ((Skull) modify).setSkullType(SkullType.valueOf(opts[1]));
          ((Skull) modify).setRotation(BlockFace.valueOf(opts[2]));
          modify.update(true, false);
        }
       
        // Command blocks
        if (modify instanceof CommandBlock) {
          final String[] commandArray = query.getString("metadata").split("\n");
View Full Code Here

                changes[xi][yi][zi] = true;
                airChanges++;
                BlockState state = volume.getWorld().getBlockAt(x, y, z).getState();
                if (state.getType() != Material.AIR) {
                  state.setType(Material.AIR);
                  state.update(true, false);
                }
                if (airChanges >= speed) {
                  this.displayStatusMessage();
                  break air;
                }
View Full Code Here

        // Command blocks
        if (modify instanceof CommandBlock) {
          final String[] commandArray = query.getString("metadata").split("\n");
          ((CommandBlock) modify).setName(commandArray[0]);
          ((CommandBlock) modify).setCommand(commandArray[1]);
          modify.update(true, false);
        }

        // Creature spawner
        if (modify instanceof CreatureSpawner) {
          ((CreatureSpawner) modify).setSpawnedType(EntityType.valueOf(query.getString("metadata")));
View Full Code Here

        }

        // Creature spawner
        if (modify instanceof CreatureSpawner) {
          ((CreatureSpawner) modify).setSpawnedType(EntityType.valueOf(query.getString("metadata")));
          modify.update(true, false);
        }
      } catch (Exception ex) {
        War.war.getLogger().log(Level.WARNING, "Exception loading some tile data. x:" + x + " y:" + y + " z:" + z + " type:" + modify.getType().toString() + " data:" + modify.getData().toString(), ex);
      }
    }
View Full Code Here

   
    // center
    BlockState current = this.warzone.getWorld().getBlockAt(x, y - 1, z).getState();
    current.setType(this.warzone.getWarzoneMaterials().getMainBlock().getType());
    current.setData(this.warzone.getWarzoneMaterials().getMainBlock().getData());
    current.update(true);

    // inner ring
    current = this.warzone.getWorld().getBlockAt(x + 1, y - 1, z + 1).getState();
    current.setType(this.warzone.getWarzoneMaterials().getLightBlock().getType());
    current.setData(this.warzone.getWarzoneMaterials().getLightBlock().getData());
View Full Code Here

    // inner ring
    current = this.warzone.getWorld().getBlockAt(x + 1, y - 1, z + 1).getState();
    current.setType(this.warzone.getWarzoneMaterials().getLightBlock().getType());
    current.setData(this.warzone.getWarzoneMaterials().getLightBlock().getData());
    current.update(true);
    current = this.warzone.getWorld().getBlockAt(x + 1, y - 1, z).getState();
    current.setType(this.warzone.getWarzoneMaterials().getMainBlock().getType());
    current.setData(this.warzone.getWarzoneMaterials().getMainBlock().getData());
    current.update(true);
    current = this.warzone.getWorld().getBlockAt(x + 1, y - 1, z - 1).getState();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.