• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BaseBiome类的典型用法和代码示例

java 1次浏览

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

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

示例1: addBiomeChange

点赞 3

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
    blockSize++;
    try {
        OutputStream os = getBiomeOS();
        os.write((byte) (x >> 24));
        os.write((byte) (x >> 16));
        os.write((byte) (x >> 8));
        os.write((byte) (x));
        os.write((byte) (z >> 24));
        os.write((byte) (z >> 16));
        os.write((byte) (z >> 8));
        os.write((byte) (z));
        os.write(from.getId());
        os.write(to.getId());
    } catch (Throwable e) {
        MainUtil.handleError(e);
    }
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:20,
代码来源:FaweStreamChangeSet.java

示例2: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(Vector2D position, BaseBiome biome) {
    if (WEManager.maskContains(mask, position.getBlockX(), position.getBlockZ())) {
        return super.setBiome(position, biome);
    }
    return false;
}
 

开发者ID:Mayomi,
项目名称:PlotSquared-Chinese,
代码行数:8,
代码来源:ProcessedWEExtent.java

示例3: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(Vector2D position) {
    BukkitImplAdapter adapter = BukkitQueue_0.getAdapter();
    if (adapter != null) {
        int id = adapter.getBiomeId(getWorld().getBiome(position.getBlockX(), position.getBlockZ()));
        return new BaseBiome(id);
    } else {
        return new BaseBiome(0);
    }
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:11,
代码来源:BukkitWorld.java

示例4: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(Level level, int x, int z, BaseBiome biome, Long seed) {
    Map<Long, Entity> ents = level.getChunkEntities(x, z);
    if (!ents.isEmpty()) {
        Iterator<Map.Entry<Long, Entity>> iter = ents.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<Long, Entity> entry = iter.next();
            Entity entity = entry.getValue();
            iter.remove();
            level.removeEntity(entity);
        }
    }
    level.regenerateChunk(x, z);
    return true;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:16,
代码来源:NukkitQueue.java

示例5: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(int x, int z, BaseBiome biome) {
    int cx = x >> 4;
    int cz = z >> 4;
    FaweChunk chunk = map.getFaweChunk(cx, cz);
    chunk.setBiome(x & 15, z & 15, biome);
    return true;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:9,
代码来源:MappedFaweQueue.java

示例6: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(int x, int z, String biome) {
    if (!StringMan.isEqual(biome, lastBiome)) {
        if (reg == null) {
            World weWorld = IMP.getWEWorld();
            reg = weWorld.getWorldData().getBiomeRegistry();
        }
        List<BaseBiome> biomes = reg.getBiomes();
        lastBiome = biome;
        this.biome = Biomes.findBiomeByName(biomes, biome, reg);
    }
    return IMP.setBiome(x, z, this.biome);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:14,
代码来源:FaweLocalBlockQueue.java

示例7: data

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Command(
        aliases = {"#biome", "$"},
        desc = "Set the biome",
        usage = "<biome>",
        min = 1,
        max = 1
)
public Pattern data(Actor actor, LocalSession session, Extent extent, BaseBiome biome) {
    return new BiomePattern(extent, biome);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:11,
代码来源:PatternCommands.java

示例8: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(Vector2D position, BaseBiome biome) {
    if (region.contains(position.getBlockX(), position.getBlockZ())) {
        return super.setBiome(position, biome);
    }
    return false;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:8,
代码来源:MaskedFaweQueue.java

示例9: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(Vector2D position) {
    mutable.mutX(position.getBlockX());
    mutable.mutZ(position.getBlockZ());
    mutable.mutY(0);
    return super.getBiome(getPos(mutable).toVector2D());
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:8,
代码来源:PositionTransformExtent.java

示例10: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(Vector2D position) {
    if (position.getX() == bx && position.getZ() == bz) {
        return biome;
    }
    return super.getBiome(position);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:8,
代码来源:TemporalExtent.java

示例11: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(Vector2D position, BaseBiome biome) {
    mutable.mutX(position.getBlockX());
    mutable.mutZ(position.getBlockZ());
    mutable.mutY(0);
    return super.setBiome(getPos(mutable).toVector2D(), biome);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:8,
代码来源:TransformExtent.java

示例12: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(Vector2D position, BaseBiome biome) {
    if (!contains(position)) {
        if (!limit.MAX_FAILS()) {
            WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_FAILS);
        }
        return false;
    }
    return super.setBiome(position, biome);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:11,
代码来源:FaweRegionExtent.java

示例13: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(Vector2D position) {
    if (!contains(position)) {
        if (!limit.MAX_FAILS()) {
            WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_FAILS);
        }
        return EditSession.nullBiome;
    }
    return super.getBiome(position);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:11,
代码来源:FaweRegionExtent.java

示例14: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(final Vector2D position, final BaseBiome biome) {
    if (!limit.MAX_CHANGES()) {
        WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
        return false;
    }
    return super.setBiome(position, biome);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:9,
代码来源:ProcessedWEExtent.java

示例15: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(Vector2D position, BaseBiome biome) {
    boolean result = false;
    Vector pos = getPos(position.getBlockX(), 0, position.getBlockZ());
    double sx = pos.getX();
    double sz = pos.getZ();
    double ex = pos.getX() + dx;
    double ez = pos.getZ() + dz;
    for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
        for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
            result |= super.setBiome(pos.toVector2D(), biome);
        }
    }
    return result;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:16,
代码来源:ScaleTransform.java

示例16: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(Vector2D position, BaseBiome newBiome) {
    BaseBiome oldBiome = this.getBiome(position);
    if (oldBiome.getId() != newBiome.getId()) {
        this.changeSet.addBiomeChange(position.getBlockX(), position.getBlockZ(), oldBiome, newBiome);
        return getExtent().setBiome(position, newBiome);
    } else {
        return false;
    }
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:11,
代码来源:HistoryExtent.java

示例17: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(int x, int z, BaseBiome biome) {
    if (super.setBiome(x, z, biome)) {
        int oldBiome = getParent().getBiomeId(x, z);
        if (oldBiome != biome.getId()) {
            set.addBiomeChange(x, z, FaweCache.getBiome(oldBiome), biome);
            return true;
        }
    }
    return false;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:12,
代码来源:ChangeSetFaweQueue.java

示例18: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(int index) {
    if (!hasBiomes()) {
        return EditSession.nullBiome;
    }
    int biomeId = mbb.get(HEADER_SIZE + (volume << 1) + index) & 0xFF;
    return FaweCache.CACHE_BIOME[biomeId];
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:9,
代码来源:DiskOptimizedClipboard.java

示例19: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean setBiome(int x, int z, BaseBiome biome) {
    int index = z * getWidth() + x;
    if (index < 0 || index >= getArea()) return false;
    biomes.setByte(index, (byte) biome.getId());
    return true;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:8,
代码来源:HeightMapMCAGenerator.java

示例20: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(int index) {
    if (!hasBiomes()) {
        return EditSession.nullBiome;
    }
    return FaweCache.CACHE_BIOME[biomes[index] & 0xFF];
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:8,
代码来源:MemoryOptimizedClipboard.java

示例21: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    IChunkProvider provider = world.getChunkProvider();
    if (!(provider instanceof ChunkProviderServer)) {
        return false;
    }


    try {
        ChunkProviderServer chunkServer = (ChunkProviderServer) provider;
        IChunkGenerator gen = chunkServer.chunkGenerator;
        long pos = ChunkPos.chunkXZ2Int(x, z);
        Chunk mcChunk;
        if (chunkServer.chunkExists(x, z)) {
            mcChunk = chunkServer.loadChunk(x, z);
            mcChunk.onChunkUnload();
        }
        PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
        List<EntityPlayerMP> oldWatchers = null;
        if (chunkServer.chunkExists(x, z)) {
            mcChunk = chunkServer.loadChunk(x, z);
            PlayerChunkMapEntry entry = playerManager.getEntry(x, z);
            if (entry != null) {
                Field fieldPlayers = PlayerChunkMapEntry.class.getDeclaredField("field_187283_c");
                fieldPlayers.setAccessible(true);
                oldWatchers = (List<EntityPlayerMP>) fieldPlayers.get(entry);
                playerManager.removeEntry(entry);
            }
            mcChunk.onChunkUnload();
        }
        try {
            Field droppedChunksSetField = chunkServer.getClass().getDeclaredField("field_73248_b");
            droppedChunksSetField.setAccessible(true);
            Set droppedChunksSet = (Set) droppedChunksSetField.get(chunkServer);
            droppedChunksSet.remove(pos);
        } catch (Throwable e) {
            MainUtil.handleError(e);
        }
        chunkServer.id2ChunkMap.remove(pos);
        mcChunk = gen.provideChunk(x, z);
        chunkServer.id2ChunkMap.put(pos, mcChunk);
        if (mcChunk != null) {
            mcChunk.onChunkLoad();
            mcChunk.populateChunk(chunkServer, chunkServer.chunkGenerator);
        }
        if (oldWatchers != null) {
            for (EntityPlayerMP player : oldWatchers) {
                playerManager.addPlayer(player);
            }
        }
        return true;
    } catch (Throwable t) {
        MainUtil.handleError(t);
        return false;
    }
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:57,
代码来源:ForgeQueue_All.java

示例22: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(net.minecraft.world.World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.getWorldInfo().getSeed();
            boolean result;
            ChunkProviderOverworld generator = new ChunkProviderOverworld(nmsWorld, seed, false, "");
            net.minecraft.world.biome.Biome base = net.minecraft.world.biome.Biome.getBiome(biome.getId());
            net.minecraft.world.biome.Biome[] existingBiomes = new net.minecraft.world.biome.Biome[256];
            Arrays.fill(existingBiomes, base);
            fieldBiomes.set(generator, existingBiomes);
            boolean cold = base.getTemperature() <= 1;
            IChunkGenerator existingGenerator = (IChunkGenerator) fieldChunkGenerator.get(nmsWorld.getChunkProvider());
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.provider.getBiomeProvider());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.provider.getBiomeProvider());
                fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), genLayer);
                fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), genLayer);

                fieldSeed.set(nmsWorld.getWorldInfo(), seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.provider.getBiomeProvider(), new BiomeCache(this.nmsWorld.provider.getBiomeProvider()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), generator);

                result = regenerateChunk(world, x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), existingGenerator);

                fieldSeed.set(nmsWorld.getWorldInfo(), existingSeed);

                fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return regenerateChunk(world, x, z);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:48,
代码来源:SpongeQueue_1_11.java

示例23: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(Vector2D position) {
    return world.getBiome(position);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:5,
代码来源:LocalWorldAdapter.java

示例24: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.worldData.getSeed();
            boolean result;
            ChunkProviderGenerate generator = new ChunkProviderGenerate(nmsWorld, seed, false, "");
            Biome bukkitBiome = getAdapter().getBiome(biome.getId());
            BiomeBase base = BiomeBase.getBiome(biome.getId());
            fieldBiomes.set(generator, new BiomeBase[]{base});
            boolean cold = base.getTemperature() <= 1;
            net.minecraft.server.v1_10_R1.ChunkGenerator existingGenerator = nmsWorld.getChunkProviderServer().chunkGenerator;
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.getWorldChunkManager());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.getWorldChunkManager());
                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), genLayer);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), genLayer);

                fieldSeed.set(nmsWorld.worldData, seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.getWorldChunkManager(), new BiomeCache(this.nmsWorld.getWorldChunkManager()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), generator);

                result = getWorld().regenerateChunk(x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), existingGenerator);

                fieldSeed.set(nmsWorld.worldData, existingSeed);

                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return super.regenerateChunk(world, x, z, biome, seed);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:47,
代码来源:BukkitQueue_1_10.java

示例25: biomeList

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Command(
        aliases = {"biomelist", "biomels"},
        usage = "[page]",
        desc = "Gets all biomes available.",
        max = 1
)
@CommandPermissions("worldedit.biome.list")
public void biomeList(Player player, CommandContext args) throws WorldEditException {
    int page;
    int offset;
    int count = 0;

    if (args.argsLength() == 0 || (page = args.getInteger(0)) < 2) {
        page = 1;
        offset = 0;
    } else {
        offset = (page - 1) * 18;
    }

    BiomeRegistry biomeRegistry = player.getWorld().getWorldData().getBiomeRegistry();
    List<BaseBiome> biomes = biomeRegistry.getBiomes();
    int totalPages = biomes.size() / 19 + 1;
    Message msg = BBC.BIOME_LIST_HEADER.m(page, totalPages);
    String setBiome = Commands.getAlias(BiomeCommands.class, "/setbiome");
    for (BaseBiome biome : biomes) {
        if (offset > 0) {
            offset--;
        } else {
            BiomeData data = biomeRegistry.getData(biome);
            if (data != null) {
                msg.newline().text(data.getName()).cmdTip(setBiome + " " + data.getName());
            } else {
                msg.newline().text("<? #" + biome.getId() + ">").cmdTip(setBiome + " " + biome.getId());
            }
            if (++count == 18) {
                break;
            }
        }
    }
    msg.newline().paginate(getCommand().aliases()[0], page, totalPages);
    msg.send(player);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:43,
代码来源:BiomeCommands.java

示例26: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.worldData.getSeed();
            boolean result;
            ChunkProviderGenerate generator = new ChunkProviderGenerate(nmsWorld, seed, false, "");
            Biome bukkitBiome = getAdapter().getBiome(biome.getId());
            BiomeBase base = BiomeBase.getBiome(biome.getId());
            fieldBiomes.set(generator, new BiomeBase[]{base});
            boolean cold = base.getTemperature() <= 1;
            net.minecraft.server.v1_12_R1.ChunkGenerator existingGenerator = nmsWorld.getChunkProviderServer().chunkGenerator;
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.getWorldChunkManager());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.getWorldChunkManager());
                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), genLayer);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), genLayer);

                fieldSeed.set(nmsWorld.worldData, seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.getWorldChunkManager(), new BiomeCache(this.nmsWorld.getWorldChunkManager()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), generator);

                result = getWorld().regenerateChunk(x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), existingGenerator);

                fieldSeed.set(nmsWorld.worldData, existingSeed);

                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return super.regenerateChunk(world, x, z, biome, seed);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:47,
代码来源:BukkitQueue_1_12.java

示例27: setBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public void setBiome(int x, int z, Biome bio) {
    int id = adapter.getBiomeId(bio);
    queue.setBiome(x, z, new BaseBiome(id));
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:6,
代码来源:AsyncWorld.java

示例28: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.worldData.getSeed();
            boolean result;
            net.minecraft.server.v1_9_R2.ChunkProviderGenerate generator = new net.minecraft.server.v1_9_R2.ChunkProviderGenerate(nmsWorld, seed, false, "");
            Biome bukkitBiome = getAdapter().getBiome(biome.getId());
            net.minecraft.server.v1_9_R2.BiomeBase base = net.minecraft.server.v1_9_R2.BiomeBase.getBiome(biome.getId());
            fieldBiomes.set(generator, new net.minecraft.server.v1_9_R2.BiomeBase[]{base});
            net.minecraft.server.v1_9_R2.ChunkGenerator existingGenerator = nmsWorld.getChunkProviderServer().chunkGenerator;
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.getWorldChunkManager());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.getWorldChunkManager());
                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), genLayer);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), genLayer);

                fieldSeed.set(nmsWorld.worldData, seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.getWorldChunkManager(), new net.minecraft.server.v1_9_R2.BiomeCache(this.nmsWorld.getWorldChunkManager()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), generator);

                result = getWorld().regenerateChunk(x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), existingGenerator);

                fieldSeed.set(nmsWorld.worldData, existingSeed);

                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return super.regenerateChunk(world, x, z, biome, seed);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:46,
代码来源:BukkitQueue_1_9_R1.java

示例29: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.worldData.getSeed();
            boolean result;
            ChunkProviderGenerate generator = new ChunkProviderGenerate(nmsWorld, seed, false, "");
            Biome bukkitBiome = getAdapter().getBiome(biome.getId());
            BiomeBase base = BiomeBase.getBiome(biome.getId());
            fieldBiomes.set(generator, new BiomeBase[]{base});
            boolean cold = base.getTemperature() <= 1;
            net.minecraft.server.v1_11_R1.ChunkGenerator existingGenerator = nmsWorld.getChunkProviderServer().chunkGenerator;
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.getWorldChunkManager());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.getWorldChunkManager());
                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), genLayer);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), genLayer);

                fieldSeed.set(nmsWorld.worldData, seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.getWorldChunkManager(), new BiomeCache(this.nmsWorld.getWorldChunkManager()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), generator);

                result = getWorld().regenerateChunk(x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProviderServer(), existingGenerator);

                fieldSeed.set(nmsWorld.worldData, existingSeed);

                fieldGenLayer1.set(nmsWorld.getWorldChunkManager(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.getWorldChunkManager(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return super.regenerateChunk(world, x, z, biome, seed);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:47,
代码来源:BukkitQueue_1_11.java

示例30: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    if (!keepLoaded.isEmpty()) keepLoaded.remove(MathMan.pairInt(x, z));
    boolean result = world.regenerateChunk(x, z);
    return result;
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:7,
代码来源:BukkitQueue_0.java

示例31: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Command(
        aliases = {"/regen"},
        usage = "[biome] [seed]",
        desc = "Regenerates the contents of the selection",
        help =
                "Regenerates the contents of the current selection.\n" +
                        "This command might affect things outside the selection,\n" +
                        "if they are within the same chunk.",
        min = 0,
        max = 2
)
@CommandPermissions("worldedit.regen")
@Logging(REGION)
public void regenerateChunk(FawePlayer player, LocalSession session, EditSession editSession, @Selection Region region, CommandContext args) throws WorldEditException {
    player.checkConfirmationRegion(getArguments(args), region);

    Mask mask = session.getMask();
    Mask sourceMask = session.getSourceMask();
    session.setMask((Mask) null);
    session.setSourceMask((Mask) null);
    BaseBiome biome = null;
    if (args.argsLength() >= 1) {
        BiomeRegistry biomeRegistry = player.getWorld().getWorldData().getBiomeRegistry();
        List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
        biome = Biomes.findBiomeByName(knownBiomes, args.getString(0), biomeRegistry);
    }
    Long seed = args.argsLength() != 2 || !MathMan.isInteger(args.getString(1)) ? null : Long.parseLong(args.getString(1));
    editSession.regenerate(region, biome, seed);
    session.setMask(mask);
    session.setSourceMask(mask);
    if (!player.hasPermission("fawe.tips")) {
        BBC.COMMAND_REGEN_2.send(player);
    } else if (biome == null) {
        BBC.COMMAND_REGEN_0.send(player);
        if (!FawePlayer.wrap(player).hasPermission("fawe.tips")) BBC.TIP_REGEN_0.send(player);
    } else if (seed == null) {
        BBC.COMMAND_REGEN_1.send(player);
        if (!FawePlayer.wrap(player).hasPermission("fawe.tips")) BBC.TIP_REGEN_1.send(player);
    } else {
        BBC.COMMAND_REGEN_2.send(player);
    }
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:43,
代码来源:RegionCommands.java

示例32: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(net.minecraft.world.World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.getWorldInfo().getSeed();
            boolean result;
            ChunkGeneratorOverworld generator = new ChunkGeneratorOverworld(nmsWorld, seed, false, "");
            net.minecraft.world.biome.Biome base = net.minecraft.world.biome.Biome.getBiome(biome.getId());
            net.minecraft.world.biome.Biome[] existingBiomes = new net.minecraft.world.biome.Biome[256];
            Arrays.fill(existingBiomes, base);
            fieldBiomes.set(generator, existingBiomes);
            IChunkGenerator existingGenerator = (IChunkGenerator) fieldChunkGenerator.get(nmsWorld.getChunkProvider());
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.provider.getBiomeProvider());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.provider.getBiomeProvider());
                fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), genLayer);
                fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), genLayer);

                fieldSeed.set(nmsWorld.getWorldInfo(), seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.provider.getBiomeProvider(), new BiomeCache(this.nmsWorld.provider.getBiomeProvider()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), generator);

                result = regenerateChunk(world, x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), existingGenerator);

                fieldSeed.set(nmsWorld.getWorldInfo(), existingSeed);

                fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return regenerateChunk(world, x, z);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:47,
代码来源:SpongeQueue_1_12.java

示例33: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
    IChunkProvider provider = world.getChunkProvider();
    if (!(provider instanceof ChunkProviderServer)) {
        return false;
    }
    try {
        ChunkProviderServer chunkServer = (ChunkProviderServer) provider;
        IChunkGenerator gen = chunkServer.chunkGenerator;
        long pos = ChunkPos.chunkXZ2Int(x, z);
        Chunk mcChunk;
        if (chunkServer.chunkExists(x, z)) {
            mcChunk = chunkServer.loadChunk(x, z);
            mcChunk.onChunkUnload();
        }
        PlayerChunkMap playerManager = ((WorldServer) getWorld()).getPlayerChunkMap();
        List<EntityPlayerMP> oldWatchers = null;
        if (chunkServer.chunkExists(x, z)) {
            mcChunk = chunkServer.loadChunk(x, z);
            PlayerChunkMapEntry entry = playerManager.getEntry(x, z);
            if (entry != null) {
                Field fieldPlayers = PlayerChunkMapEntry.class.getDeclaredField("field_187283_c");
                fieldPlayers.setAccessible(true);
                oldWatchers = (List<EntityPlayerMP>) fieldPlayers.get(entry);
                playerManager.removeEntry(entry);
            }
            mcChunk.onChunkUnload();
        }
        try {
            Field droppedChunksSetField = chunkServer.getClass().getDeclaredField("field_73248_b");
            droppedChunksSetField.setAccessible(true);
            Set droppedChunksSet = (Set) droppedChunksSetField.get(chunkServer);
            droppedChunksSet.remove(pos);
        } catch (Throwable e) {
            MainUtil.handleError(e);
        }
        chunkServer.id2ChunkMap.remove(pos);
        mcChunk = gen.provideChunk(x, z);
        chunkServer.id2ChunkMap.put(pos, mcChunk);
        if (mcChunk != null) {
            mcChunk.onChunkLoad();
            mcChunk.populateChunk(chunkServer, chunkServer.chunkGenerator);
        }
        if (oldWatchers != null) {
            for (EntityPlayerMP player : oldWatchers) {
                playerManager.addPlayer(player);
            }
        }
        return true;
    } catch (Throwable t) {
        MainUtil.handleError(t);
        return false;
    }
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:55,
代码来源:ForgeQueue_All.java

示例34: getBiome

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public BaseBiome getBiome(Vector2D position) {
    int id = getLevel().getBiomeId(position.getBlockX(), position.getBlockZ());
    return new BaseBiome(id);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:6,
代码来源:NukkitWorld.java

示例35: regenerateChunk

点赞 2

import com.sk89q.worldedit.world.biome.BaseBiome; //导入依赖的package包/类
@Override
public boolean regenerateChunk(net.minecraft.world.World world, int x, int z, BaseBiome biome, Long seed) {
    if (biome != null) {
        try {
            if (seed == null) {
                seed = world.getSeed();
            }
            nmsWorld.getWorldInfo().getSeed();
            boolean result;
            ChunkProviderOverworld generator = new ChunkProviderOverworld(nmsWorld, seed, false, "");
            net.minecraft.world.biome.Biome base = net.minecraft.world.biome.Biome.getBiome(biome.getId());
            fieldBiomes.set(generator, new net.minecraft.world.biome.Biome[]{base});
            boolean cold = base.getTemperature() <= 1;
            IChunkGenerator existingGenerator = nmsWorld.getChunkProvider().chunkGenerator;
            long existingSeed = world.getSeed();
            {
                if (genLayer == null) genLayer = new MutableGenLayer(seed);
                genLayer.set(biome.getId());
                Object existingGenLayer1 = fieldGenLayer1.get(nmsWorld.provider.getBiomeProvider());
                Object existingGenLayer2 = fieldGenLayer2.get(nmsWorld.provider.getBiomeProvider());
                fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), genLayer);
                fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), genLayer);

                fieldSeed.set(nmsWorld.getWorldInfo(), seed);

                ReflectionUtils.setFailsafeFieldValue(fieldBiomeCache, this.nmsWorld.provider.getBiomeProvider(), new BiomeCache(this.nmsWorld.provider.getBiomeProvider()));

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), generator);

                result = regenerateChunk(world, x, z);

                ReflectionUtils.setFailsafeFieldValue(fieldChunkGenerator, this.nmsWorld.getChunkProvider(), existingGenerator);

                fieldSeed.set(nmsWorld.getWorldInfo(), existingSeed);

                fieldGenLayer1.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer1);
                fieldGenLayer2.set(nmsWorld.provider.getBiomeProvider(), existingGenLayer2);
            }
            return result;
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return regenerateChunk(world, x, z);
}
 

开发者ID:boy0001,
项目名称:FastAsyncWorldedit,
代码行数:46,
代码来源:ForgeQueue_All.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)