Java 类cpw.mods.fml.common.gameevent.InputEvent.MouseInputEvent 实例源码

项目:Farrago    文件:ClientProxy.java   
@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);
    }
}
项目:LambdaLib    文件:LIFMLGameEventDispatcher.java   
@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);
    }
}
项目:rpginventory    文件:MouseHandler.java   
@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));
            }
        }
    }
项目:GimmeTime    文件:KeyHandler.java   
@SubscribeEvent
public void onMouseInput(MouseInputEvent event) {
    onInput();
}