Jump to content

jammas615

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by jammas615

  1. Have you had a look at the API you get from getConfigurationManager()? http://jd.minecraftforge.net/net/minecraft/server/management/ServerConfigurationManager.html There are methods like getAllUsernames() and getPlayerList() which return arrays or lists of all the names of players. You can then iterate over that list using getPlayerForUsername() for each player. I suggest you look through the javadoc and relevant API to get a grasp of what is available to you.
  2. How about: EntityPlayer player = server.getConfigurationManager().getPlayerForUsername("playerName"); where server = MinecraftServer.getServer(); This is assuming you know which player you want to get an instance of. Not exactly sure what you need to do with the instance though.
  3. Is the code you are using to set players invisible running on the server-side proxy? Also, in eclipse, you can run a program in debug mode just like running it normally. Next to the green run button there should be the same type of button with a picture of a bug. It works the same in that you can select which program to run in debug (client/server). Debugging is extremely powerful in eclipse and because it is such a large topic there a great amount of resources out there. I probably can't explain how to use it all very well so I'll link you to this in-depth article: http://www.vogella.com/articles/EclipseDebugging/article.html It is very detailed but you can just skim over it to get the basic concepts. Finally, just a last note on debugging with the client and server running at the same time. When debugging and your server hits a breakpoint or you manually stop it, the program is paused. If a client is connected it will time out after a few seconds which can make debugging server-side stuff annoying. But rest-assured it is still usable for most things.
  4. What do you mean not many tutorials!! http://lmgtfy.com/?q=java+enums
  5. Well. Use the field mainInventory in InventoryPlayer and iterate over only indexes 0 to 8 as super_aardvark has said. Upon each iteration you could check to see if that item is equal to the one you want.
  6. I know there is a bukkit plugin called "vanish". I think the way it works is that it stops the server from sending the packets about vanished or invisible players to the rest of the players. I haven't looked at any of this before but it is an interesting topic. I suggest trying to look into achieving the above. I might have a poke around too and reply if i find anything of interest on the subject. EDIT: I found the EntityTracker and EntityTrackerEntry classes to be something of interest. Entity tracker takes a parameter of WorldServer so I'm guessing you would get your World Server by casting WorldServer to the worldObj field of EntityPlayerMP. You could then get an instance of the world's EntityTracker and finally get an EntityTrackerEntity that corresponds to the player you want and use the removePlayerFromTracker and removePlayerFromWatchingList methods to stop packets being sent. You will need to do this on an "onTick" basis to all "invisible" players.
  7. What mods? I know that Mo' Creatures and TFC don't work well together.
  8. In your MCP folder, backup any files that you made then delete the mcp folder. When you have deleted, extract it out again and then place the forge folder inside. Once the forge folder is inside, run install.cmd in the forge folder. EDIT: Read over this: http://wuppy29.blogspot.nl/2012/08/setting-up-part-2-mcp-and-forge.html
  9. Have you tried starting again with a clean install of forge?
  10. When you do either this.blockIndexInTexture = 0 or this.blockIndexInTexture = 1 What class is "this". If it is changing the texture of every block in the world, you need to be selecting a specific block (x,y,z coords) and then changing the texture.
  11. A quick look at EntityPlayer and InventoryPlayer showed a few things. You could iterate over the mainInventory of the player which is in InventoryPlayer. Further you could only iterate over the items in mainInventory that correspond to hotbar slots and then getItem() on it and perform your checks. Have a read: http://jd.minecraftforge.net/net/minecraft/entity/player/EntityPlayer.html http://jd.minecraftforge.net/net/minecraft/entity/player/InventoryPlayer.html http://jd.minecraftforge.net/net/minecraft/item/ItemStack.html
  12. If you create your own exception classes and then have the parts of your code that you want to be checked for exceptions throw your created exceptions. You need to read up and understand exceptions. Go do it... http://docs.oracle.com/javase/tutorial/essential/exceptions/
  13. http://lmgtfy.com/?q=buildcraft+github There, was that so hard?
  14. I would normally tell you to look at the Javadoc. I don't get why people don't look there when you want to do something. Five seconds on google brought me this as first result and I think it answers you question pretty much completely?: http://www.minecraftforge.net/forum/index.php?topic=198.0 Searching the forums before posting is a good idea...
  15. You can register a Player Tracker in the event bus on server init. Your Player Tracker class that you register needs to implement IPlayerTracker. With that you have access to four methods; onPlayerLogin, onPlayerLogout, onPlayerChangedDimension and onPlayerRespawn.
  16. Do you even know what you are doing? What are you actually trying to do?
  17. Yes, if your NetworkMod annotation shows that the client does not need the mod files to join a server you are fine. Now, preInit, init, and positInit all happen before the server is actually started. So, when you set up all you commands and register them with the managers no instance of the server exists. The null pointer exception means that commandManager is trying to access a null object that does not exist. This is because the server instance had not been started when you set up all your commands. To fix this, you need to put all your command initialisation inside another method with the annotation @ServerStarting or @ServerStarted. Let me know if you understand what I mean?
  18. No worries. Are you using the @NetworkMod annotation? @NetworkMod(clientSideRequired = false, serverSideRequired = false) It should come just after the @Mod. Is that what you were asking? I'm not too sure. But if you could also post what error you're getting upon the crash that would be sweet.
  19. Yes! you basically can. Do some digging on the wiki and find wuppy's tutorials and then the one about releasing a mod. All that is needed is a recompile,reobfuscate and then zip your package for release to be dropped into the mods folder. As I said the tutorial will tell you what you need.
  20. I recommend taking a look at this: http://www.minecraftforum.net/topic/1419836-131-forge-4x-events-howto/ to get some grounding on using events and event hooks. As for creating commands your new command class should inherit from "CommandBase" and should be registered in the Server Command Manager after initialisation. Something like this: MinecraftServer server = ModLoader.getMinecraftServerInstance(); ICommandManager commandManager = server.getCommandManager(); ServerCommandManager serverCommandManager = ((ServerCommandManager)commandManager); serverCommandManager.registerCommand(new YourCommand());
×
×
  • Create New...

Important Information

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