private BiomeProviderExP(long seed, WorldType worldTypeIn, String options)
{
this();
if (worldTypeIn == WorldType.CUSTOMIZED && !options.isEmpty())
{
this.settings = ChunkGeneratorSettings.Factory.jsonToFactory(options).build();
}
GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, worldTypeIn, this.settings);
agenlayer = getModdedBiomeGenerators(worldTypeIn, seed, agenlayer);
this.genBiomes = agenlayer[0];
this.biomeIndexLayer = agenlayer[1];
this.featureProvider = new FeatureProvider(seed);
}
java类net.minecraft.world.WorldType的实例源码
WorldTypeExP.java 文件源码
项目:ExPetrum
阅读 28
收藏 0
点赞 0
评论 0
GuiCreateWorld.java 文件源码
项目:CustomWorldGen
阅读 27
收藏 0
点赞 0
评论 0
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.create", new Object[0]), this.width / 2, 20, -1);
if (this.inMoreWorldOptionsDisplay)
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterSeed", new Object[0]), this.width / 2 - 100, 47, -6250336);
this.drawString(this.fontRendererObj, I18n.format("selectWorld.seedInfo", new Object[0]), this.width / 2 - 100, 85, -6250336);
if (this.btnMapFeatures.visible)
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.mapFeatures.info", new Object[0]), this.width / 2 - 150, 122, -6250336);
}
if (this.btnAllowCommands.visible)
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.allowCommands.info", new Object[0]), this.width / 2 - 150, 172, -6250336);
}
this.worldSeedField.drawTextBox();
if (WorldType.WORLD_TYPES[this.selectedIndex].showWorldInfoNotice())
{
this.fontRendererObj.drawSplitString(I18n.format(WorldType.WORLD_TYPES[this.selectedIndex].getTranslatedInfo(), new Object[0]), this.btnMapType.xPosition + 2, this.btnMapType.yPosition + 22, this.btnMapType.getButtonWidth(), 10526880);
}
}
else
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, 47, -6250336);
this.drawString(this.fontRendererObj, I18n.format("selectWorld.resultFolder", new Object[0]) + " " + this.saveDirName, this.width / 2 - 100, 85, -6250336);
this.worldNameField.drawTextBox();
this.drawString(this.fontRendererObj, this.gameModeDesc1, this.width / 2 - 100, 137, -6250336);
this.drawString(this.fontRendererObj, this.gameModeDesc2, this.width / 2 - 100, 149, -6250336);
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
EntitySlime.java 文件源码
项目:BaseClient
阅读 24
收藏 0
点赞 0
评论 0
/**
* 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;
}
}
S07PacketRespawn.java 文件源码
项目:BaseClient
阅读 22
收藏 0
点赞 0
评论 0
public S07PacketRespawn(int dimensionIDIn, EnumDifficulty difficultyIn, WorldType worldTypeIn, WorldSettings.GameType gameTypeIn)
{
this.dimensionID = dimensionIDIn;
this.difficulty = difficultyIn;
this.gameType = gameTypeIn;
this.worldType = worldTypeIn;
}
S07PacketRespawn.java 文件源码
项目:BaseClient
阅读 21
收藏 0
点赞 0
评论 0
/**
* 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;
}
}
S01PacketJoinGame.java 文件源码
项目:BaseClient
阅读 25
收藏 0
点赞 0
评论 0
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;
}
GuiCreateWorld.java 文件源码
项目:BaseClient
阅读 31
收藏 0
点赞 0
评论 0
/**
* Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.create", new Object[0]), this.width / 2, 20, -1);
if (this.field_146344_y)
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterSeed", new Object[0]), this.width / 2 - 100, 47, -6250336);
this.drawString(this.fontRendererObj, I18n.format("selectWorld.seedInfo", new Object[0]), this.width / 2 - 100, 85, -6250336);
if (this.btnMapFeatures.visible)
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.mapFeatures.info", new Object[0]), this.width / 2 - 150, 122, -6250336);
}
if (this.btnAllowCommands.visible)
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.allowCommands.info", new Object[0]), this.width / 2 - 150, 172, -6250336);
}
this.field_146335_h.drawTextBox();
if (WorldType.worldTypes[this.selectedIndex].showWorldInfoNotice())
{
this.fontRendererObj.drawSplitString(I18n.format(WorldType.worldTypes[this.selectedIndex].func_151359_c(), new Object[0]), this.btnMapType.xPosition + 2, this.btnMapType.yPosition + 22, this.btnMapType.getButtonWidth(), 10526880);
}
}
else
{
this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, 47, -6250336);
this.drawString(this.fontRendererObj, I18n.format("selectWorld.resultFolder", new Object[0]) + " " + this.field_146336_i, this.width / 2 - 100, 85, -6250336);
this.field_146333_g.drawTextBox();
this.drawString(this.fontRendererObj, this.field_146323_G, this.width / 2 - 100, 137, -6250336);
this.drawString(this.fontRendererObj, this.field_146328_H, this.width / 2 - 100, 149, -6250336);
}
super.drawScreen(mouseX, mouseY, partialTicks);
}
WorldServerProxy.java 文件源码
项目:UniversalRemote
阅读 23
收藏 0
点赞 0
评论 0
@Override
public WorldType getWorldType() {
if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
return m_proxyWorld.getWorldType();
} else if (m_realWorld != null) {
return m_realWorld.getWorldType();
} else {
return super.getWorldType();
}
}
DefaultWorldGeneratorImplementation.java 文件源码
项目:Proyecto-DASI
阅读 23
收藏 0
点赞 0
评论 0
@Override
public boolean createWorld(MissionInit missionInit)
{
long seed = getWorldSeedFromString(this.dwparams.getSeed());
WorldType.worldTypes[0].onGUICreateWorldPress();
WorldSettings worldsettings = new WorldSettings(seed, GameType.SURVIVAL, true, false, WorldType.worldTypes[0]);
worldsettings.setWorldName("");
worldsettings.enableCommands();
// Create a filename for this map - we use the time stamp to make sure it is different from other worlds, otherwise no new world
// will be created, it will simply load the old one.
return MapFileHelper.createAndLaunchWorld(worldsettings, this.dwparams.isDestroyAfterUse());
}
FlatWorldGeneratorImplementation.java 文件源码
项目:Proyecto-DASI
阅读 20
收藏 0
点赞 0
评论 0
@Override
public boolean createWorld(MissionInit missionInit)
{
long seed = DefaultWorldGeneratorImplementation.getWorldSeedFromString(this.fwparams.getSeed());
WorldSettings worldsettings = new WorldSettings(seed, GameType.SURVIVAL, false, false, WorldType.FLAT);
// This call to setWorldName allows us to specify the layers of our world, and also the features that will be created.
// This website provides a handy way to generate these strings: http://chunkbase.com/apps/superflat-generator
worldsettings.setWorldName(this.fwparams.getGeneratorString());
worldsettings.enableCommands(); // Enables cheat commands.
// Create a filename for this map - we use the time stamp to make sure it is different from other worlds, otherwise no new world
// will be created, it will simply load the old one.
return MapFileHelper.createAndLaunchWorld(worldsettings, this.fwparams.isDestroyAfterUse());
}