-
Posts
440 -
Joined
-
Last visited
Everything posted by Flenix
-
I've just thought; could I use something similar to how the enderchest works here? I've not looked at the enderchest, but I could theoretically do a similar thing in the world NBT instead of the player one - with my "teleport locations" being the data stored instead of items, and the sender being the "physical chest" which can view those locations. Am I on the right tracks with that?
-
I must admit, judging from what I've heard I'm quite excited! I missed you on IRC earlier though, didn't wanna ping you for an answer but if you get a sec: Before we even begin to think of starting the update, what can us modders do to avoid "fucking shit up"? And, I'm assuming that even with this implemented, we're still gonna have that 4k block limit, is that correct? I've had ideas in the past for my mods which I've avoided as I don't want to go mad and overuse IDs, that's the only reason for asking
-
Sorry for the confusing title, I wasn't exactly sure how to word it. Basically, I want to make a TileEntity. Actually, it's two tileentities, effectively for "teleporation pads". So, all I need to do is for the sender pad to know where all the receiver pads in the world are located, then send the player there. What I'm unsure about, is how can I make the receiver "tell" the sender where it's located, and when should I do that? I figured I could maybe save it's coordinates in a special NBT tag in the world, but when people use a lot of them that might get messy so what better ideas are there? To be clear, there's no "channels" or anything. All senders should be able to send to any receiver, which will be selected in a GUI. The idea actually works a little differently but this is the easiest way to describe it
-
No need for fancy reflection. Stick this in your init section, and it prints the username to the log at startup: System.out.println("The username is...." + Minecraft.getMinecraft().getSession().getUsername() + "!");
-
Hey guys, I'm working on an ore mod which is designed to be a non-intrusive solution to removing duplicate ores. The mod works in that other mods can add an optional hook (checking if the mod is there then using it if so) to disable their own ores and use mine instead. However, I imagine some of the bigger mods wouldn't support it so I'm also going to try and add an override too (which simply prevents their ore actually appearing) However, I'm not sure exactly how I'd replace ores that are already added to an existing world? Basically all I need to do is find an ore which is on the list, and replace it with a specified ore. I'd want to be able to find the ore either by unlocalized name or ID - unless you know better ways? I want users to be able to add ores to a config in case there are smaller mods I've not included directly in the mod. Any help is great, thanks
-
Anyone got any more ideas? Especially with the third idea?
-
But then we're back to the age-old issue. I'm sending it from my GUI which has no player instance in the method, so I can't send a packet to the client (not to mention that it's already client-side...) Currently the packet is being sent to the server. Any ideas how I could get it client-side without Player?
-
Hey guys, After much help in the last thread I've managed to get my packet system working. My ATM will now dispense money depending on if the player has enough in their account, so it's almost ready for a release However, I do have 3 minor bugs. The first is with my PIN verification. The PIN features aren't complete yet anyway, but I'm trying to set it up so after 3 incorrect tries, it confiscates the debit card. I've got everything working, except a graphical issue with the client where there's a ghost card left behind. When right-clicking the floor (or anything else) with the card, it vanishes - but if I try and right-click the ATM itself with the ghost card, I crash. Upon restarting, it has vanished, but crashes aren't good. I figure an easy fix for this would be some sort of "force update" for the client inventory, which I could run after removing the card. Is there such a thing? The second issue is to do with how my GUI system works. I've set up a number of "stages", which are altered by button presses. However, it seems that sometimes the buttons "double-click". For example, say on stage 1 a button progresses to stage 2, and on stage 2 the same button progresses to stage 3 - if I click the button on stage 1, it skips straight to stage 3. Is there some way of me preventing this? Maybe putting a brief hold on how often the player can click a button? The final issue isn't as much related to the ATM - but I have a mob. Everything works fine in single player, but on servers the spawn egg doesn't seem to work. I figure this is due to my EntityRegistry, which adds the spawn egg, being in the client proxy - but that's the only way I know how to do it. Does anyone know how I can fix this issue?
-
Getting EntityPlayer parameter outside of the method itself
Flenix replied to Flenix's topic in Modder Support
Yeah, I can get that in the ClientPacketHandler class but I need to pass it to other classes to use. Is there an "onPacketRecieved" method or something? I want to run some code when certain packets are received. -
Getting EntityPlayer parameter outside of the method itself
Flenix replied to Flenix's topic in Modder Support
I was experimenting while I waited for a reply. Seems to work as far as ints go, but I couldn't get it to work for a double - it throws the error in the packet handler. I'm sure I can figure that out with some experimenting. So, hopefully the last question. Currently, I've got the packet to send an integer of 4 to my client from the server. How can I then go and read that 4 in the GUI? I want to print it as text on the GUI, so I need to convert it from an int (or double) to a string too -
Getting EntityPlayer parameter outside of the method itself
Flenix replied to Flenix's topic in Modder Support
Alright, I think I get it. From the looks of it, I need to be sending packets from my block class for things like checking the players NBT, because my GUI class has no method of doing it as it's client side. I could send the packet at the time the player right-clicks the block, as I know 100% the NBT value wont change after that moment until I've used it, and I can store it as a variable in the GUI for later use... is that good or bad? As for streamlining, do I need the entire snippet of code for each and every event which sends a packet, or would there be a smaller way of doing it? IE, do I need to have that entire snippet repeated for each button, or can I be clever with variables or something? -
Getting EntityPlayer parameter outside of the method itself
Flenix replied to Flenix's topic in Modder Support
Alright, looks relatively simple. Where does that first code-snippet go though - in the GUI class or the client-side packet handler (nothing else in there?) Is there supposed to be a method going with that snippet too by the way? Where's it getting the parameters from? Finally, is there any way to streamline packets? Right now I'll be having probably 8 buttons (maybe 18, depending how I handle it and what works) which would need to be sent. Thanks for the help -
Getting EntityPlayer parameter outside of the method itself
Flenix replied to Flenix's topic in Modder Support
Alright, so in order to read/edit NBT and inventory, I'll need a packet? Time to learn how to use packets! I assume the wiki tutorial isn't totally out of date..? I've been putting packets off for a long time on my "to learn" list, so I really do need to get around to it. -
Hey guys, probably a simple question but I can't figure it out. I need to get the player in order to do a few things (consume their held item and read from NBT to name two), but just adding EntityPlayer player to my method obviously breaks stuff*. So, is there any other clever way I can get player information where I usually couldn't? [spoiler=*] By break stuff, I mean: public void actionPerformed(GuiButton guibuttonr) { switch(guibutton.id) { case 1: System.out.println("You pressed 7!"); break; This works... public void actionPerformed(GuiButton guibutton, EntityPlayer player) { switch(guibutton.id) { case 1: System.out.println("You pressed 7!"); break; This does not work.
-
Custom Gui texture not working outside eclipse.
Flenix replied to EarthGuardian's topic in Modder Support
Eclipse reads files slightly differently, when compiled it has be exactly correct but eclipse is a little more lenient. Really annoying actually, if you accidentally do your capitalization wrong on a texture, it'll work in eclipse but not when compiled -
Yeah, this is the currency mod, well guessed My issue with using a text field is that it wont match the rest of the GUI. My GUI has a black screen with green text, but as far as I know a text field is forced to be the black box with white text and a white border? Obviously I don't want to actually print the pincode, I just want to change from _ to * each time a number is clicked. Is there some clever easy way I can do that? Also, this opens up a whole new question too- multi-screen GUIs. After the correct pin is entered, I want to continue to the "next screen" on the ATM. The differences are the on-screen text and the function of the buttons, so I'd probably need to open a new GUI for that. Is there some clever way of doing that?
-
My question for that, is how would I do that exactly? Do I need to use a text field for it? Ideally I'd like to keep it part of the theme of the GUI, I've never used a text field but I assume it's like a button and is a fixed texture? May I ask what this is in reference to? My GUI itself works, it's the buttons I'm having some issues with...
-
Hey guys, I've tried searching for some tutorials, but I keep turning up empty, there doesn't seem to be any good updated ones. So, I just have a few questions about GUI buttons. I've created the buttons themselves fine, it's everything after I'm having issues with Firstly, I want buttons in one GUI to enter a pin code. The player has to click 4 correct buttons, in the correct order. What would be the best approach to doing this? Running it over mentally, I figured storing NBT data might be a good option (and deleting it on close), but is there a better way? The correct pin is stored in an item, which the player has to hold to acccess the GUI, so that's always "on hand" so to speak Secondly, I need to spawn items into the players inventory depending on key presses, how would I manage that? Finally, how can I handle GUI scaling? When in full screen my buttons line up nicely, but if I go to a smaller window mode, they've all shifted! Any help with any of the above would be great, thanks
-
Hey guys, I'm having my first attempt at crops today. I couldn't find any tutorials, so I've been trying to learn from the Still Hungry source. My crop loads up, I can plant the seed to get a crop. However, it doesen't seem to grow. I left myself AFK on a test world for around 30-40 minutes (with T pressed so time will still pass), and it hadn't budged. Bonemeal doesn't work either - but I know for saplings you need a handler for that so I'd assume the same here. Anyway, has anyone got any ideas what I missed? Probably something quite obvious, but yeah I don't really know what's needed Crop class: http://pastebin.com/nLqx33Xp Let me know if you need any other classes. I can place my seed on tilled dirt so I assume everything else works, just the crop that doesn't.
-
Forge installer just gives a new version in the profile options - I want to create the actual profile, the thing you can select from a dropdown list on the launcher itself (not inside the options)
-
This "not helpful information" is correct. I literally just googled it, first result, one click later and I'm staring at a page on how to use the turtles API. Purposely not linking it due to your attitude. NOW I'm being unhelpful
-
I knew if I didn't do it, someone else would. So I just had to
-
I don't think you need to decompile it. CC has an API so there must be documentation - try the official CC forums?
-
Hey guys, I've been working on making my mod modular- IE, I have a "core" mod and then other "modules" which use elements from the core. I was told the best way to do this when using multiple projects, is to add the core to the build path. I had everything working nicely in Eclipse, but upon compiling, the compile fails because it can't find the core class files which the module is referencing. Any suggestions on how I can get around this issue? EDIT: Fixed on IRC. I needed to put the .jar in the lib folder for the compiler to find it
-
Hey guys, I'm trying to make an installer for my Forge mods, which I've packaged into a little modpack and made a test server for. What i'm trying to set up is a system whereby players can run the installer and it will install a version of forge I specify (probably on an online .xml file), put my mods and their configs in the correct place and create a launcher profile - so the player can go from a vanilla minecraft to playing my mods with a single step. However, I've been told that it's "impossible" to create a profile through the launcher any way other than clicking the new profile button. I thought that sounded a little strange, and the person who told me that has claimed impossible to many things in the past which have been proved quite easy, so I figured I'd ask here! Does anyone know of any way to create a new launcher profile with external software or a .bat file then?