Examples of Skull


Examples of org.bukkit.block.Skull

        // Takes a username.
        // @tags
        // <l@location.skull_skin>
        // -->
        if (mechanism.matches("skull_skin") && getBlock().getState() instanceof Skull) {
            Skull state = ((Skull)getBlock().getState());
            if (!state.setOwner(value.asString()))
                dB.echoError("Failed to set skull_skin!");
            state.update(true);
        }

        if (!mechanism.fulfilled())
            mechanism.reportInvalid();
    }
View Full Code Here

Examples of org.bukkit.block.Skull

        if(event.getAction() != Action.RIGHT_CLICK_BLOCK) return;

        if(event.getClickedBlock().getType() == Material.SKULL) {

            Skull skull = (Skull)event.getClickedBlock().getState();
            if(skull == null || !skull.hasOwner())
                return;

            LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());

            if(showNameClick && MobSkullType.getEntityType(skull.getOwner()) == null) {
                player.printRaw(ChatColor.YELLOW + player.translate("mech.headdrops.click-message") + " " + skull.getOwner());
            } else if (MobSkullType.getEntityType(skull.getOwner()) != null) {
                skull.setOwner(MobSkullType.getFromEntityType(MobSkullType.getEntityType(skull.getOwner())).getPlayerName());
                skull.update();
            }
        }
    }
View Full Code Here

Examples of org.bukkit.block.Skull

            return;
        if(event.getPlayer().getGameMode() == GameMode.CREATIVE) return;

        if(event.getBlock().getType() == Material.SKULL) {

            Skull skull = (Skull)event.getBlock().getState();
            if(!skull.hasOwner())
                return;
            String playerName = ChatColor.stripColor(skull.getOwner());
            LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());

            EntityType type = MobSkullType.getEntityType(playerName);

            ItemStack stack = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
View Full Code Here

Examples of org.bukkit.block.Skull

     */
    @Override
    public void update()
    {
        super.update();
        Skull skull = (Skull) blockState;
        Skull newSkull = ((Skull) blockState.getBlock().getState());
        newSkull.setRotation(skull.getRotation());
        newSkull.setSkullType(skull.getSkullType());
        if (skull.hasOwner())
            newSkull.setOwner(skull.getOwner());
        newSkull.update(true);
    }
View Full Code Here

Examples of org.bukkit.material.Skull

        MaterialData data = state.getData();
        if (!(data instanceof Skull)) {
            warnMaterialData(Skull.class, data);
            return;
        }
        Skull skull = (Skull) data;
        skull.setFacingDirection(face);
    }
View Full Code Here

Examples of org.bukkit.material.Skull

        MaterialData data = skull.getData();
        if (!(data instanceof Skull)) {
            warnMaterialData(Skull.class, data);
            return;
        }
        Skull skullData = (Skull) data;

        if (canRotate(skullData)) { // Can be rotated
            skull.setRotation(player.getFacing().getOppositeFace());
        }
        skull.update();
View Full Code Here

Examples of org.spout.vanilla.component.block.material.Skull

  @Override
  public void onPlacement(Block block, short data, BlockFace against, Vector3f clickedPos, boolean isClickedBlock, Cause<?> cause) {
    super.onPlacement(block, data, against, clickedPos, isClickedBlock, cause);
    this.setAttachedFace(block, against, cause);
    if (against == BlockFace.BOTTOM || against == BlockFace.TOP) {
      Skull skull = block.get(Skull.class);
      skull.setRotation(PlayerUtil.getYaw(cause));
    }
  }
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.