Jump to content

Flenix

Members
  • Posts

    440
  • Joined

  • Last visited

Everything posted by Flenix

  1. I took that approach before. My first attempt was the log code. However, when a log is on it's side, it only has TWO metadata positions, not 4; for north-south and east-west. Whether your facing north or south, it'll place the same texture. I couldn't quite work out why though. My next approach was to try a piston, and that actually worked, but it was quite buggy. I managed to edit the code enough so I could place in the four directions and it would rotate, and it wouldn't rotate for up and down (which was good). However, the top texture mirrored around the left/right/bottom too, and I couldn't figure out why it did that. Also, the held item looked wrong, because technically the top of the block was actually it's side. I can't understand why it's so complicated though. There must just be a simple method to rotate the top texture, surely? Even in Java itself, something to just rotate the image would be enough.
  2. As a good rule of thumb that I've learned over the past 10 days of modding or so, If it says "ModLoader" anywhere in a tutorial/guides example class files, run.
  3. As a good rule of thumb that I've learned over the past 10 days of modding or so, If it says "ModLoader" anywhere in a tutorial/guides example class files, run.
  4. It appears you are missing the flag argument in: world.setBlockMetadataWithNotify(i, j, k, dir); It should have a flag as that allows you to tell the clients to update with the proper information ex: world.setBlockMetadataWithNotify(i, j, k, dir,flag); - I advise the flag to be 3 (I think this updates the server and client) I don't remember what 4 does. Anyway, by wading through tooltips in eclipse you should eventually figure out what the different values are for the flags. Well that certainly did something. Now, when holding my block it's showing texture at tile 4. When I place it, depending on my direction it's placing either air, stone, grass or dirt (ID's 0-3). It is placing the actual vanilla blocks, not just something textured the same (middle-clicking gives me the correct block) I'm on 1.4.7 by the way (Mod is mainly for my server), Edit: haha forgot the picture I wanted to get this method working, then I was going to change that spritesheet to have rotations of each of the blocks which need them. Do you mean the subblocks class file? From what I could see in the tutorial I followed, that was only required if you want each of the subblocks to appear in creative etc, which I don't. Maybe that's where I'm going wrong?
  5. It appears you are missing the flag argument in: world.setBlockMetadataWithNotify(i, j, k, dir); It should have a flag as that allows you to tell the clients to update with the proper information ex: world.setBlockMetadataWithNotify(i, j, k, dir,flag); - I advise the flag to be 3 (I think this updates the server and client) I don't remember what 4 does. Anyway, by wading through tooltips in eclipse you should eventually figure out what the different values are for the flags. Well that certainly did something. Now, when holding my block it's showing texture at tile 4. When I place it, depending on my direction it's placing either air, stone, grass or dirt (ID's 0-3). It is placing the actual vanilla blocks, not just something textured the same (middle-clicking gives me the correct block) I'm on 1.4.7 by the way (Mod is mainly for my server), Edit: haha forgot the picture I wanted to get this method working, then I was going to change that spritesheet to have rotations of each of the blocks which need them. Do you mean the subblocks class file? From what I could see in the tutorial I followed, that was only required if you want each of the subblocks to appear in creative etc, which I don't. Maybe that's where I'm going wrong?
  6. Doesn't seem to be working. Here's the entire block's class, no matter what direction I face it's placing the same block. package co.uk.silvania.roads.block; import co.uk.silvania.roads.CommonProxy; import co.uk.silvania.roads.Roads; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.util.Facing; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class RBDoubleYellowStripe extends Block { public RBDoubleYellowStripe(int id) { super(id, Material.rock); this.setCreativeTab(Roads.tabRoads); this.setHardness(1.0F); this.setStepSound(Block.soundStoneFootstep); } @Override public int getBlockTextureFromSideAndMetadata (int side, int metadata) { return 0 + 4; } @Override public String getTextureFile () { return CommonProxy.BLOCK_PNG; } public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { int dir = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3; world.setBlockMetadataWithNotify(i, j, k, dir); } } I'm assuming I've missed something, but I have no idea what...
  7. Doesn't seem to be working. Here's the entire block's class, no matter what direction I face it's placing the same block. package co.uk.silvania.roads.block; import co.uk.silvania.roads.CommonProxy; import co.uk.silvania.roads.Roads; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.util.Facing; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class RBDoubleYellowStripe extends Block { public RBDoubleYellowStripe(int id) { super(id, Material.rock); this.setCreativeTab(Roads.tabRoads); this.setHardness(1.0F); this.setStepSound(Block.soundStoneFootstep); } @Override public int getBlockTextureFromSideAndMetadata (int side, int metadata) { return 0 + 4; } @Override public String getTextureFile () { return CommonProxy.BLOCK_PNG; } public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { int dir = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3; world.setBlockMetadataWithNotify(i, j, k, dir); } } I'm assuming I've missed something, but I have no idea what...
  8. Sorry for two questions in a row, but my mod is nearly done and I just want to get these last bits finished. An issue plaguing me since I started it, is I can't rotate the top texture of the block. I can rotate the side ones OK, but not the top. So my next approach, is to make metadata-based sub-blocks, 4 of each type, and pick which one to place depending on the direction the player is facing. How would I go about doing this? (Unless anyone knows a way to do it properly of course!)
  9. Sorry for two questions in a row, but my mod is nearly done and I just want to get these last bits finished. An issue plaguing me since I started it, is I can't rotate the top texture of the block. I can rotate the side ones OK, but not the top. So my next approach, is to make metadata-based sub-blocks, 4 of each type, and pick which one to place depending on the direction the player is facing. How would I go about doing this? (Unless anyone knows a way to do it properly of course!)
  10. Firstly, yes I know this is discontinued for 1.5.1, but I'm still working with 1.4.7 because my mods are primarily for my server, which can't upgrade because other mods aren't updated. Anyway, how do I use a TextureFX to animate my liquid? I've done plenty of searching around, but I can't find any clear tutorials, and the only code snippits I could find were ModLoader. Anyone able to help? Also on a related note (It seems information on liquids is quite scarce) - How would I change the flow distance - How would I set the drag (how fast players move through the liquid) - How would I change the sound? Any help is great. I'm writing a tutorial as I learn things about liquids so others wont have the same issues.
  11. Firstly, yes I know this is discontinued for 1.5.1, but I'm still working with 1.4.7 because my mods are primarily for my server, which can't upgrade because other mods aren't updated. Anyway, how do I use a TextureFX to animate my liquid? I've done plenty of searching around, but I can't find any clear tutorials, and the only code snippits I could find were ModLoader. Anyone able to help? Also on a related note (It seems information on liquids is quite scarce) - How would I change the flow distance - How would I set the drag (how fast players move through the liquid) - How would I change the sound? Any help is great. I'm writing a tutorial as I learn things about liquids so others wont have the same issues.
  12. I did mention on the talk pages that all tutorial should say which minecraft versions they work with. Anyone else up for going through them and marking them? I'll do the ones I use but there are some I'll never use.
  13. I did mention on the talk pages that all tutorial should say which minecraft versions they work with. Anyone else up for going through them and marking them? I'll do the ones I use but there are some I'll never use.
  14. Someone may well correct me on this, but I'm not sure if you can. It's something I've considered before (I wanted to remove all swords and armor for my futuristic server) but I couldn't find any way of doing it without modifying the base classes. There might be some sort of clever way of disabling them from being crafted or put into creative mode, but I don't know about entirely removing them.
  15. Someone may well correct me on this, but I'm not sure if you can. It's something I've considered before (I wanted to remove all swords and armor for my futuristic server) but I couldn't find any way of doing it without modifying the base classes. There might be some sort of clever way of disabling them from being crafted or put into creative mode, but I don't know about entirely removing them.
  16. Hello, I've been following this tutorial for HOURS, trying to get a jenkins build system to work. I'm stuck with the script part, and everything after. No offence to the guy who wrote it, but either it's not very clear or it's simply outdated. Here's the original script from the tutorial: rm -r builds mkdir builds python runtime/recompile.py python runtime/reobfuscate.py zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/dries007/* zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/mcmod.info zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/SP.png cd reobf/minecraft zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER * cd ../.. cd src/common zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER mcmod.info zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER SP.png cd ../.. And here is the closest to "working" I can get: cd /var/lib/jenkins/jobs/TestMod/workspace/forge/mcp ./recompile.sh ./reobfuscate.sh zip -r -9 /var/lib/jenkins/jobs/TestMod/workspace/builds/TestMod_src_$BUILD_NUMBER /var/lib/jenkins/jobs/TestMod/workspace/forge/mcp/src/minecraft/co/* cd reobf/minecraft zip -r -D -9 /var/lib/jenkins/jobs/TestMod/workspace/builds/TestMod_$BUILD_NUMBER * cd ../.. Messy, huh? That's because I have no idea what I'm doing. All I know is the original script isn't even close to working. The above script works, but it includes the entire Minecraft source, which obviously is bad. We only want my mod's source. (Don't worry, I'm not distributing MC's source. This server isn't connected to the WWW right now while I experiment with getting it working, it's just on my local network) Also, the source code is zipped into a package too, but annoyingly it has the whole tree; "var/lib/jenkins" etc instead of jsut the co/uk/silvania it should be. Server is Ubuntu 12.04 LTS. Has anyone got any tips of what I can do?
  17. Hello, I've been following this tutorial for HOURS, trying to get a jenkins build system to work. I'm stuck with the script part, and everything after. No offence to the guy who wrote it, but either it's not very clear or it's simply outdated. Here's the original script from the tutorial: rm -r builds mkdir builds python runtime/recompile.py python runtime/reobfuscate.py zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/dries007/* zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/mcmod.info zip -r -9 $WORKSPACE/builds/SimpleCore_src_$BUILD_NUMBER src/common/SP.png cd reobf/minecraft zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER * cd ../.. cd src/common zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER mcmod.info zip -r -D -9 $WORKSPACE/builds/SimpleCore_$BUILD_NUMBER SP.png cd ../.. And here is the closest to "working" I can get: cd /var/lib/jenkins/jobs/TestMod/workspace/forge/mcp ./recompile.sh ./reobfuscate.sh zip -r -9 /var/lib/jenkins/jobs/TestMod/workspace/builds/TestMod_src_$BUILD_NUMBER /var/lib/jenkins/jobs/TestMod/workspace/forge/mcp/src/minecraft/co/* cd reobf/minecraft zip -r -D -9 /var/lib/jenkins/jobs/TestMod/workspace/builds/TestMod_$BUILD_NUMBER * cd ../.. Messy, huh? That's because I have no idea what I'm doing. All I know is the original script isn't even close to working. The above script works, but it includes the entire Minecraft source, which obviously is bad. We only want my mod's source. (Don't worry, I'm not distributing MC's source. This server isn't connected to the WWW right now while I experiment with getting it working, it's just on my local network) Also, the source code is zipped into a package too, but annoyingly it has the whole tree; "var/lib/jenkins" etc instead of jsut the co/uk/silvania it should be. Server is Ubuntu 12.04 LTS. Has anyone got any tips of what I can do?
  18. Just a stab in the dark, but try a slash in front of it all too. In my projects I have /co/uk/silvania/[modname]/blocks.png - If I don't have / before co, it doesn't work. Then again, I'm still on 1.4.7 so I don't know how useful that is
  19. Just a stab in the dark, but try a slash in front of it all too. In my projects I have /co/uk/silvania/[modname]/blocks.png - If I don't have / before co, it doesn't work. Then again, I'm still on 1.4.7 so I don't know how useful that is
  20. How would I use player.openGui? Everything I can find on the web is in reference to blocks, not mobs.
  21. How would I use player.openGui? Everything I can find on the web is in reference to blocks, not mobs.
  22. Hey guys, I'm taking a break from my first project while I try and work out a bug in that, and started a second one. In this project, I am making a mob, which will follow the player and acts as a chest. Does anyone have a link to a good tutorial for something like that? I only need the chest on the mob part (Not graphical, just you right-click it and it opens a chest GUI which is saved)
  23. Hey guys, I'm taking a break from my first project while I try and work out a bug in that, and started a second one. In this project, I am making a mob, which will follow the player and acts as a chest. Does anyone have a link to a good tutorial for something like that? I only need the chest on the mob part (Not graphical, just you right-click it and it opens a chest GUI which is saved)
  24. Ok, nothing I can see so you'll have to wait for someone who's been making mods more than 3 days On a related note; There are no forge-side economy mods with digital currency, but there are a few with physical items. If you want to make something unique, allow the player to deposit their coins into a bank and use a unique card to pay for things as well as the physical coins. That's certainly a mod I'd love to use
  25. Ok, nothing I can see so you'll have to wait for someone who's been making mods more than 3 days On a related note; There are no forge-side economy mods with digital currency, but there are a few with physical items. If you want to make something unique, allow the player to deposit their coins into a bank and use a unique card to pay for things as well as the physical coins. That's certainly a mod I'd love to use
×
×
  • Create New...

Important Information

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