mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 09:55:11 +00:00
Implement IVillager Scripting (removed duplicate entity variable)
This commit is contained in:
1 parent
6f5fd25a24
commit
4a58702d16
7 files changed
+88
-35
No files matched your search
@@ -0,0 +1,41 @@
|
||||
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 {
|
||||
|
||||
public ScriptVillager(T entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProfession() {
|
||||
return entity.getProfession();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsTrading() {
|
||||
return entity.isTrading();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingBase getCustomer()
|
||||
{
|
||||
return (IEntityLivingBase) NpcAPI.Instance().getPlayer(entity.getCustomer().getCommandSenderName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType(){
|
||||
return EntityType.VILLAGER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean typeOf(int type){
|
||||
return type == EntityType.VILLAGER || super.typeOf(type);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user