Skip to content

Commit

Permalink
Fix Natura Grass not supporting plants (#20)
Browse files Browse the repository at this point in the history
* Fix Natura Grass not supporting plants

* sa

(cherry picked from commit e5a806c)

---------

Co-authored-by: Martin Robertz <[email protected]>
  • Loading branch information
DrParadox7 and Dream-Master authored Aug 18, 2024
1 parent 7c921e7 commit c744d77
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/mods/natura/blocks/GrassBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -108,4 +112,11 @@ public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
}
return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255;
}

@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction,
IPlantable plant) {
EnumPlantType plantType = plant.getPlantType(world, x, y + 1, z);
return plantType == EnumPlantType.Plains && plant.getPlant(world, x, y + 1, z) != Blocks.tallgrass;
}
}

0 comments on commit c744d77

Please sign in to comment.