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


Java WorldType类代码示例

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


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

示例1: move

import net.minecraft.world.WorldType; //导入依赖的package包/类
@SubscribeEvent
public void move(TickEvent.PlayerTickEvent event) {
	

	if (event.player.world.isRemote) {
		//System.out.println("CLIENT "+event.player.world.getBiome(event.player.getPosition()).getBiomeName());

		return;
	}
	//System.out.println(event.player.world.getBiome(event.player.getPosition()).getBiomeName());
	if (CommonProxy.d == 0) {
		return;
	}
	World w = event.player.world;
	if (w != null && w.getWorldType() == WorldType.DEFAULT) {
		new SpawnTeleport(DimensionManager.getWorld(CommonProxy.d)).teleport(event.player, DimensionManager.getWorld(CommonProxy.d));
	}
}
 
开发者ID:trigg,项目名称:Firma,代码行数:19,代码来源:JoinHandler.java

示例2: addChunk

import net.minecraft.world.WorldType; //导入依赖的package包/类
public void addChunk(ChunkPos pos, World world, IBlockState state)
{
    populatedChunks.add(pos);
    if (world.getWorldType() == WorldType.FLAT)
    {
        return;
    }

    int cap = getSampleCount(state);
    for (int i = 0; i < cap; i++)
    {
        BlockPos p = getSamplePos(world, pos);

        if (world.getBlockState(p.down()).getBlock() instanceof BlockSample || world.getBlockState(p.down()).getBlock() instanceof BlockSampleVanilla)
        {
            continue;
        }
        if (Config.getInstance().generateSamplesInWater || !isMoist(world, p))
        {
            world.setBlockState(p, state);
        }
    }
}
 
开发者ID:oitsjustjose,项目名称:Geolosys,代码行数:24,代码来源:ChunkData.java

示例3: GenLayerBiome

import net.minecraft.world.WorldType; //导入依赖的package包/类
public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_)
{
    super(p_i45560_1_);
    this.parent = p_i45560_3_;

    if (p_i45560_4_ == WorldType.DEFAULT_1_1)
    {
        this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga};
        this.field_175973_g = null;
    }
    else if (p_i45560_4_ == WorldType.CUSTOMIZED)
    {
        this.field_175973_g = ChunkProviderSettings.Factory.jsonToFactory(p_i45560_5_).func_177864_b();
    }
    else
    {
        this.field_175973_g = null;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:GenLayerBiome.java

示例4: readPacketData

import net.minecraft.world.WorldType; //导入依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readInt();
    int i = buf.readUnsignedByte();
    this.hardcoreMode = (i & 8) == 8;
    i = i & -9;
    this.gameType = WorldSettings.GameType.getByID(i);
    this.dimension = buf.readByte();
    this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte());
    this.maxPlayers = buf.readUnsignedByte();
    this.worldType = WorldType.parseWorldType(buf.readStringFromBuffer(16));

    if (this.worldType == null)
    {
        this.worldType = WorldType.DEFAULT;
    }

    this.reducedDebugInfo = buf.readBoolean();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:S01PacketJoinGame.java

示例5: getModelFromBlockState

import net.minecraft.world.WorldType; //导入依赖的package包/类
public IBakedModel getModelFromBlockState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
    Block block = state.getBlock();

    if (worldIn.getWorldType() != WorldType.DEBUG_WORLD)
    {
        try
        {
            state = block.getActualState(state, worldIn, pos);
        }
        catch (Exception var6)
        {
            ;
        }
    }

    IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state);

    if (pos != null && this.gameSettings.allowBlockAlternatives && ibakedmodel instanceof WeightedBakedModel)
    {
        ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(pos));
    }

    return ibakedmodel;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:BlockRendererDispatcher.java

示例6: readPacketData

import net.minecraft.world.WorldType; //导入依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.playerId = buf.readInt();
    int i = buf.readUnsignedByte();
    this.hardcoreMode = (i & 8) == 8;
    i = i & -9;
    this.gameType = GameType.getByID(i);
    this.dimension = buf.readInt();
    this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte());
    this.maxPlayers = buf.readUnsignedByte();
    this.worldType = WorldType.parseWorldType(buf.readStringFromBuffer(16));

    if (this.worldType == null)
    {
        this.worldType = WorldType.DEFAULT;
    }

    this.reducedDebugInfo = buf.readBoolean();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:SPacketJoinGame.java

示例7: InitBiomeGens

import net.minecraft.world.WorldType; //导入依赖的package包/类
public InitBiomeGens(WorldType worldType, long seed, GenLayer[] original)
{
    super(worldType);
    this.seed = seed;
    originalBiomeGens = original;
    setNewBiomeGens(original.clone());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:WorldTypeEvent.java

示例8: initialize

import net.minecraft.world.WorldType; //导入依赖的package包/类
public static FirmaGenLayer[] initialize(long seed, WorldType worldTypeIn) {
	FirmaGenLayer continent = genContinent(0L, false);
	continent = new GenLayerDeepOcean(4L, continent);
	drawImage(512, continent, "8b Continents Done Deep Ocean");
	byte var4 = 4;

	// Create Biomes
	FirmaGenLayer continentCopy2 = FirmaGenLayerZoom.magnify(200L, continent, 0);
	FirmaGenLayer var17 = new FirmaGenLayerBiome(200L, continentCopy2, worldTypeIn);
	FirmaGenLayer lakes = new GenLayerLakes(200L, var17);
	continentCopy2 = FirmaGenLayerZoom.magnify(1000L, lakes, 2);
	FirmaGenLayer var18 = new GenLayerBiomeEdge(1000L, continentCopy2);
	for (int var7 = 0; var7 < var4; ++var7) {
		var18 = new FirmaGenLayerZoom(1000 + var7, var18);
		drawImage(512, var18, "18-" + var7 + " Zoom");
		if (var7 == 0)
			var18 = new FirmaGenLayerAddIsland(3L, var18);
		if (var7 == 1) {
			var18 = new FirmaGenLayerShore(1000L, var18);
			drawImage(512, var18, "18z Shore");
		}
	}

	// Create Rivers
	FirmaGenLayer riverCont = FirmaGenLayerZoom.magnify(1000L, continent, 2);
	riverCont = new FirmaGenLayerRiverInit(100L, riverCont);
	riverCont = FirmaGenLayerZoom.magnify(1000L, riverCont, 6);
	riverCont = new FirmaGenLayerRiver(1L, riverCont);
	riverCont = new FirmaGenLayerSmooth(1000L, riverCont);
	FirmaGenLayerSmoothBiome smoothContinent = new FirmaGenLayerSmoothBiome(1000L, var18);
	FirmaGenLayerRiverMix riverMix = new FirmaGenLayerRiverMix(100L, smoothContinent, riverCont);
	FirmaGenLayer finalCont = FirmaGenLayerZoom.magnify(1000L, riverMix, 2);
	finalCont = new FirmaGenLayerSmoothBiome(1001L, finalCont);
	riverMix.initWorldGenSeed(seed);
	finalCont.initWorldGenSeed(seed);
	drawImage(512, riverMix, "Biome 20");
	drawImage(512, finalCont, "Biome 21");
	return new FirmaGenLayer[] { riverMix, finalCont };
}
 
开发者ID:trigg,项目名称:Firma,代码行数:40,代码来源:FirmaGenLayer.java

示例9: WorldChunkManager

import net.minecraft.world.WorldType; //导入依赖的package包/类
public WorldChunkManager(long seed, WorldType p_i45744_3_, String p_i45744_4_)
{
    this();
    this.field_180301_f = p_i45744_4_;
    GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, p_i45744_3_, p_i45744_4_);
    this.genBiomes = agenlayer[0];
    this.biomeIndexLayer = agenlayer[1];
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:WorldChunkManager.java

示例10: getCanSpawnHere

import net.minecraft.world.WorldType; //导入依赖的package包/类
/**
 * Checks if the entity's current position is a valid location to spawn this entity.
 */
public boolean getCanSpawnHere()
{
    BlockPos blockpos = new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ));
    Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos);

    if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1)
    {
        return false;
    }
    else
    {
        if (this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL)
        {
            BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos);

            if (biomegenbase == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getLightFromNeighbors(new BlockPos(this)) <= this.rand.nextInt(8))
            {
                return super.getCanSpawnHere();
            }

            if (this.rand.nextInt(10) == 0 && chunk.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D)
            {
                return super.getCanSpawnHere();
            }
        }

        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:EntitySlime.java

示例11: S07PacketRespawn

import net.minecraft.world.WorldType; //导入依赖的package包/类
public S07PacketRespawn(int dimensionIDIn, EnumDifficulty difficultyIn, WorldType worldTypeIn, WorldSettings.GameType gameTypeIn)
{
    this.dimensionID = dimensionIDIn;
    this.difficulty = difficultyIn;
    this.gameType = gameTypeIn;
    this.worldType = worldTypeIn;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:S07PacketRespawn.java

示例12: readPacketData

import net.minecraft.world.WorldType; //导入依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.dimensionID = buf.readInt();
    this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte());
    this.gameType = WorldSettings.GameType.getByID(buf.readUnsignedByte());
    this.worldType = WorldType.parseWorldType(buf.readStringFromBuffer(16));

    if (this.worldType == null)
    {
        this.worldType = WorldType.DEFAULT;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:S07PacketRespawn.java

示例13: S01PacketJoinGame

import net.minecraft.world.WorldType; //导入依赖的package包/类
public S01PacketJoinGame(int entityIdIn, WorldSettings.GameType gameTypeIn, boolean hardcoreModeIn, int dimensionIn, EnumDifficulty difficultyIn, int maxPlayersIn, WorldType worldTypeIn, boolean reducedDebugInfoIn)
{
    this.entityId = entityIdIn;
    this.dimension = dimensionIn;
    this.difficulty = difficultyIn;
    this.gameType = gameTypeIn;
    this.maxPlayers = maxPlayersIn;
    this.hardcoreMode = hardcoreModeIn;
    this.worldType = worldTypeIn;
    this.reducedDebugInfo = reducedDebugInfoIn;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:S01PacketJoinGame.java

示例14: func_146319_h

import net.minecraft.world.WorldType; //导入依赖的package包/类
private void func_146319_h()
{
    this.btnGameMode.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + ": " + I18n.format("selectWorld.gameMode." + this.gameMode, new Object[0]);
    this.field_146323_G = I18n.format("selectWorld.gameMode." + this.gameMode + ".line1", new Object[0]);
    this.field_146328_H = I18n.format("selectWorld.gameMode." + this.gameMode + ".line2", new Object[0]);
    this.btnMapFeatures.displayString = I18n.format("selectWorld.mapFeatures", new Object[0]) + " ";

    if (this.field_146341_s)
    {
        this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.off", new Object[0]);
    }

    this.btnBonusItems.displayString = I18n.format("selectWorld.bonusItems", new Object[0]) + " ";

    if (this.field_146338_v && !this.field_146337_w)
    {
        this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.off", new Object[0]);
    }

    this.btnMapType.displayString = I18n.format("selectWorld.mapType", new Object[0]) + " " + I18n.format(WorldType.worldTypes[this.selectedIndex].getTranslateName(), new Object[0]);
    this.btnAllowCommands.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " ";

    if (this.allowCheats && !this.field_146337_w)
    {
        this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.off", new Object[0]);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:GuiCreateWorld.java

示例15: updateDisplayState

import net.minecraft.world.WorldType; //导入依赖的package包/类
/**
 * Sets displayed GUI elements according to the current settings state
 */
private void updateDisplayState()
{
    this.btnGameMode.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + ": " + I18n.format("selectWorld.gameMode." + this.gameMode, new Object[0]);
    this.gameModeDesc1 = I18n.format("selectWorld.gameMode." + this.gameMode + ".line1", new Object[0]);
    this.gameModeDesc2 = I18n.format("selectWorld.gameMode." + this.gameMode + ".line2", new Object[0]);
    this.btnMapFeatures.displayString = I18n.format("selectWorld.mapFeatures", new Object[0]) + " ";

    if (this.generateStructuresEnabled)
    {
        this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.off", new Object[0]);
    }

    this.btnBonusItems.displayString = I18n.format("selectWorld.bonusItems", new Object[0]) + " ";

    if (this.bonusChestEnabled && !this.hardCoreMode)
    {
        this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.off", new Object[0]);
    }

    this.btnMapType.displayString = I18n.format("selectWorld.mapType", new Object[0]) + " " + I18n.format(WorldType.WORLD_TYPES[this.selectedIndex].getTranslateName(), new Object[0]);
    this.btnAllowCommands.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " ";

    if (this.allowCheats && !this.hardCoreMode)
    {
        this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.on", new Object[0]);
    }
    else
    {
        this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.off", new Object[0]);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:43,代码来源:GuiCreateWorld.java


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