本文整理匯總了Java中cpw.mods.fml.common.gameevent.InputEvent.MouseInputEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java InputEvent.MouseInputEvent方法的具體用法?Java InputEvent.MouseInputEvent怎麽用?Java InputEvent.MouseInputEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cpw.mods.fml.common.gameevent.InputEvent
的用法示例。
在下文中一共展示了InputEvent.MouseInputEvent方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onMouseInput
import cpw.mods.fml.common.gameevent.InputEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onMouseInput(InputEvent.MouseInputEvent event) {
if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer thePlayer = mc.getMinecraft().thePlayer;
ItemStack hand = thePlayer.getCurrentEquippedItem();
ExtendedPlayer props = ExtendedPlayer.get((EntityPlayer) thePlayer);
int x = mc.objectMouseOver.blockX;
int y = mc.objectMouseOver.blockY;
int z = mc.objectMouseOver.blockZ;
if (Mouse.isButtonDown(1) && hand == null)
props.useMana(10);
// TheDarkEra.packetPipeline.sendToServer(new PacketUseShout(x, y,
// z));
}
}
示例2: onMouseInput
import cpw.mods.fml.common.gameevent.InputEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onMouseInput(InputEvent.MouseInputEvent event) {
if (Config.keyOverlay) {
if (Mouse.getEventButtonState())
try {
KeyOverlay.keys.offer(new Object[]{Mouse.getButtonName(Mouse.getEventButton()).toUpperCase(), KeyOverlay.KEY_LIFE_LENGTH});
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例3: onMouseInput
import cpw.mods.fml.common.gameevent.InputEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onMouseInput(InputEvent.MouseInputEvent event) {
if (Config.showKeysOnHUD) {
if (Mouse.getEventButtonState())
try {
KeyOverlay.keys.offer(new Object[]{Mouse.getButtonName(Mouse.getEventButton()).toUpperCase(), KeyOverlay.KEY_LIFE_LENGTH});
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例4: mouseInputEvent
import cpw.mods.fml.common.gameevent.InputEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void mouseInputEvent(InputEvent.MouseInputEvent event) {
if(!Configuration.lockUI && !Mouse.isGrabbed()) {
if(Mouse.isButtonDown(2)) {
ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
int i = scaledresolution.getScaledWidth();
int j = scaledresolution.getScaledHeight();
int mouseX = Mouse.getX() * i / Minecraft.getMinecraft().displayWidth;
int mouseY = j - Mouse.getY() * j / Minecraft.getMinecraft().displayHeight - 1;
if(currentlySelectedBox == null && mouseX >= suitPanel.getX(i) && mouseX < suitPanel.getX(i) + suitPanel.sizeX &&
mouseY >= suitPanel.getY(j) && mouseY < suitPanel.getY(j) + suitPanel.sizeY) {
currentlySelectedBox = suitPanel;
}
if(currentlySelectedBox == null && mouseX >= oxygenBar.getX(i) && mouseX < oxygenBar.getX(i) + oxygenBar.sizeX &&
mouseY >= oxygenBar.getY(j) && mouseY < oxygenBar.getY(j) + oxygenBar.sizeY) {
currentlySelectedBox = oxygenBar;
}
if(currentlySelectedBox == null && mouseX >= hydrogenBar.getX(i) && mouseX < hydrogenBar.getX(i) + hydrogenBar.sizeX &&
mouseY >= hydrogenBar.getY(j) && mouseY < hydrogenBar.getY(j) + hydrogenBar.sizeY) {
currentlySelectedBox = hydrogenBar;
}
if(currentlySelectedBox == null && mouseX >= atmBar.getX(i) && mouseX < atmBar.getX(i) + atmBar.sizeX &&
mouseY >= atmBar.getY(j) && mouseY < atmBar.getY(j) + atmBar.sizeY) {
currentlySelectedBox = atmBar;
}
if(currentlySelectedBox != null) {
currentlySelectedBox.setRenderX(mouseX, i);
currentlySelectedBox.setRenderY(mouseY, j);
}
}
else
currentlySelectedBox = null;
}
}
示例5: onClick
import cpw.mods.fml.common.gameevent.InputEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClick(InputEvent.MouseInputEvent event) {
if (checkSmartHelmetStatus()) {
PeripheralsPlusPlus.NETWORK.sendToServer(new InputEventPacket(UUID.fromString(Minecraft.getMinecraft().thePlayer.getCurrentArmor(3).getTagCompound().getString("identifier")), Mouse.getEventButton(), Mouse.getEventButtonState(), "mouseInput", Minecraft.getMinecraft().thePlayer.getDisplayName()));
}
}