Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Why so you have a function inside your super call?
  2. No no no no. You're creating a map here. Good. You're spring the keys, good. You then save the story's keys to the map and json encode the map, bad: this fundamentally doesn't make sense. What you should do is loop through the sorted array and retreive the values in order to write to the json file. It doesn't matter of the json is encoding a map with 4000 items in it or 4000 individually sorted key-value pairs one at a time. Alternatively, use a data structure someone else already created that does what you need, as Lex suggests, rather than trying to make one that doesn't work that way work that way. The whole point of a HashTable is that the values are stored in a location that is easy to determine based on the key: "Item152964" is stored at index 15964, irregardless of if the preceding 15963 items exist or not. It is about fast lookup, not arrangement.
  3. Leave the hashmap alone. Only sort the keys in order to write the values for human reading. After that you shouldn't care.
  4. No worries, there is no such thing as a stupid question. There's only questions that clearly indicate that the user isn't trying to learn. (I've muted a couple of these folks after a thread basically goes "I have a problem," "ok, do X," "it didn't work," "show your new code," "ok, here it is," "you didn't do X like I told you to." Back and forth six times).
  5. You still need to return true on the client. For instance, I have this in one of my inventory blocks: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { if (world.isRemote) { return true; } else { player.openGui(IndustryBase.instance, 1, world, x, y, z); return true; } }
  6. The people who say that are people who are trying to learn Java by modding. Or more accurately, learning how to program by modding. There's a few other instances too, where I'll be more blunt or abrasive than I need to be and people take it as a personal insult. As an extreme example, I was once in an argument with a global moderator of a forum where he intentionally misquoted what I was saying in order to make his position stronger (something to the effect of taking my post about "I've never heard about [events] until after they happen" and some other bit and recombining them to say, "WHAT? You've never heard of the Steam Workshop!?"). According to the forum TOS, intentional mis-quoting was an instant ban offense. I screen-shoted it and went "WTF, dude." My post got deleted and I got a warning due to language (I had "WTF" as letters, not words, in the image), he got off scott free. Well, not exactly scott free, but he retained his position as global moderator. I contacted the community manager (not exactly a mod or admin, but someone who had the authority to slap mods upside the head for being idiots) and explained what happened. The warning was removed from my account and the mod team got a stern talking to. That forum was pretty damn toxic at the time though. Everyone would find any excuse possible to call in the mods in order to win an argument. I once got an unofficial warning (moderator posting in the thread "no personal attacks please") for saying, "That's a straw man argument, please try again."
  7. initRenders() isn't called anywhere in code you have posted. Just because you wrote this method doesn't mean its magically called.
  8. If your packet arrives, then the code in your packet handler runs. Ergo, your code runs if your packet is sent.
  9. Your code is way too complicated for to me to figure out what you're even doing, much less why it is broken. That said, why the FUCK are you storing the lengths of an array in another array?
  10. That function "onFoodEaten" will never be called. You need to create a new classthat extends ItemFood and override onFoodEaten
  11. Every version of Thaumcraft is closed-source. There is also this thing called JD-GUI or Fernflower. ("Fernflower"?)
  12. In fact, the item registry will be better for two reasons: Some blocks don't have item forms and can never be in the inventory (except via cheats) such as water and lava. Some items correspond to more than one block, such as the sign (which in addition to not having an item block form of either Block 63 or Block 68, the item can place down either, depending on context).
  13. Again, it entirely depends on what you want to do. In this case, is an Interface a good idea? Probably not. The backpack? That might be good to expose as an interface, so if another mod wants to come along and create a HandyHaversack that holds 200 pounds of "stuff" and only "weighs" 20, they can, and your mod will treat it correctly.
  14. Not at all! I was just whining about Reika Anyway, if you want a good API, figure out what needs to be exposed (any time you ask a vanilla item a question, that question and its answer are some kind of exposure) and then build things so that you're implementing your own API. Mine only works so well because I have five mods that all want to have some interaction with each other, so I intentionally planned all those things as API-accessible (a few things happen via IMC messages, other things don't). Any time I was thinking of a feature I was also thinking of it in terms of "how would I access this feature if it was someone else's mod, what kinds of things would I want to be able to do?"
  15. Oh man. Reika changed his API at one point after I'd suffered through having to bug report (seven or eight times) his API not working correctly (his internal implementation was using Reflection to Do Stuff, and then doing that stuff wrong so that it was getting "no such method" exceptions (he couldn't even be arsed to use his own API for his own mod's recipes)) and the update completely broke my integration. I complained to him about the contractual obligation of an API and he shrugged it off saying "a lot of modders do that" and pointed to Mystcraft as an example (which from 1.6.4 to 1.7.2 overhauled nearly the entire mod, to the point at which to the player everything had changed). So I completely ripped out any code I was using to interface with RotaryCraft and said to my users, "If it works via OreDict, great! If not, too bad because I'm not fixing it." My own API has made some structural changes (most notably when I separated out "ore handling" from "general recipes"), but the bits that I moved around still exist in the old location marked as @deprecated and throw errors when executed (but it still forwards the calls to the new method and will the game will still run). Everything else has been additive: new methods, new features, and thus maintains backwards compatibility.
  16. No, that's what I did Or more specifically, I tweaked crops to grow more slowly, but also if they were the "most grown" of the crops around them, they'd forfeit their update to update one of those instead. There was still a small probability that it'd grow anyway, but due to the increased number of "ticks" and how they were distributed, it averaged things out.
  17. Its actually not a problem in this case as crops do not grow when a neighbor updates (BlockBush#onNeighborBlockChange calls super and BlockBush#checkAndDropBlock, neither of which schedule an update or call updateTick). Otherwise you could quick-grow crops by causing redstone updates near them.
  18. I think you mean a PositionedSound that implements ITickableSound. There is no ContinuousPositionedSound
  19. I hate recommending this, but: ASM. Make a core mod and replace the 2 with a 3 (this will be relatively easy, you'd be looking for iconst_2 within that function and replacing it with iconst_3). Shieldbug's ASM Helper will make it easy to locate the method and instruction. I also have my own version of printOpcodes() which supplies better information than just the opcode (useful for going "I need to push that same parameter onto the stack....ah, I need VarInsnNode(ALOAD,1) because the existing code here has an ALOAD representing that same parameter and it's value is a 1").
  20. Wall signs are blocks. Block ID 68, specifically.
  21. The TileEnt might be important for other reasons, but yes, a block on its own can make sound (see also: note block).
  22. An item every 10 seconds, by the way, is a lot of items. If left alone, that would be 30 items littering the ground around one of these entities, constantly, due to the 5 minute entityitem lifespan.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.