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.

Xander402

Members
  • Joined

  • Last visited

  1. Block: https://pastebin.com/uHCFPFVq Container: https://pastebin.com/PBNvPkbR
  2. Since I need my own implementation of crafting container, I should be able to set which items can be used in crafting with this block, right? I tried to initiate the crafting matrix like this (the only difference between this and the vanilla class is the slot class name): for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { this.addSlot(new FoodSlot(this.inventory, j + i * 3, 30 + j * 18, 17 + i * 18)); } } But the game actually doesn't reject any item even if the FoodSlot class looks like this: package ... import ... public class FoodSlot extends Slot { public FoodSlot(IInventory inventory, int p1, int p2, int p3) { super(inventory, p1, p2, p3); } @Override public boolean isItemValid(ItemStack item) { return false; } } Instead, it moves the entire content of the matrix back to the inventory after several clicks.
  3. I tried the following: @Override public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult result) { player.openContainer(state.getContainer(world, pos)); return true; } @Override public INamedContainerProvider getContainer(BlockState state, World world, BlockPos pos) { return new SimpleNamedContainerProvider((i, playerInventory, playerEntity) -> new WorkbenchContainer(0, playerInventory), TEXT_COMPONENT); } This opens a crafting GUI, but does some mess in the inventory when opening - some items disappear, some get moved to other slot or duplicated, and everything returns back after leaving the GUI and clicking on any item in the inventory. What am I doing wrong?
  4. Yeah, right. I think this is actually a pretty common mistake.. Here is something that works: package ... import ... @Mod.EventBusSubscriber public class CropRightClickHandler { @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public static void handleCropRightClick(final PlayerInteractEvent.RightClickBlock event) { ... } } Two new things. The method handleCropRightClick is now static and the event was changed from PlayerInteractEvent to PlayerInteractEvent.RightClickBlock not to get triggered unnecessarily.
  5. The crash report told you what to do.
  6. Alright. I found own what to do my own. My RightClickEventHandler.java: package ... import ... @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class RightClickCropStickHandler { @SubscribeEvent public void handleCropRightClick(PlayerInteractEvent event) { Mod.LOGGER.warn("PlayerInteractEvent triggered!"); ... } } But there's one little problem. The event is actually never called (PlayerInteractEvent triggered! never appears in the console).
  7. How about just adding a new loot table with pools only with your mod seeds items instead of overriding the entire grass loot table? Overriding would block others potential opportunity to make their own seeds that drop from vanilla grass.
  8. I know how to use onItemUse method on a mod item. But how to add such thing to a vanilla item? I've heard about something like PlayerInteractEvent, but I don't really know know how to use it.
  9. Put your custom loot table in data.minecraft.loot_tables.blocks. Yes, you need to create the minecraft folder in your src/main/resources/data directory. It should get overridden proving the file is named the same as the vanilla loot table.
  10. It seems to be a problem with AppliedFluidics mod. Removing AppliedFluidics-1.12.2-2.0.3.jar from the mods folder should do the job.
  11. There is a java.lang.NullPointerException thrown by cofh.thermaldynamics.duct.attachments.servo.ServoItem.handleItemSending. Somewhere here in your code must be an element that is either null where it shouldn't be, or something caused it to not load/initialize properly.
  12. Try to download that library for yourself. Open C:\Users\samte\AppData\Roaming\.minecraft\libraries\net\java\dev\jna\jna\4.4.0\ folder, remove the jna-4.4.0.jar file if present and then put there the file from: [DOWNLOAD LINK]
  13. Yeah, right ... I downloaded it for myself to calculate the SHA1 checksum and then I forgot that I only downloaded it, not modified. ?
  14. Yes, I know that. ? I don't blame you. I've been playing around with modding, adding some basic items and blocks ever since 1.9, and I had to deal with all the changes (not only in naming), too. That's just for people who would potentially come to this post not willing to do research and expecting everything to be expounded exactly as it is.

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.