mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-27 15:23:12 +00:00
Fix client baubles not all being synced
This commit is contained in:
2 files changed
+22
-22
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package baubles.common.event;
|
||||
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -8,20 +9,21 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class EventHandlerNetwork {
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLoggedInEvent (PlayerEvent.PlayerLoggedInEvent event) {
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLoggedInEvent (PlayerEvent.PlayerLoggedInEvent event) {
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
if (side == Side.SERVER) {
|
||||
syncBaubles(event.player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void syncBaubles(EntityPlayer player) {
|
||||
for (int a = 0; a < 4; a++) {
|
||||
PlayerHandler.getPlayerBaubles(player).syncSlotToClients(a);
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
|
||||
for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
baubles.syncSlotToClients(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user