小编Mar*_*ura的帖子

对于声明问题?

所以我有这些代码,我的for循环有问题.

@EventHandler
    public void onPistonExtend(BlockPistonExtendEvent event)
    {
        if (TownStones.blockPistons)
        {
            List<Block> pushedBlocks = event.getBlocks();
            Material theMaterial = null;
            int end = TownStones.blocks;
            boolean done = false;
            if (pushedBlocks != null) {
                for (Iterator localIterator = pushedBlocks.iterator(); localIterator.hasNext(); !done)
                {
                    Block theBlock = (Block)localIterator.next();
                    theMaterial = theBlock.getType();
                    done = false;
                    int i = 0; continue;
                    if (theMaterial == Material.getMaterial(TownStones.blockType[i]))
                    {
                        event.setCancelled(true);
                        done = true;
                    }
                    else if (i > end)
                    {
                        done = true;
                    }
                    i++;
                }
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

Intellij …

java intellij-idea minecraft bukkit

-2
推荐指数
1
解决办法
87
查看次数

标签 统计

bukkit ×1

intellij-idea ×1

java ×1

minecraft ×1