Skip to content

Instantly share code, notes, and snippets.

Created February 8, 2014 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8889261 to your computer and use it in GitHub Desktop.
Save anonymous/8889261 to your computer and use it in GitHub Desktop.
package amw.witchcraft;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid=witchcraftInfo.ID, name=witchcraftInfo.NAME, version=witchcraftInfo.VERS)
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class witchcraft {
public static CreativeTabs amwWitchcraft = new CreativeTabs("amwWitchcraft") {
public ItemStack getIconItemStack() {
return new ItemStack(amw.witchcraft.witchcraft.flowerSoul.blockID, 1, 0);
}
};
//other
public static Item bookOfShadows = new bookOfShadows(710).setCreativeTab(amwWitchcraft).setUnlocalizedName("bookOfShadows");
public final static Item soulFragment = new soulFragment(706).setCreativeTab(amwWitchcraft);
//bushes
public final static Block bushShadow = new bushShadow(700, Material.leaves).setCreativeTab(amwWitchcraft);
public final static Block bushSoul = new bushSoul(704, Material.rock).setCreativeTab(amwWitchcraft);
//flowers
public static Block flowerShadow = new flowerShadow(701).setUnlocalizedName("flowerShadow").setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setCreativeTab(amwWitchcraft).setTextureName(witchcraftInfo.ID.toLowerCase() + ":flower_shadow");
public static Block flowerSoul = new flowerSoul(705).setUnlocalizedName("flowerSoul").setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setCreativeTab(amwWitchcraft).setTextureName(witchcraftInfo.ID.toLowerCase() + ":flower_soul");
//wands
private final static Item wandGravity = new wandGravity(702).setCreativeTab(amwWitchcraft);
private final static Item wandPush = new wandPush(703).setCreativeTab(amwWitchcraft);
// The instance of your mod that Forge uses.
@Instance("witchcraft")
public static witchcraft instance;
// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide=witchcraftInfo.CLIENTPROXY + "ClientProxy", serverSide=witchcraftInfo.COMMONPROXY + "CommonProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// Stub Method
}
@EventHandler
public void load(FMLInitializationEvent event) {
proxy.registerRenderers();
LanguageRegistry.instance().addStringLocalization("itemGroup.amwWitchcraft", "en_US", "Azania Witchcraft");
ItemStack stickStack = new ItemStack(Item.stick);
ItemStack flowerShadowStack = new ItemStack(amw.witchcraft.witchcraft.flowerShadow);
ItemStack wandPushStack = new ItemStack(amw.witchcraft.witchcraft.wandPush);
ItemStack soulFragmentStack = new ItemStack(amw.witchcraft.witchcraft.soulFragment);
ItemStack vineStack = new ItemStack(Block.vine);
ItemStack flowerSoulStack = new ItemStack(amw.witchcraft.witchcraft.flowerSoul);
ItemStack paperStack = new ItemStack(Item.paper);
ItemStack leatherStack = new ItemStack(Item.leather);
ItemStack blazeRodStack = new ItemStack(Item.blazeRod);
ItemStack bookOfShadowsStack = new ItemStack(amw.witchcraft.witchcraft.bookOfShadows);
//bushes
GameRegistry.registerBlock(bushShadow, "bushShadow");
LanguageRegistry.addName(bushShadow, "Shadow Bush");
GameRegistry.registerWorldGenerator(new generationShadowBush());
GameRegistry.registerBlock(bushSoul, "bushSoul");
LanguageRegistry.addName(bushSoul, "Soul Bush");
MinecraftForge.setBlockHarvestLevel(bushSoul, "pickaxe", 3);
GameRegistry.registerWorldGenerator(new generationSoulBush());
//flowers
GameRegistry.registerBlock(flowerShadow, "flowerShadow");
LanguageRegistry.addName(flowerShadow, "Shadow Flower");
GameRegistry.registerBlock(flowerSoul, "flowerSoul");
LanguageRegistry.addName(flowerSoul, "Soul Flower");
GameRegistry.addRecipe(flowerSoulStack, " x ", " y ", " z ",
'x', soulFragmentStack, 'y', vineStack, 'z', stickStack);
//wands
GameRegistry.registerItem(wandGravity, "wandGravity");
LanguageRegistry.addName(wandGravity, "Wand Of Gravity");
GameRegistry.registerItem(wandPush, "wandPush");
LanguageRegistry.addName(wandPush, "Wand Of Push");
GameRegistry.addRecipe(wandPushStack, " x ", " y ", " y ",
'x', flowerShadowStack, 'y', stickStack);
//other
GameRegistry.registerItem(bookOfShadows, "bookOfShadows");
GameRegistry.addRecipe(bookOfShadowsStack, "aba", "aca", "ded",
'a', paperStack, 'b', flowerShadowStack, 'c', soulFragmentStack, 'd', leatherStack, 'e', blazeRodStack);
GameRegistry.registerItem(soulFragment, "soulFragment");
LanguageRegistry.addName(soulFragment, "Soul Fragment");
GameRegistry.addSmelting(amw.witchcraft.witchcraft.bushSoul.blockID, soulFragmentStack, 0.1f);
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
// Stub Method
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment