Jump to content

BigDaveNz

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by BigDaveNz

  1. Does this still work? Launcher 1.2.7 doesn't appear to show the session id??
  2. Haha, my MCforum post is now outdated. I'm moving everything to my website... Once I've finished developing it... But yeah, I may end up implementing that feature, although I think it would require me to use a dedicated server, which costs a lot of money ... That may come later. Not to start with. The actual coding of that program would be fairly easy. The idea with that is also to graph players on a global scale, either anonymously or via username (depending on player request). Then I can accurately balance the mod based on what all players are doing. But thats a very short non detailed description. And of course It's all subject to change as I continue . guess you'll just have to find out... Is there a VoIP server for modders to hang out in?? Or is there only forgeIRC?
  3. found it, looks like it will do what I need it to. Going to code again when I wake up, so ill post if I have any issues, otherwise, thank you for the help.
  4. Thanks diesieben07, that gets rid of all the player data. The question is, if I want to save a whole lot of data based on information about the server itself, such as whether or not the ender dragon has been defeated(regardless of whether or not it was the individual player), also I need the current version of the mod saved, as if the mod has updated, it may require certain things to be done to the save file of both player and server. Or save information to the server, then i presume IExtendedEntityProperties wont work. There is Level.dat which saves per world data (if im correct). However I wish my data to be saved for each playthrough. For Instance, every SSP world and every Server connected to must have it's own data file. I believe this is the last problem I will have for a while. I might even get a testing version out before I have to come back and ask more questions "Hurray!" @hydroflame, I highly doubt that our mods will ever compete with each other, lets just say what I am creating is very intricate and different then anything out there. Your mod is safe . But anyway. Wouldn't minecraft be boring with just one tech mod?? The fun is being able to pick and choose between many different mods, and play your own way is what separates minecraft from most games. It's the same with any mod anyone creates, no matter what we make, there is always someone who can improve on an idea. The goal is to improve the communities experience as a whole. I personally am creating my mod because I want to practice coding, I want a challenge, and I feel there is a need for something new. There is no such thing as "competition" in my mind. I choose to be non-for profit, coding because I enjoy it. Who knows, maybe in the future our mods will run side by side. Anyway, sorry for the rant... Happy coding
  5. Hello all, Just been doing a little bit of future planning. Below is a rough map of almost all the data is should need to save for later use. (note all data is saved server side) I initially thought of using nbt for the player based data and a config file for the server side. However I have a leaderboard system where the player selects a skill/enchant/ability they want to view the leaderboard for. This prints out the top 5 players for that item. The question is, in this case is it practical to use nbt tags? When to figure out the leaderboard it would require me to open all player.dat files and retrieve the appropriate information in order to find the top 5 players etc. To me this sounds more like something a database would take care of (possibly), handling the leaderboard via queries. I know certain server side plugins use mysql, but for SSP this feature would be next to useless. So what I would like to know is... What is the best method for my mod, to save data. Any suggestions/comments are appreciated
  6. ah! Its the intanceof part im missing. Thankyou
  7. Sorry i should clarify... In my eventHandler class i already have @ForgeSubscribe public void onLivingHurt(LivingHurtEvent event) { EILivingHurt.process(event); } everythign works, except i cant figure out how to get the username of the "hurt" player.
  8. Hello all, just been going round in circles for a while with this problem, I'm trying to get the username of a hurt character. I currently have a filter that means only entities that are of the EntityPlayerMP class, but i cant figure out how to get the username field from there. Is there something in reflection API that I'm missing??? Or is there just a way easier way of doing this? Current Code(that doesnt work fyi): public class EILivingHurt { /** * General Living Hurt Processor */ public static void process(LivingHurtEvent event) { int xpAmount = (int)event.ammount * 10; DamageSource damageSource = event.source; EntityLivingBase entity = event.entityLiving; Class<? extends EntityLivingBase> entityClass = entity.getClass(); String className = entityClass.getName(); Type superclass = entityClass.getGenericSuperclass(); EIDebugHandler.sendDebugInfoToConsole("Entity was hurt: " + className); EIDebugHandler.sendDebugInfoToConsole(superclass + " Superclass, Type: " + superclass.toString()); switch (superclass.toString()){ case "net.minecraft.entity.player.EntityPlayer": EIDebugHandler.sendDebugInfoToConsole("Player Was Hurt"); Method method = null; try { method = entityClass.getMethod("getEntityName", EntityPlayer.class); } catch (NoSuchMethodException | SecurityException e) { e.printStackTrace(); } String username = null; try { username = (String)method.invoke(entityClass); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { e.printStackTrace(); } EIDebugHandler.sendDebugInfoToConsole("Player Damaged" + username); } } } Note that this code is just mashed together for testing purposes.
  9. Have you thought of creating a implementing IPlayerTracker... and using the onPlayerLogout event??? public class YourPlayerTracker implements IPlayerTracker{ @Override public void onPlayerLogout(EntityPlayer player) { //Do Cleanup } //...other meaningless code... } EDIT Just saw your other post... perhaps your problem is... @Override public void onPlayerLogout(EntityPlayer player) { String playerName = player.getEntityName(); //Do Cleanup with respect to the leaving players name }
  10. Solved it, For anyone who wants to know, you can use ChatMessageComponent.func_111066_d(message); Where message is a string, to return a ChatMessageComponent object. That object can be modified with things such as Bold/Italic etc. also the colour can be changed, and a few other things, Using the methods associated. To call that simply use player.sendChatToPlayer(chatMessage) or player.addChatMessage(chatMessage) //chatMessage refers to ChatMessageComponent Object //player refers to the EntityPlayer Object Depending on which class your player Object is associated with (EntityPlayerSP/EntityPlayerMP/ICommandSender etc.) I believe the theory is to remove addChatToPlayer(string) all together and use the more dynamic chat message system.
  11. Thankyou. Had not seen that method. EDIT: It appears that most Classes have a addChatMessage(string), or sendChatToPlayer(string) which fixed 90% of my errors, however ICommandSender only uses sendChatToPlayer(ChatMessageComponent)....
  12. Hello, Just finished updating a WIP mod of mine to 1.6.2, however player.sendChatToPlayer(String message) Has been changed to player.sendChatToPlayer(ChatMessageComponent chatMessageComponent) Where player is simply an EnityPlayer. Can someone please briefly explain (since it hasn't been commented in the javadoc yet, everything is simply func_111059_a etc.), what you can do with the chatMessageComponent Object compared to the old string input into sendChatToPlayer. Also can someone please show me from a coding point of view, as an example, how to modify this method to work in 1.6.2. public static void sendDebugToPlayer(String message, EntityPlayer player){ if(Reference.debugMode == true){ player.sendChatToPlayer(message); } Thankyou, BigDaveNz
×
×
  • Create New...

Important Information

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