Jump to content

Lycanus Darkbinder

Members
  • Posts

    118
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lycanus Darkbinder's Achievements

Creeper Killer

Creeper Killer (4/8)

5

Reputation

  1. Thanks, yourname99. The suggestion about positioning with the arrow keys should be helpful.
  2. Hmm, looks like I might have asked too soon. After reviewing GuiSlider.java a bit more, it appears this is handled within the mouseDragged() method which needs to be overridden: if (this.sliderValue < 0.0F) { this.sliderValue = 0.0F; } if (this.sliderValue > 1.0F) { this.sliderValue = 1.0F; } I've been spoiled by developing in languages where the control managed these bounds that I forgot to look in the "drag handler" before posting.
  3. I've been working on my block's GUI and decided using a slider in place of a text input field would be more user friendly. Trouble is, the slider doesn't seem to be developer friendly. I haven't been able to find a method that sets the min / max value of the slider. I only want it to go from 0 to 15 but the constructor only asks for a "value". There is a method to set / get the value but nothing to limit the min / max, that I could find. Any advice? Thanks!
  4. Since this isn't a coding question I thought it would do better inGeneral: Are there any "best practices" when designing a GUI? I spent some time learning how to program a GUI but it looks bad. In other languages I've been spoiled with a "form designer" that lets you simply add the controls you need from a "toolbox" and then write the code underneath. In Minecraft, I seem to have the most trouble positioning the controls on the screen. My GUI isn't really complex but it's got enough to be annoying: 3 Input fields (text) 3 Labels (next to each text box) 1 Yes / No 2 Buttons When you design a GUI, what workflow do you use? Do you use something like Photoshop to draw a background with cutouts for each control? Do you "bake" the text onto a background (ie: text tool in Photoshop) rather than use font rendering in the game? Do you just render rectangles in Minecraft and skip the background completely? I'm just gathering information as to what would be the easisest way to position the controls properly while leaving room for modifications in the future. Thanks!
  5. Well not really. I still haven't found a GUI tutorial that deals with a simple GUI that itsn't a container. Basically all I want to have is a textbox where the player enters a number and a checkbox. These values get written to the TileEntity as "lightValue" and "isLit", respectively. So far the tutorials I've seen extend GuiContainer. I'm pretty sure I all I need is GuiScreen but still looking into it. PS: Not to beat a dead horse but I posted a definition of deprecated so I don't see how you could say it lacked actual definition. So far it seems nobody subscribes to that definition: the method of coding with proxies has been superceded by the method of coding without them. That is a valid application of the word deprecated. Even the 1.5.2 examples in the wiki don't use them anymore.
  6. I guess it's a matter of opinion then. When most of the earlier 1.3.x and 1.4.x tutorials go through great lengths explaining proxies and how to set them up, it feels a bit compulsory. None that I saw in that generation ever said "don't bother with proxies, they're not necessary". Naturally when several 1.5.x tutorials arrive and tell you not to bother with proxies, it feels a bit deprecated, as in "not necessary".
  7. Deprecated has nothing to do with it extending anything or being a "self made class", it simply means it's been superceded or replaced. The process of using CommonProxy has been superceded by the process of not using CommonProxy. As I linked a few posts above, Wuppy explains in a 1.5.1 video that they're not necessary. I don't use them and haven't run into any issues with my 1.5.2 mod.
  8. Thanks, I'll check it out. I posted his Minecraft series on the wiki but it didn't include GUIs. On his YouTube channel I saw the "Climbing the Interface Ladder" playlist but didn't bother clicking on it because there was no description and I thought it was about implementing interfaces in Java.
  9. I don' t know when exactly but every tutorial I watched for 1.5.2 and 1.6.2 says you no longer need to muck around with the CommonProxy crap. My SmartLights mod works just fine without it anyway. Edit: In for 1.5.1, Wuppy explains (at around 25 seconds) that you don't need CommonProxy anymore. Can you link to your tutorial? I'm not sure if it is one that I found or not.
  10. Greetings, I'm looking to create a GUI that allows users to make changes to the block's TileEntity data. For example, the user right-clicks my block and the GUI provides them a text field for entering a number and a check box to simulate a boolean. When they close the GUI these values get written to the block's TileEntity. Unfortunately the only GUI tutorials I've found (on the wiki and minecraft forums) are either too old and use the deprecated "CommonProxy" and / or they demonstrate a GUI container such as an extended chest. Are there any tutorials out there that pertain to a GUI interface that allows users to enter data? Right now my block is fully functional but I wanted to give the user access to change some fields without having to exit the game and modify the config file. Thanks PS: All I really need is something to point me in the direction of setting up the GUI for input. I can figure out the TileEntity portion on my own, I think.
  11. Perhaps try canceling the event: event.setCanceled(true);
  12. Oh, I don't store anything that complex. I only track the owner of the block (string) so not just anyone can fiddle with it as well as a few integers and floats. That's why I was surprised when it crashed after making a change. More than likely I did something I shouldn't but I'll have to wait until next time because once I remade the world it stopped crashing. I'm certain it had to do with my TileEntity though because the offending class is the only one that makes use of it.
  13. NBT returns zero on an attempt to retrieve a value for a key that has not been saved. None of the fields in my TileEntity would cause a crash with a value of zero. Worst case is the block would display the wrong texture or light value, or allow someone who is not the block's owner to interact with it.
  14. I don't have a crash log at the moment but if I get another I'll definitely post it. I'm not using ASM but there are TileEntities involved. What I did was place a block to see if the TileEntity's fields were set properly, then I quit the game and added a couple new methods to the block's class file and I think one new method to the TileEntity. When I started the world again it crashed instantly with that "error ticking block". I had to delete the world and recreate it. I was under the impression that the TileEntity would still function because Minecraft doesn't save the actual TileEntity but rather it's fields. When you load your world it calls createNewTileEntity which returns a blank TileEntity that is then populated from readNBT(). This should allow you to add new features without breaking existing worlds.
  15. I noticed while debugging and testing that if you add methods to a block's class and then load a world where blocks have already been placed, it will crash: "error while ticking block" I'm not talking about changing block IDs or anything crazy like that, simply adding a few new methods (no, not removing methods). How does one go about updating their mod or adding new features after it's been released to the public without breaking the worlds people have built? I can't put my finger on it yet but sometimes I have to delete my test world or it simply crashes over and over after making changes. I assumed that as long as you weren't deleting methods then it would be fine.
×
×
  • Create New...

Important Information

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