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.

poopoodice

Members
  • Joined

Everything posted by poopoodice

  1. Return your capability provider there
  2. It's a supplier that supplies an instance, so of(() -> new MyProvider(); or just of(MyProvider::new)
  3. Just a thought, instead having your own timer, you can have an "extra time" where when the night skips you add it by xx value...or something similar, and when you need that specific value you just get it by adding it with the current game time.
  4. Just change your code to the code I attached, I've tested it that it worked. Play around with it and should be easier for you to understand.
  5. This isn't quite right. int color = (int) (Minecraft.getInstance().gameSettings.getTextBackgroundOpacity(0.25F) * 255.0F) << 24; float alpha = (float)(color >> 24 & 255) / 255.0F; float red = (float)(color >> 16 & 255) / 255.0F; float green = (float)(color >> 8 & 255) / 255.0F; float blue = (float)(color & 255) / 255.0F; check EntityRenderer L97, 98, and FontRenderer#func_238441_a_ (finish)
  6. ForgeRegistries.ITEMS.getValues() allows you to get all items. If I were you I will create and save the recipes with vanilla fuels, and then maybe check the input dynamically if it's from other mods (iterate through all other mod items once, and cache them), although there should be a better way for doing this... In fact you might not need recipes for this, unless you really want the players to be able to customize them.
  7. I'm not quite sure what is the usage but you can either new one or use IReorderingProcessor.EMPTY, and since ITextComponent inherits ITextProperties, some checkings and casting should work.
  8. No, use @Mod.EventBusSubscriber(Dist.CLIENT) to register or just make sure the class is not referenced by any common or server stuff.
  9. You shouldn't be rendering stuff there, use RenderTooltipEvent.
  10. Comment of the method: so you should probably use it. Can you show more of your code?
  11. Why do you need it?
  12. You should also try enable alpha test and blend.
  13. Disable depth test so it renders through walls and other stuff (no checking for which comes first, and which goes after).
  14. Is it named .json?
  15. You have to call honeyType.getRegistryName().toString() to receive something like "mymod:honey_block", otherwise you will get "honey_block" that Minecraft will automatically put the prefix "minecraft:" in front of it, which does not exist.
  16. ICommandSource.DUMMY The second parameter is a string where is the command inserted, e.g. "/gamemode survival". And then it will just print an error message if the command cannot be executed.
  17. Might be wrong, but I think in here you should be comparing items instead of itemstacks. And in fact this returns an array that contains all of the "without" items, which I think it's the opposite of your target? Because you then @Override public boolean test(@Nullable ItemStack p_test_1_) { if (super.test(p_test_1_)) { for (ItemStack itemStack : this.of.getItems()) { if (!this.without.test(itemStack)) return true; } } return false; } check if the stack is not in "without", where does not make much sense.
  18. https://mcforge.readthedocs.io/en/latest/concepts/registries/
  19. You can call IForgeRegistryEntry.getRegistryName.toString() and save it to the nbt, to read it you can use ForgeRegistries.BLOCKS.getValue(new ResourceLocation(nbt.getString("saved_block"))) something like that.
  20. Screen#renderToolTip will render the item information, e.g. on the hovered slot.
  21. Just look at how vanilla register it in EntityType.java, there's only 2 method named create in EntityType.Builder
  22. Use EntityType.create(), the one that is WITHOUT IFactory as the first parameter.
  23. IIrc there's item tags for them, check out ItemTags.
  24. Vanilla uses the builder that returned null for the factory because players shouldn't be spawned in usual ways.
  25. Check out Java lambda. IFactory is an interface that has an abstract method create(EntityType, World) that you need to implement it your self. class MyEntityFactory implements IFactory<MyEntity> { @Override MyEntity create(EntityType<MyEntity> type, World world) { return new MyEntity(type, world); } } register(new MyEntityFactory(), ....) -> register(new IFactory<MyEntity>() { @Override MyEntity create(EntityType<MyEntity> type, World world) { return new MyEntity(type, world); } }, ....) -> register((type, world) -> new MyEntity(type, world), ....) -> register(MyEntity::new, ....) However vanilla is passing in null as Players are kinda different to other entities (they don't spawn naturally, no spawn eggs..etc). They are created and added with a totally different way.

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.