From ab01a3c60728f838e0d3593d0f2cd1f9da5c7a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Fri, 8 Jul 2016 14:00:19 +0200 Subject: [PATCH] Sulphur --- TODO.txt | 1 - src/java/mmm/materials/MOre.java | 18 +++++++++++++++++- src/java/mmm/materials/Materials.java | 14 ++++++++++++++ src/java/mmm/world/WLocation.java | 10 ++++++++++ .../blockstates/materials/ore/sulphur.json | 5 +++++ src/resources/assets/mmm/lang/en_US.lang | 3 +++ .../models/block/materials/ore/sulphur.json | 6 ++++++ .../models/item/materials/ore/sulphur.json | 3 +++ .../item/materials/stone/sulphur_powder.json | 6 ++++++ .../textures/blocks/materials/ore/sulphur.png | Bin 0 -> 465 bytes .../items/materials/stone/sulphur_powder.png | Bin 0 -> 222 bytes 11 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 src/resources/assets/mmm/blockstates/materials/ore/sulphur.json create mode 100644 src/resources/assets/mmm/models/block/materials/ore/sulphur.json create mode 100644 src/resources/assets/mmm/models/item/materials/ore/sulphur.json create mode 100644 src/resources/assets/mmm/models/item/materials/stone/sulphur_powder.json create mode 100644 src/resources/assets/mmm/textures/blocks/materials/ore/sulphur.png create mode 100644 src/resources/assets/mmm/textures/items/materials/stone/sulphur_powder.png diff --git a/TODO.txt b/TODO.txt index fd927db..97555cb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -58,7 +58,6 @@ materials.rock No Smooth basalt ------------------------------------------------------------------------------------------------------- materials.ore No Silver (native, horn silver) materials.ore No Olivine -materials.ore No Sulfur materials.ore No Saltpeter ------------------------------------------------------------------------------------------------------- tech.base No Alloy furnace diff --git a/src/java/mmm/materials/MOre.java b/src/java/mmm/materials/MOre.java index d0d10f7..28f6247 100644 --- a/src/java/mmm/materials/MOre.java +++ b/src/java/mmm/materials/MOre.java @@ -113,7 +113,7 @@ public class MOre } - public MOre setMetal( final MMetal metal , int count ) + public MOre setMetal( final MMetal metal , final int count ) { return this.setMetal( metal , count , E_MMetalItemType.INGOT ); } @@ -129,6 +129,22 @@ public class MOre } + @Override + public MOre setResistance( final float resistance ) + { + super.setResistance( resistance ); + return this; + } + + + @Override + public MOre setHardness( final float hardness ) + { + super.setHardness( hardness ); + return this; + } + + @Override @Nullable public Item getItemDropped( final IBlockState state , final Random rand , final int fortune ) diff --git a/src/java/mmm/materials/Materials.java b/src/java/mmm/materials/Materials.java index ccf814a..be600ba 100644 --- a/src/java/mmm/materials/Materials.java +++ b/src/java/mmm/materials/Materials.java @@ -14,6 +14,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockStone; import net.minecraft.block.material.MapColor; import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -51,6 +52,7 @@ public class Materials public static final Item ITEM_CASSITERITE; public static final Item ITEM_SPHALERITE; public static final Item ITEM_ROCK_SALT; + public static final Item ITEM_SULPHUR_POWDER; public static final MOre ORE_COPPER; public static final MOre ORE_MALACHITE; @@ -61,6 +63,7 @@ public class Materials public static final MOre ORE_BAUXITE; public static final MOre ORE_GALENA; public static final MOre ORE_CINNABAR; + public static final MOre ORE_SULPHUR; static { // Rocks @@ -97,6 +100,7 @@ public class Materials ITEM_CASSITERITE = Materials.makeItem( "cassiterite" ); ITEM_SPHALERITE = Materials.makeItem( "sphalerite" ); ITEM_ROCK_SALT = Materials.makeItem( "rock_salt" ); + ITEM_SULPHUR_POWDER = Materials.makeItem( "sulphur_powder" ); // Actual ores ORE_COPPER = new MOre( "copper" , 1 ) // @@ -123,10 +127,16 @@ public class Materials ORE_BAUXITE = new MOre( "bauxite" , 1 ); ORE_GALENA = new MOre( "galena" , 1 ); ORE_CINNABAR = new MOre( "cinnabar" , 1 ); + ORE_SULPHUR = new MOre( "sulphur" , 0 ) // + .setResistance( 2.0f ) // + .setHardness( 1.0f ) // + .setDrops( ITEM_SULPHUR_POWDER , 3 , 6 ) // + .setExperience( 1 , 2 ); // Other recipes, ore generation parameters, etc. final Materials materials = new Materials( ); URegistry.addRecipeRegistrar( materials ); + URegistry.addOreGenerationRegistrar( materials ); } @@ -264,6 +274,10 @@ public class Materials conditions.add( new WGOreCondition( WLocation.inOverworld( ) , // new WGOreParameters( Materials.ORE_CINNABAR , 1 , 20 , 0 , 50 ) ) ); + + conditions.add( new WGOreCondition( WLocation.inTheNether( ) , // + new WGOreParameters( Materials.ORE_SULPHUR , 15 , 25 , // + BlockMatcher.forBlock( Blocks.NETHERRACK ) ) ) ); } } diff --git a/src/java/mmm/world/WLocation.java b/src/java/mmm/world/WLocation.java index e945562..af73939 100644 --- a/src/java/mmm/world/WLocation.java +++ b/src/java/mmm/world/WLocation.java @@ -8,6 +8,7 @@ import net.minecraft.world.biome.Biome; public class WLocation { private static I_WLocationCheck inOverworld; + private static I_WLocationCheck inTheNether; public static I_WLocationCheck inDimension( final int dimension ) @@ -25,6 +26,15 @@ public class WLocation } + public static I_WLocationCheck inTheNether( ) + { + if ( WLocation.inTheNether == null ) { + WLocation.inTheNether = WLocation.inDimension( -1 ); + } + return WLocation.inTheNether; + } + + public static < T extends Biome > WLocationInBiome< T > inBiome( final Class< T > biomeType ) { return new WLocationInBiome<>( biomeType ); diff --git a/src/resources/assets/mmm/blockstates/materials/ore/sulphur.json b/src/resources/assets/mmm/blockstates/materials/ore/sulphur.json new file mode 100644 index 0000000..f72e116 --- /dev/null +++ b/src/resources/assets/mmm/blockstates/materials/ore/sulphur.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mmm:materials/ore/sulphur" } + } +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 75f4bd7..149158e 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -22,6 +22,9 @@ tile.mmm.materials.ore.galena.name=Galena tile.mmm.materials.ore.cinnabar.name=Cinnabar +tile.mmm.materials.ore.sulphur.name=Sulphur +item.mmm.materials.stone.sulphur_powder.name=Sulphur Powder + item.mmm.materials.stone.coke.name=Coke item.mmm.materials.stone.slag.name=Slag item.mmm.materials.nugget.iron.name=Iron Nugget diff --git a/src/resources/assets/mmm/models/block/materials/ore/sulphur.json b/src/resources/assets/mmm/models/block/materials/ore/sulphur.json new file mode 100644 index 0000000..57276ef --- /dev/null +++ b/src/resources/assets/mmm/models/block/materials/ore/sulphur.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "mmm:blocks/materials/ore/sulphur" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/ore/sulphur.json b/src/resources/assets/mmm/models/item/materials/ore/sulphur.json new file mode 100644 index 0000000..ccac88c --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/ore/sulphur.json @@ -0,0 +1,3 @@ +{ + "parent": "mmm:block/materials/ore/sulphur" +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/stone/sulphur_powder.json b/src/resources/assets/mmm/models/item/materials/stone/sulphur_powder.json new file mode 100644 index 0000000..e05787b --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/stone/sulphur_powder.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/materials/stone/sulphur_powder" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/blocks/materials/ore/sulphur.png b/src/resources/assets/mmm/textures/blocks/materials/ore/sulphur.png new file mode 100644 index 0000000000000000000000000000000000000000..355bccfae367560fba86668a34fbd636741b1db2 GIT binary patch literal 465 zcmV;?0WSWDP)2o9?Lm~GBRgk2Me zaMRJ8Z9E7+Cj0p4Ks{$q_tLlAHX&Dc_r43;o=?{-gv|Jzsyi?M+^*%vdqZU7RwRa! z%^lpK??__!xsSDaK-iBmzBL>OrpfB@(f0%ZrI;gx0K=BkUEREC$lL+Z-P5J;uBWzv zQnVeUdO`KrvSxFKCVJN~5fXIRO0 zZoubj-VeOlNzS_I+0@jO146*JZRiIslYO4%VZ&)M2jE;S#!$1Rq|czwY_{XE z)7O>#0Xqk`8PhT6s8pa(t*47)h{fsT1c`eKl*7N+b4*_Q^X}T02|k+?6?pCK?=xrD z?YRB!fA7|=BhpPd#yrhD3a12eW+k%eWKCk(&9z+d#JM(0S(oM`33>-!3(a_I(0gMK zLlJ8nv%@5V=#7#N2096C2Y8qgXRKA|G3U7;%x@O$>BVorE3(vW7X!n-7ayPS$C*tB PI)uT~)z4*}Q$iB}9}Y(e literal 0 HcmV?d00001