Skip to content

Commit

Permalink
Fixes #5627, give plastic fences hardness and resistance values. Also…
Browse files Browse the repository at this point in the history
… make a custom "material" type for them so they match rather than fences being "clay" and blocks being "wood"
  • Loading branch information
pupnewfster committed Aug 25, 2019
1 parent 0c932ee commit 5b398c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main/java/mekanism/common/block/BlockPlastic.java
Expand Up @@ -6,6 +6,7 @@
import mekanism.common.block.states.BlockStatePlastic;
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockType;
import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
Expand All @@ -20,10 +21,12 @@

public class BlockPlastic extends Block {

public static final Material PLASTIC = new Material(MapColor.CLAY);

public PlasticBlockType type;

public BlockPlastic(PlasticBlockType blockType) {
super(Material.WOOD);
super(PLASTIC);
type = blockType;
setHardness(type == PlasticBlockType.REINFORCED ? 50F : 5F);
setResistance(type == PlasticBlockType.REINFORCED ? 2000F : 10F);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/mekanism/common/block/BlockPlasticFence.java
Expand Up @@ -6,7 +6,6 @@
import mekanism.api.EnumColor;
import mekanism.common.Mekanism;
import net.minecraft.block.BlockFence;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
Expand All @@ -20,7 +19,9 @@
public class BlockPlasticFence extends BlockFence {

public BlockPlasticFence() {
super(Material.CLAY, Material.CLAY.getMaterialMapColor());
super(BlockPlastic.PLASTIC, BlockPlastic.PLASTIC.getMaterialMapColor());
setHardness(5F);
setResistance(10F);
setCreativeTab(Mekanism.tabMekanism);
}

Expand Down

0 comments on commit 5b398c2

Please sign in to comment.