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.

Eroc33

Members
  • Joined

  • Last visited

  1. That makes sense. Thanks. Is there any easy way to work around that?
  2. Is this a bug or is there some reason that writing NBT data changes how right mouse up is handled, or am I doing something different wrong? Also by adding some simple logging and using @SubscribeEvent that the PlayerUseItemEvent.Stop event isn't always triggered when the use button is released if NBT data is written. Example code snippet: public class ItemRFBlaster { //some methods ommited for brevity @Override public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer entityPlayer, int itemInUseCount) { super.onPlayerStoppedUsing(itemstack,world,entityPlayer,itemInUseCount); logger.info("Stopped using"); if(getFiremode(itemstack) == Firemode.Single) { tryFire(itemstack, world, entityPlayer, itemInUseCount); } setCoolingdown(itemstack); setPartialTicks(itemstack, 0); } @Override public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { super.onUsingTick(stack, player, count); logger.info("count: {}",count); if(player.getEntityWorld().isRemote) return; assert(player.isUsingItem()); if(!canFire(stack)) { setCoolingdown(stack); return; } if(getFiremode(stack) == Firemode.Auto){ tryFire(stack,player.getEntityWorld(),player,count); }else if(getFiremode(stack) == Firemode.Burst){ if(tryFire(stack,player.getEntityWorld(),player,count)) { incrBurst(stack); } } } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityPlayer) { if(entityPlayer.isSneaking()) { if(!world.isRemote) { cycleFiremode(itemstack, entityPlayer); } } else if (entityPlayer.capabilities.isCreativeMode || getEnergyStored(itemstack) >= 5) { entityPlayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack)); } return itemstack; } } Where tryFire, incrBurst, and canFire read and write NBT data. If the NBT data writing is commented out then onPlayerStoppedUsing is always called when I expect it.

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.