2018-09-16 00:45:44 +02:00
|
|
|
package com.minelittlepony.unicopia.player;
|
|
|
|
|
|
|
|
import com.minelittlepony.unicopia.Race;
|
|
|
|
|
|
|
|
import net.minecraft.entity.item.EntityItem;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
|
|
|
class ItemCapabilities implements IRaceContainer<EntityItem>, IOwned<EntityItem> {
|
|
|
|
|
|
|
|
private Race race = Race.HUMAN;
|
|
|
|
|
|
|
|
private EntityItem owner;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onUpdate(EntityItem entity) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Race getPlayerSpecies() {
|
|
|
|
return race;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setPlayerSpecies(Race race) {
|
|
|
|
this.race = race;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeToNBT(NBTTagCompound compound) {
|
|
|
|
compound.setString("owner_species", race.name());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readFromNBT(NBTTagCompound compound) {
|
2019-01-29 13:13:06 +01:00
|
|
|
race = Race.fromName(compound.getString("owner_species"));
|
2018-09-16 00:45:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setOwner(EntityItem owner) {
|
|
|
|
this.owner = owner;
|
|
|
|
}
|
|
|
|
|
2019-02-02 12:23:49 +01:00
|
|
|
@Override
|
|
|
|
public void onDimensionalTravel(int destinationDimension) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-09-16 00:45:44 +02:00
|
|
|
@Override
|
|
|
|
public EntityItem getOwner() {
|
|
|
|
return owner;
|
|
|
|
}
|
|
|
|
}
|