Prevents teleportation of a leashed creature with a passenger
This commit is contained in:
parent
f92fd2de5d
commit
b2bb995d7e
@ -391,11 +391,13 @@ portalInfoServer=Server: %server%
|
||||
|
||||
#### \[Version 0.9.2.2] EpicKnarvik97 fork
|
||||
|
||||
- Prevents teleportation of a player holding creatures on a leash when handleLeashedCreatures is disabled to prevent
|
||||
- Prevents teleportation of a player holding creatures on a leash when handleLeashedCreatures is disabled, to prevent
|
||||
players accidentally losing the creatures during teleportation
|
||||
- Fixes a potential exception when a gate's open-block or closed-block is set to a material which isn't a block
|
||||
- Fixes a potential exception when a portal without a sign has an invalid gate type
|
||||
- Prevents loading of gate files using non-blocks as part of the border
|
||||
- Prevents a player smuggling another player through a restricted stargate by sitting on a creature held in a lead by
|
||||
the first player
|
||||
|
||||
#### \[Version 0.9.2.1] EpicKnarvik97 fork
|
||||
|
||||
|
@ -257,15 +257,22 @@ public abstract class Teleporter {
|
||||
* @return <p>False if the player has leashed any creatures that cannot go through the portal</p>
|
||||
*/
|
||||
public static boolean noLeashedCreaturesPreventTeleportation(Player player) {
|
||||
//Find any nearby leashed entities to teleport with the player
|
||||
List<Creature> nearbyCreatures = getLeashedCreatures(player);
|
||||
|
||||
//Disallow creatures with passengers to prevent smuggling
|
||||
for (Creature creature : nearbyCreatures) {
|
||||
if (!creature.getPassengers().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//If it's enabled, there is no problem
|
||||
if (Stargate.getGateConfig().handleLeashedCreatures()) {
|
||||
return true;
|
||||
} else {
|
||||
return nearbyCreatures.isEmpty();
|
||||
}
|
||||
|
||||
//Find any nearby leashed entities to teleport with the player
|
||||
List<Creature> nearbyEntities = getLeashedCreatures(player);
|
||||
|
||||
return nearbyEntities.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user