That did it. When I took out the files from the 1.6.2.jar and put them in the assets folder in the source code folder it worked! Thanks so much Mazetar.
Thanks for the sound tutorial! Works perfectly. In the OP, you said you would only post tutorials that were not common. Might I suggest one? For a while now, I've been having trouble with saving variables to existing entities (Specifically EntityPlayer). It uses .getEntityData() somehow, but I can't figure it out for the life of me. A tutorial on that would be very awesome and helpful.
Cheers,
LittleBreadLoaf
For a while now, I've been having trouble with saving variables to existing entities (Specifically EntityPlayer). It uses .getEntityData() somehow, but I can't figure it out for the life of me.
That's a good suggestion, I might do that in the future
For now here's a suggestion for you: IExtendedEntityProperties
Look into that class. Every entity is capable of having such things and have methods to get and add ExtendedProperties
Alright, I'll look into it. I just don't know how to make the code I write relevant, or have it actually function properly... >.<
Anyway, for the sounds, how would you go about doing a record? I know the sound for it would be addStreaming, but for the item itself. Could you make a new ItemRecord, or would you have to make your own class and copy certain things from ItemRecord?
That's a good suggestion, I might do that in the future
For now here's a suggestion for you: IExtendedEntityProperties
Look into that class. Every entity is capable of having such things and have methods to get and add ExtendedProperties
Thanks for the sound tutorial! Works perfectly. In the OP, you said you would only post tutorials that were not common. Might I suggest one? For a while now, I've been having trouble with saving variables to existing entities (Specifically EntityPlayer). It uses .getEntityData() somehow, but I can't figure it out for the life of me. A tutorial on that would be very awesome and helpful.
Cheers,
LittleBreadLoaf
Hey, I've got a tutorial on just this in the works, it should be up in a day or so. I finished the prerequisite tutorial on setting up and using Forge Events already and have the spot reserved for ExtendedEntityProperties here.
Would you be able to do a guide / tutorial on the considerations that need to be taken when making a mod so that it will be multiplayer compatible? I've found bits and pieces of advice here and there, but no solid guide on what to and not to do.
One example would be 'don't store variables within your Item class if they need to have independent values' such as for a custom gun that has multiple ammos. If you store the 'selectedAmmo' variable in your ItemGun class, everytime one person changes ammo it will change it for everybody with the same item (as in same itemID).
A list of stuff like that would be awesome!
EDIT: Got the tutorial up. Btw, Maz, I hope you don't feel like I'm intruding or anything, since this is YOUR tutorial section. I just think it would be a shame to do the same work twice is all. Feel free to tell me to shut it or whatever
I've been trying to get a Fluid to work but I always get errors with my block id. Here are my class files:
[spoiler]
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
public class RootBeerFluid extends Fluid {
public RootBeerFluid() {
super("RootBeer");
public static Fluid [u]RootBee[/u]r;
// and before blocks are initialized:
RootBeer = new RootBeerFluid();
setDensity(10); // How tick the fluid is, affects movement inside the liquid.
setViscosity(1000); // How fast the fluid flows.
FluidRegistry.registerFluid(this); // Registering inside it self, keeps things neat
}}
And this is the Block
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fluids.BlockFluidClassic;
public class BlockRootBeerFluid extends BlockFluidClassic {
public BlockRootBeerFluid(int Id) {
super(2010, [u]ModTutorial[/u].RootBeer, Material.water);
[u]ModTutorial[/u].RootBeer.setBlockID(2010); // Set the fluids block ID to this block.
}
public static Block RootBeer;
// and before blocks are initialized:
RootBeer = new BlockRootBeerFluid();
// Use Register Icon as usual to get the block's icon.
// If you want you can reuse the water texture and change the color of it by doing as I have below:
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int meta) {
return Block.waterMoving.getIcon(side, meta);
}
@Override
public int colorMultiplier(IBlockAccess iblockaccess, int x, int y, int z)
{
return 0x66FF00; // HEX color code as indicated by the 0x infront. This is a greenish color.
}}
How do I fix the underlined problems? Do I need to add anything into my main mod class?
Hey, I've been having an issue with your fluid tut. Getting a NullPointer at at BlockFluid: par1World.setBlock(par2, par3, par4, this.blockID + 1, l, 2);
I'm assuming I need another block with an id of the main block +1, as setting one of my ore blocks to the id above my water block turns my liquid into that ore. Here's my code:
package steamcraft.steamcraft.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.FluidRegistry;
import steamcraft.steamcraft.Steamcraft;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSteamcraftFluid extends BlockFluidClassic {
private boolean isTinted;
private int tint;
public BlockSteamcraftFluid(int id, boolean par2, int par3) {
super(id, Steamcraft.fluidCopper, Material.water);
Steamcraft.fluidCopper.setBlockID(id); // Set the fluids block ID to this block.
this.isTinted = par2;
this.tint = par3;
this.setCreativeTab(CreativeTabs.tabBlock);
}
// Use Register Icon as usual to get the block's icon.
// If you want you can reuse the water texture and change the color of it by doing as I have below:
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int meta) {
return Block.waterMoving.getIcon(side, meta);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("steamcraft:water");
}
@Override
public int colorMultiplier(IBlockAccess iblockaccess, int x, int y, int z)
{
return 0x66FF00; // HEX color code as indicated by the 0x infront. This is a greenish color.
}
}
fluidCopper = new FluidSteamcraft("copperFluid").setDensity(1000).setViscosity(1000);
FluidRegistry.registerFluid(fluidCopper);
Rollback Post to RevisionRollBack
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
Please forgive my bad English.
I've been following your tutorial and tried to add custom sounds.
This is my event container,
package modshizuku;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
public class IzuchiSoundEvent {
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
event.manager.soundPoolSounds.addSound("modshizuku:izuchi.ogg");
}
}
and this is the client proxy class,
package modshizuku;
import net.minecraftforge.common.MinecraftForge;
public class ClientProxy extends CommonProxy
{
public void registerRenderers() {
MinecraftForge.EVENT_BUS.register(new IzuchiSoundEvent());
}
}
When I tried to play the sound, nothing crashed but also nothing heard.
It seems that something got wrong that forced minecraft to be muted.
I tried the /playsound command and this also muted the game.
And then I tried to replace the vanilla sound file with that file I tried to add and it played prefectly.
So, I pretty sure that there's nothing wrong with the sound file itself.
I really don't know what's gone wrong with the code. Please Help...
Please forgive my bad English.
I've been following your tutorial and tried to add custom sounds.
Where is the line where you play your sound?
Also which folder is the sound file located inside? it should be "assets/modshizuku/sound/izuchi.ogg"
Another thing is "registerRenderers" ever getting called? Do you do proxy.registerRenders(); in your @mod file?
PS: "registerRenderers" is a retarded name for something which does not register a single renderer
Where is the line where you play your sound?
Also which folder is the sound file located inside? it should be "assets/modshizuku/sound/izuchi.ogg"
Thank you so much!!
I just can't believe how stupid I was. I messed up the path of the sound files and it's all OK now..Orz
I think I was just too tired yesterday that I couldn't notice the "/sound" even though I read through the tutorial several times before looking up on the internet for several hours.
Anyway, thanks a lot
Of course those two are just the ones I would recommend, whatever course which gives you a understanding of the fundamentals of Java will be a good first step
You forgot to read the error, which would have told you what kind of error it was
Or you just figured it would be fun to tell everyone you had an error with something and letting them use their mind-reading abilities to solve it -_-'
with your bucket class, there is an error with this.tryPlaceContainedLiquid....no idea where its coming from or what its even trying to reference....any ideas?
Theres at least 10 different errors and ups one could do which would lead to an error redlining the indicated line.
So sorry but without knowing the error, I can't help you!
If you take that for not being helpful then, fine but that's how it actually is!
Yah like that's helpful ¬.¬
The error is undefined..
Thank you, now that we know the error we can start problem solving.
Are all your imports done correctly and you are extending the classes you should extend, if so you should have access to everything you need.
Now if you don't for some reason then I guess the simplest thing would be to simply create thos methods yourself, by looking at the vanilla code it shouldn't be too hard for you to figure out how and why the vanilla ItemBucket works
Explain that you are following maz's fluid tutorial and show the code for your @mod file and all the other relevant files (Each file in spoiler and code tags please, it will make people more likely to read it!)
By having your own thread there you aren't relying on my lazy ass viewing it, as we are a lot of active helpers there which include myself Also that makes for a focused support on your problem
error would be to see your etire class...if you could PM it to me
The entire code is left out intentionally, those who fit the pre-requirements won't need the entire classes.
I'm not handing out the rest of it, sorry.
Cheers,
LittleBreadLoaf
Bleach Mod
That's a good suggestion, I might do that in the future
For now here's a suggestion for you: IExtendedEntityProperties
Look into that class. Every entity is capable of having such things and have methods to get and add ExtendedProperties
Anyway, for the sounds, how would you go about doing a record? I know the sound for it would be addStreaming, but for the item itself. Could you make a new ItemRecord, or would you have to make your own class and copy certain things from ItemRecord?
Bleach Mod
Hey, I've got a tutorial on just this in the works, it should be up in a day or so. I finished the prerequisite tutorial on setting up and using Forge Events already and have the spot reserved for ExtendedEntityProperties here.
Would you be able to do a guide / tutorial on the considerations that need to be taken when making a mod so that it will be multiplayer compatible? I've found bits and pieces of advice here and there, but no solid guide on what to and not to do.
One example would be 'don't store variables within your Item class if they need to have independent values' such as for a custom gun that has multiple ammos. If you store the 'selectedAmmo' variable in your ItemGun class, everytime one person changes ammo it will change it for everybody with the same item (as in same itemID).
A list of stuff like that would be awesome!
EDIT: Got the tutorial up. Btw, Maz, I hope you don't feel like I'm intruding or anything, since this is YOUR tutorial section. I just think it would be a shame to do the same work twice is all. Feel free to tell me to shut it or whatever
[spoiler]
And this is the Block
How do I fix the underlined problems? Do I need to add anything into my main mod class?
You seem to be doing some rather odd stuff mate
Client proxy:
SoundHandler.java:
EntityEmployee.java:
tune.ogg stored in /minedonalds/sound/tune.ogg
Now my mod has a nice fluid and little sound. =)
Tmtravlr
I'm assuming I need another block with an id of the main block +1, as setting one of my ore blocks to the id above my water block turns my liquid into that ore. Here's my code:
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
I've been following your tutorial and tried to add custom sounds.
This is my event container,
and this is the client proxy class,
When I tried to play the sound, nothing crashed but also nothing heard.
It seems that something got wrong that forced minecraft to be muted.
I tried the /playsound command and this also muted the game.
And then I tried to replace the vanilla sound file with that file I tried to add and it played prefectly.
So, I pretty sure that there's nothing wrong with the sound file itself.
I really don't know what's gone wrong with the code. Please Help...
Where is the line where you play your sound?
Also which folder is the sound file located inside? it should be "assets/modshizuku/sound/izuchi.ogg"
Another thing is "registerRenderers" ever getting called? Do you do proxy.registerRenders(); in your @mod file?
PS: "registerRenderers" is a retarded name for something which does not register a single renderer
Thank you so much!!
I just can't believe how stupid I was. I messed up the path of the sound files and it's all OK now..Orz
I think I was just too tired yesterday that I couldn't notice the "/sound" even though I read through the tutorial several times before looking up on the internet for several hours.
Anyway, thanks a lot
Happens to me all the time and I have programmed for a few years
What line do I put in front of the 'onItemRightClick'?
I'm sorry you do not meet the pre-requierments for this tutorial.
You would need to study the basics of basic java first.
I'd suggest the free CS106A course from Stanfords website, it's a great introduction to programming and java
http://see.stanford.edu/see/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111
Besides that http://courses.vswe.se are a great place to get into minecraft modding.
Of course those two are just the ones I would recommend, whatever course which gives you a understanding of the fundamentals of Java will be a good first step
Or you just figured it would be fun to tell everyone you had an error with something and letting them use their mind-reading abilities to solve it -_-'
Sorry mate, but you said
Theres at least 10 different errors and ups one could do which would lead to an error redlining the indicated line.
So sorry but without knowing the error, I can't help you!
If you take that for not being helpful then, fine but that's how it actually is!
Thank you, now that we know the error we can start problem solving.
Are all your imports done correctly and you are extending the classes you should extend, if so you should have access to everything you need.
Now if you don't for some reason then I guess the simplest thing would be to simply create thos methods yourself, by looking at the vanilla code it shouldn't be too hard for you to figure out how and why the vanilla ItemBucket works
www.minecraftforum.net/forum/140-modification-development/
Explain that you are following maz's fluid tutorial and show the code for your @mod file and all the other relevant files (Each file in spoiler and code tags please, it will make people more likely to read it!)
By having your own thread there you aren't relying on my lazy ass viewing it, as we are a lot of active helpers there which include myself Also that makes for a focused support on your problem
The entire code is left out intentionally, those who fit the pre-requirements won't need the entire classes.
I'm not handing out the rest of it, sorry.