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. Even when the mods don't change? I thought it was at least stable under those conditions. And the hash is built during startup, IDs shouldn't change while the program is running and nothing about this data structure persists between runs (or even be relevant), it shouldn't even matter that the IDs changed due to a new mod install.
  2. So I'm having an issue with a wrapper class I wrote, so I can map a block+metadata to another piece of information data. It works find in Eclipse, no problems, none. Yet I've got reports from players (of a specific modpack, none the less, I haven't had reports from anyone else) of some console spam that only shows up if there is no match between the block and the info in the hashmap. The console spam is just debug logging info trying to resolve the underlying problem. Here's a section of that logging info, note the 4th listed item: [15:43:27][com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:201]: Hard Ore block, tile.ore_diamond has no flower data. This is a bug! [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:203]: Listing all mapped blocks: [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_iron:-1 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_gold:-1 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.beyondrealitycore:oreCopper:0 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_diamond:-1 true [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.beyondrealitycore:oreTin:0 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_redstone:0 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_redstone:1 false Here's the code that generates the logging: BlockWrapper bw = new BlockWrapper(this,-1); OreData dat = HardLibAPI.recipeManager.getOreList().get(bw); if(dat != null) { //do stuff } else { System.out.println("Hard Ore block, " + this.getUnlocalizedName() + " has no flower data. This is a bug!"); System.out.println("Listing all mapped blocks:"); Map<BlockWrapper,OreFlowerData> map = HardLibAPI.recipeManager.getOreList(); for(BlockWrapper b : map.keySet()) { System.out.println(" " + b.block.getUnlocalizedName() + ":" + b.meta + " " + bw.equals(b)); } } Here's the wrapper class: public class BlockWrapper { public Block block; public int meta; private int fHashCode; /** * the block and metadata to match, -1 matches all **/ public BlockWrapper(Block block, int meta) { this.block = block; this.meta = meta; } @Override public int hashCode() { if (fHashCode == 0) { int result = HashUtils.SEED; result = HashUtils.hash(result, Block.getIdFromBlock(block)); fHashCode = result; } return fHashCode; } @Override public boolean equals(Object aThat) { if(aThat instanceof BlockWrapper) { BlockWrapper other = (BlockWrapper)aThat; return other.block == this.block && (other.meta == -1 || this.meta == -1 || other.meta == this.meta); } return false; } } I don't get what could possibly be going wrong to cause map.get(key) to be returning null here.
  3. Or you could call the fire info in your main mod class....
  4. Guis are client side only. In order to make changes to slots and items, you need to do or on the server.
  5. they need to sync the data back from the server to the client again. Look for the methods getdescription packet and on description packet.
  6. The redstone repeater is a diode.
  7. Your Block dirt there is the same object as Blocks.dirt , you didn't create anything new with that code. Because setHardness looks like this: public Block setHardness(float val) { this.hardness = val; return this; }
  8. He wants to give the player an item (like an empty bowl) when they eat each of item various food items (like soup) without having to create a custom class for those food items. And the answer is no.
  9. That would be dumb and would violate the whole point of a public getter/setter wrapped around a private object.
  10. I still don't know why a batch file with "gradlew setupDecompWorkspace eclipse" in it isn't included, along with another one for IntelliJ.
  11. There's a good reason for that and that's because you haven't told Eclipse to load them.
  12. It absolutely exists. Vanilla does tags-within-tags for a ton of things. For instance, chunk data is an NBT tag that contains the NBT tags of all the entities in that chunk. Enchantments are stored as an NBTTagList, IIRC, as well. So yes, it absolutely exists. Whether or not the name has been de-SRGed, I don't know.
  13. stack.setTagCompound(new NBTTagCompound()); Like that. Its magic. You now have NBT data and can start storing things into it. stack.getTagCompound().setWhatever("Key",value);
  14. Uh huh. That would be the case.
  15. https://github.com/Draco18s/HarderStuff/blob/master/main/java/com/draco18s/ores/item/ItemOreDustSmall.java#L77-L98
  16. You mean, you aren't sure how to register a renderer for an Entity?
  17. You need two presses because of this: private boolean pressedLastTick = false;
  18. Draco18s replied to Asweez's topic in Modder Support
    There is NOT another way to so it. The static downward acceleration on entities is a hard-coded float value. Is not even a variable.
  19. See this bit here? See how it occurs after this bit here? Yeah, they need to be reversed. This is why you do not define your blocks, items, and fluids outside of a method.
  20. This one's easy dude. Look for references to "magic_gem."
  21. Nope. You need to draw all 12 edges.
  22. Single simple non-disruptive ASM hook in EntityItemFrame I suppose I could, but when it was reported, I looked into existing hooks and didn't find anything and said, "Actually, that effect is really neat, I like it." So yes, with some ASM I could "fix" the bug, but I thought it was a neat trick. It adds a little something to PvP servers. If someone finds your base where you've stashed all your stat boost items and breaks them, you're no longer so uber.
  23. You can't add a parameter to a function and expect it to get called by magic.
  24. Only sort of. If you're checking onUpdate how long its been since creation (rather than incrementing a counter every tick) then it's not free. As soon as the player breaks the item frame and picks up the food, it'll go rotten. But I know what you're thinking, it turned into a kind of "phylactery" effect for my Unique Artifacts mod. If a player found an item that increased their health (or speed, etc.) they could shove it into an item frame and get the bonus permanently. Wasn't something I could prevent so I called it a feature.

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.