ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/util/FakePlayerUtil.java

22 lines
668 B
Java
Raw Normal View History

2015-05-04 17:26:50 +02:00
package ellpeck.actuallyadditions.util;
import com.mojang.authlib.GameProfile;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayer;
import java.util.UUID;
public class FakePlayerUtil{
public static final String fakeName = "EllpecksActuallyAdditionsFakePlayer";
public static GameProfile fakeProfile = new GameProfile(UUID.nameUUIDFromBytes(fakeName.getBytes()), fakeName);
public static FakePlayer newFakePlayer(World world){
if(world instanceof WorldServer){
return new FakePlayer((WorldServer)world, fakeProfile);
}
else return null;
}
}