package com.jaquadro.minecraft.storagedrawers.core;

import com.jaquadro.minecraft.chameleon.Chameleon;
import com.jaquadro.minecraft.chameleon.resources.IconRegistry;
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.network.BoolConfigUpdateMessage;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class ClientProxy extends CommonProxy
{
    boolean configSyncDone = false;

    @Override
    public void initDynamic () {
        StorageDrawers.blocks.initDynamic();
    }

    @Override
    public void initClient () {
        StorageDrawers.blocks.initClient();
        StorageDrawers.items.initClient();
    }

    @Override
    public void registerRenderers () {
        IconRegistry iconRegistry = Chameleon.instance.iconRegistry;
        iconRegistry.registerIcon(iconIndicatorCompOnResource);
        iconRegistry.registerIcon(iconIndicatorCompOffResource);

        for (int i = 0; i < 5; i++) {
            if (iconIndicatorOffResource[i] != null)
                iconRegistry.registerIcon(iconIndicatorOffResource[i]);
            if (iconIndicatorOnResource[i] != null)
                iconRegistry.registerIcon(iconIndicatorOnResource[i]);
        }
    }

    @Override
    public void registerDrawer (Block block) {
        //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(block), itemRenderer);
    }

    @SubscribeEvent
    public void onEntityJoinWorldEvent(net.minecraftforge.event.entity.EntityJoinWorldEvent event) {
        if (this.configSyncDone || !event.getEntity().worldObj.isRemote || !(event.getEntity() instanceof EntityPlayer)) {
            return;
        }

        if (event.getEntity().getEntityId() == FMLClientHandler.instance().getClientPlayerEntity().getEntityId()) {
            StorageDrawers.network.sendToServer(new BoolConfigUpdateMessage(FMLClientHandler.instance().getClientPlayerEntity().getUniqueID().toString(), "invertShift", StorageDrawers.config.cache.invertShift));
            this.configSyncDone = true;
        }
    }
}

@@ -556,45 +556,8 @@
 y%0A%7B%0A
-    boolean configSyncDone = false;%0A%0A
     
@@ -1648,31 +1648,8 @@
 if (
-this.configSyncDone %7C%7C 
 !eve
@@ -1729,18 +1729,16 @@
 Player))
- %7B
 %0A       
@@ -1749,26 +1749,16 @@
  return;
-%0A        %7D
 %0A%0A      
@@ -1864,18 +1864,16 @@
 ityId())
- %7B
 %0A       
@@ -2081,58 +2081,8 @@
 ));%0A
-            this.configSyncDone = true;%0A        %7D%0A
     

Fix invert shift setting not syncing on second world join