mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2025-02-22 02:41:27 +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 {
|
} else {
|
||||||
DisguiseUtilities.getLogger().info("Config is up to date!");
|
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() {
|
public static void loadModdedDisguiseTypes() {
|
||||||
|
@ -469,29 +469,41 @@ public abstract class Disguise {
|
|||||||
setupWatcher();
|
setupWatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getEntity() instanceof Player && isSelfDisguiseVisible() && !isTallDisguisesVisible() && !getType().isCustom()) {
|
if (getEntity() instanceof Player && isSelfDisguiseVisible() && !isTallDisguisesVisible() && isTallDisguise()) {
|
||||||
DisguiseValues values = DisguiseValues.getDisguiseValues(getType());
|
setSelfDisguiseVisible(false);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
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
|
* Get the disguise type
|
||||||
*
|
*
|
||||||
@ -895,6 +907,10 @@ public abstract class Disguise {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Disguise setViewSelfDisguise(boolean viewSelfDisguise) {
|
public Disguise setViewSelfDisguise(boolean viewSelfDisguise) {
|
||||||
|
if (viewSelfDisguise && !isTallDisguisesVisible() && isTallDisguise()) {
|
||||||
|
viewSelfDisguise = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (isSelfDisguiseVisible() == viewSelfDisguise || !DisguiseConfig.isViewDisguises()) {
|
if (isSelfDisguiseVisible() == viewSelfDisguise || !DisguiseConfig.isViewDisguises()) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ public class LibsPremium {
|
|||||||
if (bisectHosted = new BisectHosting().isBisectHosted("LibsDisguises")) {
|
if (bisectHosted = new BisectHosting().isBisectHosted("LibsDisguises")) {
|
||||||
DisguiseUtilities.getLogger().info("Hosted by BisectHosting! Premium enabled!");
|
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;
|
thisPluginIsPaidFor = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -629,6 +629,12 @@ public class DisguiseListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LibsPremium.isPremium() && !LibsPremium.isBisectHosted() && LibsPremium.getPaidInformation() != null &&
|
||||||
|
LibsPremium.getPaidInformation().getSize() == 0) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (event.getReason()) {
|
switch (event.getReason()) {
|
||||||
case TARGET_ATTACKED_ENTITY:
|
case TARGET_ATTACKED_ENTITY:
|
||||||
if (LibsPremium.isBisectHosted() && !Bukkit.getIp().matches("((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\\.(?!$)|$)){4}")) {
|
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