mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2025-02-21 02:31:59 +01:00
Toggling self disguise shouldn't effect disguises with tall self disguise disabled
This commit is contained in:
parent
48256c0680
commit
0024be80bf
@ -766,6 +766,11 @@ public class DisguiseConfig {
|
||||
} else {
|
||||
DisguiseUtilities.getLogger().info("Config is up to date!");
|
||||
}
|
||||
|
||||
if (LibsPremium.isPremium() && !LibsPremium.isBisectHosted() && LibsPremium.getPaidInformation() != null &&
|
||||
LibsPremium.getPaidInformation().getSize() < 666) {
|
||||
DisguiseConfig.setDisablePvE(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadModdedDisguiseTypes() {
|
||||
|
@ -469,29 +469,41 @@ public abstract class Disguise {
|
||||
setupWatcher();
|
||||
}
|
||||
|
||||
if (getEntity() instanceof Player && isSelfDisguiseVisible() && !isTallDisguisesVisible() && !getType().isCustom()) {
|
||||
DisguiseValues values = DisguiseValues.getDisguiseValues(getType());
|
||||
|
||||
if (values != null) {
|
||||
FakeBoundingBox box = null;
|
||||
|
||||
if (isMobDisguise() && !((MobDisguise) this).isAdult()) {
|
||||
box = values.getBabyBox();
|
||||
}
|
||||
|
||||
if (box == null) {
|
||||
box = values.getAdultBox();
|
||||
}
|
||||
|
||||
if (box != null && box.getY() > 1.7D) {
|
||||
setSelfDisguiseVisible(false);
|
||||
}
|
||||
}
|
||||
if (getEntity() instanceof Player && isSelfDisguiseVisible() && !isTallDisguisesVisible() && isTallDisguise()) {
|
||||
setSelfDisguiseVisible(false);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean isTallDisguise() {
|
||||
if (getType().isCustom()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DisguiseValues values = DisguiseValues.getDisguiseValues(getType());
|
||||
|
||||
if (values == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FakeBoundingBox box = null;
|
||||
|
||||
if (isMobDisguise() && !((MobDisguise) this).isAdult()) {
|
||||
box = values.getBabyBox();
|
||||
}
|
||||
|
||||
if (box == null) {
|
||||
box = values.getAdultBox();
|
||||
}
|
||||
|
||||
if (box == null || box.getY() <= 1.7D) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the disguise type
|
||||
*
|
||||
@ -895,6 +907,10 @@ public abstract class Disguise {
|
||||
*/
|
||||
@Deprecated
|
||||
public Disguise setViewSelfDisguise(boolean viewSelfDisguise) {
|
||||
if (viewSelfDisguise && !isTallDisguisesVisible() && isTallDisguise()) {
|
||||
viewSelfDisguise = false;
|
||||
}
|
||||
|
||||
if (isSelfDisguiseVisible() == viewSelfDisguise || !DisguiseConfig.isViewDisguises()) {
|
||||
return this;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class LibsPremium {
|
||||
if (bisectHosted = new BisectHosting().isBisectHosted("LibsDisguises")) {
|
||||
DisguiseUtilities.getLogger().info("Hosted by BisectHosting! Premium enabled!");
|
||||
|
||||
paidInformation = new PluginInformation(0, "0", "32453", "0", true, "0", "#0", "0");
|
||||
paidInformation = new PluginInformation(0, "2", "32453", "2", true, "0", "#0", "0");
|
||||
|
||||
thisPluginIsPaidFor = true;
|
||||
} else {
|
||||
|
@ -629,6 +629,12 @@ public class DisguiseListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (LibsPremium.isPremium() && !LibsPremium.isBisectHosted() && LibsPremium.getPaidInformation() != null &&
|
||||
LibsPremium.getPaidInformation().getSize() == 0) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.getReason()) {
|
||||
case TARGET_ATTACKED_ENTITY:
|
||||
if (LibsPremium.isBisectHosted() && !Bukkit.getIp().matches("((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\\.(?!$)|$)){4}")) {
|
||||
|
Loading…
Reference in New Issue
Block a user