From e02bf94c74b6c6ce290f9397a8d69492eb2a4c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 3 Jul 2016 21:04:32 +0200 Subject: [PATCH] Slate --- src/java/mmm/materials/Materials.java | 3 ++ src/java/mmm/materials/rock/MRSlate.java | 49 ++++++++++++++++++ src/java/mmm/world/gen/WGOre.java | 1 - .../mmm/blockstates/materials/rock/slate.json | 5 ++ src/resources/assets/mmm/lang/en_US.lang | 1 + .../models/block/materials/rock/slate.json | 6 +++ .../mmm/models/item/materials/rock/slate.json | 3 ++ .../textures/blocks/materials/rock/slate.png | Bin 0 -> 315 bytes 8 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/java/mmm/materials/rock/MRSlate.java create mode 100644 src/resources/assets/mmm/blockstates/materials/rock/slate.json create mode 100644 src/resources/assets/mmm/models/block/materials/rock/slate.json create mode 100644 src/resources/assets/mmm/models/item/materials/rock/slate.json create mode 100644 src/resources/assets/mmm/textures/blocks/materials/rock/slate.png diff --git a/src/java/mmm/materials/Materials.java b/src/java/mmm/materials/Materials.java index 188b017..7295776 100644 --- a/src/java/mmm/materials/Materials.java +++ b/src/java/mmm/materials/Materials.java @@ -8,6 +8,7 @@ import mmm.materials.ore.MOMalachite; import mmm.materials.ore.MOSphalerite; import mmm.materials.rock.MRChalk; import mmm.materials.rock.MRLimestone; +import mmm.materials.rock.MRSlate; import mmm.utils.I_URecipeRegistrar; import mmm.utils.URegistry; import net.minecraft.block.material.MapColor; @@ -23,6 +24,7 @@ public class Materials { public static final MRLimestone ROCK_LIMESTONE; public static final MRChalk ROCK_CHALK; + public static final MRSlate ROCK_SLATE; public static final MMetal GOLD; public static final MMetal IRON; @@ -52,6 +54,7 @@ public class Materials // Rocks URegistry.addBlock( ROCK_LIMESTONE = new MRLimestone( ) ); URegistry.addBlock( ROCK_CHALK = new MRChalk( ) ); + URegistry.addBlock( ROCK_SLATE = new MRSlate( ) ); // Vanilla metals GOLD = new MMetal( Blocks.GOLD_BLOCK , Items.GOLD_INGOT , Items.GOLD_NUGGET ); diff --git a/src/java/mmm/materials/rock/MRSlate.java b/src/java/mmm/materials/rock/MRSlate.java new file mode 100644 index 0000000..023e6f6 --- /dev/null +++ b/src/java/mmm/materials/rock/MRSlate.java @@ -0,0 +1,49 @@ +package mmm.materials.rock; + + +import java.util.List; + +import mmm.utils.I_UOreGenerationRegistrar; +import mmm.utils.URegistry; +import mmm.world.WLocationInBiome; +import mmm.world.gen.WGOreCondition; +import mmm.world.gen.WGOreParameters; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.world.biome.BiomePlains; +import net.minecraft.world.biome.BiomeSwamp; + + + +public class MRSlate + extends Block + implements I_UOreGenerationRegistrar +{ + + public MRSlate( ) + { + super( Material.ROCK , MapColor.BLACK ); + this.setCreativeTab( CreativeTabs.BUILDING_BLOCKS ); + this.setHardness( 1.5f ); + this.setResistance( 10f ); + this.setSoundType( SoundType.STONE ); + this.setHarvestLevel( "pickaxe" , 0 ); + URegistry.setIdentifiers( this , "materials" , "rock" , "slate" ); + } + + + @Override + public void addConditions( final List< WGOreCondition > conditions ) + { + conditions.add( new WGOreCondition( // + new WLocationInBiome<>( BiomePlains.class ) , + new WGOreParameters( this.getDefaultState( ) , 15 , 40 ) ) ); + conditions.add( new WGOreCondition( // + new WLocationInBiome<>( BiomeSwamp.class ) , + new WGOreParameters( this.getDefaultState( ) , 20 , 60 ) ) ); + } + +} diff --git a/src/java/mmm/world/gen/WGOre.java b/src/java/mmm/world/gen/WGOre.java index 9a80fbe..b9e3fbd 100644 --- a/src/java/mmm/world/gen/WGOre.java +++ b/src/java/mmm/world/gen/WGOre.java @@ -31,7 +31,6 @@ public class WGOre public void generate( final Random random , final int chunkX , final int chunkZ , final World world , final IChunkGenerator chunkGenerator , final IChunkProvider chunkProvider ) { - System.err.println( "GEN ORES " + chunkX + " / " + chunkZ ); final Biome biome = world.getBiomeGenForCoords( new BlockPos( chunkX * 16 , 0 , chunkZ * 16 ) ); if ( biome instanceof I_WBiomeWithOres ) { for ( final WGOreParameters parameters : ( (I_WBiomeWithOres) biome ).getBiomeOres( world ) ) { diff --git a/src/resources/assets/mmm/blockstates/materials/rock/slate.json b/src/resources/assets/mmm/blockstates/materials/rock/slate.json new file mode 100644 index 0000000..3bfe92e --- /dev/null +++ b/src/resources/assets/mmm/blockstates/materials/rock/slate.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mmm:materials/rock/slate" } + } +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index cca2afa..1d80444 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -10,6 +10,7 @@ gui.mmm.tech.base.am.disabled=Deactivated tile.mmm.materials.rock.limestone.name=Limestone tile.mmm.materials.rock.chalk.name=Chalk +tile.mmm.materials.rock.slate.name=Slate item.mmm.materials.stone.coke.name=Coke item.mmm.materials.stone.slag.name=Slag diff --git a/src/resources/assets/mmm/models/block/materials/rock/slate.json b/src/resources/assets/mmm/models/block/materials/rock/slate.json new file mode 100644 index 0000000..2a46410 --- /dev/null +++ b/src/resources/assets/mmm/models/block/materials/rock/slate.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "mmm:blocks/materials/rock/slate" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/rock/slate.json b/src/resources/assets/mmm/models/item/materials/rock/slate.json new file mode 100644 index 0000000..2adc664 --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/rock/slate.json @@ -0,0 +1,3 @@ +{ + "parent": "mmm:block/materials/rock/slate" +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/blocks/materials/rock/slate.png b/src/resources/assets/mmm/textures/blocks/materials/rock/slate.png new file mode 100644 index 0000000000000000000000000000000000000000..b815972a68f501e830168d0c9acc955ed9ef30bd GIT binary patch literal 315 zcmV-B0mS}^P)wVF$4&Xb`9T|0m2#TXS?BtZv&??k>x=ZO3sCJ05^Rg_%&uNclK=*e76R9o#;FtOgYS17f0WEPLBe_HAz=4#St4(D1 ziDuL*vHZ67BbMLRe#G+I+K*U%Tl*2qZ)-nd`EBh-EWfS&h~>AnpFeW-(!u{B^E3be N002ovPDHLkV1lEEltTaj literal 0 HcmV?d00001