mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-17 05:31:26 +01:00
Owner check in Controllable
This commit is contained in:
parent
18d9d412c8
commit
59a6bd7770
@ -7,6 +7,7 @@ import net.citizensnpcs.api.event.NPCRightClickEvent;
|
|||||||
import net.citizensnpcs.api.exception.NPCLoadException;
|
import net.citizensnpcs.api.exception.NPCLoadException;
|
||||||
import net.citizensnpcs.api.persistence.Persist;
|
import net.citizensnpcs.api.persistence.Persist;
|
||||||
import net.citizensnpcs.api.trait.Trait;
|
import net.citizensnpcs.api.trait.Trait;
|
||||||
|
import net.citizensnpcs.api.trait.trait.Owner;
|
||||||
import net.citizensnpcs.api.util.DataKey;
|
import net.citizensnpcs.api.util.DataKey;
|
||||||
import net.citizensnpcs.command.CommandConfigurable;
|
import net.citizensnpcs.command.CommandConfigurable;
|
||||||
import net.citizensnpcs.command.CommandContext;
|
import net.citizensnpcs.command.CommandContext;
|
||||||
@ -58,7 +59,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
|||||||
player.leaveVehicle();
|
player.leaveVehicle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
handle.setPassengerOf(getHandle());
|
if (npc.getTrait(Owner.class).isOwnedBy(handle.getBukkitEntity()))
|
||||||
|
handle.setPassengerOf(getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityLiving getHandle() {
|
private EntityLiving getHandle() {
|
||||||
|
Loading…
Reference in New Issue
Block a user