Skip to content

Commit

Permalink
Fixed another strange bug, apparently there are client worlds which a…
Browse files Browse the repository at this point in the history
…re not remote #release
  • Loading branch information
Maxanier committed Sep 5, 2015
1 parent e2c7e04 commit 397b6ce
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package de.teamlapen.vampirism.entity.player;

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent;
import de.teamlapen.vampirism.VampirismMod;
import de.teamlapen.vampirism.castleDim.ChunkProviderCastle;
import net.minecraft.entity.Entity;
import de.teamlapen.vampirism.entity.player.skills.Skills;
import de.teamlapen.vampirism.network.RequestEntityUpdatePacket;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.EntityEvent.EntityConstructing;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
Expand All @@ -13,14 +21,6 @@
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
import net.minecraftforge.event.world.BlockEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent;
import de.teamlapen.vampirism.VampirismMod;
import de.teamlapen.vampirism.entity.player.skills.Skills;
import de.teamlapen.vampirism.network.RequestEntityUpdatePacket;

public class VampirePlayerEventHandler {

Expand Down Expand Up @@ -58,7 +58,7 @@ public void onEntityConstructing(EntityConstructing event) {
@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent event) {
if (event.entity instanceof EntityPlayer) {
if (event.entity.worldObj.isRemote) {
if (event.entity.worldObj.isRemote || event.entity instanceof EntityClientPlayerMP) {
VampirismMod.modChannel.sendToServer(new RequestEntityUpdatePacket(event.entity));
} else {
VampirePlayer.onPlayerJoinWorld((EntityPlayer) event.entity);
Expand Down Expand Up @@ -104,7 +104,6 @@ public void onLivingJump(LivingJumpEvent event) {
public void onLivingUpdate(LivingUpdateEvent event) {
if (event.entity instanceof EntityPlayer) {
VampirePlayer.get((EntityPlayer) event.entity).onUpdate();
;
}
}

Expand Down

2 comments on commit 397b6ce

@maxanier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxanier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.