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. 1) that boolean shouldn't be a class property: there may be multiple players breaking blocks at the same time. 2) you never modify the break speed.
  2. That causes updates to the itemstack every tick, which isn't efficient.
  3. It is currently considered good practice to use the registry name to set the unlocalized name: Item my_item = new MyItem().setRegistryName("myitem"); my_item.setUnlocalizeName(my_item.getRegistryName());
  4. By the way, your main class is basically empty. Your item won't ever show up in-game because none of your methods ever get called.
  5. You want it to run in Eclipse, I take it? Yeah, there's a runtime argument you need to add to the run configurations. -Dfml.coreMods.load=path.to.main.coremod_class I'm still pretty sure you can overhaul the combat system without coremodding, though. By the way... You will get virtually no help writing coremods.
  6. You kinda need to register an entity renderer too.
  7. For example: https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/ores/recipes/NEIIntegration.java
  8. Compare written world time to the currnet world time + delay amount. If greater: Do your effect and write the current world time to the ItemStack's NBT. Else: Do nothing
  9. That will crash a dedicated server. The server may not have a keyboard attached or know what a keyboard is. Not to mention having no fucking clue about the remote connection's keyboard status. You will have to implement this as a Capability / IExtendedEntityProperty that's set on the client via the Keybind class (don't ever directly reference the Keyboard: there are Keybinds for a reason, use them) and then use packets to sync. Then hold on a moment, you're looking at the shift key. Shift makes the player sneak. player.isSneaking done. Jesus.
  10. There is not. You would need to handle every mod individually.
  11. The right-click method has an ItemStack parameter and returns an ItemStack. Just return a different item stack.
  12. All of this is bad: public ItemBase init(FMLInitializationEvent event) { GameRegistry.register(this); if(event.getSide() != Side.SERVER) { registerModel(); } return this; } private void registerModel() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(TheMod.MODID + ":" + name, "inventory")); }
  13. Mind there's also Smelting recipes (Furnace.getSmelting() iirc) and brewing recipes. Mods then may add their own recipes devices (grinders, sifters, macerators, crushers, extractors, compressers, canners, electrolyzers, injectors, washers, mixers...).
  14. Even with no attached source you'll still get code hinting.
  15. "Using" and "Reading" are two separate things: Eclipse can still use the jar to validate code that you right, it just can't show you the source.
  16. The book is just an item that displays a GUI. In that GUI you can make it draw whatever you want.
  17. Item.getItemFromBlock... gets...the item form of the block...
  18. You gave it a model for the item but not the block. Also:
  19. Along with that, don't use item.getUnlocalizedName().substring(5) , use getRegistryName . Then go punch whoever told you to use getUnlocalizedName.
  20. Yes. Because you have a common class ( BlocClearInventory ) that contains sided code ( registerRenders references Minecraft.getMinecraft() ). As soon as the server reads your block class from the disk, it needs to make sure that the class is valid code. This includes loading every class referenced by your class. This means that it will then attempt to load the Minecraft class, which won't exist. This is not a question of "where is it called from." This is a question of "does the code exist." Your class contains CLIENT SIDE ONLY code. The mere existence of that code crashes the dedicated server, even if you never call the function from anywhere ever. This is why the registerRenders code must be moved out of the block class and into the ClientProxy.
  21. Have you registered your block model with the rendering registry?
  22. That's because you're looking at the raw bytecode for the mod, not the source code. If you wanted to read .class files as code, you'd need to decompile it first (fortunately Java is an open source format, albeit complicated). Or you can write it as a mod, as diesieben suggests.
  23. I'm not quite I see the error. I apologize, I didn't realize your main class was named "Chest." What I saw was the openGui command that vanilla uses to open chests, not the mod-specific openGui. You should refactor -> rename your main class so it's some like "MoreChests" or better still "MoreChestsBase" or "MoreChestsMain" so it's clear that it's your base or main mod class file.
  24. If you smelted to a custom item then you'd be able to tell. But yeah, smelting isn't supposed to give you a lot of exp.
  25. You need to add BOP to your gradle.build file under Dependencies

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.