當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。