2024-02-20 21:08:48 -05:00
|
|
|
package noppes.npcs.scripted.entity;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.entity.passive.EntityVillager;
|
|
|
|
|
import noppes.npcs.api.entity.IEntityLivingBase;
|
|
|
|
|
import noppes.npcs.api.entity.IVillager;
|
|
|
|
|
import noppes.npcs.scripted.NpcAPI;
|
|
|
|
|
import noppes.npcs.scripted.constants.EntityType;
|
|
|
|
|
|
|
|
|
|
public class ScriptVillager<T extends EntityVillager> extends ScriptLiving<T> implements IVillager {
|
|
|
|
|
|
2025-03-13 17:14:45 -04:00
|
|
|
public ScriptVillager(T entity) {
|
|
|
|
|
super(entity);
|
|
|
|
|
}
|
2024-02-20 21:08:48 -05:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getProfession() {
|
|
|
|
|
return entity.getProfession();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean getIsTrading() {
|
|
|
|
|
return entity.isTrading();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2025-03-13 17:14:45 -04:00
|
|
|
public IEntityLivingBase getCustomer() {
|
2024-02-20 21:08:48 -05:00
|
|
|
return (IEntityLivingBase) NpcAPI.Instance().getPlayer(entity.getCustomer().getCommandSenderName());
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 17:14:45 -04:00
|
|
|
@Override
|
|
|
|
|
public int getType() {
|
|
|
|
|
return EntityType.VILLAGER;
|
|
|
|
|
}
|
2024-02-20 21:08:48 -05:00
|
|
|
|
|
|
|
|
@Override
|
2025-03-13 17:14:45 -04:00
|
|
|
public boolean typeOf(int type) {
|
2024-02-20 21:08:48 -05:00
|
|
|
return type == EntityType.VILLAGER || super.typeOf(type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|