/** * initializes and returns the chunk loader for the specified world provider */ public IChunkLoader getChunkLoader(WorldProvider provider) { File file1 = this.getWorldDirectory(); if (provider instanceof WorldProviderHell) { File file3 = new File(file1, "DIM-1"); file3.mkdirs(); return new AnvilChunkLoader(file3); } else if (provider instanceof WorldProviderEnd) { File file2 = new File(file1, "DIM1"); file2.mkdirs(); return new AnvilChunkLoader(file2); } else { return new AnvilChunkLoader(file1); } }
/** * initializes and returns the chunk loader for the specified world provider */ public IChunkLoader getChunkLoader(WorldProvider provider) { File file1 = this.getWorldDirectory(); if (provider instanceof WorldProviderHell) { File file3 = new File(file1, "DIM-1"); file3.mkdirs(); return new AnvilChunkLoader(file3, this.dataFixer); } else if (provider instanceof WorldProviderEnd) { File file2 = new File(file1, "DIM1"); file2.mkdirs(); return new AnvilChunkLoader(file2, this.dataFixer); } else { return new AnvilChunkLoader(file1, this.dataFixer); } }
/** * Gets the name of the current world the player is. * Returns "single player" is the player is playing single player. */ public String getWorldID() { if (lastResponse < lastRequest) { //No WorldInfo response so just use vanilla world names WorldProvider provider = Minecraft.getMinecraft().theWorld.provider; if (provider instanceof WorldProviderEnd) return "world_the_end"; else if (provider instanceof WorldProviderHell) return "world_nether"; else return "world"; } else return worldID; }
public static void init() { if (hasInit) { return; } hasInit = true; registerProviderType( 0, WorldProviderSurface.class, true); registerProviderType(-1, WorldProviderHell.class, true); registerProviderType( 1, WorldProviderEnd.class, false); registerDimension( 0, 0); registerDimension(-1, -1); registerDimension( 1, 1); }
/** * Returns the chunk loader with the provided world provider */ public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) { File var2 = this.getWorldDirectory(); File var3; if (par1WorldProvider instanceof WorldProviderHell) { var3 = new File(var2, "DIM-1"); var3.mkdirs(); return new AnvilChunkLoader(var3); } else if (par1WorldProvider instanceof WorldProviderEnd) { var3 = new File(var2, "DIM1"); var3.mkdirs(); return new AnvilChunkLoader(var3); } else { return new AnvilChunkLoader(var2); } }
public EntityLivingData func_110161_a(EntityLivingData p_110161_1_) { p_110161_1_ = super.func_110161_a(p_110161_1_); if(this.field_70170_p.field_73011_w instanceof WorldProviderHell && this.func_70681_au().nextInt(5) > 0) { this.field_70714_bg.func_75776_a(4, this.field_85038_e); this.func_82201_a(1); this.func_70062_b(0, new ItemStack(Item.field_77711_v)); this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(4.0D); } else { this.field_70714_bg.func_75776_a(4, this.field_85037_d); this.func_82164_bB(); this.func_82162_bC(); } this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * this.field_70170_p.func_110746_b(this.field_70165_t, this.field_70163_u, this.field_70161_v)); if(this.func_71124_b(4) == null) { Calendar var2 = this.field_70170_p.func_83015_S(); if(var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.field_70146_Z.nextFloat() < 0.25F) { this.func_70062_b(4, new ItemStack(this.field_70146_Z.nextFloat() < 0.1F?Block.field_72008_bf:Block.field_72061_ba)); this.field_82174_bp[4] = 0.0F; } } return p_110161_1_; }
/** * Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called * when entity is reloaded from nbt. Mainly used for initializing attributes and inventory */ public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { livingdata = super.onInitialSpawn(difficulty, livingdata); if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { this.tasks.addTask(4, this.aiAttackOnCollide); this.setSkeletonType(1); this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); } else { this.tasks.addTask(4, this.aiArrowAttack); this.setEquipmentBasedOnDifficulty(difficulty); this.setEnchantmentBasedOnDifficulty(difficulty); } this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * difficulty.getClampedAdditionalDifficulty()); if (this.getEquipmentInSlot(4) == null) { Calendar calendar = this.worldObj.getCurrentDate(); if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); this.equipmentDropChances[4] = 0.0F; } } return livingdata; }
public MusicTicker.MusicType getAmbientMusicType() { return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; }
@Nonnull public static BlockPos findSuitableSpawnpoint(World world) { WorldProvider provider = world.provider; BlockPos pos; // Likely end type dimensions if (provider.getDimensionType() == DimensionType.THE_END || provider instanceof WorldProviderEnd) { pos = provider.getSpawnCoordinate(); if (pos == null) { pos = getSuitableSpawnBlockInColumn(world, BlockPos.ORIGIN); } } // Likely nether type dimensions else if (provider.getDimensionType() == DimensionType.NETHER || provider instanceof WorldProviderHell || provider instanceof WorldProviderHellJED) { pos = findNetherSpawnpoint(world); } else if (world.getWorldInfo().getTerrainType() == WorldType.DEBUG_ALL_BLOCK_STATES) { pos = BlockPos.ORIGIN.up(64); } // Mostly overworld type dimensions else { pos = findOverworldSpawnpoint(world); } return pos; }
public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { this.tasks.addTask(4, this.aiAttackOnCollide); this.setSkeletonType(1); this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); } else { this.tasks.addTask(4, this.aiArrowAttack); this.addRandomArmor(); this.enchantEquipment(); } this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)); if (this.getEquipmentInSlot(4) == null) { Calendar var2 = this.worldObj.getCurrentDate(); if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F) { this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); this.equipmentDropChances[4] = 0.0F; } } return par1EntityLivingData; }
/** * @author jamierocks - 30th October 2016 * @reason Use the Canary directory structure */ @Overwrite public IChunkLoader getChunkLoader(WorldProvider provider) { if (provider instanceof WorldProviderHell) { return new AnvilChunkLoader(new File(this.getWorldDirectory(), this.getWorldDirectoryName() + "_" + DimensionType.NETHER.getName())); } else if (provider instanceof WorldProviderEnd) { return new AnvilChunkLoader(new File(this.getWorldDirectory(), this.getWorldDirectoryName() + "_" + DimensionType.END.getName())); } else { return new AnvilChunkLoader(new File(this.getWorldDirectory(), this.getWorldDirectoryName() + "_" + DimensionType.NORMAL.getName())); } }
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { this.tasks.addTask(4, this.aiAttackOnCollide); this.setSkeletonType(1); this.setCurrentItemOrArmor(0, new ItemStack(Item.swordStone)); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(4.0D); } else { this.tasks.addTask(4, this.aiArrowAttack); this.addRandomArmor(); this.enchantEquipment(); } this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); if (this.getCurrentItemOrArmor(4) == null) { Calendar calendar = this.worldObj.getCurrentDate(); if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); this.equipmentDropChances[4] = 0.0F; } } return par1EntityLivingData; }
public World(WorldServer worldMC) { this.worldMC = worldMC; if (worldMC.provider instanceof WorldProviderSurface) type = WorldType.OVERWORLD; else if (worldMC.provider instanceof WorldProviderHell) type = WorldType.NETHER; else if (worldMC.provider instanceof WorldProviderEnd) type = WorldType.END; else type = WorldType.CUSTOM; if (!worlds.contains(this)) worlds.add(this); }
public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { this.tasks.addTask(4, this.aiAttackOnCollide); this.setSkeletonType(1); this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); } else { this.tasks.addTask(4, this.aiArrowAttack); this.addRandomArmor(); this.enchantEquipment(); } this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)); if (this.getEquipmentInSlot(4) == null) { Calendar calendar = this.worldObj.getCurrentDate(); if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); this.equipmentDropChances[4] = 0.0F; } } return p_110161_1_; }
public IChunkLoader func_75763_a(WorldProvider p_75763_1_) { File var2 = this.func_75765_b(); File var3; if(p_75763_1_ instanceof WorldProviderHell) { var3 = new File(var2, "DIM-1"); var3.mkdirs(); return new AnvilChunkLoader(var3); } else if(p_75763_1_ instanceof WorldProviderEnd) { var3 = new File(var2, "DIM1"); var3.mkdirs(); return new AnvilChunkLoader(var3); } else { return new AnvilChunkLoader(var2); } }
public MusicTicker.MusicType getAmbientMusicType() { return this.player != null ? (this.player.world.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.player.world.provider instanceof WorldProviderEnd ? (this.ingameGUI.getBossOverlay().shouldPlayEndBossMusic() ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.player.capabilities.isCreativeMode && this.player.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; }
/** * Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called * when entity is reloaded from nbt. Mainly used for initializing attributes and inventory */ @Nullable public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) { livingdata = super.onInitialSpawn(difficulty, livingdata); if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { this.tasks.addTask(4, this.aiAttackOnCollide); this.setSkeletonType(SkeletonType.WITHER); this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD)); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D); } else { Biome biome = this.worldObj.getBiome(new BlockPos(this)); if (biome instanceof BiomeSnow && this.worldObj.canSeeSky(new BlockPos(this)) && this.rand.nextInt(5) != 0) { this.setSkeletonType(SkeletonType.STRAY); } this.tasks.addTask(4, this.aiArrowAttack); this.setEquipmentBasedOnDifficulty(difficulty); this.setEnchantmentBasedOnDifficulty(difficulty); } this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * difficulty.getClampedAdditionalDifficulty()); if (this.getItemStackFromSlot(EntityEquipmentSlot.HEAD) == null) { Calendar calendar = this.worldObj.getCurrentDate(); if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { this.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.LIT_PUMPKIN : Blocks.PUMPKIN)); this.inventoryArmorDropChances[EntityEquipmentSlot.HEAD.getIndex()] = 0.0F; } } return livingdata; }
public MusicTicker.MusicType getAmbientMusicType() { return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (this.ingameGUI.getBossOverlay().shouldPlayEndBossMusic() ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; }
@SuppressWarnings("unchecked") public static Class<? extends WorldProvider> getProviderClass(String providerClassName) { Class<? extends WorldProvider> providerClass; if (providerClassName.equals("WorldProviderSurfaceJED")) { providerClass = WorldProviderSurfaceJED.class; } else if (providerClassName.equals("WorldProviderHellJED")) { providerClass = WorldProviderHellJED.class; } else if (providerClassName.equals("WorldProviderEndJED")) { providerClass = WorldProviderEndJED.class; } else if (providerClassName.equals("WorldProviderSurface")) { providerClass = WorldProviderSurface.class; } else if (providerClassName.equals("WorldProviderHell")) { providerClass = WorldProviderHell.class; } else if (providerClassName.equals("WorldProviderEnd")) { providerClass = WorldProviderEnd.class; } else { try { providerClass = (Class<? extends WorldProvider>) Class.forName(providerClassName); } catch (Exception e) { JustEnoughDimensions.logger.error("Failed to get a WorldProvider class for '{}'", providerClassName); e.printStackTrace(); return null; } } return providerClass; }
public MusicTicker.MusicType func_147109_W() { return this.currentScreen instanceof GuiWinGame ? MusicTicker.MusicType.CREDITS : (this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU); }
/** * Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called * when entity is reloaded from nbt. Mainly used for initializing attributes and inventory */ @Nullable public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) { livingdata = super.onInitialSpawn(difficulty, livingdata); if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { this.tasks.addTask(4, this.aiAttackOnCollide); this.func_189768_a(SkeletonType.WITHER); this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD)); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D); } else { Biome biome = this.worldObj.getBiomeGenForCoords(new BlockPos(this)); if (biome instanceof BiomeSnow && this.worldObj.canSeeSky(new BlockPos(this)) && this.rand.nextInt(5) != 0) { this.func_189768_a(SkeletonType.STRAY); } this.tasks.addTask(4, this.aiArrowAttack); this.setEquipmentBasedOnDifficulty(difficulty); this.setEnchantmentBasedOnDifficulty(difficulty); } this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * difficulty.getClampedAdditionalDifficulty()); if (this.getItemStackFromSlot(EntityEquipmentSlot.HEAD) == null) { Calendar calendar = this.worldObj.getCurrentDate(); if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) { this.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.LIT_PUMPKIN : Blocks.PUMPKIN)); this.inventoryArmorDropChances[EntityEquipmentSlot.HEAD.getIndex()] = 0.0F; } } return livingdata; }