Jump to content

wmcritter

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by wmcritter

  1. Yeah, I need a bunch Mostly, I'm trying to learn it on my own, and just come here when I'm stuck. The last bit of code I posted was just a sanity check. See if you guys see anything just plain wrong in the code.
  2. larsgerrits: flying is what I want It's not a bug, it's a feature.
  3. Thanks Ernio. Here is what I have so far. It's not finished, but it at least has the basic functionality I'm looking for. When I press "forward" I don't go toward the front of my body, instead I go in the direction I am looking, including the Y axis. The result is that I "fly" wherever I look. @SubscribeEvent public void PlayerTickevent(TickEvent.PlayerTickEvent event) { if (event.phase == Phase.END) { if (event.player != null) { if (event.player.moveForward != 0) { Vector3 playerPos = new Vector3(event.player); Vec3 look = event.player.getLookVec(); Vector3 look3 = new Vector3(look); look3 = look3.scale(event.player.getAIMoveSpeed()); double motionX = look3.x; double motionY = look3.y; double motionZ = look3.z; event.player.motionX = motionX; event.player.motionY = motionY; event.player.motionZ = motionZ; } else { event.player.motionX = 0d; event.player.motionZ = 0d; if (!event.player.isSneaking()) event.player.motionY = 0; } } } }
  4. Does this look right: public class EventHandlerTest { Minecraft mc; public EventHandlerTest() { mc = Minecraft.getMinecraft(); } @SubscribeEvent public void PlayerTickevent(TickEvent.PlayerTickEvent event) { if (event.phase == Phase.END) { EntityPlayerSP player = mc.thePlayer; //do my stuff } } }
  5. Thanks for the clarification diesieben07.
  6. Thanks for the help so far. To achieve my desired result, it appears as though I can create a new player class that extends EntityPlayer, and from there override onLivingUpdate(). The part I'm having trouble with now is how to register my new player class and get it to take the place of the normal player. For blocks, items, and tile entities, it is a simple matter of calling GameRegistry.registerXXX, but I don't see any registry for the player. The closest I have found is EntityRegistry.registerModEntity, but that seems to be for mobs only. As usual, any help is appreciated. p.s. I appreciate these forums, but the search function is utterly worthless. I tried searching for "Register Player" and other similar phrases, but the results were nonsensical, unrelated, and restricted to only a single page. Are the operators of this site aware of this?
  7. A while ago I asked if it was possible to turn off gravity for the player, and I was told that it was possible and pretty simple. Well, I'm now ready to give it a try. So, can anyone point me in the right direction? Basically, I want the player to behave as if they were flying in creative mode all the time. Any tutorials to follow? Can anyone at least point me toward the right classes to investigate? Thanks.
  8. Nevermind about the index error. It was PEBCAK error.
  9. Thanks for the quick reply. As a quick test, I hard coded a 'for' loop as for(int y = 0; y < 256; y++) But it throws an index out of range error when I try to set that to the primer (primer.setBlockState(x, y, z, Blocks.stone.getDefaultState()). I also tried 128. Happen to know why it would throw that error?
  10. I am trying my hand at generating my own terrain. I have had some success, but the Y coordinate is throwing me off. I thought chunks were 16x16x16, and since the world is 256 high there are 16 chunks stacked on top of each other for each X and Z position. However, when the IChunkProvider is called, only X and Z values are passed, never a Y. And looking in ChunkProviderEnd I see that they are iterating through a for loop that I think is their Y values, but it is hard-coded to 127. So, are chunks actually 16x16x256? Or am I missing something entirely? Thanks for any help you can offer.
  11. I've found lots of tutorials and code examples to learn from, but the one thing I can't find is documentation. For example, a tutorial will show how to create a new class and that it implements IChunkProvider. Great, but how did the author know what IChunkProvider is, what it does, and why thy should use it? Somewhere there must be documentation that the tutorial author used to discover IChunkProvider and learn how to use it, right? That's the documentation I'm looking for: the docs that show all the available classes and what they do. Can someone help me find that? Thanks.
  12. Thanks for the input Ernio. I think I can work within the limitations you outlined. I know there will be challenges, I just didn't want to waste a ton of time and effort if there is some part that is simply impossible to accomplish. I actually started this project by building a prototype in Unity. But then I heard that modding Minecraft was pretty easy and flexible, so I am investigating it as a possibility. It would definitely be faster to modify the existing code base rather writing everything from the ground up. Just trying to be thorough and explore all my options Thanks again.
  13. Hi everyone, I have an idea for a game based on Minecraft that I'm going to make. I'm trying to figure out if I need to start from scratch, or build the game as a mod for Minecraft. To know which way I need to go, I need to know if a mod is capable of doing what I require. Here are the 3 major requirements: 1.) I need to be able to change the player's shape. Instead of a humanoid, I want the player to control a space ship. 2.) I want a spherical world instead of a flat world. 3.) I want to adjust or remove gravity. Does anyone know if these 3 things can be done with a mod? I've just started learning about mods and have built some tutorials on easy things like new types of blocks and items. But I have not seen any tutorials about really radical changes like the ones I require. So, before I invest a lot of time in learning about mods, I would just like to know if you guys think it is possible to do in a mod. Thanks for you input.
×
×
  • Create New...

Important Information

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