Files
CustomNPC-Plus/src/main/java/noppes/npcs/scripted/roles/ScriptRoleTransporter.java
T

48 lines
1.2 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
package noppes.npcs.scripted.roles;
import net.minecraft.entity.player.EntityPlayerMP;
2018-09-13 12:03:28 -04:00
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.roles.RoleTransporter;
2018-09-13 12:03:28 -04:00
import noppes.npcs.scripted.constants.RoleType;
2022-11-15 15:25:53 -05:00
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.handler.data.ITransportLocation;
import noppes.npcs.api.roles.IRoleTransporter;
2018-09-13 12:03:28 -04:00
2022-06-12 01:26:23 -05:00
public class ScriptRoleTransporter extends ScriptRoleInterface implements IRoleTransporter {
private final RoleTransporter role;
2018-09-13 12:03:28 -04:00
public ScriptRoleTransporter(EntityNPCInterface npc) {
super(npc);
role = (RoleTransporter) npc.roleInterface;
}
public String getName() {
return role.name;
}
public int getTransportId() {
return role.transportId;
}
public void unlock(IPlayer<EntityPlayerMP> player, ITransportLocation location) {
this.role.unlock(player.getMCEntity(), location);
}
public ITransportLocation getTransport(){
return this.role.getLocation();
}
public boolean hasTransport(){
return this.role.hasTransport();
}
public void setTransport(ITransportLocation location) {
this.role.setTransport(location);
2018-09-13 12:03:28 -04:00
}
@Override
public int getType(){
return RoleType.TRANSPORTER;
}
}