mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-26 06:42:56 +00:00
Update to 1.7.10
1.0.1.2 - added a simple way to switch between the normal and baubles inventory. Thanks to Vazkii for the idea and permission to port it to base Baubles. - removed the Miners Ring crafting recipe... it is a bit op. I will leave the item in so it is attainable in creative and so it can still serve as an example bauble for devs. 1.0.1.1 - added backwards compatibility for legacy (pre 1.7.10) savefiles 1.0.1.0 - update for MC 1.7.10 - no requires Forge 10.13.0.1177 - removed support for legacy save format and moved saving/loading to new forge events
This commit is contained in:
1 parent
b515b965d5
commit
3e8015e246
12 files changed
+149
-9
No files matched your search
@@ -0,0 +1,55 @@
|
||||
package baubles.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import baubles.common.network.PacketHandler;
|
||||
import baubles.common.network.PacketOpenBaublesInventory;
|
||||
import baubles.common.network.PacketOpenNormalInventory;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class GuiEvents {
|
||||
|
||||
@SideOnly(value = Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
|
||||
if (event.gui instanceof GuiInventory || event.gui instanceof GuiPlayerExpanded) {
|
||||
|
||||
int xSize = 176;
|
||||
int ySize = 166;
|
||||
|
||||
int guiLeft = (event.gui.width - xSize) / 2;
|
||||
int guiTop = (event.gui.height - ySize) / 2;
|
||||
|
||||
if (!event.gui.mc.thePlayer.getActivePotionEffects().isEmpty()) {
|
||||
guiLeft = 160 + (event.gui.width - xSize - 200) / 2;
|
||||
}
|
||||
|
||||
event.buttonList.add(new GuiBaublesButton(55, guiLeft + 66, guiTop + 9, 10, 10,
|
||||
I18n.format((event.gui instanceof GuiInventory)?"button.baubles":"button.normal", new Object[0])));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(value = Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void guiPostAction(GuiScreenEvent.ActionPerformedEvent.Post event) {
|
||||
|
||||
if (event.gui instanceof GuiInventory) {
|
||||
if (event.button.id == 55) {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketOpenBaublesInventory(event.gui.mc.thePlayer));
|
||||
}
|
||||
}
|
||||
|
||||
if (event.gui instanceof GuiPlayerExpanded) {
|
||||
if (event.button.id == 55) {
|
||||
event.gui.mc.displayGuiScreen(new GuiInventory(event.gui.mc.thePlayer));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketOpenNormalInventory(event.gui.mc.thePlayer));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user