From a03ec70140dca198e7701e318f24211437d80920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 16 Jun 2016 14:12:11 +0200 Subject: [PATCH] Malachite --- TODO.txt | 1 - src/java/mmm/materials/MOre.java | 2 +- src/java/mmm/materials/Materials.java | 19 +++++++ src/java/mmm/materials/ore/MOMalachite.java | 48 ++++++++++++++++++ .../blockstates/materials/ore/malachite.json | 5 ++ src/resources/assets/mmm/lang/en_US.lang | 3 ++ .../models/block/materials/ore/malachite.json | 6 +++ .../models/item/materials/ore/malachite.json | 3 ++ .../item/materials/stone/malachite.json | 6 +++ .../blocks/materials/ore/malachite.png | Bin 0 -> 264 bytes .../items/materials/ore/malachite.png | Bin 0 -> 338 bytes 11 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 src/java/mmm/materials/ore/MOMalachite.java create mode 100644 src/resources/assets/mmm/blockstates/materials/ore/malachite.json create mode 100644 src/resources/assets/mmm/models/block/materials/ore/malachite.json create mode 100644 src/resources/assets/mmm/models/item/materials/ore/malachite.json create mode 100644 src/resources/assets/mmm/models/item/materials/stone/malachite.json create mode 100644 src/resources/assets/mmm/textures/blocks/materials/ore/malachite.png create mode 100644 src/resources/assets/mmm/textures/items/materials/ore/malachite.png diff --git a/TODO.txt b/TODO.txt index 31909c0..a3397f5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -16,7 +16,6 @@ plants No? Eggplant plants No? Strawberries ------------------------------------------------------------------------------------------------------- ores No Rock salt -ores No Malachite (copper) ores No Cuprite (copper) ------------------------------------------------------------------------------------------------------- animals ??? Goats diff --git a/src/java/mmm/materials/MOre.java b/src/java/mmm/materials/MOre.java index 7520cd6..d827176 100644 --- a/src/java/mmm/materials/MOre.java +++ b/src/java/mmm/materials/MOre.java @@ -181,7 +181,7 @@ public class MOre public void registerRecipes( ) { if ( this.metal != null ) { - ItemStack output = new ItemStack( this.metal.INGOT , 0 , this.genIngots ); + ItemStack output = new ItemStack( this.metal.INGOT , this.genIngots ); float xp = this.metal.SMELTING_XP * this.genIngots; if ( this.dropItems == null ) { GameRegistry.addSmelting( this , output , xp ); diff --git a/src/java/mmm/materials/Materials.java b/src/java/mmm/materials/Materials.java index 117c4ba..29da5fd 100644 --- a/src/java/mmm/materials/Materials.java +++ b/src/java/mmm/materials/Materials.java @@ -2,25 +2,44 @@ package mmm.materials; import mmm.materials.ore.MOCopper; +import mmm.materials.ore.MOMalachite; import mmm.utils.URegistry; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; +import net.minecraft.item.Item; public class Materials { + public static final MMetal GOLD; public static final MMetal IRON; public static final MMetal COPPER; + public static final Item STONE_MALACHITE; + public static final MOre ORE_COPPER; + public static final MOre ORE_MALACHITE; static { GOLD = new MMetal( Items.GOLD_INGOT , Items.GOLD_NUGGET ); IRON = new MMetal( Items.IRON_INGOT , new MMetalItem( E_MMetalItemType.NUGGET , "iron" ) ); COPPER = new MMetal( "copper" , 0.4f ); + URegistry.addItem( STONE_MALACHITE = makeStone( "malachite" ) ); + URegistry.addBlock( ORE_COPPER = new MOCopper( ) ); + URegistry.addBlock( ORE_MALACHITE = new MOMalachite( ) ); + } + + + public static Item makeStone( String name ) + { + Item stone = new Item( ); + URegistry.setIdentifiers( stone , "materials" , "stone" , name ); + stone.setCreativeTab( CreativeTabs.MATERIALS ); + return stone; } diff --git a/src/java/mmm/materials/ore/MOMalachite.java b/src/java/mmm/materials/ore/MOMalachite.java new file mode 100644 index 0000000..9486210 --- /dev/null +++ b/src/java/mmm/materials/ore/MOMalachite.java @@ -0,0 +1,48 @@ +package mmm.materials.ore; + + +import java.util.List; + +import mmm.materials.MOre; +import mmm.materials.Materials; +import mmm.utils.I_UOreGenerationRegistrar; +import mmm.world.WLocation; +import mmm.world.WOreGenerationCondition; +import mmm.world.WOreGenerationParameters; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class MOMalachite + extends MOre + implements I_UOreGenerationRegistrar +{ + + public MOMalachite( ) + { + super( "malachite" , 1 ); + this.setMetal( Materials.COPPER ); + this.setDrops( Materials.STONE_MALACHITE ); + this.setExperience( 1 , 3 ); + } + + + @Override + public void addConditions( final List< WOreGenerationCondition > conditions ) + { + conditions.add( new WOreGenerationCondition( WLocation.inOverworld( ) , + new WOreGenerationParameters( this.getDefaultState( ) , 5 , 9 , 80 , 255 ) ) ); + } + + + @Override + public void registerRecipes( ) + { + super.registerRecipes( ); + GameRegistry.addShapelessRecipe( new ItemStack( Items.DYE , 1 , 2 ) , + new ItemStack( Materials.STONE_MALACHITE ) ); + } + +} diff --git a/src/resources/assets/mmm/blockstates/materials/ore/malachite.json b/src/resources/assets/mmm/blockstates/materials/ore/malachite.json new file mode 100644 index 0000000..659a5db --- /dev/null +++ b/src/resources/assets/mmm/blockstates/materials/ore/malachite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mmm:materials/ore/malachite" } + } +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index bc811de..2ef26b8 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -26,3 +26,6 @@ item.mmm.materials.nugget.iron.name=Iron Nugget item.mmm.materials.ingot.copper.name=Copper Ingot item.mmm.materials.nugget.copper.name=Copper Nugget tile.mmm.materials.ore.copper.name=Native Copper + +item.mmm.materials.stone.malachite.name=Malachite +tile.mmm.materials.ore.malachite.name=Malachite diff --git a/src/resources/assets/mmm/models/block/materials/ore/malachite.json b/src/resources/assets/mmm/models/block/materials/ore/malachite.json new file mode 100644 index 0000000..e2088bb --- /dev/null +++ b/src/resources/assets/mmm/models/block/materials/ore/malachite.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "mmm:blocks/materials/ore/malachite" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/ore/malachite.json b/src/resources/assets/mmm/models/item/materials/ore/malachite.json new file mode 100644 index 0000000..8f0d10f --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/ore/malachite.json @@ -0,0 +1,3 @@ +{ + "parent": "mmm:block/materials/ore/malachite" +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/stone/malachite.json b/src/resources/assets/mmm/models/item/materials/stone/malachite.json new file mode 100644 index 0000000..4cede72 --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/stone/malachite.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/materials/ore/malachite" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/blocks/materials/ore/malachite.png b/src/resources/assets/mmm/textures/blocks/materials/ore/malachite.png new file mode 100644 index 0000000000000000000000000000000000000000..801b4f7b2bef2be1ab5c6b5530f103f7329635f6 GIT binary patch literal 264 zcmV+j0r&oiP)XY%Vv;ky+W?#{CHbdYej3F~v( zbi^%@Vrmm5x^bcIXg1*6+wd0zJb4G7NsfqxnT6&qVW8T{EO(Qk0xXic91`w;RRMgS z>Imn{0vh%m$pg_s;+_6hl&G^D67L*UVGbg)zcOa4xKqwF&&Y}c5c>gZ7*-NoamiZ% O0000UtP)M@Hg&-7!J~qBUQHy5UF*OgW1BnSF6H-IazaqL71XphSk;mz6J5(D> zm*T)-p5M85UX1X+xh&p-#Rlzrn+&$2GpsqSG1RM%>z6A?DSsH~!Ky77_#+4V zd?YwY5=2o{aSl&iu=m&)nRGQ&6a{HG^pRy5j+~2mgCO8gN`XBKn2aXy2u#zIqPwnJ zeGBp-K^TU#a0IbeiLxw_=Q%~StTsBG#^SedGU)2X4&t~+uu^@T-#Or%W9dgIgn;LH k@cmQRwyh(#@OQt=7jN{wvZ1cAD*ylh07*qoM6N<$f|F8}TL1t6 literal 0 HcmV?d00001