And fix firing for single player loading.
This commit is contained in:
parent
127605ec3e
commit
4778c33902
2 changed files with 27 additions and 8 deletions
|
@ -51,7 +51,15 @@
|
|||
p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p);
|
||||
String s = "local";
|
||||
|
||||
@@ -244,6 +260,7 @@
|
||||
@@ -217,6 +233,7 @@
|
||||
p_72380_1_.func_70020_e(nbttagcompound);
|
||||
nbttagcompound1 = nbttagcompound;
|
||||
field_148546_d.debug("loading single player");
|
||||
+ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_72380_1_, this.field_72412_k, p_72380_1_.func_110124_au().toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -244,6 +261,7 @@
|
||||
this.func_148540_a(new S38PacketPlayerListItem(p_72377_1_.func_70005_c_(), true, 1000));
|
||||
this.field_72404_b.add(p_72377_1_);
|
||||
WorldServer worldserver = this.field_72400_f.func_71218_a(p_72377_1_.field_71093_bK);
|
||||
|
@ -59,7 +67,7 @@
|
|||
worldserver.func_72838_d(p_72377_1_);
|
||||
this.func_72375_a(p_72377_1_, (WorldServer)null);
|
||||
|
||||
@@ -276,6 +293,7 @@
|
||||
@@ -276,6 +294,7 @@
|
||||
worldserver.func_73040_p().func_72695_c(p_72367_1_);
|
||||
this.field_72404_b.remove(p_72367_1_);
|
||||
this.field_148547_k.remove(p_72367_1_.func_70005_c_());
|
||||
|
@ -67,7 +75,7 @@
|
|||
this.func_148540_a(new S38PacketPlayerListItem(p_72367_1_.func_70005_c_(), false, 9999));
|
||||
}
|
||||
|
||||
@@ -361,13 +379,23 @@
|
||||
@@ -361,13 +380,23 @@
|
||||
|
||||
public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_)
|
||||
{
|
||||
|
@ -93,7 +101,7 @@
|
|||
p_72368_1_.field_71093_bK = p_72368_2_;
|
||||
Object object;
|
||||
|
||||
@@ -383,6 +411,7 @@
|
||||
@@ -383,6 +412,7 @@
|
||||
EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), (ItemInWorldManager)object);
|
||||
entityplayermp1.field_71135_a = p_72368_1_.field_71135_a;
|
||||
entityplayermp1.func_71049_a(p_72368_1_, p_72368_3_);
|
||||
|
@ -101,7 +109,7 @@
|
|||
entityplayermp1.func_145769_d(p_72368_1_.func_145782_y());
|
||||
WorldServer worldserver = this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK);
|
||||
this.func_72381_a(entityplayermp1, p_72368_1_, worldserver);
|
||||
@@ -427,6 +456,11 @@
|
||||
@@ -427,6 +457,11 @@
|
||||
|
||||
public void func_72356_a(EntityPlayerMP p_72356_1_, int p_72356_2_)
|
||||
{
|
||||
|
@ -113,7 +121,7 @@
|
|||
int j = p_72356_1_.field_71093_bK;
|
||||
WorldServer worldserver = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK);
|
||||
p_72356_1_.field_71093_bK = p_72356_2_;
|
||||
@@ -434,7 +468,7 @@
|
||||
@@ -434,7 +469,7 @@
|
||||
p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, p_72356_1_.field_70170_p.field_73013_u, p_72356_1_.field_70170_p.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b()));
|
||||
worldserver.func_72973_f(p_72356_1_);
|
||||
p_72356_1_.field_70128_L = false;
|
||||
|
@ -122,7 +130,7 @@
|
|||
this.func_72375_a(p_72356_1_, worldserver);
|
||||
p_72356_1_.field_71135_a.func_147364_a(p_72356_1_.field_70165_t, p_72356_1_.field_70163_u, p_72356_1_.field_70161_v, p_72356_1_.field_70177_z, p_72356_1_.field_70125_A);
|
||||
p_72356_1_.field_71134_c.func_73080_a(worldserver1);
|
||||
@@ -452,38 +486,47 @@
|
||||
@@ -452,38 +487,47 @@
|
||||
|
||||
public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_)
|
||||
{
|
||||
|
@ -182,7 +190,7 @@
|
|||
{
|
||||
ChunkCoordinates chunkcoordinates;
|
||||
|
||||
@@ -518,7 +561,7 @@
|
||||
@@ -518,7 +562,7 @@
|
||||
if (p_82448_1_.func_70089_S())
|
||||
{
|
||||
p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A);
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.minecraftforge.event;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -12,10 +13,13 @@ import net.minecraft.entity.EnumCreatureType;
|
|||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.storage.IPlayerFileData;
|
||||
import net.minecraft.world.storage.SaveHandler;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.EntityStruckByLightningEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingPackSizeEvent;
|
||||
|
@ -181,4 +185,11 @@ public class ForgeEventFactory
|
|||
{
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerEvent.SaveToFile(player, playerDirectory, uuidString));
|
||||
}
|
||||
|
||||
public static void firePlayerLoadingEvent(EntityPlayer player, IPlayerFileData playerFileData, String uuidString)
|
||||
{
|
||||
SaveHandler sh = (SaveHandler) playerFileData;
|
||||
File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_"+"75771_c");
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue