Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Bumped version to 1.2.2
Browse files Browse the repository at this point in the history
Nether Growth can now be silk touched.
Nether Growth will now switch back to netherrack if an opaque block is on top of it.
Nether Growth now permits nether wart and saplings to grow on it.
Nether Growth will now grow under non-opaque blocks.
  • Loading branch information
renevo committed Mar 10, 2016
1 parent 619e6e9 commit b215bef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod_version=1.2.1
mod_version=1.2.2
minecraft_version=1.8.9
forge_version=11.15.1.1761
mappings=stable_20
Expand Down
33 changes: 26 additions & 7 deletions src/main/java/com/renevo/nethercore/blocks/BlockNetherGrass.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

import com.renevo.nethercore.NetherCoreRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand All @@ -36,18 +38,39 @@ public BlockNetherGrass() {
this.setCreativeTab(NetherCoreRegistry.tabNetherCore);
}

public boolean canSustainPlant(IBlockAccess blockAccess, BlockPos blockPos, EnumFacing facing, IPlantable iPlant) {
IBlockState plant = iPlant.getPlant(blockAccess, blockPos.offset(facing));

if (plant.getBlock() == Blocks.nether_wart) {
return true;
}

if (plant.getBlock() instanceof BlockBush) {
return true;
}

return super.canSustainPlant(blockAccess, blockPos, facing, iPlant);
}

public void updateTick(World world, BlockPos blockPos, IBlockState blockState, Random random) {
if (!world.isRemote) {
if (world.provider.doesWaterVaporize()) {
int rate = blockState.getValue(BURNING) ? 12 : 4;
Block blockUp = world.getBlockState(blockPos.up()).getBlock();
if (blockUp.isOpaqueCube()) {
world.setBlockState(blockPos, Blocks.netherrack.getDefaultState());
return;
}

for (int i = 0; i < rate; ++i) {
BlockPos blockpos = blockPos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
Block blockOnTop = world.getBlockState(blockpos.up()).getBlock();
IBlockState iblockstate = world.getBlockState(blockpos);
if (iblockstate.getBlock() == Blocks.netherrack && blockOnTop.isAir(world, blockpos.up())) {
if (iblockstate.getBlock() == Blocks.netherrack && !blockOnTop.isOpaqueCube()) {
world.setBlockState(blockpos, NetherCoreBlocks.blockNetherGrass.getDefaultState());
world.setBlockState(blockpos.up(), Blocks.fire.getDefaultState());
if (blockOnTop.isAir(world, blockpos.up())) {
world.setBlockState(blockpos.up(), Blocks.fire.getDefaultState());
}
}
}
}
Expand All @@ -63,10 +86,6 @@ public Item getItemDropped(IBlockState blockState, Random random, int meta) {
return Blocks.netherrack.getItemDropped(Blocks.netherrack.getDefaultState(), random, meta);
}

public boolean canSilkHarvest(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer entityPlayer) {
return false;
}

public boolean canCreatureSpawn(IBlockAccess blockAccess, BlockPos blockPos, EntityLiving.SpawnPlacementType spawnPlacementType) {
return false;
}
Expand Down
9 changes: 5 additions & 4 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"homepage": "https://github.com/RenEvo/nethercore/releases",
"promos": {
"1.8.9-latest": "1.2.1",
"1.8.9-latest": "1.2.2",
"1.8.9-recommended": "1.1.0",
"latest": "1.2.1",
"recommended": "1.2.1"
"latest": "1.2.2",
"recommended": "1.2.2"
},
"1.8.9": {
"1.0.0": "Initial Release",
Expand All @@ -13,6 +13,7 @@
"1.0.3": "Added compressed Netherrack\nUpdated textures to no longer be overlays.",
"1.1.0": "Added Tinkers Construct Integration for Nether Ores",
"1.2.0": "Added in Nether Stone, Nether Spores, and Configurations",
"1.2.1": "Miscellaneous Bug Fixes"
"1.2.1": "Miscellaneous Bug Fixes",
"1.2.2": "Nether Growth Tweaks"
}
}

0 comments on commit b215bef

Please sign in to comment.