@SubscribeEvent public void onMouseInput(MouseInputEvent e) { Minecraft mc = Minecraft.getMinecraft(); if (mc.thePlayer != null) { int dWheel = Mouse.getEventDWheel(); mc.thePlayer.inventory.changeCurrentItem(dWheel*-1); if (dWheel != 0) { if (mc.thePlayer.isSneaking()) { if (mc.thePlayer.getHeldItem() != null) { ItemStack held = mc.thePlayer.getHeldItem(); if (held.getItem() == FarragoMod.RIFLE) { if (dWheel > 0) { dWheel = 1; } if (dWheel < 0) { dWheel = -1; } FarragoMod.CHANNEL.sendToServer(new ModifyRifleModeMessage(false, dWheel*-1)); return; } } } } mc.thePlayer.inventory.changeCurrentItem(dWheel); } }
@SubscribeEvent public void onMouseInput(MouseInputEvent event) { if (!addMouseInput.isEmpty()) { hMouseInput.addAll(addMouseInput); addMouseInput.clear(); } for (Iterator<LIHandler> it = hMouseInput.iterator(); it.hasNext(); ) { LIHandler handler = it.next(); if (handler.isDead()) it.remove(); else handler.trigger(event); } }
@SubscribeEvent public void mouseInput(MouseInputEvent ev){ //right click if(Mouse.getEventButton() == 1){ if(Mouse.isButtonDown(1) ){ //Set blocking // PlayerRpgInventory.get(Minecraft.getMinecraft().thePlayer).setBlocking(true); RpgInventoryMod.SNW.sendToServer(new PacketSyncBlockShield(true)); }else{ // PlayerRpgInventory.get(Minecraft.getMinecraft().thePlayer).setBlocking(false); RpgInventoryMod.SNW.sendToServer(new PacketSyncBlockShield(false)); } } }
@SubscribeEvent public void onMouseInput(MouseInputEvent event) { onInput(); }