And register that in your PreInit method in your main class with:
"MinecraftForge.EVENT_BUS.register(new SoundHandler());"
Now make a new class where you are going to register all of your custom sounds! Call this something like "Sound"
public class Sound {
public static final String SOUND_RESOURCE_LOCATION = "MODID" + ":";
public static final String SOUND_PREFIX = "MODID" + ":";
public static String[] files = { SOUND_RESOURCE_LOCATION + "SOUND.ogg"};
public static final String CustomSound = SOUND_PREFIX + "SOUND";
}
So in that example, the sound your trying to add would be called "SOUND.ogg"
Place the sound called "SOUND.ogg" in your "assets/modid/sound/SOUND.ogg"
After that, just go into your custom mob or item or block or ANYTHING THAT YOU'RE USING THE SOUND ON! And where it asks for the sounds, just put "Sound.CustomSound"
And thats it.. If it doesnt work just comment with your code
To add more than one sound, all you have to do in the array (files[]) is just add a commar and put:
", SOUND_RESOURCE_LOCATION + "SOUND2.ogg"
And down the bottom with your "public static final String CustomSound = SOUND_PREFIX + "SOUND";"
just put under that "public static final String CustomSound2 = SOUND_PREFIX + "SOUND2";"
You can play it the same as you would the first one! For and eg. (this is for a mob)
The Meaning of Life, the Universe, and Everything.
Location:
Somewhere
Join Date:
11/29/2012
Posts:
619
Location:
Australia
Minecraft:
The_SlayerMC
Member Details
The only thing that i can see is that yout "public static final int DOG_TREAT_ID = 5000;" is too high, try changing the 5000 to about 3000, that should remove the NPE (Null Pointer Exception) Minecraft only has a certain range for ID's and 4095 is the highest i think...
Slayer maybe you should put all of you tutorials into one post. And/or if it gets to big at least link to the different tutorials, this way people know what you have Otherwise great job! +1
I run a pet project which is to gather tutorial requests from these boards and other minecraft modding sites.
Here's some popular ones on the list:
Gas - Create a block which acts like a gass, generated randomly in the world like the worlds natural gass reserves
Tech Machines - Tutorials on how to do tech machines which use power
Power networks - How to create your own power system.
Custom Enchantments - Add new enchantment types which can be found in the enchanting table.
Try changing you method name or you class name! It's saying this because they are written the exact same, when a method is written the same as the class name, it will think thats it's a constructor!
Hi, Im trying to get a Custom sound effect to work on a item, but i can't use the method in the tutorial as it is for a entity.I can not get it too work at all
public ItemPotatonade(int id)
{
super(id);
this.maxStackSize = 2;
this.setCreativeTab(CreativeTabs.tabCombat);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "disguisesiclecraft:PotatonadeOut", 1.0F, 1.0F);
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityPotatonade(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
@Mod(modid = DisguisesicleCraft.modid, name = "Disguisesicle Craft", version = "0.2.5")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class DisguisesicleCraft
{
public static final String modid = "glados64_disguisesiclecraft";
//Blocks and Ores
public static Block StoneTNT;
public static Block DirtTNT;
public static Block CobblestoneTNT;
public static Block SandTNT;
public static Block GravelTNT;
public static Block GoldOreTNT;
public static Block IronOreTNT;
public static Block CoalOreTNT;
public static Block LapisOreTNT;
public static Block DiamondOreTNT;
public static Block DisguisesicleRack = new BlockDisguisesicleRack(174, Material.rock).setHardness(0.4F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DisguisesicleRack");
public static Block DisguisesicleRackTrap = new BlockDisguisicleRackTrap(175, Material.rock).setHardness(0.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DisguisesicleRackTrap");
public static Block DisguisesicleOreTrap;
public static Block DisguisesicleOre;
public static Block DisguiseceptionPortal;
public static Block DisguisesicleGrass = new BlockDisguisesicleGrass(176, Material.grass).setHardness(0.6F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DisguisesicleGrass");
public static Block DisguisesicleDirt = new BlockDisguisesicleDirt(177, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DisguisesicleDirt");
public static Block DisguisesicleWood = new BlockDisguisesicleWood(178, Material.wood).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("DisguisesicleWood");
public static Block DisguisesicleWoodPlank = new BlockDisguisesicleWoodPlank(179, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("DisguisesicleWoodPlank");
public static Block DisguisesicleLeaves = new BlockDisguisesicleLeaves(180, Material.leaves).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("DisguisesicleLeaves");
//Items,Tools,Weapons and Armour
public static Item Disguisesicle;
public static Item DisguisesicleIngot;
public static Item DisguisesicleSword;
public static Item DisguiseSword;
public static Item DisguisesicleShovelPickaxe;
public static Item DisguisesicleSow;
public static Item Potatonade;
public static Item Endernade;
public static Item Disguiseanoter;
public static Item DisguiseiscleSapling;
//Biome's
public static BiomeGenBase Disguiseception = new BiomeGenDisguiseception(25);
//Dim ID
public static int DimID = 25;
EventManager eventmanager = new EventManager();
public void registerGenerate()
{
GameRegistry.registerWorldGenerator(new DisguiseceptionWorldGenerator());
}
@EventHandler
public void load(FMLInitializationEvent event)
{
//Blocks and Ores
StoneTNT = new BlockStoneTNT(801, Material.ground).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("StoneTNT");
DirtTNT = new BlockDirtTNT(802, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DirtTNT");
CobblestoneTNT = new BlockCobblestoneTNT(803, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CobblestoneTNT");
SandTNT = new BlockSandTNT(804, Material.sand).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setUnlocalizedName("SandTNT");
GravelTNT = new BlockGravelTNT(805, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("GravelTNT");
GoldOreTNT = new BlockGoldOreTNT(806, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("GoldOreTNT");
IronOreTNT = new BlockIronOreTNT(807, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("IronOreTNT");
CoalOreTNT = new BlockCoalOreTNT(808, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CoalOreTNT");
LapisOreTNT = new BlockLapisOreTNT(809, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("LapisOreTNT");
DiamondOreTNT = new BlockDiamondOreTNT(810, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DiamondOreTNT");
DisguisesicleOre = new BlockDisguisesicleOre(811, Material.rock).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Disguisesicle Ore");
DisguisesicleOreTrap = new BlockDisguisesicleOreTrap(814, Material.rock).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Disguisesicle OreTrap");
DisguiseceptionPortal = new BlockDisguiseceptionPortal(203).setHardness(-3.0F).setUnlocalizedName("Disguiseception Portal");
//Items,Tools,Weapons and Armour
Disguisesicle = new ItemDisguisesicle(8001).setUnlocalizedName("Disguisesicle");
DisguisesicleIngot = new ItemDisguisesicleIngot(8002).setUnlocalizedName("Disguisesicle Ingot");
DisguisesicleSword = new ItemDisguisesicleSword(8003, EnumToolMaterial.IRON).setUnlocalizedName("Disguisesicle Sword");
DisguiseSword = new ItemDisguiseSword(8004, EnumToolMaterial.EMERALD).setUnlocalizedName("Disguise Sword");
DisguisesicleShovelPickaxe = new ItemDisguisesicleShovelPickaxe(8005, EnumToolMaterial.EMERALD, 1).setUnlocalizedName("Disguisesicle ShovelPickaxe");
DisguisesicleSow = new ItemDisguisesicleSow(8006, EnumToolMaterial.IRON).setUnlocalizedName("Disguisesicle Sow");
Potatonade = new ItemPotatonade(8007).setUnlocalizedName("Potatonade");
Disguiseanoter = new ItemDisguiseanoter(8008).setUnlocalizedName("Disguiseanoter");
Endernade = new ItemEndernade(8009).setUnlocalizedName("Endernade");
Hi, Im trying to get a Custom sound effect to work on a item, but i can't use the method in the tutorial as it is for a entity.I can not get it too work at all
public ItemPotatonade(int id)
{
super(id);
this.maxStackSize = 2;
this.setCreativeTab(CreativeTabs.tabCombat);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "disguisesiclecraft:PotatonadeOut", 1.0F, 1.0F);
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityPotatonade(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
@Mod(modid = DisguisesicleCraft.modid, name = "Disguisesicle Craft", version = "0.2.5")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class DisguisesicleCraft
{
public static final String modid = "glados64_disguisesiclecraft";
//Blocks and Ores
public static Block StoneTNT;
public static Block DirtTNT;
public static Block CobblestoneTNT;
public static Block SandTNT;
public static Block GravelTNT;
public static Block GoldOreTNT;
public static Block IronOreTNT;
public static Block CoalOreTNT;
public static Block LapisOreTNT;
public static Block DiamondOreTNT;
public static Block DisguisesicleRack = new BlockDisguisesicleRack(174, Material.rock).setHardness(0.4F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DisguisesicleRack");
public static Block DisguisesicleRackTrap = new BlockDisguisicleRackTrap(175, Material.rock).setHardness(0.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DisguisesicleRackTrap");
public static Block DisguisesicleOreTrap;
public static Block DisguisesicleOre;
public static Block DisguiseceptionPortal;
public static Block DisguisesicleGrass = new BlockDisguisesicleGrass(176, Material.grass).setHardness(0.6F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DisguisesicleGrass");
public static Block DisguisesicleDirt = new BlockDisguisesicleDirt(177, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DisguisesicleDirt");
public static Block DisguisesicleWood = new BlockDisguisesicleWood(178, Material.wood).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("DisguisesicleWood");
public static Block DisguisesicleWoodPlank = new BlockDisguisesicleWoodPlank(179, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("DisguisesicleWoodPlank");
public static Block DisguisesicleLeaves = new BlockDisguisesicleLeaves(180, Material.leaves).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("DisguisesicleLeaves");
//Items,Tools,Weapons and Armour
public static Item Disguisesicle;
public static Item DisguisesicleIngot;
public static Item DisguisesicleSword;
public static Item DisguiseSword;
public static Item DisguisesicleShovelPickaxe;
public static Item DisguisesicleSow;
public static Item Potatonade;
public static Item Endernade;
public static Item Disguiseanoter;
public static Item DisguiseiscleSapling;
//Biome's
public static BiomeGenBase Disguiseception = new BiomeGenDisguiseception(25);
//Dim ID
public static int DimID = 25;
EventManager eventmanager = new EventManager();
public void registerGenerate()
{
GameRegistry.registerWorldGenerator(new DisguiseceptionWorldGenerator());
}
@EventHandler
public void load(FMLInitializationEvent event)
{
//Blocks and Ores
StoneTNT = new BlockStoneTNT(801, Material.ground).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("StoneTNT");
DirtTNT = new BlockDirtTNT(802, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DirtTNT");
CobblestoneTNT = new BlockCobblestoneTNT(803, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CobblestoneTNT");
SandTNT = new BlockSandTNT(804, Material.sand).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setUnlocalizedName("SandTNT");
GravelTNT = new BlockGravelTNT(805, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("GravelTNT");
GoldOreTNT = new BlockGoldOreTNT(806, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("GoldOreTNT");
IronOreTNT = new BlockIronOreTNT(807, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("IronOreTNT");
CoalOreTNT = new BlockCoalOreTNT(808, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CoalOreTNT");
LapisOreTNT = new BlockLapisOreTNT(809, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("LapisOreTNT");
DiamondOreTNT = new BlockDiamondOreTNT(810, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DiamondOreTNT");
DisguisesicleOre = new BlockDisguisesicleOre(811, Material.rock).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Disguisesicle Ore");
DisguisesicleOreTrap = new BlockDisguisesicleOreTrap(814, Material.rock).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Disguisesicle OreTrap");
DisguiseceptionPortal = new BlockDisguiseceptionPortal(203).setHardness(-3.0F).setUnlocalizedName("Disguiseception Portal");
//Items,Tools,Weapons and Armour
Disguisesicle = new ItemDisguisesicle(8001).setUnlocalizedName("Disguisesicle");
DisguisesicleIngot = new ItemDisguisesicleIngot(8002).setUnlocalizedName("Disguisesicle Ingot");
DisguisesicleSword = new ItemDisguisesicleSword(8003, EnumToolMaterial.IRON).setUnlocalizedName("Disguisesicle Sword");
DisguiseSword = new ItemDisguiseSword(8004, EnumToolMaterial.EMERALD).setUnlocalizedName("Disguise Sword");
DisguisesicleShovelPickaxe = new ItemDisguisesicleShovelPickaxe(8005, EnumToolMaterial.EMERALD, 1).setUnlocalizedName("Disguisesicle ShovelPickaxe");
DisguisesicleSow = new ItemDisguisesicleSow(8006, EnumToolMaterial.IRON).setUnlocalizedName("Disguisesicle Sow");
Potatonade = new ItemPotatonade(8007).setUnlocalizedName("Potatonade");
Disguiseanoter = new ItemDisguiseanoter(8008).setUnlocalizedName("Disguiseanoter");
Endernade = new ItemEndernade(8009).setUnlocalizedName("Endernade");
In the item try changing: "par2World.playSoundAtEntity(par3EntityPlayer, "disguisesiclecraft:PotatonadeOut", 1.0F, 1.0F);"
to: "par2World.playSoundAtEntity(par3EntityPlayer, Sound.CustomSound, 1.0F, 1.0F);"
And in the DisguisesicleCraftSoundEvents try changing: "event.manager.soundPoolSounds.addSound("disguisesiclecraft:PotatonadeOut.ogg");"
to: "event.manager.soundPoolSounds.addSound(sound);"
In the item try changing: "par2World.playSoundAtEntity(par3EntityPlayer, "disguisesiclecraft:PotatonadeOut", 1.0F, 1.0F);"
to: "par2World.playSoundAtEntity(par3EntityPlayer, Sound.CustomSound, 1.0F, 1.0F);"
And in the DisguisesicleCraftSoundEvents try changing: "event.manager.soundPoolSounds.addSound("disguisesiclecraft:PotatonadeOut.ogg");"
to: "event.manager.soundPoolSounds.addSound(sound);"
I would like to think that most of you know the basic Forge setup... (Stuff like base mod and all that jazz)
Okay.. Lets start with custom sounds!
Make a new folder in your assets/MODID/ folder called "sound" so the directory for the folder is:
"assets/modid/sound"
now that thats done, lets make a class called "SoundHandler"
And register that in your PreInit method in your main class with:
"MinecraftForge.EVENT_BUS.register(new SoundHandler());"
Now make a new class where you are going to register all of your custom sounds! Call this something like "Sound"
So in that example, the sound your trying to add would be called "SOUND.ogg"
Place the sound called "SOUND.ogg" in your "assets/modid/sound/SOUND.ogg"
After that, just go into your custom mob or item or block or ANYTHING THAT YOU'RE USING THE SOUND ON! And where it asks for the sounds, just put "Sound.CustomSound"
And thats it.. If it doesnt work just comment with your code
To add more than one sound, all you have to do in the array (files[]) is just add a commar and put:
", SOUND_RESOURCE_LOCATION + "SOUND2.ogg"
And down the bottom with your "public static final String CustomSound = SOUND_PREFIX + "SOUND";"
just put under that "public static final String CustomSound2 = SOUND_PREFIX + "SOUND2";"
You can play it the same as you would the first one! For and eg. (this is for a mob)
Now lets move onto a custom liquid!
Alright, first of all you want a basic block:
Now you want to extend it as "BlockFluidClassic":
Then give it a constructor with a Icon:
You will get an error at "ModFluid" and thats because we have to make that class!
So first add this above your init method (Not in it, above)
Then make the class and add this into it..
Now back to your tutFluid.java:
Time to add your texture!
Now just add your texture into your block texture directory and your done! but dont forget to register you block like a normal block
Other Tutorials:
Crafting table (5x3):
http://www.minecraftforum.net/topic/2046045-the-slayers-modding-tutorials-5x3-crafting-table/
Custom mob:
http://www.minecraftforum.net/topic/2046075-the-slayers-modding-tutorials-custom-mob/
Find out how I generate....coolAlias...world structure generation and rotation tool...
Thanks for telling me, it works for me though! :/ ill just fix it in the tut code!
Here's some popular ones on the list:
Gas - Create a block which acts like a gass, generated randomly in the world like the worlds natural gass reserves
Tech Machines - Tutorials on how to do tech machines which use power
Power networks - How to create your own power system.
Custom Enchantments - Add new enchantment types which can be found in the enchanting table.
Do you mean like shovels/pickaxes/hoes/axe/sword?
Try changing you method name or you class name! It's saying this because they are written the exact same, when a method is written the same as the class name, it will think thats it's a constructor!
here is my code
Item Potatonade.java
package disguisesiclecraft;
import cpw.mods.fml.common.network.Player;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemPotatonade extends Item
{
public ItemPotatonade(int id)
{
super(id);
this.maxStackSize = 2;
this.setCreativeTab(CreativeTabs.tabCombat);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "disguisesiclecraft:PotatonadeOut", 1.0F, 1.0F);
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityPotatonade(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
public void registerIcons(IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(DisguisesicleCraft.modid + ":" + (this.getUnlocalizedName().substring(5)));
}
}
Sound.java
package disguisesiclecraft;
public class Sound {
public static final String SOUND_RESOURCE_LOCATION = "disguisesiclecraft" + ":";
public static final String SOUND_PREFIX = "disguisesiclecraft" + ":";
public static String[] files = { SOUND_RESOURCE_LOCATION + "PotatonadeOut.ogg"};
public static final String CustomSound = SOUND_PREFIX + "PotatonadeOut";
}
Also DisguisesicleCraftSoundEvents.java
package disguisesiclecraft;
import java.util.logging.Level;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.launchwrapper.LogWrapper;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
public class DisguisesicleCraftSoundEvents {
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
for(String sound : Sound.files){
try {
event.manager.soundPoolSounds.addSound("disguisesiclecraft:PotatonadeOut.ogg");
} catch(Exception e) {
LogWrapper.log(Level.WARNING, "Failed loading sound: " + sound);
}
}
}
}
And Last but not least my main Mod file
package disguisesiclecraft;
import net.minecraft.block.Block;
import net.minecraft.block.BlockGrass;
import net.minecraft.block.BlockLog;
import net.minecraft.block.BlockWood;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import disguisesiclecraft.biomes.BiomeGenDisguiseception;
import disguisesiclecraft.world.DisguiseceptionWorldGenerator;
import disguisesiclecraft.world.WorldProviderDisguiseception;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.common.MinecraftForge;
@Mod(modid = DisguisesicleCraft.modid, name = "Disguisesicle Craft", version = "0.2.5")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class DisguisesicleCraft
{
public static final String modid = "glados64_disguisesiclecraft";
//Blocks and Ores
public static Block StoneTNT;
public static Block DirtTNT;
public static Block CobblestoneTNT;
public static Block SandTNT;
public static Block GravelTNT;
public static Block GoldOreTNT;
public static Block IronOreTNT;
public static Block CoalOreTNT;
public static Block LapisOreTNT;
public static Block DiamondOreTNT;
public static Block DisguisesicleRack = new BlockDisguisesicleRack(174, Material.rock).setHardness(0.4F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DisguisesicleRack");
public static Block DisguisesicleRackTrap = new BlockDisguisicleRackTrap(175, Material.rock).setHardness(0.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DisguisesicleRackTrap");
public static Block DisguisesicleOreTrap;
public static Block DisguisesicleOre;
public static Block DisguiseceptionPortal;
public static Block DisguisesicleGrass = new BlockDisguisesicleGrass(176, Material.grass).setHardness(0.6F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DisguisesicleGrass");
public static Block DisguisesicleDirt = new BlockDisguisesicleDirt(177, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DisguisesicleDirt");
public static Block DisguisesicleWood = new BlockDisguisesicleWood(178, Material.wood).setHardness(2.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("DisguisesicleWood");
public static Block DisguisesicleWoodPlank = new BlockDisguisesicleWoodPlank(179, Material.wood).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("DisguisesicleWoodPlank");
public static Block DisguisesicleLeaves = new BlockDisguisesicleLeaves(180, Material.leaves).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("DisguisesicleLeaves");
//Items,Tools,Weapons and Armour
public static Item Disguisesicle;
public static Item DisguisesicleIngot;
public static Item DisguisesicleSword;
public static Item DisguiseSword;
public static Item DisguisesicleShovelPickaxe;
public static Item DisguisesicleSow;
public static Item Potatonade;
public static Item Endernade;
public static Item Disguiseanoter;
public static Item DisguiseiscleSapling;
//Biome's
public static BiomeGenBase Disguiseception = new BiomeGenDisguiseception(25);
//Dim ID
public static int DimID = 25;
EventManager eventmanager = new EventManager();
public void registerGenerate()
{
GameRegistry.registerWorldGenerator(new DisguiseceptionWorldGenerator());
}
@EventHandler
public void load(FMLInitializationEvent event)
{
//Blocks and Ores
StoneTNT = new BlockStoneTNT(801, Material.ground).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("StoneTNT");
DirtTNT = new BlockDirtTNT(802, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("DirtTNT");
CobblestoneTNT = new BlockCobblestoneTNT(803, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CobblestoneTNT");
SandTNT = new BlockSandTNT(804, Material.sand).setHardness(0.5F).setStepSound(Block.soundSandFootstep).setUnlocalizedName("SandTNT");
GravelTNT = new BlockGravelTNT(805, Material.grass).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setUnlocalizedName("GravelTNT");
GoldOreTNT = new BlockGoldOreTNT(806, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("GoldOreTNT");
IronOreTNT = new BlockIronOreTNT(807, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("IronOreTNT");
CoalOreTNT = new BlockCoalOreTNT(808, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CoalOreTNT");
LapisOreTNT = new BlockLapisOreTNT(809, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("LapisOreTNT");
DiamondOreTNT = new BlockDiamondOreTNT(810, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DiamondOreTNT");
DisguisesicleOre = new BlockDisguisesicleOre(811, Material.rock).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Disguisesicle Ore");
DisguisesicleOreTrap = new BlockDisguisesicleOreTrap(814, Material.rock).setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Disguisesicle OreTrap");
DisguiseceptionPortal = new BlockDisguiseceptionPortal(203).setHardness(-3.0F).setUnlocalizedName("Disguiseception Portal");
//Items,Tools,Weapons and Armour
Disguisesicle = new ItemDisguisesicle(8001).setUnlocalizedName("Disguisesicle");
DisguisesicleIngot = new ItemDisguisesicleIngot(8002).setUnlocalizedName("Disguisesicle Ingot");
DisguisesicleSword = new ItemDisguisesicleSword(8003, EnumToolMaterial.IRON).setUnlocalizedName("Disguisesicle Sword");
DisguiseSword = new ItemDisguiseSword(8004, EnumToolMaterial.EMERALD).setUnlocalizedName("Disguise Sword");
DisguisesicleShovelPickaxe = new ItemDisguisesicleShovelPickaxe(8005, EnumToolMaterial.EMERALD, 1).setUnlocalizedName("Disguisesicle ShovelPickaxe");
DisguisesicleSow = new ItemDisguisesicleSow(8006, EnumToolMaterial.IRON).setUnlocalizedName("Disguisesicle Sow");
Potatonade = new ItemPotatonade(8007).setUnlocalizedName("Potatonade");
Disguiseanoter = new ItemDisguiseanoter(8008).setUnlocalizedName("Disguiseanoter");
Endernade = new ItemEndernade(8009).setUnlocalizedName("Endernade");
//Block Registry
LanguageRegistry.addName(StoneTNT, "StoneTNT");
MinecraftForge.setBlockHarvestLevel(StoneTNT, "pickaxe", 1);
GameRegistry.registerBlock(StoneTNT, "StoneTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "StoneTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","StoneTNT");
LanguageRegistry.addName(DirtTNT, "DirtTNT");
MinecraftForge.setBlockHarvestLevel(DirtTNT, "shovel", 1);
GameRegistry.registerBlock(DirtTNT, "DirtTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "DirtTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","DirtTNT");
LanguageRegistry.addName(CobblestoneTNT, "CobblestoneTNT");
MinecraftForge.setBlockHarvestLevel(CobblestoneTNT, "pickaxe", 1);
GameRegistry.registerBlock(CobblestoneTNT, "CobblestoneTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "CobblestoneTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","CobblestoneTNT");
LanguageRegistry.addName(SandTNT, "SandTNT");
MinecraftForge.setBlockHarvestLevel(SandTNT, "shovel", 1);
GameRegistry.registerBlock(SandTNT, "SandTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "SandTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","SandTNT");
LanguageRegistry.addName(GravelTNT, "GravelTNT");
MinecraftForge.setBlockHarvestLevel(GravelTNT, "shovel", 1);
GameRegistry.registerBlock(GravelTNT, "GravelTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "GravelTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","GravelTNT");
LanguageRegistry.addName(GoldOreTNT, "GoldOreTNT");
MinecraftForge.setBlockHarvestLevel(GoldOreTNT, "pickaxe", 2);
GameRegistry.registerBlock(GoldOreTNT, "GoldOreTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "GoldOreTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","GoldOreTNT");
LanguageRegistry.addName(IronOreTNT, "IronOreTNT");
MinecraftForge.setBlockHarvestLevel(IronOreTNT, "pickaxe", 2);
GameRegistry.registerBlock(IronOreTNT, "IronOreTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "IronOreTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","IronOreTNT");
LanguageRegistry.addName(CoalOreTNT, "CoalOreTNT");
MinecraftForge.setBlockHarvestLevel(CoalOreTNT, "pickaxe", 1);
GameRegistry.registerBlock(CoalOreTNT, "CoalOreTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "CoalOreTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","CoalOreTNT");
LanguageRegistry.addName(LapisOreTNT, "LapisOreTNT");
MinecraftForge.setBlockHarvestLevel(LapisOreTNT, "pickaxe", 1);
GameRegistry.registerBlock(LapisOreTNT, "LapisOreTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "LapisOreTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","LapisOreTNT");
LanguageRegistry.addName(DiamondOreTNT, "DiamondOreTNT");
MinecraftForge.setBlockHarvestLevel(DiamondOreTNT, "pickaxe", 2);
GameRegistry.registerBlock(DiamondOreTNT, "DiamondOreTNT");
EntityRegistry.registerModEntity(EntityDisguiseTNTPrimed.class, "DiamondOreTNT", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true);
LanguageRegistry.instance().addStringLocalization("entity.DisguisesicleCraft.name","DiamondOreTNT");
LanguageRegistry.addName(DisguisesicleOre, "Disguisesicle Ore");
MinecraftForge.setBlockHarvestLevel(DisguisesicleOre, "pickaxe", 2);
GameRegistry.registerBlock(DisguisesicleOre, "DisguisesicleOre");
LanguageRegistry.addName(DisguisesicleRack, "Disguisesicle Rack");
MinecraftForge.setBlockHarvestLevel(DisguisesicleRack, "pickaxe", 1);
GameRegistry.registerBlock(DisguisesicleRack, "DisguisesicleRack");
LanguageRegistry.addName(DisguisesicleRackTrap, "DisguisesicleRack Trap");
MinecraftForge.setBlockHarvestLevel(DisguisesicleRackTrap, "pickaxe", 1);
GameRegistry.registerBlock(DisguisesicleRackTrap, "DisguisesicleRackTrap");
LanguageRegistry.addName(DisguisesicleOreTrap, "Disguisesicle OreTrap");
MinecraftForge.setBlockHarvestLevel(DisguisesicleOreTrap, "pickaxe", 2);
GameRegistry.registerBlock(DisguisesicleOreTrap, "DisguisesicleOreTrap");
LanguageRegistry.addName(DisguiseceptionPortal, "Disguiseception Portal");
GameRegistry.registerBlock(DisguiseceptionPortal, "DisguiseceptionPortal");
LanguageRegistry.addName(DisguisesicleGrass, "Disguisesicle Grass");
GameRegistry.registerBlock(DisguisesicleGrass, "DisguisesicleGrass");
LanguageRegistry.addName(DisguisesicleDirt, "Disguisesicle Dirt");
GameRegistry.registerBlock(DisguisesicleDirt, "DisguisesicleDirt");
LanguageRegistry.addName(DisguisesicleWood, "Disguisesicle Wood");
GameRegistry.registerBlock(DisguisesicleWood, "DisguisesicleWood");
LanguageRegistry.addName(DisguisesicleWoodPlank, "Disguisesicle WoodPlank");
GameRegistry.registerBlock(DisguisesicleWoodPlank, "DisguisesicleWoodPlank");
LanguageRegistry.addName(DisguisesicleLeaves, "Disguisesicle Leaves");
GameRegistry.registerBlock(DisguisesicleLeaves, "DisguisesicleLeaves");
//Items,Tools,Weapons and Armour Registry
LanguageRegistry.addName(Disguisesicle, "Disguisesicle");
GameRegistry.registerItem(Disguisesicle, "Disguisesicle");
LanguageRegistry.addName(DisguisesicleIngot, "Disguisesicle Ingot");
GameRegistry.registerItem(DisguisesicleIngot, "Disguisesicle Ingot");
LanguageRegistry.addName(DisguisesicleSword, "Disguisesicle Sword");
GameRegistry.registerItem(DisguisesicleSword, "Disguisesicle Sword");
LanguageRegistry.addName(DisguiseSword, "Disguise Sword");
GameRegistry.registerItem(DisguiseSword, "Disguise Sword");
LanguageRegistry.addName(DisguisesicleShovelPickaxe, "Disguisesicle ShovelPickaxe");
GameRegistry.registerItem(DisguisesicleShovelPickaxe, "Disguisesicle ShovelPickaxe");
LanguageRegistry.addName(DisguisesicleSow, "Disguisesicle Sow");
GameRegistry.registerItem(DisguisesicleSow, "Disguisesicle Sow");
LanguageRegistry.addName(Disguiseanoter, "Disguiseanoter");
GameRegistry.registerItem(Disguiseanoter, "Disguiseanoter");
LanguageRegistry.addName(Potatonade, "Potatonade");
GameRegistry.registerItem(Potatonade, "Potatonade");
LanguageRegistry.addName(Endernade, "Endernade");
GameRegistry.registerItem(Endernade, "Endernade");
GameRegistry.addSmelting(Disguisesicle.itemID, new ItemStack(DisguisesicleIngot), 5F);
GameRegistry.addBiome(Disguiseception);
DimensionManager.registerProviderType(DimID, WorldProviderDisguiseception.class, false);
DimensionManager.registerDimension(DimID, DimID);
MinecraftForge.EVENT_BUS.register(new DisguisesicleCraftSoundEvents());
//Crafting Recipes for Blocks
GameRegistry.addRecipe(new ItemStack(StoneTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Block.stone, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(DirtTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Block.dirt, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(CobblestoneTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Block.cobblestone, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(SandTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Block.sand, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(GravelTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Block.gravel, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(GoldOreTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Item.ingotGold, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(IronOreTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Item.ingotIron, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(CoalOreTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Item.coal, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(LapisOreTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Block.oreLapis, 'C', DisguisesicleCraft.Disguisesicle,
});
GameRegistry.addRecipe(new ItemStack(DiamondOreTNT, 8), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Item.diamond, 'C', DisguisesicleCraft.Disguisesicle,
});
//Crafting Recipes for Items
GameRegistry.addRecipe(new ItemStack(DisguisesicleSword), new Object[]{
"C",
"C",
"X",
'X', Item.stick, 'C', DisguisesicleCraft.DisguisesicleIngot,
});
GameRegistry.addRecipe(new ItemStack(DisguiseSword), new Object[]{
" C ",
"QCQ",
" X ",
'X', Item.stick, 'Q', Item.netherQuartz, 'C', DisguisesicleCraft.DisguisesicleIngot,
});
GameRegistry.addRecipe(new ItemStack(DisguisesicleShovelPickaxe), new Object[]{
"CCC",
" X ",
" X ",
'X', Item.stick, 'C', DisguisesicleCraft.DisguisesicleIngot,
});
GameRegistry.addRecipe(new ItemStack(DisguisesicleSow), new Object[]{
"XC",
'X', Item.bow, 'C', DisguisesicleCraft.DisguisesicleSword,
});
GameRegistry.addRecipe(new ItemStack(Disguiseanoter), new Object[]{
" Q",
"XCX",
"XXX",
'X', DisguisesicleCraft.Disguisesicle, 'C', Item.redstone, 'Q', Item.stick,
});
GameRegistry.addRecipe(new ItemStack(Potatonade, 2), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Item.bakedPotato, 'C', Item.potato,
});
GameRegistry.addRecipe(new ItemStack(Endernade, 2), new Object[]{
"XXX",
"XCX",
"XXX",
'X', Item.enderPearl, 'C', Item.eyeOfEnder,
});
}
}
In the item try changing: "par2World.playSoundAtEntity(par3EntityPlayer, "disguisesiclecraft:PotatonadeOut", 1.0F, 1.0F);"
to: "par2World.playSoundAtEntity(par3EntityPlayer, Sound.CustomSound, 1.0F, 1.0F);"
And in the DisguisesicleCraftSoundEvents try changing: "event.manager.soundPoolSounds.addSound("disguisesiclecraft:PotatonadeOut.ogg");"
to: "event.manager.soundPoolSounds.addSound(sound);"
thanks dude for the help IT Worked