Fix for server/client setup

This commit is contained in:
Stephen Seo 2018-09-12 16:10:02 +09:00
parent 2872543c93
commit ca018a63b3

View file

@ -14,7 +14,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import com.seodisparate.TurnBasedMinecraft.common.networking.PacketBattleInfo;
import com.seodisparate.TurnBasedMinecraft.common.networking.PacketBattleMessage;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -590,7 +589,7 @@ public class Battle
// have player look at attack target
final Entity nextEntity = next.entity;
final Entity targetEntity = target.entity;
Minecraft.getMinecraft().addScheduledTask(() -> {
next.entity.getServer().addScheduledTask(() -> {
((EntityPlayerMP)nextEntity).connection.setPlayerLocation(nextEntity.posX, nextEntity.posY, nextEntity.posZ, Utility.yawDirection(nextEntity.posX, nextEntity.posZ, targetEntity.posX, targetEntity.posZ), Utility.pitchDirection(nextEntity.posX, nextEntity.posY, nextEntity.posZ, targetEntity.posX, targetEntity.posY, targetEntity.posZ));
});
TurnBasedMinecraftMod.attackingEntity = next.entity;