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

46 lines
1.3 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia;
2020-01-27 11:05:22 +01:00
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.minelittlepony.unicopia.util.dummy.DummyPlayerEntity;
import com.minelittlepony.unicopia.util.dummy.DummyServerPlayerEntity;
2020-01-27 11:05:22 +01:00
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.world.ServerWorld;
public class InteractionManager {
2020-04-24 15:23:36 +02:00
public static InteractionManager INSTANCE = new InteractionManager();
2020-01-27 11:05:22 +01:00
public static InteractionManager instance() {
2020-04-24 15:23:36 +02:00
return INSTANCE;
2020-01-27 11:05:22 +01:00
}
public boolean isClientPlayer(@Nullable PlayerEntity player) {
return false;
}
public int getViewMode() {
return 0;
}
2020-04-25 13:32:33 +02:00
public Race getPreferredRace() {
return Unicopia.getConfig().getPrefferedRace();
}
2020-01-27 11:05:22 +01:00
/**
* Side-independent method to create a new player.
*
* Returns an implementation of PlayerEntity appropriate to the side being called on.
*/
@Nonnull
public PlayerEntity createPlayer(Entity observer, GameProfile profile) {
if (observer.world instanceof ServerWorld) {
return new DummyServerPlayerEntity((ServerWorld)observer.world, profile);
}
return new DummyPlayerEntity(observer.world, profile);
}
}