Jump to content

ldodds

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by ldodds

  1. I have a mod that uses some open source libraries packaged as separate jar files. During development I've been adding these to the lib directory. Once added to the eclipse project this works fine. When I'm ready to distribute my mod where would these jars need to be placed? Will minecraft forge add extra jar files from a standard location, e.g mods/lib or similar? I couldn't see any documentation on this, so thought I'd ask. Cheers, L.
  2. OK, I've figured out my issue, so am replying to my own question It would seem that the following code always returns objects from the client: The clue is there in the class name of the player. Obvious in hindsight. To properly spawn mobs you need to spawn them on the server. So you need a reference to an instance of EntityPlayerMP and from that you can get a WorldServer instance. In my case I have a ITickHandler instance registered on Side.SERVER and a tick() method that returns the following: When the tickStart method is called on the handler the first item in the tickData array is a reference to the player and is an instance of EntityPlayerMP. I needed to use this object to retrieve a reference to the players world. Spawning the entity then works as expected. Hope that helps someone else struggling with similar issues.
  3. Hi, I'm trying out minecraft forge for a new mod. However I'm having trouble getting mob spawning to work. I'm not using a custom mob, just trying to get a sheep to spawn in the world. However when I do that the mob doesn't seem to get properly spawned: it doesn't move, react and there's no collisions. I have the following, very simple code that executes in an object that implements the ITickHandler interface, specifically the tickStart method. The tick handler is registered with the TickFactory using Side.SERVER. The sheep appears, but doesn't do anything. I've looked over other code in the source and examples elsewhere and this seems like it should work. I've seen references to checking world.isRemote but that now seems to always return true. I've also tried checking FMLCommonHandler.instance().getEffectiveSide() and have confirmed that is Side.SERVER when the code is running. So as far as I can tell the sheep should be spawning on the server side. I've seen other people have similar problems, so I'm guessing I'm overlooking something simple. Anyone have any ideas? Update: I've noticed that the World object returned by Minecraft.theWorld is an instance of WorldClient. I'm guessing this might be the issue. Assuming that is the problem, how do I reliably get access to the server world?
×
×
  • Create New...

Important Information

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