@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)); } }
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); } } }
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; } }
/** * 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(); }
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; }
/** * 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(); }
public InitBiomeGens(WorldType worldType, long seed, GenLayer[] original) { super(worldType); this.seed = seed; originalBiomeGens = original; setNewBiomeGens(original.clone()); }
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 }; }
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]; }
/** * 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; } }
public S07PacketRespawn(int dimensionIDIn, EnumDifficulty difficultyIn, WorldType worldTypeIn, WorldSettings.GameType gameTypeIn) { this.dimensionID = dimensionIDIn; this.difficulty = difficultyIn; this.gameType = gameTypeIn; this.worldType = worldTypeIn; }
/** * 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; } }
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; }
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]); } }
/** * 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]); } }
public SPacketRespawn(int dimensionIdIn, EnumDifficulty difficultyIn, WorldType worldTypeIn, GameType gameModeIn) { this.dimensionID = dimensionIdIn; this.difficulty = difficultyIn; this.gameType = gameModeIn; this.worldType = worldTypeIn; }
/** * 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); }
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); }
/** * 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); }
@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(); } }
@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()); }
@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()); }