Permalink
Browse files

Merge branch '1.10.2' of https://github.com/squeek502/AppleCore into …

…1.11
  • Loading branch information...
squeek502 committed Dec 31, 2016
2 parents 1b25b76 + f6d06b2 commit fca5ccc8be87a5e6566efa0234c80cb8435b5f3a
Showing with 11 additions and 0 deletions.
  1. +11 −0 java/squeek/applecore/network/SyncHandler.java
@@ -1,12 +1,14 @@
package squeek.applecore.network;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;
import squeek.applecore.ModInfo;
@@ -27,6 +29,15 @@ public static void init()
*/
private EnumDifficulty lastDifficultySetting = null;
@SubscribeEvent
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event)
{
if (!(event.player instanceof EntityPlayerMP))
return;
CHANNEL.sendTo(new MessageDifficultySync(event.player.world.getDifficulty()), (EntityPlayerMP) event.player);
}
@SubscribeEvent
public void onWorldTick(WorldTickEvent event)
{

0 comments on commit fca5ccc

Please sign in to comment.