当前位置: 首页>>代码示例>>Java>>正文


Java Player.sendBlockChange方法代码示例

本文整理汇总了Java中org.bukkit.entity.Player.sendBlockChange方法的典型用法代码示例。如果您正苦于以下问题:Java Player.sendBlockChange方法的具体用法?Java Player.sendBlockChange怎么用?Java Player.sendBlockChange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.entity.Player的用法示例。


在下文中一共展示了Player.sendBlockChange方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public boolean execute(CommandSender sender, String[] args) {    	
	Player p = (Player) sender;
	
	if (args.length != 1) {
		Chat.player(sender, "&4[SG] &cPlease include the world name");
		return true;
	}
	
	Chat.player(sender, Map.getList().toString());
	Map m = Map.getByID(1);
	
	
	for (Location l : m.getSpawns()) {
		l.setWorld(m.getWorld());
		p.sendBlockChange(l, Material.GLOWSTONE, (byte) 0);
	}
	
	Chat.player(sender, "&2[SG] &aSpawns have been shown with glowstone");
	
    return true;
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:22,代码来源:AdminSpawnsCmd.java

示例2: clearVisualBlock

import org.bukkit.entity.Player; //导入方法依赖的package包/类
/**
 * Clears a visual block at a given location for a player.
 *
 * @param player
 *            the player to clear for
 * @param location
 *            the location to clear at
 * @param sendRemovalPacket
 *            if a packet to send a block change should be sent (this is used to prevent unnecessary packets sent when disconnecting or changing worlds, for example)
 * @return if the visual block was shown in the first place
 */
public boolean clearVisualBlock(Player player, Location location, boolean sendRemovalPacket) {
    synchronized (storedVisualises) {
        VisualBlock visualBlock = this.storedVisualises.remove(player.getUniqueId(), location);
        if (sendRemovalPacket && visualBlock != null) {
            // Have to send a packet to the original block type, don't send if the fake block has the same data properties though.
            Block block = location.getBlock();
            VisualBlockData visualBlockData = visualBlock.getBlockData();
            if (visualBlockData.getBlockType() != block.getType() || visualBlockData.getData() != block.getData()) {
                player.sendBlockChange(location, block.getType(), block.getData());
            }

            return true;
        }
    }

    return false;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:29,代码来源:VisualiseHandler.java

示例3: generate

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public LinkedHashMap<Location, VisualBlockData> generate(Player player, Iterable<Location> locations, VisualType visualType, boolean canOverwrite) {
    synchronized (storedVisualises) {
        LinkedHashMap<Location, VisualBlockData> results = new LinkedHashMap<>();

        ArrayList<VisualBlockData> filled = visualType.blockFiller().bulkGenerate(player, locations);
        if (filled != null) {
            int count = 0;
            for (Location location : locations) {
                if (!canOverwrite && storedVisualises.contains(player.getUniqueId(), location)) {
                    continue;
                }

                Material previousType = location.getBlock().getType();
                if (previousType.isSolid() || previousType != Material.AIR) {
                    continue;
                }

                VisualBlockData visualBlockData = filled.get(count++);
                results.put(location, visualBlockData);
                player.sendBlockChange(location, visualBlockData.getBlockType(), visualBlockData.getData());
                storedVisualises.put(player.getUniqueId(), location, new VisualBlock(visualType, visualBlockData, location));
            }
        }

        return results;
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:28,代码来源:VisualiseHandler.java

示例4: sendBlockChange

import org.bukkit.entity.Player; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public static void sendBlockChange(Player player, Location loc, Material type, int data) {
    player.sendBlockChange(loc, type, (byte) data);
}
 
开发者ID:lucko,项目名称:helper,代码行数:5,代码来源:Players.java

示例5: sendBlockChange

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public static void sendBlockChange(Player player, Location blockLocation, BlockState blockState) {
    player.sendBlockChange(blockLocation, blockState.id, (byte)blockState.meta);
}
 
开发者ID:SamaGames,项目名称:AntiCheat,代码行数:4,代码来源:DeprecatedMethods.java

示例6: send

import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void send(Player p) {
    p.sendBlockChange(loc, mat, data);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:4,代码来源:FakeBlock.java


注:本文中的org.bukkit.entity.Player.sendBlockChange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。