diff --git a/changelog.txt b/changelog.txt index aac7053..8d49e41 100644 --- a/changelog.txt +++ b/changelog.txt @@ -203,7 +203,7 @@ 1.2: Added biomes to Deep Underground For performance reasons, most of the gravel generation has been removed from the deep underground dimension. - Liquid Redstone now generate underground in lakes + Liquid Redstone now generates underground in lakes Added Glowing Ice Optimized the DU and DV chunk generators @@ -223,3 +223,6 @@ 1.3 (Cave Update): Improved cave generation (thank you for the idea, u/SaveThePhytoplankton!) + Added 2 easter eggs + Added underground villages + Optimized ore generation diff --git a/src/.directory b/src/.directory new file mode 100644 index 0000000..2c5c88b --- /dev/null +++ b/src/.directory @@ -0,0 +1,3 @@ +[Dolphin] +Timestamp=2018,7,23,17,33,53 +Version=4 diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/RSDoor.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/RSDoor.java index 2952187..3376821 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/RSDoor.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/RSDoor.java @@ -179,9 +179,7 @@ public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, Ent BlockPos blockpos = pos.down(); BlockPos blockpos1 = pos.up(); if (player.capabilities.isCreativeMode && state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER && worldIn.getBlockState(blockpos).getBlock() == this) - { worldIn.setBlockToAir(blockpos); - } if (state.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER && worldIn.getBlockState(blockpos1).getBlock() == this) { if (player.capabilities.isCreativeMode) diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/DiamondButtonTicks.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/DiamondButtonTicks.java index 5732d3f..7c12c6a 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/DiamondButtonTicks.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/DiamondButtonTicks.java @@ -83,9 +83,7 @@ public boolean canPlaceBlockAt(World worldIn, BlockPos pos) for (EnumFacing enumfacing : EnumFacing.values()) { if (canPlaceBlock(worldIn, pos, enumfacing)) - { return true; - } } return false; } @@ -111,9 +109,7 @@ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Bloc private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { if (canPlaceBlockAt(worldIn, pos)) - { return true; - } else { dropBlockAsItem(worldIn, pos, state, 0); @@ -147,9 +143,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (state.getValue(POWERED).booleanValue()) - { return true; - } else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); @@ -166,9 +160,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (state.getValue(POWERED).booleanValue()) - { notifyNeighbors(worldIn, pos, state.getValue(FACING)); - } super.breakBlock(worldIn, pos, state); } @Override @@ -198,9 +190,7 @@ public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random ra if (state.getValue(POWERED).booleanValue()) { if (wooden) - { checkPressed(state, worldIn, pos); - } else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); @@ -219,9 +209,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s if (wooden) { if (!state.getValue(POWERED).booleanValue()) - { checkPressed(state, worldIn, pos); - } } } } @@ -245,9 +233,7 @@ private void checkPressed(IBlockState p_185616_1_, World p_185616_2_, BlockPos p playReleaseSound(p_185616_2_, p_185616_3_); } if (flag) - { p_185616_2_.scheduleUpdate(new BlockPos(p_185616_3_), this, tickRate(p_185616_2_)); - } } private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing) { @@ -307,9 +293,7 @@ public int getMetaFromState(IBlockState state) i = 0; } if (state.getValue(POWERED).booleanValue()) - { i |= 8; - } return i; } @Override diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/EmeraldButtonTicks.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/EmeraldButtonTicks.java index 02fd982..26b5698 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/EmeraldButtonTicks.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/EmeraldButtonTicks.java @@ -84,9 +84,7 @@ public boolean canPlaceBlockAt(World worldIn, BlockPos pos) for (EnumFacing enumfacing : EnumFacing.values()) { if (canPlaceBlock(worldIn, pos, enumfacing)) - { return true; - } } return false; } @@ -112,9 +110,7 @@ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Bloc private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { if (canPlaceBlockAt(worldIn, pos)) - { return true; - } else { dropBlockAsItem(worldIn, pos, state, 0); @@ -148,9 +144,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (state.getValue(POWERED).booleanValue()) - { return true; - } else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); @@ -167,9 +161,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (state.getValue(POWERED).booleanValue()) - { notifyNeighbors(worldIn, pos, state.getValue(FACING)); - } super.breakBlock(worldIn, pos, state); } @Override @@ -199,9 +191,7 @@ public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random ra if (state.getValue(POWERED).booleanValue()) { if (wooden) - { checkPressed(state, worldIn, pos); - } else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); @@ -220,9 +210,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s if (wooden) { if (!state.getValue(POWERED).booleanValue()) - { checkPressed(state, worldIn, pos); - } } } } @@ -246,9 +234,7 @@ private void checkPressed(IBlockState p_185616_1_, World p_185616_2_, BlockPos p this.playReleaseSound(p_185616_2_, p_185616_3_); } if (flag) - { p_185616_2_.scheduleUpdate(new BlockPos(p_185616_3_), this, this.tickRate(p_185616_2_)); - } } private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing) { @@ -309,9 +295,7 @@ public int getMetaFromState(IBlockState state) i = 0; } if (state.getValue(POWERED).booleanValue()) - { i |= 8; - } return i; } @Override diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/IronButtonTicks.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/IronButtonTicks.java index e5c8ae8..12c4a4c 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/IronButtonTicks.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/IronButtonTicks.java @@ -83,9 +83,7 @@ public boolean canPlaceBlockAt(World worldIn, BlockPos pos) for (EnumFacing enumfacing : EnumFacing.values()) { if (canPlaceBlock(worldIn, pos, enumfacing)) - { return true; - } } return false; } @@ -111,9 +109,7 @@ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Bloc private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { if (canPlaceBlockAt(worldIn, pos)) - { return true; - } else { dropBlockAsItem(worldIn, pos, state, 0); @@ -148,9 +144,7 @@ public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, Bloc public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (state.getValue(POWERED).booleanValue()) - { return true; - } else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); @@ -167,9 +161,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (state.getValue(POWERED).booleanValue()) - { notifyNeighbors(worldIn, pos, state.getValue(FACING)); - } super.breakBlock(worldIn, pos, state); } @Override @@ -199,9 +191,7 @@ public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random ra if (state.getValue(POWERED).booleanValue()) { if (wooden) - { checkPressed(state, worldIn, pos); - } else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); @@ -220,9 +210,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s if (wooden) { if (!state.getValue(POWERED).booleanValue()) - { checkPressed(state, worldIn, pos); - } } } } @@ -246,9 +234,7 @@ private void checkPressed(IBlockState p_185616_1_, World p_185616_2_, BlockPos p playReleaseSound(p_185616_2_, p_185616_3_); } if (flag) - { p_185616_2_.scheduleUpdate(new BlockPos(p_185616_3_), this, tickRate(p_185616_2_)); - } } private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing) { @@ -310,9 +296,7 @@ public int getMetaFromState(IBlockState state) i = 0; } if (state.getValue(POWERED).booleanValue()) - { i |= 8; - } return i; } @Override diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/QuickButton.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/QuickButton.java index af8b8b7..ac1c431 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/QuickButton.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/buttonTicks/QuickButton.java @@ -85,9 +85,8 @@ public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) @Override public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { for (EnumFacing enumfacing : EnumFacing.values()) { - if (canPlaceBlock(worldIn, pos, enumfacing)) { + if (canPlaceBlock(worldIn, pos, enumfacing)) return true; - } } return false; } @@ -112,9 +111,9 @@ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Bloc } } private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) { - if (canPlaceBlockAt(worldIn, pos)) { + if (canPlaceBlockAt(worldIn, pos)) return true; - } else { + else { dropBlockAsItem(worldIn, pos, state, 0); worldIn.setBlockToAir(pos); return false; @@ -182,9 +181,9 @@ public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random ra public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (!worldIn.isRemote) { if (state.getValue(POWERED).booleanValue()) { - if (wooden) { + if (wooden) checkPressed(state, worldIn, pos); - } else { + else { worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); notifyNeighbors(worldIn, pos, state.getValue(FACING)); playReleaseSound(worldIn, pos); @@ -197,9 +196,8 @@ public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random ra public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { if (wooden) { - if (!state.getValue(POWERED).booleanValue()) { + if (!state.getValue(POWERED).booleanValue()) checkPressed(state, worldIn, pos); - } } } } @@ -220,9 +218,8 @@ private void checkPressed(IBlockState p_185616_1_, World p_185616_2_, BlockPos p p_185616_2_.markBlockRangeForRenderUpdate(p_185616_3_, p_185616_3_); playReleaseSound(p_185616_2_, p_185616_3_); } - if (flag) { + if (flag) p_185616_2_.scheduleUpdate(new BlockPos(p_185616_3_), this, tickRate(p_185616_2_)); - } } private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing) { worldIn.notifyNeighborsOfStateChange(pos, this, false); @@ -277,9 +274,8 @@ public int getMetaFromState(IBlockState state) { case DOWN: i = 0; } - if (state.getValue(POWERED).booleanValue()) { + if (state.getValue(POWERED).booleanValue()) i |= 8; - } return i; } @Override diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/planks.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/planks.java index c2f4c61..4aa6a70 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/planks.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/planks.java @@ -34,9 +34,7 @@ public int damageDropped(IBlockState state) public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { for (planks.EnumType blockplanks$enumtype : planks.EnumType.values()) - { list.add(new ItemStack(itemIn, 1, blockplanks$enumtype.getMetadata())); - } } @Override public IBlockState getStateFromMeta(int meta) @@ -92,9 +90,7 @@ public String toString() public static planks.EnumType byMetadata(int meta) { if (meta < 0 || meta >= META_LOOKUP.length) - { meta = 0; - } return META_LOOKUP[meta]; } @Override @@ -109,9 +105,7 @@ public String getUnlocalizedName() static { for (planks.EnumType blockplanks$enumtype : values()) - { META_LOOKUP[blockplanks$enumtype.getMetadata()] = blockplanks$enumtype; - } } } } \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/BedrockPlateCode.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/BedrockPlateCode.java index 95fb841..d250702 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/BedrockPlateCode.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/BedrockPlateCode.java @@ -41,25 +41,17 @@ protected IBlockState setRedstoneStrength(IBlockState state, int strength) protected void playClickOnSound(World worldIn, BlockPos color) { if (blockMaterial == Material.WOOD) - { worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.8F); - } else - { worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F); - } } @Override protected void playClickOffSound(World worldIn, BlockPos pos) { if (blockMaterial == Material.WOOD) - { worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.7F); - } else - { worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.5F); - } } @Override protected int computeRedstoneStrength(World worldIn, BlockPos pos) @@ -85,9 +77,7 @@ protected int computeRedstoneStrength(World worldIn, BlockPos pos) for (Entity entity : list) { if (!entity.doesEntityNotTriggerPressurePlate()) - { return 15; - } } } return 0; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/DiamondPlateCode.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/DiamondPlateCode.java index 848ed71..1e73446 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/DiamondPlateCode.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/DiamondPlateCode.java @@ -41,25 +41,17 @@ protected IBlockState setRedstoneStrength(IBlockState state, int strength) protected void playClickOnSound(World worldIn, BlockPos color) { if (blockMaterial == Material.WOOD) - { worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.8F); - } else - { worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F); - } } @Override protected void playClickOffSound(World worldIn, BlockPos pos) { if (blockMaterial == Material.WOOD) - { worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.7F); - } else - { worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.5F); - } } @Override protected int computeRedstoneStrength(World worldIn, BlockPos pos) @@ -83,9 +75,7 @@ protected int computeRedstoneStrength(World worldIn, BlockPos pos) for (Entity entity : list) { if (!entity.doesEntityNotTriggerPressurePlate()) - { return 7; - } } } return 0; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/EmeraldPlateCode.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/EmeraldPlateCode.java index 1a99ca0..8ada4e3 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/EmeraldPlateCode.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/pressurePlates/EmeraldPlateCode.java @@ -41,25 +41,17 @@ protected IBlockState setRedstoneStrength(IBlockState state, int strength) protected void playClickOnSound(World worldIn, BlockPos color) { if (blockMaterial == Material.WOOD) - { worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.8F); - } else - { worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F); - } } @Override protected void playClickOffSound(World worldIn, BlockPos pos) { if (blockMaterial == Material.WOOD) - { worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.7F); - } else - { worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.5F); - } } @Override protected int computeRedstoneStrength(World worldIn, BlockPos pos) @@ -83,9 +75,7 @@ protected int computeRedstoneStrength(World worldIn, BlockPos pos) for (Entity entity : list) { if (!entity.doesEntityNotTriggerPressurePlate()) - { return 5; - } } } return 0; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/xmasTree.java b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/xmasTree.java index 28bf9e9..61bdbf4 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/xmasTree.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/CustomBlockCode/xmasTree.java @@ -104,9 +104,7 @@ public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random worldIn.setBlockState(pos.add(i + 1, 0, j + 1), iblockstate2, 4); } else - { worldIn.setBlockState(pos, iblockstate2, 4); - } if (!worldgenerator.generate(worldIn, rand, pos.add(i, 0, j))) { if (flag) @@ -138,9 +136,7 @@ public int damageDropped(IBlockState state) public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { for (planks.EnumType planks$enumtype : planks.EnumType.values()) - { list.add(new ItemStack(itemIn, 1, planks$enumtype.getMetadata())); - } } @Override public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) diff --git a/src/main/java/com/NetherNoah/ParadiseMod/GUI/ContainerCustomCraftBench.java b/src/main/java/com/NetherNoah/ParadiseMod/GUI/ContainerCustomCraftBench.java index 4becc18..d06fbc1 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/GUI/ContainerCustomCraftBench.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/GUI/ContainerCustomCraftBench.java @@ -46,5 +46,5 @@ else if (!mergeItemStack(slotStack, 10, 46, false)) @Override public boolean canInteractWith(EntityPlayer arg0) { return true; - } + } } \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/ParadiseMod.java b/src/main/java/com/NetherNoah/ParadiseMod/ParadiseMod.java index 3eac39f..054e26d 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/ParadiseMod.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/ParadiseMod.java @@ -37,13 +37,15 @@ import com.NetherNoah.ParadiseMod.tileentity.hopper.TileEntityGoldHopper; import com.NetherNoah.ParadiseMod.tileentity.hopper.TileEntitySilverHopper; import com.NetherNoah.ParadiseMod.world.dimension.DimensionRegistry; +import com.NetherNoah.ParadiseMod.world.worldgen.misc.DUTrees; import com.NetherNoah.ParadiseMod.world.worldgen.misc.DirtGen; import com.NetherNoah.ParadiseMod.world.worldgen.misc.Rose; import com.NetherNoah.ParadiseMod.world.worldgen.ores.OreGenEnd; import com.NetherNoah.ParadiseMod.world.worldgen.ores.OreGenNether; import com.NetherNoah.ParadiseMod.world.worldgen.ores.OreGenOverworld; import com.NetherNoah.ParadiseMod.world.worldgen.structures.Buoy; -import com.NetherNoah.ParadiseMod.world.worldgen.structures.DUTrees; +import com.NetherNoah.ParadiseMod.world.worldgen.structures.EasterEgg; +import com.NetherNoah.ParadiseMod.world.worldgen.structures.EasterEgg2; import com.NetherNoah.ParadiseMod.world.worldgen.structures.GiantGrassBlock; import com.NetherNoah.ParadiseMod.world.worldgen.structures.Home; import com.NetherNoah.ParadiseMod.world.worldgen.structures.Ocean; @@ -52,6 +54,7 @@ import com.NetherNoah.ParadiseMod.world.worldgen.structures.Runway; import com.NetherNoah.ParadiseMod.world.worldgen.structures.SkyWheel; import com.NetherNoah.ParadiseMod.world.worldgen.structures.TreasureChest; +import com.NetherNoah.ParadiseMod.world.worldgen.structures.UndergroundVillage; import com.NetherNoah.ParadiseMod.world.worldgen.structures.WickerMan; import com.NetherNoah.ParadiseMod.world.worldgen.structures.AttieCat.JeffTank; import com.NetherNoah.ParadiseMod.world.worldgen.structures.AttieCat.Shrine; @@ -193,12 +196,18 @@ public void preInit(FMLPreInitializationEvent event) { new Rose(), //trees in the Deep Underground - new DUTrees() + new DUTrees(), + + //easter egg + new EasterEgg(), + new EasterEgg2(), + + //underground villages + new UndergroundVillage() }; - for(int i=0;i= 19) { + if (blockToReplace == Blocks.STONE && blockAbove == Blocks.AIR && y >= 19) theChunk.setBlockState(new BlockPos(x, y, z), Blocks.GRASS.getDefaultState()); - } - //vines - if (blockToReplace == Blocks.STONE&&(jungle||swamp)&&y>=20) { + // vines + if (blockToReplace == Blocks.STONE&&y>=19) { // east - if (theChunk.getBlockState(x + 1, y, z).getBlock() == Blocks.AIR&& rand.nextInt(10) == 0) + if (theChunk.getBlockState(x + 1, y, z).getBlock() == Blocks.AIR&& rand.nextInt(10) == 0&&x!=15) theChunk.setBlockState(new BlockPos(x + 1, y, z),Blocks.VINE.getDefaultState().withProperty(BlockVine.WEST, true)); // west - if ( theChunk.getBlockState(x - 1, y, z).getBlock() == Blocks.AIR&& rand.nextInt(10) == 0) + if (theChunk.getBlockState(x - 1, y, z).getBlock() == Blocks.AIR && rand.nextInt(10) == 0&&x!=0) theChunk.setBlockState(new BlockPos(x - 1, y, z),Blocks.VINE.getDefaultState().withProperty(BlockVine.EAST, true)); // south - if (theChunk.getBlockState(x, y, z + 1).getBlock() == Blocks.AIR && rand.nextInt(10) == 0) + if (theChunk.getBlockState(x, y, z + 1).getBlock() == Blocks.AIR && rand.nextInt(10) == 0&&z!=15) theChunk.setBlockState(new BlockPos(x, y, z + 1),Blocks.VINE.getDefaultState().withProperty(BlockVine.NORTH, true)); // north - if ( blockToReplace == Blocks.STONE&& theChunk.getBlockState(x, y, z - 1).getBlock() == Blocks.AIR&& rand.nextInt(10) == 0) - theChunk.setBlockState(new BlockPos(x, y, z - 1), Blocks.VINE.getDefaultState().withProperty(BlockVine.SOUTH, true)); + if (theChunk.getBlockState(x, y, z - 1).getBlock() == Blocks.AIR && rand.nextInt(10) == 0&&z!=0) + theChunk.setBlockState(new BlockPos(x, y, z - 1),Blocks.VINE.getDefaultState().withProperty(BlockVine.SOUTH, true)); } - + } - //swamp only features + // swamp only features if (swamp) { - //replace some of the grass with slime - if(blockToReplace==Blocks.GRASS&&(rand.nextInt(10)==0)&&y<56) - theChunk.setBlockState(new BlockPos(x, y, z), Blocks.SLIME_BLOCK.getDefaultState()); - //tall grass - if(blockToReplace==Blocks.GRASS&&rand.nextInt(5)==0&&y<56) - theChunk.setBlockState(new BlockPos(x, y+1, z), Blocks.TALLGRASS.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS)); + + // replace some of the grass with slime + if (blockToReplace == Blocks.GRASS && (rand.nextInt(10) == 0) && y < height) + theChunk.setBlockState(new BlockPos(x, y, z), Blocks.SLIME_BLOCK.getDefaultState()); + + // tall grass + if (blockToReplace == Blocks.GRASS && rand.nextInt(2) == 0 && y < height) + theChunk.setBlockState(new BlockPos(x, y + 1, z), Blocks.TALLGRASS.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS)); } - - //mushroom island only features + + // mushroom island only features if (mushroom) { // replace ground stone with mycelium - if ( blockToReplace == Blocks.STONE && blockAbove == Blocks.AIR) { + if (blockToReplace == Blocks.STONE && blockAbove == Blocks.AIR) theChunk.setBlockState(new BlockPos(x, y, z), Blocks.MYCELIUM.getDefaultState()); - } - //little mushrooms - if(blockToReplace==Blocks.MYCELIUM&&y<56&&rand.nextInt(4)==0) { - BlockPos pos = new BlockPos(x, y+1, z); - theChunk.setBlockState(pos, Blocks.RED_MUSHROOM.getDefaultState()); - } + // little mushrooms + // red + if (blockToReplace == Blocks.MYCELIUM && y < height && rand.nextInt(4) == 0) + theChunk.setBlockState(new BlockPos(x, y + 1, z), Blocks.RED_MUSHROOM.getDefaultState()); + + // brown + if (blockToReplace == Blocks.MYCELIUM && y < height && rand.nextInt(2) == 0) + theChunk.setBlockState(new BlockPos(x, y + 1, z), Blocks.BROWN_MUSHROOM.getDefaultState()); - if(blockToReplace==Blocks.MYCELIUM&&y<56&&rand.nextInt(2)==0) { - BlockPos pos = new BlockPos(x, y+1, z); - theChunk.setBlockState(pos, Blocks.BROWN_MUSHROOM.getDefaultState()); + // the cave is a giant mushroom! + if (blockToReplace == Blocks.STONE && blockBelow == Blocks.AIR) { + int a = 1; + theChunk.setBlockState(new BlockPos(x, y, z), Blocks.BROWN_MUSHROOM_BLOCK.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.CENTER)); + if (rand.nextInt(20) == 0) { + Block blockToReplace2 = theChunk.getBlockState(x, y - 1, z).getBlock(); + while (blockToReplace2 == Blocks.AIR || blockToReplace2 == Blocks.WATER|| blockToReplace2 == Blocks.FLOWING_LAVA|| blockToReplace2 == Blocks.FLOWING_WATER || blockToReplace2 == Blocks.LAVA) { + theChunk.setBlockState(new BlockPos(x, y - a, z),Blocks.BROWN_MUSHROOM_BLOCK.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM)); + a++; + blockToReplace2 = theChunk.getBlockState(x, y - a, z).getBlock(); + } + } } - } - //shrubs in mesa and desert biomes - if((mesa||desert)&&(blockToReplace==Blocks.HARDENED_CLAY||blockToReplace==Blocks.STAINED_HARDENED_CLAY||blockToReplace==Blocks.SANDSTONE)&&blockAbove==Blocks.AIR&&rand.nextInt(5)==0&&y<56) - theChunk.setBlockState(new BlockPos(x, y+1, z), Blocks.DEADBUSH.getDefaultState()); - - //generate lots of crystals - if(rand.nextInt(2)==0&&crystal&&(blockToReplace == Blocks.STONE || blockToReplace == Blocks.SANDSTONE|| blockToReplace == Blocks.PACKED_ICE || blockToReplace == Blocks.HARDENED_CLAY|| blockToReplace == Blocks.STAINED_HARDENED_CLAY||blockToReplace==Blocks.MYCELIUM||blockToReplace==Blocks.GRASS)&&blockAbove==Blocks.AIR&&y 0) } } - /** - * Generates the chunk at the specified position, from scratch - */ @Override public Chunk generateChunk(int x, int z) { @@ -334,16 +331,11 @@ public void populate(int x, int z) if (net.minecraftforge.event.terraingen.TerrainGen.decorate(world, rand, blockpos,DecorateBiomeEvent.Decorate.EventType.SHROOM)) { if (rand.nextBoolean()) { //crystals - quartzGen.generate(world, rand, - blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); - diamondGen.generate(world, rand, - blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); - emeraldGen.generate(world, rand, - blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); - redstoneGen.generate(world, rand, - blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); - rubyGen.generate(world, rand, - blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); + quartzGen.generate(world, rand, blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); + diamondGen.generate(world, rand,blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); + emeraldGen.generate(world, rand,blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); + redstoneGen.generate(world, rand,blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); + rubyGen.generate(world, rand,blockpos.add(rand.nextInt(16) + 8, rand.nextInt(256), rand.nextInt(16) + 8)); } } if (TerrainGen.generateOre(world, rand, coalGen, blockpos,OreGenEvent.GenerateMinable.EventType.QUARTZ)) @@ -357,9 +349,6 @@ public void populate(int x, int z) } } - /** - * Called to generate additional structures after initial worldgen, used by ocean monuments - */ @Override public boolean generateStructures(Chunk chunkIn, int x, int z) { diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/dimension/DimTeleporter.java b/src/main/java/com/NetherNoah/ParadiseMod/world/dimension/DimTeleporter.java index 98745bc..b64b646 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/dimension/DimTeleporter.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/dimension/DimTeleporter.java @@ -263,9 +263,7 @@ public boolean makePortal(Entity entityIn) int k5 = l2 + (k4 - 1) * i4 - j4 * l3; blockpos$mutableblockpos.setPos(i5, j5, k5); if (l4 < 0 && !worldServerInstance.getBlockState(blockpos$mutableblockpos).getMaterial().isSolid() || l4 >= 0 && !worldServerInstance.isAirBlock(blockpos$mutableblockpos)) - { continue label146; - } } } } diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDUCaves.java b/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDUCaves.java index b39b3b5..133347e 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDUCaves.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDUCaves.java @@ -20,7 +20,7 @@ public class MapGenDUCaves extends MapGenBase{ protected static final IBlockState WATER = Blocks.WATER.getDefaultState(); protected void addRoom(long p_180703_1_, int p_180703_3_, int p_180703_4_, ChunkPrimer primer, double p_180703_6_, double p_180703_8_, double p_180703_10_){ - this.addTunnel(p_180703_1_, p_180703_3_, p_180703_4_, primer, p_180703_6_, p_180703_8_, p_180703_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + addTunnel(p_180703_1_, p_180703_3_, p_180703_4_, primer, p_180703_6_, p_180703_8_, p_180703_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); } protected void addTunnel(long p_180702_1_, int p_180702_3_, int p_180702_4_, ChunkPrimer primer, double p_180702_6_, double p_180702_8_, double p_180702_10_, float p_180702_12_, float p_180702_13_, float p_180702_14_, int p_180702_15_, int p_180702_16_, double p_180702_17_){ @@ -31,7 +31,7 @@ protected void addTunnel(long p_180702_1_, int p_180702_3_, int p_180702_4_, Chu Random random = new Random(p_180702_1_); if (p_180702_16_ <= 0){ - int i = this.range * 16 - 16; + int i = range * 16 - 16; p_180702_16_ = i - random.nextInt(i / 4); } @@ -66,8 +66,8 @@ protected void addTunnel(long p_180702_1_, int p_180702_3_, int p_180702_4_, Chu f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; if (!flag2 && p_180702_15_ == j && p_180702_12_ > 1.0F && p_180702_16_ > 0){ - this.addTunnel(random.nextLong(), p_180702_3_, p_180702_4_, primer, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ - ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D); - this.addTunnel(random.nextLong(), p_180702_3_, p_180702_4_, primer, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ + ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D); + addTunnel(random.nextLong(), p_180702_3_, p_180702_4_, primer, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ - ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D); + addTunnel(random.nextLong(), p_180702_3_, p_180702_4_, primer, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ + ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D); return; } @@ -169,9 +169,6 @@ else if (block1.getBlock()==Blocks.FLOWING_WATER||block1.getBlock()==Blocks.WATE return (block1.getBlock() == Blocks.SAND || block1.getBlock() == Blocks.GRAVEL) && block2.getMaterial() != Material.WATER; } - /** - * Recursively called by generate() - */ protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int originalX, int originalZ, ChunkPrimer chunkPrimerIn){ int i = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(15) + 1) + 1); diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDURavines.java b/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDURavines.java index 94bc51e..cc9214d 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDURavines.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/mapgen/MapGenDURavines.java @@ -131,9 +131,6 @@ protected void addTunnel(long p_180707_1_, int p_180707_3_, int p_180707_4_, Chu } } - /** - * Recursively called by generate() - */ protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int originalX, int originalZ, ChunkPrimer chunkPrimerIn){ if (this.rand.nextInt(50) == 0){ double d0 = (double)(chunkX * 16 + this.rand.nextInt(16)); diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/ChristmasTree.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/ChristmasTree.java index 6c90f05..eb0c013 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/ChristmasTree.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/ChristmasTree.java @@ -81,9 +81,7 @@ public boolean generate(World worldIn, Random rand, BlockPos position) BlockPos blockpos = new BlockPos(i2, j4, k2); state = worldIn.getBlockState(blockpos); if (state.getBlock().canBeReplacedByLeaves(state, worldIn, blockpos)) - { setBlockAndNotifyAdequately(worldIn, blockpos, LEAF); - } } } } diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/DUTrees.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DUTrees.java similarity index 96% rename from src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/DUTrees.java rename to src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DUTrees.java index f2c158a..54db29e 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/DUTrees.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DUTrees.java @@ -1,4 +1,4 @@ -package com.NetherNoah.ParadiseMod.world.worldgen.structures; +package com.NetherNoah.ParadiseMod.world.worldgen.misc; import java.util.Random; @@ -45,4 +45,5 @@ public static int getGroundFromAbove(World world, int x, int z) public boolean generate(World worldIn, Random rand, BlockPos position) { return false; } -} \ No newline at end of file +} + diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/DUTreesGen.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DUTreesGen.java similarity index 98% rename from src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/DUTreesGen.java rename to src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DUTreesGen.java index 4f0248e..ac4d2cc 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/DUTreesGen.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DUTreesGen.java @@ -1,4 +1,4 @@ -package com.NetherNoah.ParadiseMod.world.worldgen.structures; +package com.NetherNoah.ParadiseMod.world.worldgen.misc; import java.util.Random; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DirtGen.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DirtGen.java index 996dadf..330131c 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DirtGen.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/misc/DirtGen.java @@ -19,13 +19,8 @@ public void generate(Random random, int chunkX, int chunkZ, World world, IChunkG generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } private void generateOverworld(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider){ - int dirtOrSand=random.nextInt(3); - if (dirtOrSand==1) - generateOre(Blocks.DIRT.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(55), 6); - if (dirtOrSand==2) - generateOre(Blocks.SAND.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(55), 6); - else - generateOre(Blocks.CLAY.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(55), 6); + IBlockState[] earth= {Blocks.DIRT.getDefaultState(),Blocks.SAND.getDefaultState(),Blocks.CLAY.getDefaultState()}; + generateOre(earth[random.nextInt(3)], world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(55), 6); } private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenEnd.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenEnd.java index 553934f..386c645 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenEnd.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenEnd.java @@ -18,24 +18,12 @@ public class OreGenEnd implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - if (world.provider.getDimension() == 1) { - if (ModConfig.worldgen.GenerateEndOres==true) - generateEnd(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); - } + if ((world.provider.getDimension() == 1)&&ModConfig.worldgen.GenerateEndOres) + generateEnd(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } private void generateEnd(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - int selectOreEnd=random.nextInt(3); - - IBlockState oreSelectionEnd=null; - - if (selectOreEnd==0) - oreSelectionEnd=Ores.EndRubyOre.getDefaultState(); - if (selectOreEnd==1) - oreSelectionEnd=Ores.EndRubyOre.getDefaultState(); - if (selectOreEnd==2) - oreSelectionEnd=Ores.VoidPearlOre.getDefaultState(); - - generateOre(oreSelectionEnd, world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(15), 6); + IBlockState[]endOres= {Ores.EndRubyOre.getDefaultState(),Ores.EnderPearlOre.getDefaultState(),Ores.VoidPearlOre.getDefaultState()}; + generateOre(endOres[random.nextInt(3)], world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(15), 6); } private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenNether.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenNether.java index e312231..04a520d 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenNether.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenNether.java @@ -18,24 +18,12 @@ public class OreGenNether implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - if (world.provider.getDimension() == -1) { - if (ModConfig.worldgen.GenerateNetherOres==true) - generateNether(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); - } + if ((world.provider.getDimension() == -1)&&ModConfig.worldgen.GenerateNetherOres) + generateNether(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } private void generateNether(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - int selectOreNether=random.nextInt(2); - - //silver ore (nether variant) - IBlockState oreSelectionNether=Ores.SilverOreNether.getDefaultState(); - - //gold ore (nether variant) - if (selectOreNether==1) - oreSelectionNether=Ores.GoldOreNether.getDefaultState(); - else - oreSelectionNether=Ores.SilverOreNether.getDefaultState(); - - generateOre(oreSelectionNether, world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(15), 6); + IBlockState [] netherOres= {Ores.SilverOreNether.getDefaultState(),Ores.GoldOreNether.getDefaultState()}; + generateOre(netherOres[random.nextInt(2)], world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(15), 6); } private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenOverworld.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenOverworld.java index eff7766..39aa486 100644 --- a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenOverworld.java +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/ores/OreGenOverworld.java @@ -18,25 +18,12 @@ public class OreGenOverworld implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - if (ModConfig.worldgen.GenerateOverworldOres==true || world.provider.getDimension() !=0) + if ((world.provider.getDimension()==0)&&ModConfig.worldgen.GenerateOverworldOres==true) generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } private void generateOverworld(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - int selectOreOverworld=random.nextInt(3); - - //salt ore - IBlockState oreSelectionOverworld=Ores.SaltOre.getDefaultState(); - - //ruby ore - if (selectOreOverworld==0) - oreSelectionOverworld=Ores.RubyOre.getDefaultState(); - - //silver ore - else if (selectOreOverworld==1) - oreSelectionOverworld=Ores.SilverOre.getDefaultState(); - else - oreSelectionOverworld=Ores.SaltOre.getDefaultState(); - generateOre(oreSelectionOverworld, world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(4), 6); + IBlockState[] ores= {Ores.SaltOre.getDefaultState(),Ores.RubyOre.getDefaultState(),Ores.SilverOre.getDefaultState()}; + generateOre(ores[random.nextInt(3)], world, random, chunkX * 16, chunkZ * 16, 16, 64, 4 + random.nextInt(4), 6); } private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg.java new file mode 100644 index 0000000..6dfa947 --- /dev/null +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg.java @@ -0,0 +1,44 @@ +package com.NetherNoah.ParadiseMod.world.worldgen.structures; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.IChunkGenerator; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.fml.common.IWorldGenerator; + +public class EasterEgg extends WorldGenerator implements IWorldGenerator{ + @Override + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, + IChunkProvider chunkProvider) { + int blockX = chunkX * 16; + int blockZ = chunkZ * 16; + generateOverworld(world, rand, blockX + 8, blockZ + 8); + } + private void generateOverworld(World world, Random rand, int blockX, int blockZ) + { + int y = getGroundFromAbove(world, blockX, blockZ); + BlockPos pos = new BlockPos(blockX, y, blockZ); + WorldGenerator structure = new EasterEggGen(); + structure.generate(world, rand, pos); + } + public static int getGroundFromAbove(World world, int x, int z) + { + int y = 255; + boolean foundGround = false; + while(!foundGround && y-- >= 63) + { + Block blockAt = world.getBlockState(new BlockPos(x,y,z)).getBlock(); + foundGround = blockAt == Blocks.GRASS||blockAt == Blocks.DIRT||blockAt == Blocks.STONE||blockAt == Blocks.WATER; + } + return y; + } + @Override + public boolean generate(World worldIn, Random rand, BlockPos position) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg2.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg2.java new file mode 100644 index 0000000..0525775 --- /dev/null +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg2.java @@ -0,0 +1,34 @@ +package com.NetherNoah.ParadiseMod.world.worldgen.structures; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.IChunkGenerator; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.fml.common.IWorldGenerator; + +public class EasterEgg2 extends WorldGenerator implements IWorldGenerator{ + + @Override + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, + IChunkProvider chunkProvider) { + int blockX = chunkX * 16; + int blockZ = chunkZ * 16; + if (world.provider.getDimension() == 0) + generateOverworld(world, rand, blockX + 8, blockZ + 8); + } + + private void generateOverworld(World world, Random rand, int blockX, int blockZ) + { + BlockPos pos = new BlockPos(blockX, 30, blockZ); + WorldGenerator structure = new EasterEgg2Gen(); + structure.generate(world, rand, pos); + } + + @Override + public boolean generate(World worldIn, Random rand, BlockPos position) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg2Gen.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg2Gen.java new file mode 100644 index 0000000..47e0283 --- /dev/null +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEgg2Gen.java @@ -0,0 +1,46 @@ +package com.NetherNoah.ParadiseMod.world.worldgen.structures; + +import java.util.Random; + +import com.NetherNoah.ParadiseMod.Reference; +import com.NetherNoah.ParadiseMod.config.ModConfig; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.Mirror; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.gen.structure.template.PlacementSettings; +import net.minecraft.world.gen.structure.template.Template; +import net.minecraft.world.gen.structure.template.TemplateManager; + +public class EasterEgg2Gen extends WorldGenerator { + @Override + public boolean generate(World world, Random rand, BlockPos position) { + WorldServer worldserver = (WorldServer) world; + MinecraftServer minecraftserver = world.getMinecraftServer(); + TemplateManager templatemanager = worldserver.getStructureTemplateManager(); + Template template = templatemanager.getTemplate(minecraftserver, new ResourceLocation(Reference.MOD_ID+":easter_egg_2")); + if(template == null||ModConfig.worldgen.structures.EasterEgg==false) + return false; + Biome biome = world.getBiomeForCoordsBody(position); + if(rand.nextInt(ModConfig.worldgen.structures.EasterEggChance) == 0){ + IBlockState iblockstate = world.getBlockState(position); + world.notifyBlockUpdate(position, iblockstate, iblockstate, 3); + PlacementSettings placementsettings = (new PlacementSettings()).setMirror(Mirror.NONE) + .setRotation(Rotation.NONE).setIgnoreEntities(false).setChunk((ChunkPos) null) + .setReplacedBlock((Block) null).setIgnoreStructureBlock(false); + template.getDataBlocks(position, placementsettings); + template.addBlocksToWorld(world, position.add(0, 0, 0), placementsettings); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEggGen.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEggGen.java new file mode 100644 index 0000000..62767e3 --- /dev/null +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/EasterEggGen.java @@ -0,0 +1,52 @@ +package com.NetherNoah.ParadiseMod.world.worldgen.structures; + +import java.util.Random; + +import com.NetherNoah.ParadiseMod.Reference; +import com.NetherNoah.ParadiseMod.config.ModConfig; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.Mirror; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.gen.structure.template.PlacementSettings; +import net.minecraft.world.gen.structure.template.Template; +import net.minecraft.world.gen.structure.template.TemplateManager; + +public class EasterEggGen extends WorldGenerator { + @Override + public boolean generate(World world, Random rand, BlockPos position) { + WorldServer worldserver = (WorldServer) world; + MinecraftServer minecraftserver = world.getMinecraftServer(); + TemplateManager templatemanager = worldserver.getStructureTemplateManager(); + Template template = templatemanager.getTemplate(minecraftserver, new ResourceLocation(Reference.MOD_ID+":easter_egg_1")); + if(ModConfig.worldgen.structures.EasterEgg==false) + return false; + Biome biome = world.getBiomeForCoordsBody(position); + if(rand.nextInt(ModConfig.worldgen.structures.EasterEggChance) == 0){ + IBlockState iblockstate = world.getBlockState(position); + world.notifyBlockUpdate(position, iblockstate, iblockstate, 3); + PlacementSettings placementsettings = (new PlacementSettings()).setMirror(Mirror.NONE) + .setRotation(Rotation.NONE).setIgnoreEntities(false).setChunk((ChunkPos) null) + .setReplacedBlock((Block) null).setIgnoreStructureBlock(false); + template.getDataBlocks(position, placementsettings); + template.addBlocksToWorld(world, position.add(0, 0, 0), placementsettings); + return true; + } + return false; + } + public static boolean canSpawnHere(Template template, World world, BlockPos posAboveGround) + { + int zwidth = template.getSize().getZ(); + int xwidth = template.getSize().getX(); + return posAboveGround.getY() > 10; + } +} \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/UndergroundVillage.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/UndergroundVillage.java new file mode 100644 index 0000000..7fe8116 --- /dev/null +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/UndergroundVillage.java @@ -0,0 +1,34 @@ +package com.NetherNoah.ParadiseMod.world.worldgen.structures; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.IChunkGenerator; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.fml.common.IWorldGenerator; + +public class UndergroundVillage extends WorldGenerator implements IWorldGenerator{ + + @Override + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, + IChunkProvider chunkProvider) { + int blockX = chunkX * 16; + int blockZ = chunkZ * 16; + if (world.provider.getDimension() == 0) + generateOverworld(world, rand, blockX + 8, blockZ + 8); + } + + private void generateOverworld(World world, Random rand, int blockX, int blockZ) + { + BlockPos pos = new BlockPos(blockX, 20, blockZ); + WorldGenerator structure = new UndergroundVillageGen(); + structure.generate(world, rand, pos); + } + + @Override + public boolean generate(World worldIn, Random rand, BlockPos position) { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/UndergroundVillageGen.java b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/UndergroundVillageGen.java new file mode 100644 index 0000000..013347f --- /dev/null +++ b/src/main/java/com/NetherNoah/ParadiseMod/world/worldgen/structures/UndergroundVillageGen.java @@ -0,0 +1,49 @@ +package com.NetherNoah.ParadiseMod.world.worldgen.structures; + +import java.util.Random; + +import com.NetherNoah.ParadiseMod.Reference; +import com.NetherNoah.ParadiseMod.config.ModConfig; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.Mirror; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Rotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.gen.structure.template.PlacementSettings; +import net.minecraft.world.gen.structure.template.Template; +import net.minecraft.world.gen.structure.template.TemplateManager; + +public class UndergroundVillageGen extends WorldGenerator { + @Override + public boolean generate(World world, Random rand, BlockPos position) { + WorldServer worldserver = (WorldServer) world; + MinecraftServer minecraftserver = world.getMinecraftServer(); + TemplateManager templatemanager = worldserver.getStructureTemplateManager(); + Template template = templatemanager.getTemplate(minecraftserver, new ResourceLocation(Reference.MOD_ID+":underground_village")); + Template filler = templatemanager.getTemplate(minecraftserver, new ResourceLocation(Reference.MOD_ID+":filler")); + if(template == null||ModConfig.worldgen.structures.UndergroundVillage==false) + return false; + Biome biome = world.getBiomeForCoordsBody(position); + if(rand.nextInt(ModConfig.worldgen.structures.UndergroundVillageChance) == 0){ + IBlockState iblockstate = world.getBlockState(position); + world.notifyBlockUpdate(position, iblockstate, iblockstate, 3); + PlacementSettings placementsettings = (new PlacementSettings()).setMirror(Mirror.NONE) + .setRotation(Rotation.NONE).setIgnoreEntities(false).setChunk((ChunkPos) null) + .setReplacedBlock((Block) null).setIgnoreStructureBlock(false); + filler.getDataBlocks(position, placementsettings); + filler.addBlocksToWorld(world, position.add(0, 0, 0), placementsettings,0); + template.getDataBlocks(position, placementsettings); + template.addBlocksToWorld(world, position.add(0, 0, 0), placementsettings,0); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/main/resources/assets/nnparadisemod/lang/en_US.lang b/src/main/resources/assets/nnparadisemod/lang/en_US.lang index 948e929..53341fd 100644 --- a/src/main/resources/assets/nnparadisemod/lang/en_US.lang +++ b/src/main/resources/assets/nnparadisemod/lang/en_US.lang @@ -299,6 +299,10 @@ tile.VoidPearlOre.name=Void Pearl Ore fluid.liquid_redstone=Liquid Redstone #Config +config.cavetypes=Cave Types +config.caves=Better Caves +config.crystalchance=Crystal Chance +config.bettercaves=Beautify Caves config.worldgen=World Generation config.dimensions=Dimensions config.structures=Structures @@ -323,7 +327,9 @@ config.mesatemples=Mesa Temples config.minerbase=Abandoned Miner Bases config.ministronghold=Mini Strongholds config.shipwreck=Shipwrecks +config.easteregg=Easter Egg config.oceanvillages=Underwater Villages +config.undergroundvillages=Underground Villages config.portal=Rogue Portals config.runways=Elytra Runways config.skywheels=Wheels in the Sky diff --git a/src/main/resources/assets/nnparadisemod/structures/easter_egg_1.nbt b/src/main/resources/assets/nnparadisemod/structures/easter_egg_1.nbt new file mode 100644 index 0000000..7cf818d Binary files /dev/null and b/src/main/resources/assets/nnparadisemod/structures/easter_egg_1.nbt differ diff --git a/src/main/resources/assets/nnparadisemod/structures/easter_egg_2.nbt b/src/main/resources/assets/nnparadisemod/structures/easter_egg_2.nbt new file mode 100644 index 0000000..900625a Binary files /dev/null and b/src/main/resources/assets/nnparadisemod/structures/easter_egg_2.nbt differ diff --git a/src/main/resources/assets/nnparadisemod/structures/filler.nbt b/src/main/resources/assets/nnparadisemod/structures/filler.nbt new file mode 100644 index 0000000..0659da2 Binary files /dev/null and b/src/main/resources/assets/nnparadisemod/structures/filler.nbt differ diff --git a/src/main/resources/assets/nnparadisemod/structures/underground_village.nbt b/src/main/resources/assets/nnparadisemod/structures/underground_village.nbt new file mode 100644 index 0000000..0e9952a Binary files /dev/null and b/src/main/resources/assets/nnparadisemod/structures/underground_village.nbt differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index cae0f34..27d44fe 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "nnparadisemod", "name": "Nether Noah's Paradise Mod", "description": "This Mod adds stuff that makes minecraft better!\nBest if used alongside Quark!", - "version": "1.2.2", + "version": "1.3 (The Cave Update)", "logoFile": "assets/nnparadisemod/textures/nnparadisemod.png", "url": "https://github.com/NoahJelen/nnparadisemod/tree/1.12.2", "updateUrl": "",