|
7 | 7 | import com.cleanroommc.modularui.holoui.ScreenEntityRender; |
8 | 8 | import com.cleanroommc.modularui.network.NetworkHandler; |
9 | 9 | import com.cleanroommc.modularui.network.packets.OpenGuiPacket; |
| 10 | +import com.cleanroommc.modularui.network.packets.SyncHoloPacket; |
10 | 11 | import com.cleanroommc.modularui.screen.*; |
11 | 12 | import com.cleanroommc.modularui.value.sync.GuiSyncManager; |
12 | 13 | import com.cleanroommc.modularui.widget.WidgetTree; |
13 | 14 |
|
14 | 15 | import net.minecraft.client.Minecraft; |
15 | 16 | import net.minecraft.client.entity.EntityPlayerSP; |
| 17 | +import net.minecraft.entity.player.EntityPlayer; |
16 | 18 | import net.minecraft.entity.player.EntityPlayerMP; |
17 | 19 | import net.minecraft.network.PacketBuffer; |
18 | 20 | import net.minecraftforge.client.event.GuiOpenEvent; |
@@ -41,7 +43,8 @@ public static <T extends GuiData> void open(@NotNull UIFactory<T> factory, @NotN |
41 | 43 | if (HoloUI.isOpen(panel)) { |
42 | 44 | HoloUI.builder() |
43 | 45 | .inFrontOf(player, 5, true) |
44 | | - .reposition(panel.getName()); |
| 46 | + .reposition(panel.getName(), player); |
| 47 | + NetworkHandler.sendToPlayer(new SyncHoloPacket(panel.getName()), player); |
45 | 48 | ModularUI.LOGGER.warn("reposition the holo, sync to client"); |
46 | 49 | return; |
47 | 50 | } |
@@ -91,6 +94,13 @@ public static <T extends GuiData> void open(int windowId, @NotNull UIFactory<T> |
91 | 94 | }, player.getEntityWorld()); |
92 | 95 | } |
93 | 96 |
|
| 97 | + public static void reposition(String panel, EntityPlayer player) { |
| 98 | + HoloUI.builder() |
| 99 | +// .screenScale(0.25f) |
| 100 | + .inFrontOf(player, 5, true) |
| 101 | + .reposition(panel, player); |
| 102 | + } |
| 103 | + |
94 | 104 | //todo make this a mixin instead of using event to cancel arm animation stuff |
95 | 105 | @SideOnly(Side.CLIENT) |
96 | 106 | @SubscribeEvent |
|
0 commit comments