Unicopia/src/main/java/com/minelittlepony/unicopia/UClient.java

93 lines
2.4 KiB
Java
Raw Normal View History

2018-09-12 01:29:49 +02:00
package com.minelittlepony.unicopia;
2019-01-31 16:21:14 +01:00
import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.minelittlepony.unicopia.entity.EntityFakeServerPlayer;
import com.minelittlepony.unicopia.forgebullshit.FUF;
import com.minelittlepony.unicopia.player.IPlayer;
import com.minelittlepony.unicopia.player.PlayerSpeciesList;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.WorldServer;
public class UClient {
private static UClient instance;
2018-09-12 01:29:49 +02:00
public static boolean isClientSide() {
return net.minecraftforge.fml.common.FMLCommonHandler.instance().getSide().isClient();
2018-09-12 01:29:49 +02: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;
}
@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;
}
public int getViewMode() {
return 0;
}
/**
* 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) {
return new EntityFakeServerPlayer((WorldServer)observer.world, profile);
}
public boolean renderEntity(Entity entity, float renderPartialTicks) {
return false;
}
public void tick() {}
public void preInit() {}
public void init() {}
public void posInit() {}
2018-09-12 01:29:49 +02:00
}