Skip to content

Commit e18ca76

Browse files
committed
vanilla ores added
1 parent 4902a54 commit e18ca76

File tree

82 files changed

+267
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+267
-34
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package com.knoxhack.nethermetals.blocks;
2+
3+
4+
5+
6+
7+
import java.util.Random;
8+
9+
import net.minecraft.block.Block;
10+
11+
import net.minecraft.block.material.Material;
12+
import net.minecraft.block.state.IBlockState;
13+
import net.minecraft.creativetab.CreativeTabs;
14+
15+
16+
public class ModBlockOre3 extends Block {
17+
18+
private Block drop;
19+
private int meta;
20+
private int least_quantity;
21+
private int most_quantity;
22+
23+
protected ModBlockOre3(String unlocalizedName, Material mat, Block nethernickelOre, int meta, int least_quantity, int most_quantity) {
24+
super(mat);
25+
this.drop = nethernickelOre;
26+
this.meta = meta;
27+
this.least_quantity = least_quantity;
28+
this.most_quantity = most_quantity;
29+
this.setHarvestLevel("pickaxe", 3);
30+
this.setHardness(15.0f);
31+
this.setResistance(20.0f);
32+
this.setUnlocalizedName(unlocalizedName);
33+
this.setCreativeTab(CreativeTabs.tabBlock);
34+
}
35+
36+
protected ModBlockOre3(String unlocalizedName, Material mat, Block nethernickelOre, int least_quantity, int most_quantity) {
37+
this(unlocalizedName, mat, nethernickelOre, 0, least_quantity, most_quantity);
38+
}
39+
40+
protected ModBlockOre3(String unlocalizedName, Material mat, Block drop) {
41+
this(unlocalizedName, mat, drop, 1, 1);
42+
}
43+
44+
45+
46+
47+
@Override
48+
public int damageDropped(IBlockState blockstate) {
49+
return this.meta;
50+
}
51+
52+
@Override
53+
public int quantityDropped(IBlockState blockstate, int fortune, Random random) {
54+
if (this.least_quantity >= this.most_quantity)
55+
return this.least_quantity;
56+
return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1);
57+
}
58+
}
59+

src/main/java/com/knoxhack/nethermetals/blocks/ModBlocks.java renamed to src/java/com/knoxhack/nethermetals/blocks/ModBlocks.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ public final class ModBlocks {
1717
public static Block nethernickelOre;
1818
public static Block netherzincOre;
1919

20+
public static Block netherironOre;
21+
public static Block netherlapisOre;
22+
public static Block netherredstoneOre;
23+
public static Block netherdiamondOre;
24+
public static Block nethergoldOre;
25+
26+
27+
28+
2029

2130

2231
public static void createBlocks() {
@@ -27,7 +36,12 @@ public static void createBlocks() {
2736
GameRegistry.registerBlock(netherzincOre = new ModBlockOre("nether_zinc_ore", Material.rock, ModBlocks.netherzincOre, 1, 1), "nether_zinc_ore");
2837
GameRegistry.registerBlock(nethernickelOre = new ModBlockOre("nether_nickel_ore", Material.rock, ModBlocks.nethernickelOre, 1, 1), "nether_nickel_ore");
2938

30-
39+
GameRegistry.registerBlock(netherironOre = new ModBlockOre("nether_iron_ore", Material.rock, ModBlocks.netherironOre, 1, 1), "nether_iron_ore");
40+
GameRegistry.registerBlock(netherlapisOre = new ModBlockOre("nether_lapis_ore", Material.rock, ModBlocks.netherlapisOre, 1, 1), "nether_lapis_ore");
41+
GameRegistry.registerBlock(netherredstoneOre = new ModBlockOre("nether_redstone_ore", Material.rock, ModBlocks.netherredstoneOre, 1, 1), "nether_redstone_ore");
42+
GameRegistry.registerBlock(netherdiamondOre = new ModBlockOre3("nether_diamond_ore", Material.rock, ModBlocks.netherdiamondOre, 1, 1), "nether_diamond_ore");
43+
GameRegistry.registerBlock(nethergoldOre = new ModBlockOre2("nether_gold_ore", Material.rock, ModBlocks.nethergoldOre, 1, 1), "nether_gold_ore");
44+
3145

3246

3347

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ public static void registerBlockRenderer() {
1717
reg(ModBlocks.nethersilverOre);
1818
reg(ModBlocks.nethernickelOre);
1919
reg(ModBlocks.netherzincOre);
20-
21-
22-
23-
20+
21+
reg(ModBlocks.netherironOre);
22+
reg(ModBlocks.netherlapisOre);
23+
reg(ModBlocks.netherredstoneOre);
24+
reg(ModBlocks.netherdiamondOre);
25+
reg(ModBlocks.nethergoldOre);
2426

2527
}
2628

0 commit comments

Comments
 (0)