2020-04-15 14:22:03 +02:00
|
|
|
package com.minelittlepony.unicopia;
|
2020-01-27 11:05:22 +01:00
|
|
|
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2020-04-15 14:22:03 +02:00
|
|
|
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;
|
|
|
|
|
2020-01-27 17:37:22 +01:00
|
|
|
public class InteractionManager {
|
2020-01-27 11:05:22 +01:00
|
|
|
|
2020-01-27 17:37:22 +01:00
|
|
|
public static InteractionManager instance() {
|
|
|
|
return UnicopiaCore.interactionManager;
|
2020-01-27 11:05:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isClientPlayer(@Nullable PlayerEntity player) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getViewMode() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
}
|