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. It might have something to do with getBlockState....
  2. If you (generic) are creating a furnace that "just looks different" you would just have all the Blocks create the same TileEntity. There's no reason to create a new TE class (even one that extends some generic version) just because it belongs to a different block. As for "allowing mods (and MC itself) just to know this thing is a furnace": what value is there in that? Why "furnace" instead of "grinder" "machine" "oven" "a thing that has an inventory and updates every tick and alters that inventory" or some other niche distinction? Why is "furnace" the important distinction to make?
  3. Ok, I'll grant that that is a valid point.
  4. Really though, there doesn't need to be a common furnace. It's a TileEntity (common code) that implements ISidedInventory (probably) or at least IInventory. Which is all that's needed for every mod ever to be able to insert items or extract them (including using the vanilla Hopper). No other mod needs to care about how your CustomFurnace actually smelts inputs into outputs, so having a "common core" for the updateTick method is pointless. Per liquids, I suspect it was originally because creating a new liquid was Hard* and so it was written as a base class that mods could extend in order to easily get a liquid working "like vanilla" and morphed later into the liquid registry (et cetera) due to the number of mods wanting to move liquids around and treat them in common ways without having to do a bunch of special casing. There is IFluidBlock, which is implemented by BlockFluidBase, but it doesn't really supply all of the necessary details, as BlockFluidBase is the class that handles the Fluid object. But sure, feel free to create that library if you want to. Dollars to doughnuts no one will use it. *My first attempt at a liquid, using the Forge liquid base block didn't even work correctly, just to give you an idea of how Hard it actually is!
  5. Also keep in mind that there are other mods out there that modify a chunk long after its been generated. COG, for example, waits until the next chunk over is modified so that it can go in and clean up any coal that bleeds over before placing ores using its own algorithms ("deferred generation +16"; "deferred +32" would be two-chunks-over, etc. although nothing uses anything later than that by default). So yeah, depending on what you're doing, the right place to sit and wait for an event might change.
  6. Exactly what it says on the tin. Funny how classes are named what they are.
  7. Reflection is an entire Java package dealing with class files. It's half way between "code that runs" and "code that modifies running code" (ASM). Here's a chunk I use: try { Class clz = BiomeGenBase.class; WildlifeEventHandler.rains = clz.getDeclaredField("enableRain");//field_76765_S WildlifeEventHandler.rains.setAccessible(true); WildlifeEventHandler.snows = clz.getDeclaredField("enableSnow");//field_76766_R WildlifeEventHandler.snows.setAccessible(true); } catch(NoSuchFieldException e ) { } Basically, I request a private field from a class, set its accessibility to public, so that later I can modify the value (if I don't, the program will crash with an exception). Eg: WildlifeEventHandler.snows.set(BiomeGenBase.plains, true);
  8. Vec3.createVectorHelper(x, y, z)
  9. world.setBlock(x, y, z, Blocks.air) Just like setting a block to annnything else 'course, there's also the helper function world.setBlockToAir(x, y, z) ... but it just calls the above line anyway.
  10. No code, can't help.
  11. You don't actually need IProxy or ServerProxy. IProxy here is pointless and generally speaking your "server" proxy is actually the Common proxy.
  12. Pretty much unless Forge needs to be doing something, it should be left up to the individual developer. Liquids being one example: there needs to be a single way to go "oh that's a liquid" so the various mods that have pumps and pipes can handle every mod liquid the same way. Furnaces? Not really. There's a single furnace recipe repository and that's really all that's needed. Various mods will do their own cooking their own way as their specs require. Some mods might use different fuels, cook faster, cook slower, have a variety of other tweaks and alterations. There's no "good" way to supply a common package for this.
  13. No i need slime block and Armorstand with the physics of 1.8 Good luck doing the physics with vanilla code that doesn't exist.
  14. It's a potion effect. I don't know how I can be any more clear about this. I opened up the list of potions and look at what I found: public static final Potion field_76443_y = (new PotionHealth(23, false, 16262179)).setPotionName("potion.saturation"); It doesn't have a deobf field name, but it still says "potion.saturation"
  15. There are only so many global IDs and if everyone is registering their entity using registerGlobalEntityId, there won't be enough to go around. So instead, you use registerModEntity, which gives you 256 IDs that you, and you alone, can use.
  16. Uh huh. And neither one of those code snippets is a class named "ModelBakery" nor a class that contains a field called ModelBakery. Or even a reference to the other two.
  17. Fuck. Click the thing that says "cast to..." This is why your IDE exists.
  18. Go to the relevant class, click "edit." GitHub will ask you if you want to fork the project (yes, you do). Edit the relevant function so it does what it is supposed to. If you need to, make sure it compiles and runs properly (do a git pull, edit and test, then git push). Then submit a merge request.
  19. Hunger is negative food. That's why I said "Saturation." And my mistake it was 1 half-shank per tick.
  20. Yeah, when I was messing around with this, I had to use potion effects. A half-shank worth is like 5 ticks worth of the Saturation effect.
  21. Making every block change in one dimension affect the other is going to be neigh impossible.
  22. Also, aren't all of the 1.8 blocks available in 1.7 using Gany's Surface?
  23. Not sure why the crash, but I am noticing that addDefaultEquipmentAndRecipies does nothing.
  24. This ^ How to: https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows

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.