mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2025-01-30 23:01:50 +01:00
Partial fix for #739, however this cannot be fully fixed due to how llama spit behaves
This commit is contained in:
parent
6145b20196
commit
4dcc283207
@ -542,11 +542,11 @@ public class DisguiseListener implements Listener {
|
||||
DisguiseUtilities.doBoundingBox((TargetedDisguise) disguise);
|
||||
}
|
||||
|
||||
if (DisguiseConfig.isStopShulkerDisguisesFromMoving()) {
|
||||
Disguise disguise;
|
||||
Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer());
|
||||
|
||||
if ((disguise = DisguiseAPI.getDisguise(event.getPlayer())) != null) {
|
||||
if (disguise.getType() == DisguiseType.SHULKER) { // Stop Shulker disguises from moving their coordinates
|
||||
if (disguise != null) {
|
||||
if (DisguiseConfig.isStopShulkerDisguisesFromMoving() &&
|
||||
disguise.getType() == DisguiseType.SHULKER) { // Stop Shulker disguises from moving their coordinates
|
||||
Location from = event.getFrom();
|
||||
Location to = event.getTo();
|
||||
|
||||
@ -554,6 +554,15 @@ public class DisguiseListener implements Listener {
|
||||
to.setZ(from.getZ());
|
||||
|
||||
event.setTo(to);
|
||||
} else if (disguise.getType() == DisguiseType.LLAMA_SPIT) {
|
||||
Location from = event.getFrom();
|
||||
Location to = event.getTo();
|
||||
|
||||
// Llama spit disappears when it encounters a solid
|
||||
if (Math.min(from.getY(), to.getY()) >= from.getWorld().getMinHeight() && Math.max(from.getY(), to.getY()) < from.getWorld().getMaxHeight()) {
|
||||
if (!from.getBlock().isEmpty() && to.getBlock().isEmpty()) {
|
||||
DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user