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. Use your debugger and figure it out. If the variant isn't the variant you expect, what is it?
  2. I think you have to try and merge the changes you made with the changes on the current Head locally.
  3. Oh. Try this. ((BlockBOPLeaves)BOPBlocks.leaves_2).variantProperty This is also why I store my block variant properties in an API location, not only so I don't need to cast things, use static fields inside my classes (which wouldn't be present in the API), or other weirdness.
  4. Deprecated methods are fine to override but not to invoke.
  5. Can you post the code that defines the variant? e.g. I have this: public class Props { public static final PropertyEnum<EnumOreFlower> FLOWER_TYPE = PropertyEnum.<EnumOreFlower>create("flower_type", EnumOreFlower.class); }
  6. getActualState Check out how vanilla walls work.
  7. Fixed a typo, stay -> start. The event handler takes 3 events (effectively, save load and generate) and passes it off to the data structure that holds the information so that it cansave to disk, read from disk, or create data from the world. Save/load is just NBT writing. But there's also an Unload event so you can remove data from the data structure when the associated chunk is no longer in memory (avoiding a memory leak). You'll also need lookup ("get nearest") and modify ("block permanently removed") methods.
  8. Oh I know what's wrong. Ok, so by specifing the parent as cube_all there needs to be a final non-reference value for "#all" but what you specified is this: "all": { "texture": "#texture" } "#all" now points to "#texture" and "#texture" points to.......nothing. Unable to resolve reference.
  9. Items don't have blockstates, although you can use the system for it. When I wrote my code I was writing this in my client proxy (things have been refactored to make it a common object that all of my dependent mods can then access), but this is what I did: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L86 The interface IMetaLookup was just a custom interface I apply to all of my variant enums so that I can convert between variant and metadata and back. You should already have those methods, I just encapsulated them into a common interface.
  10. You can't do ".this" as it makes no sense. You need to get a reference to the actual block object. Say.... BOPBlocks.leaves_2.variantProperty
  11. You'll also want to save and load the data. Feel free to take a look through this: https://github.com/Draco18s/ReasonableRealism/tree/master/src/main/java/com/draco18s/flowers Start with the event handler. My data is more complex than yours, but functions similarly (you will also want the vanilla generation events, not COG's).
  12. If they're being placed into the world as part of worldgen and there aren't that many of them, they're easy to keep track of in a separate class: as one generates, push its location to a list of known. When destroyed, remove it. If they're preset (i.e. always at 123,45,987) then you can know where the nearest is before it's even been generated. Vanilla sort of does this with end portals, though the code is stupidly complex.
  13. By the way, if your model is that simple, why are you using it? Why not make your blockstate tell the game to use block/cube_all?
  14. The problem with this is: How far away are you willing to search? Or are you willing to track the blocks' positions another way?
  15. ((!EntityPlayer)result.entityHit) The hell? What are you trying to do here? An anti-cast? Also, that's not how you check for "not an instance of." http://stackoverflow.com/questions/9068150/best-way-to-negate-an-instanceof
  16. That's not how extending works, so no.
  17. While true, the point is he doesn't need it. At all. Ever. The fact that he had it was to solve a problem with not knowing how to create resource locations, so he did it there, which was the wrongest place.
  18. I was being sarcastic at gurujive, not you. I was telling him he was being dumb because he was suggesting Solution-A which won't work for Problem-B (he can't even get his own entities working properly, so he's really got no experience helping other people with entities).
  19. You have two things named "rsrcl" and your code doesn't know which one you want. Seriously, you're passing an object TO the method, you don't need the static final one.
  20. When the key is pressed: tell the server The server then checks if the player is wearing the armor. And if so, activates the effect.
  21. And go learn basic programming. You're literally flailing about at random and don't know what anything does.
  22. Pretty sure it's DataWatcher stuff.
  23. https://en.wikipedia.org/wiki/Scope_%28computer_science%29
  24. Yeah, that's totally going to work for a sword.
  25. That chunk of code probably doesn't even need mutable blockpos objects. But yes, it looks like you are correct.

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.