2018-09-12 01:29:49 +02:00
|
|
|
package com.minelittlepony.unicopia;
|
|
|
|
|
2019-01-31 16:21:14 +01:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2019-02-09 13:27:15 +01:00
|
|
|
import javax.annotation.Nonnull;
|
2019-01-30 11:26:00 +01:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2019-02-11 16:41:24 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityFakeServerPlayer;
|
2019-01-30 11:26:00 +01:00
|
|
|
import com.minelittlepony.unicopia.forgebullshit.FUF;
|
2019-02-17 00:08:19 +01:00
|
|
|
import com.minelittlepony.unicopia.player.IPlayer;
|
|
|
|
import com.minelittlepony.unicopia.player.PlayerSpeciesList;
|
2019-02-09 13:27:15 +01:00
|
|
|
import com.mojang.authlib.GameProfile;
|
2019-01-30 11:26:00 +01:00
|
|
|
|
2019-02-09 13:27:15 +01:00
|
|
|
import net.minecraft.entity.Entity;
|
2019-01-30 11:26:00 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.world.IInteractionObject;
|
2019-02-09 13:27:15 +01:00
|
|
|
import net.minecraft.world.WorldServer;
|
2019-01-30 11:26:00 +01:00
|
|
|
|
|
|
|
public class UClient {
|
|
|
|
|
|
|
|
private static UClient instance;
|
2018-09-12 01:29:49 +02:00
|
|
|
|
2019-01-30 11:26:00 +01:00
|
|
|
public static boolean isClientSide() {
|
2019-02-17 00:08:19 +01:00
|
|
|
return net.minecraftforge.fml.common.FMLCommonHandler.instance().getSide().isClient();
|
2018-09-12 01:29:49 +02:00
|
|
|
}
|
2019-01-30 11:26:00 +01:00
|
|
|
|
|
|
|
@FUF(reason = "Forced client Separation")
|
|
|
|
public static UClient instance() {
|
|
|
|
if (instance == null) {
|
|
|
|
if (isClientSide()) {
|
|
|
|
instance = new UnicopiaClient();
|
|
|
|
} else {
|
|
|
|
instance = new UClient();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
@FUF(reason = "Forced client Separation")
|
|
|
|
public void displayGuiToPlayer(EntityPlayer player, IInteractionObject inventory) {
|
|
|
|
player.displayGui(inventory);
|
|
|
|
}
|
|
|
|
|
|
|
|
@FUF(reason = "Forced client Separation")
|
|
|
|
@Nullable
|
|
|
|
public EntityPlayer getPlayer() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
@Nullable
|
|
|
|
public IPlayer getIPlayer() {
|
|
|
|
return PlayerSpeciesList.instance().getPlayer(getPlayer());
|
|
|
|
}
|
|
|
|
|
2019-01-31 16:21:14 +01:00
|
|
|
@FUF(reason = "Forced client Separation")
|
|
|
|
@Nullable
|
|
|
|
public EntityPlayer getPlayerByUUID(UUID playerId) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-01-30 21:17:09 +01:00
|
|
|
@FUF(reason = "Forced client Separation")
|
|
|
|
public boolean isClientPlayer(@Nullable EntityPlayer player) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-02-02 17:50:15 +01:00
|
|
|
public int getViewMode() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-02-09 13:27:15 +01:00
|
|
|
/**
|
|
|
|
* Side-independent method to create a new player.
|
|
|
|
*
|
|
|
|
* Returns an implementation of EntityPlayer appropriate to the side being called on.
|
|
|
|
*/
|
|
|
|
@Nonnull
|
|
|
|
public EntityPlayer createPlayer(Entity observer, GameProfile profile) {
|
2019-02-11 16:41:24 +01:00
|
|
|
return new EntityFakeServerPlayer((WorldServer)observer.world, profile);
|
2019-02-09 13:27:15 +01:00
|
|
|
}
|
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
public boolean renderEntity(Entity entity, float renderPartialTicks) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void tick() {}
|
|
|
|
|
|
|
|
public void preInit() {}
|
2019-01-30 11:26:00 +01:00
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
public void init() {}
|
2019-01-30 11:26:00 +01:00
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
public void posInit() {}
|
2018-09-12 01:29:49 +02:00
|
|
|
}
|