2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs.scripted.roles;
|
|
|
|
|
|
2022-11-06 01:25:28 -06:00
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
2018-09-13 12:03:28 -04:00
|
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
2022-11-06 01:25:28 -06:00
|
|
|
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 {
|
2022-11-06 01:25:28 -06:00
|
|
|
private final RoleTransporter role;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
|
|
|
|
public ScriptRoleTransporter(EntityNPCInterface npc) {
|
|
|
|
|
super(npc);
|
2022-11-06 01:25:28 -06:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|