Skip 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. You open the vanilla GUI, which checks to see if the player is using a vanilla workbench, and immediately closes the gui if they are not. You need to open your custom GUI using a GuiHandler and player.openGui(...) which includes passing your mod ID.
  2. What you want is a coremod that operates via ASM. ASM is a very deep, dark abyss and you will get minimal help figuring out how to make a coremod. Primarily because: 1) You should not be modifying base classes at all ever, doing so can very easily introduce mod conflicts. 2) ASM requires understanding Java bytecode, you will need to know this before you can start, at all. 3) Providing resources on how to coremod will cause more people to go "yay, I can modify base classes!" when they didn't need to. Given that you are interested in doing this on 1.9, I suggest actually supplying a patch back to Forge as a Pull Request that inserts an event hook where you want it, that way you don't have to modify vanilla classes.
  3. https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/client/PedestalRenderer.java#L57-L106
  4. And then doesn't give a shit what the actual value of the metadata was, because it performed the same check on all of them: meta == i It doesn't matter what value meta was from the world (because it can only be 0 to 15), at some point during that loop that check will be true. Following that, because you are doing return true in the block-check, as soon as it determines that yes, one of these blocks is what we're looking for it never even fucking checks your loop.
  5. Rather than incrementing a counter every tick, store the start time and compare with the current time.
  6. Also, pretty sure that statement will never return false. //somewhere... stack new ItemStack(yourItem); //somewhere else... stack.getItem().getContainerItem(stack)
  7. Or you can compare the player's lastPos values with its pos values and see if they have changed.
  8. http://www.minecraftforge.net/forum/index.php?topic=22764.0
  9. Do note that in order to add AI tasks, you need to wait until after the entity has spawned in the world. EntityLivingBase#tasks is null until then.
  10. ...look at TileEntitySign and see how it does it?
  11. You need to look at ClassLoaders. ClassLoaders are objects that load other classes when needed. This means that you can write a custom class loader that fetches a class, examines it, makes changes (if it wants), and then passes it off to the JVM.
  12. How long is the sound file (in seconds)? Option a: make it shorter. Option b: make it a sound like the jukebox or minecart, which can be canceled.
  13. Hesus Christie. Put the setRegistryName chunk with the same chunk that does the unlocalized name and max stack size. Or better yet, put all of that into the constructors for those classes, the whole "method returns itself" pattern is dumb IMO.
  14. if(block == otherBlock) ..?
  15. Good job not knowing how proxies work.
  16. And some are weirdly related, like seeds. Seeds are absolutely not the item form of a block, yet when used they create a block, when that block is middle-clicked, you get a seed, and when the block is broken, you get the seed (usually!) But you can also get seeds from breaking tall grass (which has its own itemblock!)
  17. .getUnlocalizedName() == this.getUnlocalizedName(); Hesus Christie! You have no idea what you're doing, do you.
  18. You initialize Items before Blocks, but pass a Block (which is null) to your Item's constructor.
  19. Override createStackedBlock for your Block class.
  20. No need for a tick event here, Potion class has isReady and performEffect methods which will be called. I meant the visual display next to your inventory where it contains a timer (the "duration"), not the effect.
  21. world.playSoundEffect(...) ? Also, have you even looked at how the Jukebox works?
  22. Integers are a fixed size. byteBuffer.writeInt(value)
  23. It's a client-side tick notification, it can be used to keep things like potion durations updating correctly without having to wait for an update packet from the server, keeps the sun/moon/stars sliding smoothly across the heavens, etc. You'll notice during periods of extreme lag that these values keep updating even though they're wrong and will "snap" back to the correct value when an update packet from the server does finally arrive (yes, even single player!). Or at least, that's what vanilla does in between Phase.START and Phase.END, what a mod does with it is up to the mod, but that gives you an idea of the kinds of things that occur.

Important Information

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

Account

Navigation

Search

Search

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.