diff --git a/TODO.txt b/TODO.txt index 5f2e81b..7ce1afb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -46,7 +46,6 @@ materials No Metal from slag materials.rock No Smooth limestone ------------------------------------------------------------------------------------------------------- materials.ore No Rock salt -materials.ore No Tin (cassiterite) materials.ore No Zinc (sphalerite) materials.ore No Aluminium (bauxite) materials.ore No Silver (native, horn silver) diff --git a/src/java/mmm/materials/MOre.java b/src/java/mmm/materials/MOre.java index 87a0bab..d0d10f7 100644 --- a/src/java/mmm/materials/MOre.java +++ b/src/java/mmm/materials/MOre.java @@ -34,7 +34,8 @@ public class MOre private int expMin , expMax; private MMetal metal; - private int genIngots; + private int genQuantity; + private E_MMetalItemType smeltingOutput; public MOre( final String name , final int harvestLevel ) @@ -55,7 +56,8 @@ public class MOre this.dropMin = this.dropMax = 1; this.expMin = this.expMax = 0; this.metal = null; - this.genIngots = 0; + this.genQuantity = 0; + URegistry.addBlock( this ); } @@ -107,15 +109,22 @@ public class MOre public MOre setMetal( final MMetal metal ) { - return this.setMetal( metal , 1 ); + return this.setMetal( metal , 1 , E_MMetalItemType.INGOT ); } - public MOre setMetal( final MMetal metal , final int ingots ) + public MOre setMetal( final MMetal metal , int count ) { - assert metal != null && ingots > 0; + return this.setMetal( metal , count , E_MMetalItemType.INGOT ); + } + + + public MOre setMetal( final MMetal metal , final int quantity , final E_MMetalItemType type ) + { + assert metal != null && quantity > 0; this.metal = metal; - this.genIngots = ingots; + this.genQuantity = quantity; + this.smeltingOutput = type; return this; } @@ -181,8 +190,22 @@ public class MOre public void registerRecipes( ) { if ( this.metal != null ) { - final ItemStack output = new ItemStack( this.metal.INGOT , this.genIngots ); - final float xp = this.metal.SMELTING_XP * this.genIngots; + final ItemStack output; + final float xpMul; + switch ( this.smeltingOutput ) { + case INGOT: + output = new ItemStack( this.metal.INGOT , this.genQuantity ); + xpMul = 1; + break; + case NUGGET: + output = new ItemStack( this.metal.NUGGET , this.genQuantity ); + xpMul = 1 / 9f; + break; + default: + throw new IllegalStateException( this.smeltingOutput.toString( ) ); + } + + final float xp = this.metal.SMELTING_XP * this.genQuantity * xpMul; if ( this.dropItems == null ) { GameRegistry.addSmelting( this , output , xp ); } else { diff --git a/src/java/mmm/materials/Materials.java b/src/java/mmm/materials/Materials.java index 9f144af..780cf66 100644 --- a/src/java/mmm/materials/Materials.java +++ b/src/java/mmm/materials/Materials.java @@ -1,6 +1,7 @@ package mmm.materials; +import mmm.materials.ore.MOCassiterite; import mmm.materials.ore.MOCopper; import mmm.materials.ore.MOCuprite; import mmm.materials.ore.MOMalachite; @@ -23,16 +24,19 @@ public class Materials public static final MMetal GOLD; public static final MMetal IRON; public static final MMetal COPPER; - //public static final MMetal RED_COPPER; + public static final MMetal TIN; + // public static final MMetal RED_COPPER; public static final Item ITEM_SLAG; public static final Item ITEM_MALACHITE; public static final Item ITEM_CUPRITE; public static final Item ITEM_COKE; + public static final Item ITEM_CASSITERITE; public static final MOre ORE_COPPER; public static final MOre ORE_MALACHITE; public static final MOre ORE_CUPRITE; + public static final MOre ORE_CASSITERITE; static { // Rocks @@ -45,18 +49,21 @@ public class Materials // Custom metals COPPER = new MMetal( "copper" , 0.4f , 4f , 1 , MapColor.DIRT ); - //RED_COPPER = new MMetal( "red_copper" , 0f , 2f , 1 , MapColor.RED ); + TIN = new MMetal( "tin" , 0.6f , 1f , 0 , MapColor.GRAY ); + // RED_COPPER = new MMetal( "red_copper" , 0f , 2f , 1 , MapColor.RED ); // Items that do not correspond to metals or ores - URegistry.addItem( ITEM_SLAG = Materials.makeItem( "slag" ) ); - URegistry.addItem( ITEM_MALACHITE = Materials.makeItem( "malachite" ) ); - URegistry.addItem( ITEM_CUPRITE = Materials.makeItem( "cuprite" ) ); - URegistry.addItem( ITEM_COKE = Materials.makeFuel( "coke" , 9600 ) ); + ITEM_SLAG = Materials.makeItem( "slag" ); + ITEM_MALACHITE = Materials.makeItem( "malachite" ); + ITEM_CUPRITE = Materials.makeItem( "cuprite" ); + ITEM_COKE = Materials.makeFuel( "coke" , 9600 ); + ITEM_CASSITERITE = Materials.makeItem( "cassiterite" ); // Actual ores - URegistry.addBlock( ORE_COPPER = new MOCopper( ) ); - URegistry.addBlock( ORE_MALACHITE = new MOMalachite( ) ); - URegistry.addBlock( ORE_CUPRITE = new MOCuprite( ) ); + ORE_COPPER = new MOCopper( ); + ORE_MALACHITE = new MOMalachite( ); + ORE_CUPRITE = new MOCuprite( ); + ORE_CASSITERITE = new MOCassiterite( ); // Other recipes URegistry.addRecipeRegistrar( new Materials( ) ); @@ -76,6 +83,7 @@ public class Materials final Item stone = new Item( ); URegistry.setIdentifiers( stone , "materials" , "stone" , name ); stone.setCreativeTab( CreativeTabs.MATERIALS ); + URegistry.addItem( stone ); return stone; } @@ -97,8 +105,8 @@ public class Materials { // Alloy recipes // MAlloyRecipe.build( ).setName( "materials/red_copper" ).setBurnTime( 800 ) - // .addInput( Materials.COPPER.INGOT , 1 ).addInput( Items.REDSTONE , 2 ) - // .setOutput( Materials.RED_COPPER.INGOT ).setSlag( 1 ).register( ); + // .addInput( Materials.COPPER.INGOT , 1 ).addInput( Items.REDSTONE , 2 ) + // .setOutput( Materials.RED_COPPER.INGOT ).setSlag( 1 ).register( ); // XXX coke is not an alloy MAlloyRecipe.build( ).setName( "materials/coke" ).setBurnTime( 3200 ).addInput( Items.COAL , 2 ) .setOutput( Materials.ITEM_COKE ).setSlag( 1 ).register( ); diff --git a/src/java/mmm/materials/ore/MOCassiterite.java b/src/java/mmm/materials/ore/MOCassiterite.java new file mode 100644 index 0000000..25d1297 --- /dev/null +++ b/src/java/mmm/materials/ore/MOCassiterite.java @@ -0,0 +1,37 @@ +package mmm.materials.ore; + + +import java.util.List; + +import mmm.materials.E_MMetalItemType; +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; + + + +public class MOCassiterite + extends MOre + implements I_UOreGenerationRegistrar +{ + + public MOCassiterite( ) + { + super( "cassiterite" , 0 ); + this.setMetal( Materials.TIN , 1 , E_MMetalItemType.NUGGET ); + this.setDrops( Materials.ITEM_CASSITERITE , 2 , 5 ); + this.setExperience( 2 , 5 ); + } + + + @Override + public void addConditions( final List< WOreGenerationCondition > conditions ) + { + conditions.add( new WOreGenerationCondition( WLocation.inOverworld( ) , + new WOreGenerationParameters( this.getDefaultState( ) , 10 , 9 , 45 , 80 ) ) ); + } + +} diff --git a/src/resources/assets/mmm/blockstates/materials/block/tin.json b/src/resources/assets/mmm/blockstates/materials/block/tin.json new file mode 100644 index 0000000..e8fc96e --- /dev/null +++ b/src/resources/assets/mmm/blockstates/materials/block/tin.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mmm:materials/block/tin" } + } +} diff --git a/src/resources/assets/mmm/blockstates/materials/ore/cassiterite.json b/src/resources/assets/mmm/blockstates/materials/ore/cassiterite.json new file mode 100644 index 0000000..321f3b9 --- /dev/null +++ b/src/resources/assets/mmm/blockstates/materials/ore/cassiterite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mmm:materials/ore/cassiterite" } + } +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index a0e5426..7e2b284 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -2,6 +2,13 @@ gui.mmm.configure=Configure gui.mmm.configure.hoppers=Hoppers gui.mmm.configure.comparator=Comparator Output +gui.mmm.tech.base.am.always_active=Always Active +gui.mmm.tech.base.am.powered=Redstone Activates +gui.mmm.tech.base.am.unpowered=Redstone Disables +gui.mmm.tech.base.am.disabled=Deactivated + + +tile.mmm.materials.rock.limestone.name=Limestone item.mmm.materials.stone.coke.name=Coke item.mmm.materials.stone.slag.name=Slag @@ -16,11 +23,12 @@ tile.mmm.materials.ore.malachite.name=Malachite Ore item.mmm.materials.stone.cuprite.name=Cuprite tile.mmm.materials.ore.cuprite.name=Cuprite Ore +item.mmm.materials.ingot.tin.name=Tin Ingot +item.mmm.materials.nugget.tin.name=Tin Nugget +tile.mmm.materials.block.tin.name=Tin Block +tile.mmm.materials.ore.cassiterite.name=Cassiterite Ore +item.mmm.materials.stone.cassiterite.name=Cassiterite -gui.mmm.tech.base.am.always_active=Always Active -gui.mmm.tech.base.am.powered=Redstone Activates -gui.mmm.tech.base.am.unpowered=Redstone Disables -gui.mmm.tech.base.am.disabled=Deactivated tile.mmm.tech.base.alloy_furnace.inactive.name=Alloy Furnace container.mmm.alloy_furnace.contents=Furnace Contents diff --git a/src/resources/assets/mmm/models/block/materials/block/tin.json b/src/resources/assets/mmm/models/block/materials/block/tin.json new file mode 100644 index 0000000..759c290 --- /dev/null +++ b/src/resources/assets/mmm/models/block/materials/block/tin.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "mmm:blocks/materials/block/tin" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/materials/ore/cassiterite.json b/src/resources/assets/mmm/models/block/materials/ore/cassiterite.json new file mode 100644 index 0000000..40aa470 --- /dev/null +++ b/src/resources/assets/mmm/models/block/materials/ore/cassiterite.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "mmm:blocks/materials/ore/cassiterite" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/block/tin.json b/src/resources/assets/mmm/models/item/materials/block/tin.json new file mode 100644 index 0000000..29fd14b --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/block/tin.json @@ -0,0 +1,3 @@ +{ + "parent": "mmm:block/materials/block/tin" +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/ingot/tin.json b/src/resources/assets/mmm/models/item/materials/ingot/tin.json new file mode 100644 index 0000000..c0094d9 --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/ingot/tin.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/materials/ingots/tin" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/nugget/tin.json b/src/resources/assets/mmm/models/item/materials/nugget/tin.json new file mode 100644 index 0000000..399a4a7 --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/nugget/tin.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/materials/nuggets/tin" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/ore/cassiterite.json b/src/resources/assets/mmm/models/item/materials/ore/cassiterite.json new file mode 100644 index 0000000..5b21d38 --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/ore/cassiterite.json @@ -0,0 +1,3 @@ +{ + "parent": "mmm:block/materials/ore/cassiterite" +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/materials/stone/cassiterite.json b/src/resources/assets/mmm/models/item/materials/stone/cassiterite.json new file mode 100644 index 0000000..019ff3e --- /dev/null +++ b/src/resources/assets/mmm/models/item/materials/stone/cassiterite.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/materials/stone/cassiterite" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/blocks/materials/block/tin.png b/src/resources/assets/mmm/textures/blocks/materials/block/tin.png new file mode 100644 index 0000000..889fd20 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/materials/block/tin.png differ diff --git a/src/resources/assets/mmm/textures/blocks/materials/ore/cassiterite.png b/src/resources/assets/mmm/textures/blocks/materials/ore/cassiterite.png new file mode 100644 index 0000000..1f9116c Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/materials/ore/cassiterite.png differ diff --git a/src/resources/assets/mmm/textures/items/materials/ingots/tin.png b/src/resources/assets/mmm/textures/items/materials/ingots/tin.png new file mode 100644 index 0000000..f26f30b Binary files /dev/null and b/src/resources/assets/mmm/textures/items/materials/ingots/tin.png differ diff --git a/src/resources/assets/mmm/textures/items/materials/nuggets/tin.png b/src/resources/assets/mmm/textures/items/materials/nuggets/tin.png new file mode 100644 index 0000000..83598c4 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/materials/nuggets/tin.png differ diff --git a/src/resources/assets/mmm/textures/items/materials/stone/cassiterite.png b/src/resources/assets/mmm/textures/items/materials/stone/cassiterite.png new file mode 100644 index 0000000..6cbed68 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/materials/stone/cassiterite.png differ