use of com.teamwizardry.wizardry.common.network.capability.PacketUpdateMiscCapToServer in project Wizardry by TeamWizardry.
the class ItemFairyBell method onScroll.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void onScroll(MouseEvent event) {
EntityPlayer player = Minecraft.getMinecraft().player;
if (player == null)
return;
if (Keyboard.isCreated() && event.getDwheel() != 0) {
for (EnumHand hand : EnumHand.values()) {
ItemStack stack = player.getHeldItem(hand);
if (stack.getItem() != ModItems.FAIRY_BELL)
continue;
IMiscCapability cap = MiscCapabilityProvider.getCap(Minecraft.getMinecraft().player);
if (cap == null)
continue;
cap.setSelectedFairy(null);
PacketHandler.NETWORK.sendToServer(new PacketUpdateMiscCapToServer(cap.serializeNBT()));
}
}
}
Aggregations