• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LocalPlayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sk89q.worldedit.LocalPlayer的典型用法代码示例。如果您正苦于以下问题:Java LocalPlayer类的具体用法?Java LocalPlayer怎么用?Java LocalPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LocalPlayer类属于com.sk89q.worldedit包,在下文中一共展示了LocalPlayer类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onBlockBreak

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockBreak(BlockBreakEvent event) {
    final LocalPlayer player = plugin.wrapPlayer(event.getPlayer());
    final World world = player.getWorld();
    final WorldEdit we = WorldEdit.getInstance();
    final Block clickedBlock = event.getBlock();
    final WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ());
    if (we.handleBlockLeftClick(player, pos)) {
        event.setCancelled(true);
    }
    if (we.handleArmSwing(player)) {
        event.setCancelled(true);
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:15,代码来源:WorldEditListener.java


示例2: equals

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@Override
public boolean equals(Object other) {
    if (!(other instanceof LocalPlayer)) {
        return false;
    }
    LocalPlayer other2 = (LocalPlayer) other;
    return other2.getName().equals(getName());
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:9,代码来源:AbstractPlayerActor.java


示例3: getEditSession

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@Override
public EditSession getEditSession(LocalWorld world, int maxBlocks, LocalPlayer player)
{
    if (this.ignoreWorldEdit(world))
    {
        return this.oldFactory.getEditSession(world, maxBlocks, player);
    }
    else
    {
        return new LogEditSession(world, maxBlocks, player, this.module, this.listener);
    }
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:13,代码来源:LogEditSessionFactory.java


示例4: LogEditSession

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
public LogEditSession(LocalWorld world, int maxBlocks, LocalPlayer player, Log module, LogListener listener)
{
    super(world, maxBlocks);
    this.player = player;
    this.module = module;
    this.listener = listener;
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:8,代码来源:LogEditSession.java


示例5: draw

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@Override
public void draw(short data, BlockLoger loger, LocalPlayer localPlayer, IColorMap colorMap) 
        throws MaxChangedBlocksException {
    
    BukkitPlayer bPlayer = (BukkitPlayer)localPlayer;
    double yaw = localPlayer.getYaw();
    double pitch = localPlayer.getPitch();
    Orientation orientation = new Orientation(yaw, pitch);
    
    Vector oPosition = Utils.getPlayerPos(localPlayer);
    Vector position = orientation.moveStart(oPosition, yaw, pitch);
    
    FacingBlock fb = m_variants.values().iterator().next();
    fb.render(orientation.getFacing(), 0, position, bPlayer.getPlayer(), loger, colorMap, null);
}
 
开发者ID:SBPrime,项目名称:MCPainter,代码行数:16,代码来源:AssetBlock.java


示例6: dump

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
public void dump(LocalPlayer p){
    p.print(ChatColor.RED+ "Debugging Arguments: ");
    p.print("    "+ChatColor.GREEN + "subcommand: "+ ChatColor.BLUE + this.getSubCommand());
    Iterator<Argument> it = this.argumentList.iterator();
    
    while(it.hasNext()){
        Argument c = it.next();
        p.print("    "+ChatColor.GREEN +c.getKey() + ": "+ ChatColor.BLUE + c.getValue());
    }
}
 
开发者ID:Laubi,项目名称:MineMaze,代码行数:11,代码来源:CommandHandler.java


示例7: prims

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@MazeGenerator(
        alias = "prims",
        fullName = "Prims Maze Generator",
        author = "Laubi"
)
public static Maze prims(LocalPlayer player, CommandHandler handler, WorldEdit we, Maze maze)
        throws UnknownItemException, DisallowedItemException {
    return genBasicMaze(player, handler, we, maze, new Prims(maze.getWidth(), maze.getLength()));
}
 
开发者ID:Laubi,项目名称:MineMaze,代码行数:10,代码来源:BasicMazes.java


示例8: primsc

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@MazeGenerator(
        alias = "primsc",
        fullName = "Prims Chaotic Maze Generator",
        author = "Laubi"
)
public static Maze primsc(LocalPlayer player, CommandHandler handler, WorldEdit we, Maze maze)
        throws UnknownItemException, DisallowedItemException {
    return genBasicMaze(player, handler, we, maze, new PrimsChaos(maze.getWidth(), maze.getLength()));
}
 
开发者ID:Laubi,项目名称:MineMaze,代码行数:10,代码来源:BasicMazes.java


示例9: dfs

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@MazeGenerator(
        alias = "dfs",
        fullName = "DeepFirstSearch Maze Generator",
        author = "Laubi"
)
public static Maze dfs(LocalPlayer player, CommandHandler handler, WorldEdit we, Maze maze)
        throws UnknownItemException, DisallowedItemException {
    return genBasicMaze(player, handler, we, maze, new DeepFirstSearch(maze.getWidth(), maze.getLength()));
}
 
开发者ID:Laubi,项目名称:MineMaze,代码行数:10,代码来源:BasicMazes.java


示例10: dfsc

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@MazeGenerator(
        alias = "dfsc",
        fullName = "DeepFirstSearch Chaotic Maze Generator",
        author = "Laubi"
)
public static Maze dfsc(LocalPlayer player, CommandHandler handler, WorldEdit we, Maze maze)
        throws UnknownItemException, DisallowedItemException {
    return genBasicMaze(player, handler, we, maze, new DeepFirstSearchChaos(maze.getWidth(), maze.getLength()));
}
 
开发者ID:Laubi,项目名称:MineMaze,代码行数:10,代码来源:BasicMazes.java


示例11: prepare

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
default void prepare(LocalSession session, LocalPlayer player, Vector target) {
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:3,代码来源:Mask.java


示例12: clearSpawner

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
private void clearSpawner(Sign spawner, Player clicker){
	Long timestamp = data.get(spawner.getLocation());
	System.out.println("timestamp: " + timestamp);
	if(timestamp == null){
		timestamp = STARTUP_TIME + 180000;
	}
	if((System.currentTimeMillis() - timestamp) > SPAWNER_TIMEOUT){
		BlockFace direction = DirectionUtils.getSignDirection(spawner.getBlock());
		Location startBlock = spawner.getBlock().getRelative(direction, 2).getLocation();
		BukkitWorld world = new BukkitWorld(startBlock.getWorld());
		EditSession session = new EditSession(world, 1000);
		WorldEditPlugin wep = ((WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit"));
		WorldEdit we = wep.getWorldEdit();
		LocalConfiguration config = we.getConfiguration();
		LocalPlayer p = wep.wrapPlayer(clicker);
		String fileName = getSchematicName(spawner);
		//int price = getPrice(spawner);
		File dir = we.getWorkingDirectoryFile(config.saveDir);
		File f;
		Vector v = new Vector(startBlock.getX(), startBlock.getY(), startBlock.getZ());

		try {
			f = we.getSafeOpenFile(p, dir, fileName, "schematic", "schematic");
			CuboidClipboard cc = SchematicFormat.MCEDIT.load(f);
			int originX = startBlock.getBlockX();
			int originY = startBlock.getBlockY();
			int originZ = startBlock.getBlockZ();
			
			Vector v2 = generateFarPointVector(cc, startBlock, direction);
			
			CuboidSelection sr = new CuboidSelection(startBlock.getWorld(), v, v2);
			Location minPoint = sr.getMinimumPoint();
			for (int X = 0; X < sr.getWidth(); X++) {
				for (int Y = 0; Y < sr.getHeight(); Y++) {
					for (int Z = 0; Z < sr.getLength(); Z++) {
						Location l = new Location(startBlock.getWorld(), minPoint.getX() + X, minPoint.getY() + Y, minPoint.getZ() + Z);
						l.getBlock().setType(Material.AIR);
					}
				}
			}
		} catch (Exception e){
			e.printStackTrace();
		}
		clicker.sendMessage("Spawner Cleared!");
	} else {
		clicker.sendMessage("This spawner cannot be cleared yet. It has been used in the last two minutes.");
		long time = (SPAWNER_TIMEOUT - (System.currentTimeMillis() - timestamp)) / 1000;
		clicker.sendMessage("It can be cleared in " + time + " seconds.");
	}
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:51,代码来源:ShipSpawnerCore.java


示例13: wrapPlayer

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
@Override
public ILocalPlayer wrapPlayer(Player player) {
    LocalPlayer lPlayer = m_worldEdit.wrapPlayer(player);
    return new WorldEditLocalPlayer(lPlayer);
}
 
开发者ID:SBPrime,项目名称:MCPainter,代码行数:6,代码来源:WorldEditWrapper.java


示例14: WorldEditLocalPlayer

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
public WorldEditLocalPlayer(LocalPlayer localPlayer) {
    m_localPlayer = localPlayer;
}
 
开发者ID:SBPrime,项目名称:MCPainter,代码行数:4,代码来源:WorldEditLocalPlayer.java


示例15: getLocalPlayer

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
public LocalPlayer getLocalPlayer(){
    return m_localPlayer;
}
 
开发者ID:SBPrime,项目名称:MCPainter,代码行数:4,代码来源:WorldEditLocalPlayer.java


示例16: genBasicMaze

import com.sk89q.worldedit.LocalPlayer; //导入依赖的package包/类
private static Maze genBasicMaze(LocalPlayer player, CommandHandler handler, WorldEdit we, Maze maze, SimpleMazeGenerator gen)
        throws UnknownItemException, DisallowedItemException {

    Pattern wallPattern = new SingleBlockPattern(new BaseBlock(BlockID.STONE));

    if (handler.containsArgument("mat")) {
        wallPattern = we.getBlockPattern(player, handler.getArgumentValue("mat"));
    }



    boolean[][] flatMaze = gen.generateMaze();

    for (int x = 0; x < maze.getWidth(); x++) {
        for (int y = 0; y < maze.getHeight(); y++) {
            for (int z = 0; z < maze.getLength(); z++) {
                maze.set(x, y, z, flatMaze[x][z] ? wallPattern.next(x, y, z) : airBlock);
            }
        }
    }



    if (!handler.containsArgument("nodoors")) {
        for (int i = 0; i < maze.getHeight(); i++) {
            maze.set(0, i, 1, airBlock);
            maze.set(maze.getWidth() - 1, i, maze.getLength() - 2, airBlock);

            if (maze.getWidth() % 2 == 0 || maze.getLength() % 2 == 0) {
                maze.set(maze.getWidth() - 2, i, maze.getLength() - 2, airBlock);
            }
            if (maze.getWidth() % 2 == 0 && maze.getLength() % 2 == 0) {
                maze.set(maze.getWidth() - 2, i, maze.getLength() - 3, airBlock);
            }
        }
    }

    if (handler.containsArgument("bottom")) {
        Pattern floorPattern = we.getBlockPattern(player, handler.getArgumentValue("bottom"));
        for (int i = 0; i < maze.getWidth(); i++) {
            for (int j = 0; j < maze.getLength(); j++) {
                maze.set(i, 0, j, floorPattern.next(i, 0, j));
            }
        }
    }

    if (handler.containsArgument("top")) {
        Pattern roofPattern = we.getBlockPattern(player, handler.getArgumentValue("top"));
        for (int i = 0; i < maze.getWidth(); i++) {
            for (int j = 0; j < maze.getLength(); j++) {
                maze.set(i, maze.getHeight() - 1, j, roofPattern.next(i, maze.getHeight() - 1, j));
            }
        }
    }

    if (handler.containsArgument("torches")) {
        final BaseBlock torchBlock = handler.containsArgument("r") ? new BaseBlock(BlockID.REDSTONE_TORCH_ON) : new BaseBlock(BlockID.TORCH);
        final int p = handler.containsArgument("p") ? Integer.parseInt(handler.getArgumentValue("p")) : 10;
        int he = handler.containsArgument("h") ? Integer.parseInt(handler.getArgumentValue("h")) : 2;

        he += (handler.containsArgument("bottom") ? 1 : 0);

        if (he <= maze.getHeight() && he > 0) {
            for (int i = 1; i < maze.getWidth() - 1; i++) {
                for (int j = 1; j < maze.getLength() - 1; j++) {
                    if (rnd.nextInt(100) < p && maze.get(i, he - 1, j) == airBlock) {
                        if (maze.get(i - 1, he - 1, j) != airBlock
                                || maze.get(i + 1, he - 1, j) != airBlock
                                || maze.get(i, he - 1, j - 1) != airBlock
                                || maze.get(i, he - 1, j + 1) != airBlock) {
                            maze.set(i, he - 1, j, torchBlock);
                        }
                    }
                }
            }
        }
    }
    return maze;
}
 
开发者ID:Laubi,项目名称:MineMaze,代码行数:80,代码来源:BasicMazes.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FeatureDao类代码示例发布时间:2022-05-23
下一篇:
Java CurrencyStyle类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap