Jump to content

Loratia

Members
  • Posts

    12
  • Joined

  • Last visited

Loratia's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. After I figured out that it was a technical issue, what it was and fixing it, it took roughly an hour of coding, testing and finishing up and I was done. I did not learn the API, since I only really needed two lines of code. I did not install a different IDE, since MCreator did the job needed. I did not learn more about sides (which I totally do/did not get anyway), as I did not have to use any proxies or @SideOnly. For anyone interested, the two lines of code I needed/used: (EntityPlayerMP sender) for (EntityPlayer receiver : sender.getServer().getPlayerList().getPlayers()){} // runs through a list of players. sender.getDistance(receiver) // Gets the distance between players. Had someone just said "Hey, try to run 'System.out.println(World.isRemote)' and that should give you a clear response serverside" or "FMLCommonHandler.GetPlayer(0).MoveY(10); will make your player move 10 feet up in the air on the server, test that one", I would have said "Thank you" and been straight into the technical/installation area looking for the problem and saved a lot of time. I spent more time trying to figure out what all the obscure, weird responses meant and why I felt like you guys repeatly weren't responding in any useful manner to my seemingly simple question, than I did in finishing the mod, which is really a shame. I would think a community would want to be forthcoming and open, if it wants a chance to evolve, develop and expand its member base.
  2. I'm totally on board with the whole "give a man a fish, teach a man to fish"-thing. I also get that MCreator is bad and that noone knows what it does or will take responsibility for what it does. But I've looked through the internet, I've looked through the source-code, I haven't found what I'm looking for and I'm not trying to build an MMORPG and looking for someone to "just code it for free for me, cause Blizzard did it in 1 year". I have no intention of learning a whole API to do a simple thing and I dont intend on doing any other projects. I'm not unexperienced in programming, I'm not asking for someone to hold my hand or program anything for me. I'm trying to find a "needle in a haystack" for me right now without using 10 times as much time as it should take me (would take me in a language I knew) and as a side note I'm having a technical error/problem, where I'm asking for some help to verify where the problem is. I'm not even asking anyone to guess where the problem is, I just ask for a single piece of information, so I can determine where the error is myself (and fix it myself). The whole continued "get a real IDE" is like answering my question with a "did you remember to turn on your screen?". I know how to fish, I've caught many fish, I just dont know what bait works with a cod. Now you can tell me that I should get an Abu fishing wheel, but I still wouldn't know what bait to use with a cod. (I hope you see the comparison) As for the original author. The mod is "discontinued" and the author has been attempted contacted without any response for a long period of time. (I dont know the specifics of this, but from what I've been told, it sounded like it has been so for a few years). Doing the mod from scratch would also not have been a big deal and I'm pretty sure there's no patent on "/say" and "/tell".
  3. Thanks for your input, DavidM. But you dont really have to doubt whether a particular IDE is good, bad or has certain features or if said IDE generates good or bad code for know whether any particular one line of code *should* work in a particular way, right? I mean the "World.isRemote" boolean either works or it doesn't, right? It shouldn't turn all blocks into nether-blocks when compiled with Eclipse and then turn all blocks into lava if compiled with MCreator, right? It might give two different results based on whether you are on client-side and server-side, I get that. I also get that MCreator might be a piece of #%¤& and might cause problems, but that doesn't change the statement or my questions. If I look up World.isRemote in the source code, I get the comment "server worlds have this set to false, client worlds have this set to true." - alright, I get the explaination there. But for instance World.calendar does not contain any comments. What is it, how does it work, what does it do, does it work server-side and/or client-side, does it give the same answer on both. (but that's not my question either, nor important) But I'm not asking anyone to go through the entire source code and tell me what functions do. I haven't posted more than perhaps a line or two of code, and even then I'm not asking what the functions do. Instead, I'm asking for "two" specific functions (if anyone knows them), that I can definately use server-side. And as a side-question, if noone was able to answer the main question, I'm asking for a single line of server-side code, that will definately run server-side, so I can test that everything works as it should, because I thought/think I have some issues with that (That could definately be System.out.println(World.isRemote), if that's a valid line of code I can call, but given the fact that it also works on client-side, I would prefer another) This "If you have the entity that sent the message, you can get the entities world and get the list of players from that." is also half helpful, but why not just post the code instead of letting me guess the rest. Is it <entityname>.getWorld().getPlayerList()? Is this a valid server-side line of code that will work? Or is it <entityname>.getWorld().instance.getOnlinePlayerNames()? I totally get the "I can look it up through the source code docs"-answer, but it honestly seems a little halfway done answer. I also see no point in posting the entire source code of my project, when I'm asking for something so specific. I guess I could decompile the old class files again for you, Cadiboo, but would you get a lot from a call to something like function_0981f()? Especially if said function doesn't exist in 1.12 anymore? I mean I already read through the files and functions, figured out what it did, rewrote all the "generic parts" and basically just needed answers to the functionality I have outlined a few times, since I couldn't find anything elsewhere and this place seemed to be a very good to get some help. (and again cut a lot of time out of the process)
  4. I'm still confused about the essence of your two answers there. Are your answers (paraphrased) : 1. We dont know the answer. (look it up) 2. We wouldn't tell you the answer. (look it up) 3. Having a better IDE will automatically tell you the answer. (no look up is needed at all) I'm especially confused about the "this can be done in 3 clicks", when that's all I'm really asking for someone to verify for me. It's also not true, that I didn't post code. I posted "FMLCommonHandler.instance().getMinecraftServerInstance();" as I line I used and tested. Is "FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList();" a valid server-side only code that should compile correctly and give me a list of players currently online on the server, possibly in a format, where I can then extract the player position afterwards? I'm asking to save time and because I got an actual error trying to call that function on the actual server, but had no compile errors, so I'm unsure whether I have an error with the MC installation, the function, the software used or my code. A simple "yes, that function works server-side and would be a way to get a list of players" would answer that question in full, or a "No, that is a client-side only function" would also be half the answer. Installing a different IDE and getting the same error would not bring me closer to my goal. Asking the quick question "what function works for A" and getting the quick answer "function B" would instantly get me over the finish line. Even getting the answer of "function C works server-side, you can test it" would save me hours and hours of testing, reading, error-checking etc. Especially if I have misunderstood a key part of something somewhere - I see no reason for any potentiel condescension, when I'm asking for help in a supporting forum in a hopefully tactful manner, taking the time to write out extra details on my problems and trying to be forthcoming with my lack of knowledge, my already tried efforts, my actual goals and my hoped answers.
  5. DaemonUmbra, I'll answer your questions, but why not just answer mine? It's a pretty simple question (at least from other coding language perspectives) and either you know it and could answer it rather quickly, or you dont and I must say, I wonder where you're going with all this? - I learned Java as my first major programming language at the University and used it for ~5 years while studying. That's ~20 years ago. In the meanwhile I learned a bunch of other languages as well, but havent kept my java skills up to date, but syntax-wise, it's not really that different from a lot of the other major ones. So I would say untrue. - Totally dont want to learn a whole API, when it's a 50-100 line program and where I don't ever plan to use it again, so true. Also, I havent found a real API, just the source code, where I can spend hours and hours getting nowhere. - I had to look up IDE to answer correctly: From Wiki "An IDE normally consists of at least a source code editor, build automation tools, and a debugger.". Since MCreator actually has the ability to edit source code, has a build tool and a debugger, I have to say I already installed one. And as I said, I'm not against installing another one. I just installed the first, easiest program I found that seemed to be able to do the job. Whether it can or not is not one of the questions I asked. So I would believe the answer is untrue. - I'm testing my code a lot already and hence the questions I asked. I tested it on a server and gave details on how and what I tested, what results I got and my ideas on why. So this would be untrue as well. Heck, I'd ask you to code the thing, if you want, but I honestly just wanted to know: A. How do I get a list of current online players server-side? B. How do I get the position of said players server-side? (just working lines of code that is known to compile and run correctly. I'm not asking you to debug my code, my IDE or my installation, I'm just unsure as to which function would actually do, what I want and should run on the correct side) If you want to code it instead, I'm sure up for letting you. I'm sure you'd be faster than me, since, again, I dont know what functions I'm looking for that should work on server-side. (heck, even if unable to help me with the actual questioned functionality, another garantied working server-side function would be a small step in the right direction) In pseudo-code the program did previously and should still do the following: 1. Hook the SendMessage-function <- already works. 2. Lookup range between sender and all receives <- thus the questions. 3. String-functions to check chat message for "/say" or "/shout" etc and manipulate strings. <- already works. 4. Format message and send new format to players within range. <- needs a little work, cause I haven't tested it, but should be done quickly. So you see, it's really not a big program. As I said, it's like 50-100 lines. Most of it was already working, but just needed an update, because functions changed from 1.8 to 1.12. Here's the two lines of code in C# using Unity (just to show how simple my question is): GameObject playerlist[] = GameObject.FindGameObjectsWithTag("Player"); Vector3 distance = playerlist[0].transform.position - playerlist[1].transform.position; I'm sure it's readable even if it's C# and not Java. It took me less than 2 min to write and make sure the syntax was correct from the API. It could take a person with no prior Unity knowledge hours to figure out that it was those two lines he/she needed to use. I'm just trying to avoid spending many more hours and instead just asking the pro's with the knowledge. If you don't know the answer, that's totally cool and I support all your opinions on MCreator, but maybe you could help a fellow out and throw me a line of code you know for sure works server-side only. (or even let me know if my lines of code that I posted as already tried examples should work correctly server-side) And Cadiboo, "- find out the methods that exist for getting a list of players that aren’t exclusively in 1 distribution" - I think this is what I'm asking, no? So, again, no need to bash me or my attempt, I wholeheartedly agree with your opinions, just throw me a bone, help me out, answer my question(s) if you can or anything that will speed up the process is much appreciated!
  6. DaemonUmbra, I totally get what you are saying! I usually use Unity3D for work. It uses C# or Unity script for coding. In that framework, I could do all the coding in less than 3 hours. I don't intend to create or publish any mods, since this is a quick, small one-time thing with 50-100 lines of code with no updates or nothing in the future. Unity has a decent API, which I know somewhat well, having spent years coding in that framework, which is also why I know where I would look for info, when I need to code something there. But I was trying to avoid spending time learning a new system/api and installing and setting up a lot of stuff. Even if I set up the suggested IDE, it would still save me hours of running through code, installations, testing, etc, if someone could say 'ohh, server-side getting a list of players, you just write mcserver.getplayer() and positions on those are player.position.x' With that information, I know the right lines of code and could check if that worked and if not, debug what I (or the IDE, or the minecraft installation) was doing wrong. I was trying to provide as much information as possible, maybe that was a mistake, but the question I'm asking is really just 'what line(s) of code do I need to use server-side to get a list of players and extract their positions' Thx for any and all input.
  7. I really don't mean to step on anyone's toes here. I have not said, that I think MCreator is good, suggested that anyone else use it or said I wouldn't use something else. I have been honest in that it was the actual IDE and that because of it, I don't seem to get a lot of features, but I do have some sort of autocomplete and I can see the source code. I was also just honest about why I choose it to begin with. But DaemonUmbra giving a suggestion to help me instead bashing a IDE seems like a way more productive way of going forward. And while I do read the suggestion on IDE change, it is actually a lot more work than clicking an exe installer (from the description). And again not saying that I wouldn't do it! But for what seems to be two lines of code (minecraftserver.getplayerlist + player.position), I'd rather just start with those and maybe avoid the whole reinstalls and roaming through source codes, if someone knew the "two lines of code". Again, I don't mean to dismiss any suggestions or good advice, I really would like to know, how can I get a list of the current online players server-side and check their position? Am I using wrong lines of code or should it be working already? (I apologize if this was answered already, if so I missed it and it wasn't clear to me) Again, thx for all your input
  8. Well, Im not using any of the MCreator files, Im just using it to compile my own classes, instead of using the java console. Again, it was easy to setup up, as the installer was small and did all the work and it didnt require any setup. But thanks for the heads up on the bad IDE. But assuming that MCreator is not the problem, how am I gonna get my problem solved :-?
  9. Agreed, but for "2 lines of code" it seems to do the trick and it was a quick download and setup vs other IDEs which seemed like a big hassle to set up.
  10. Hi Diesieben07 Thx for your reply. I'm using something called MCreator. It does give compilation errors, if I'm trying to use a function, that does not exist, but it does not seem to check if something is serverside or clientside only. I'm also not running the code from MCreator, but rather moving the compiled classes into a jar file and running it on the server to test whether it works. If I use: System.out.println(FMLCommonHandler.instance().getSide()); I get a "SERVER" printout. If I use: System.out.println(DedicatedServer.getCurrentTimeMillis()); I can compile, but I get a no-method-found error, when running it. System.out.println(FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList()); gives the same. So I'm looking for the way to find all players and determine distance between them serverside or as a lesser solution a way to determine if I'm actually able to use serversided function and what serversided functions I have available.
  11. Hi Cadiboo Thx for your incredibly fast response! I already read the page you are referencing and I honestly don't *really* get it. Maybe because I don't really think I need it for this mod, as you are kinda suggesting as well. As I said, I think I am hooking the event just fine and I'm able to respond by printout console lines just fine when a user 'says something'. I'm also able to show the message in chat or ignore it and thus not show it. My main problem is that I don't know how to get a list of players and positions and when I try to use any functions I've found through Google or here, I get a server error with a method-not-found, which I'm unable to determine is because I'm using client-side functions or doing something else completely wrong?
  12. Hi guys I'm new at this, so take everything I say with a grain of salt. So I'm trying to update an small, old 1.8 mod to 1.12.2 by request from a friend. The original creator is unavailable and so I did a decompile on his classes and got the source code. I figured out what the mod was doing and rewrote the classes. I can run the mod on a dedicated server on my own machine (I *think* it's a dedicated server - console pop-up server?) and I can connect to it as a multiplayer lan server from my client. So here's my problems: I'm trying to hook into the chat message system and "redo" the send message function with some added functionality. The hook seems to work, as I can stop the message or let it pass through. In the hook I want to compare the distance between the sender and all other players. (for stuff like /talk, /shout, /yell) My IDE is horrible to say the least and I have no experience with minecraft or modding and for this small task, this IDE was the best way to quickly edit and compile the code and see if it worked. I haven't found any way of telling whether a function is a serverside function or a clientside function and using my google-fu skills to find some functions to help me, got me to try to do something like this FMLCommonHandler.instance().getMinecraftServerInstance(); And while that function works, if I do anything with the minecraft-server-instance, such as getPlayerList(), I get a java.lang.nosuchmethoderror. I have looked at the proxy-client-server-thing, but I dont understand it and do I need it? Am I trying to call a client-only function? (the intend is to have a serverside only mod with no need for client installation) Is there a quick way to tell, whether I'm doing something totally wrong? If I'm just not using the correct functions, could someone tell me the functions I need use to get all players/playerlist and a player positions? Thx in advance for any help.
×
×
  • Create New...

Important Information

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