Jump to content

Recommended Posts

Posted

I have a stone block I set up.

It has the hardness and resistance of stone.

It is programmed to require a diamond pickaxe to mine it.

 

It's mineable with any pick, even wood.

I even mined it with my fists!

 

Forge 804 (Please fix this!)

Posted

I initalize all my Gallifrey- related stuff in another file:

 

@EventHandler
        public void load(FMLInitializationEvent event) {
        	
        	// Loads Gallifrey package
        	if (CoreConfiguration.enableGallifrey == true) {
            CoreGallifrey.initalize();
        	}
        	else {
        		System.out.println("[Whocraft-Core] Gallifrey is disabled, ignoring it...");
        	}
        	
            proxy.registerRenderers();
        }

 

Let's look at that file.

 

package net.pekkit.mcforge.whocraft.gallifrey;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import net.pekkit.mcforge.whocraft.CoreConfiguration;

public class CoreGallifrey {

public static Block gallifreyStone;
public static Block gallifreyGrass;
    public static Block gallifreyDirt;
public static Block gallifreyDiamondOre;
public static Block gallifreyPortal;

    public static int gallifreyDimID = 10;
    
    public static BiomeGenBase BiomeGallifrey;
    public static int gallifreyBiomeID = 53;

@SuppressWarnings("deprecation")
    public static void initalize() {
	System.out.println("[Whocraft-Core] Core module Gallifrey is enabled, loading it...");
	loadBlocks();
	registerDimension();
	loadBiome();
}

public static void loadBlocks() {
	gallifreyStone = new BlockGallifreyStone(241, Material.ground);
	gallifreyGrass = new BlockGallifreyGrass(242, Material.grass);
    gallifreyDirt = new BlockGallifreyDirt(243, Material.grass);
	gallifreyDiamondOre = new BlockGallifreyDiamondOre(244);
	gallifreyPortal = new BlockGallifreyPortal(CoreConfiguration.gallifreyPortalID).setUnlocalizedName("whocraft:gallifreyPortal");

	LanguageRegistry.addName(gallifreyStone, "§4Stone");
        MinecraftForge.setBlockHarvestLevel(gallifreyStone, "pickaxe", 3);
        GameRegistry.registerBlock(gallifreyStone, "gallifreyStone");
    	
    	LanguageRegistry.addName(gallifreyDirt, "§4Dirt");
        MinecraftForge.setBlockHarvestLevel(gallifreyDirt, "shovel", 0);
        GameRegistry.registerBlock(gallifreyDirt, "gallifreyDirt");
    	
    	LanguageRegistry.addName(gallifreyGrass, "§4Grass Block");
        MinecraftForge.setBlockHarvestLevel(gallifreyGrass, "shovel", 0);
        GameRegistry.registerBlock(gallifreyGrass, "gallifreyGrass");
        
        LanguageRegistry.addName(gallifreyDiamondOre, "§4Diamond Ore");
        MinecraftForge.setBlockHarvestLevel(gallifreyDiamondOre, "pickaxe", 2);
        GameRegistry.registerBlock(gallifreyDiamondOre, "gallifreyDiamondOre");
        
        GameRegistry.registerBlock(gallifreyPortal, "gallifreyPortal");
        LanguageRegistry.addName(gallifreyPortal, "§4[DEV] Gallifrey Portal Block");

System.out.println("[Whocraft-Core: Gallifrey] Loaded 5 blocks!");
    }
public static void registerDimension() {
    	
	DimensionManager.registerProviderType(gallifreyDimID, WorldProviderGallifrey.class, false);
	DimensionManager.registerDimension(gallifreyDimID, gallifreyDimID);
    	 
    	 System.out.println("[Whocraft-Core: Gallifrey] Registered the dimension Gallifrey with the dimension ID " + gallifreyDimID + "!");
    }

public static void loadBiome() {
	 BiomeGallifrey = new BiomeGenGallifrey(gallifreyBiomeID);
	 System.out.println("[Whocraft-Core: Gallifrey] Registered the biome Gallifrey with the biome ID " + gallifreyBiomeID + "!");
}
}

 

Now for the affected block file:

 

package net.pekkit.mcforge.whocraft.gallifrey;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class BlockGallifreyStone extends Block {

public BlockGallifreyStone(int id, Material material) {
	super(id, material);
	setHardness(1.5F);
	setResistance(10.0F);
	setStepSound(Block.soundStoneFootstep);
	setUnlocalizedName("gallifreyStone");
	setCreativeTab(CreativeTabs.tabBlock);

	// Texture
	func_111022_d("whocraft:gallifreyStone");

}

}

 

I don't see a problem.

Posted

Taken from the Gallifrey class. I initalized the Blocks like this:

public static Block gallifreyStone;

 

public static void loadBlocks() {
	gallifreyStone = new BlockGallifreyStone(241, Material.ground);
	gallifreyGrass = new BlockGallifreyGrass(242, Material.grass);
    gallifreyDirt = new BlockGallifreyDirt(243, Material.grass);
	gallifreyDiamondOre = new BlockGallifreyDiamondOre(244);
	gallifreyPortal = new BlockGallifreyPortal(CoreConfiguration.gallifreyPortalID).setUnlocalizedName("whocraft:gallifreyPortal");

	LanguageRegistry.addName(gallifreyStone, "§4Stone");
        MinecraftForge.setBlockHarvestLevel(gallifreyStone, "pickaxe", 3);
        GameRegistry.registerBlock(gallifreyStone, "gallifreyStone");
    	
    	LanguageRegistry.addName(gallifreyDirt, "§4Dirt");
        MinecraftForge.setBlockHarvestLevel(gallifreyDirt, "shovel", 0);
        GameRegistry.registerBlock(gallifreyDirt, "gallifreyDirt");
    	
    	LanguageRegistry.addName(gallifreyGrass, "§4Grass Block");
        MinecraftForge.setBlockHarvestLevel(gallifreyGrass, "shovel", 0);
        GameRegistry.registerBlock(gallifreyGrass, "gallifreyGrass");
        
        LanguageRegistry.addName(gallifreyDiamondOre, "§4Diamond Ore");
        MinecraftForge.setBlockHarvestLevel(gallifreyDiamondOre, "pickaxe", 2);
        GameRegistry.registerBlock(gallifreyDiamondOre, "gallifreyDiamondOre");
        
        GameRegistry.registerBlock(gallifreyPortal, "gallifreyPortal");
        LanguageRegistry.addName(gallifreyPortal, "§4[DEV] Gallifrey Portal Block");

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.