mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-10-26 14:24:14 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90782f5ed1 | ||
|
|
ad1aa80b78 | ||
|
|
3f5c317926 |
No files matched your search
+1
-1
@@ -109,7 +109,7 @@ public class ClientEventHandler {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderGameOverlayEvent(final RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == RenderGameOverlayEvent.ElementType.ALL) {
|
||||
statusDisplayManager.drawItemStack();
|
||||
statusDisplayManager.drawItemStack(event.resolution);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-8
@@ -35,22 +35,16 @@ public final class ItemDisplayManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void drawItemStack() {
|
||||
public void drawItemStack(ScaledResolution resolution) {
|
||||
if (ticksCounter > 0 && itemStack != null && itemStack.getItem() != null) {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
final int y = res.getScaledHeight();
|
||||
|
||||
final int y = resolution.getScaledHeight();
|
||||
GL11.glTranslatef(7.0f, y * 0.25f, 0);
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(fontRenderer, textureManager, itemStack, 0, 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
@@ -21,8 +21,8 @@ public final class KeyBindings {
|
||||
|
||||
static {
|
||||
placeItem = new KeyBinding("key.placeItem", Keyboard.KEY_P, References.MODNAME);
|
||||
toolConfig = new KeyBinding("key.toolConfig", Keyboard.KEY_C, References.MODNAME);
|
||||
toolProfileChange = new KeyBinding("key.toolProfileChange", Keyboard.KEY_BACKSLASH, References.MODNAME);
|
||||
toolConfig = new KeyBinding("key.toolConfig", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toolProfileChange = new KeyBinding("key.toolProfileChange", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleFlight = new KeyBinding("key.toggleFlight", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleMagnet = new KeyBinding("key.toggleMagnet", Keyboard.KEY_NONE, References.MODNAME);
|
||||
}
|
||||
|
||||
+10
-9
@@ -29,8 +29,9 @@ public class KeyInputHandler {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(InputEvent.KeyInputEvent event) {
|
||||
if (KeyBindings.placeItem.isPressed()) handlePlaceItemKey();
|
||||
else if (KeyBindings.toolConfig.isPressed()) {
|
||||
if (KeyBindings.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (KeyBindings.toolConfig.isPressed()) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
} else if (KeyBindings.toolProfileChange.isPressed()
|
||||
&& Minecraft.getMinecraft().thePlayer != null
|
||||
@@ -50,19 +51,17 @@ public class KeyInputHandler {
|
||||
if (player.capabilities.allowFlying) {
|
||||
if (player.capabilities.isFlying) {
|
||||
player.capabilities.isFlying = false;
|
||||
player.sendPlayerAbilities();
|
||||
} else {
|
||||
player.capabilities.isFlying = true;
|
||||
if (player.onGround) {
|
||||
player.setPosition(player.posX, player.posY + 0.05D, player.posZ);
|
||||
player.motionY = 0;
|
||||
}
|
||||
player.sendPlayerAbilities();
|
||||
}
|
||||
player.sendPlayerAbilities();
|
||||
}
|
||||
} else if (KeyBindings.toggleMagnet.isPressed()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (player.inventory.hasItem(ModItems.magnet)) {
|
||||
DraconicEvolution.network.sendToServer(new MagnetTogglePacket());
|
||||
}
|
||||
@@ -73,16 +72,18 @@ public class KeyInputHandler {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
WorldClient world = Minecraft.getMinecraft().theWorld;
|
||||
MovingObjectPosition mop = ToolHandler.raytraceFromEntity(world, player, 4.5D);
|
||||
if (mop != null)
|
||||
if (mop != null) {
|
||||
DraconicEvolution.network.sendToServer(
|
||||
new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onMouseInput(InputEvent.MouseInputEvent event) {
|
||||
if (KeyBindings.placeItem.isPressed()) handlePlaceItemKey();
|
||||
else if (KeyBindings.toolConfig.isPressed()) {
|
||||
if (KeyBindings.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (KeyBindings.toolConfig.isPressed()) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
|
||||
@@ -107,7 +108,7 @@ public class KeyInputHandler {
|
||||
player.inventory.currentItem = previouseSlot(1, player.inventory.currentItem);
|
||||
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.SCROLL, -1, false));
|
||||
}
|
||||
} else if (change < 0) {
|
||||
} else {
|
||||
ItemStack item = player.inventory.getStackInSlot(previouseSlot(-1, player.inventory.currentItem));
|
||||
if (item != null && item.getItem().equals(ModItems.teleporterMKII)) {
|
||||
player.inventory.currentItem = previouseSlot(-1, player.inventory.currentItem);
|
||||
|
||||
Reference in new issue
Block a user