Skip to content

Commit

Permalink
aggressive guide link in readme, and some minor cleanings
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 25, 2020
1 parent d9f268c commit 6f39161
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -5,6 +5,8 @@ An implementation of the Denizen Scripting Language for Spigot servers, with str

**Version 1.1.5**: Compatible with Spigot 1.13.2, 1.14.4, 1.15.2, and 1.16.1!

**Learn about Denizen from the Beginner's guide:** https://guide.denizenscript.com/guides/background/index.html

#### Download Links:

- **Release builds**: https://ci.citizensnpcs.co/job/Denizen/
Expand Down
Expand Up @@ -156,7 +156,7 @@ public boolean addHide(UUID player, UUID entity) {
return hidden.add(player);
}

public void hideEntity(Player player, Entity entity, boolean keepInTabList) { // TODO: remove or reimplement tablist option somehow?
public void hideEntity(Player player, Entity entity) {
if (player == null) {
addHide(DEFAULT_HIDE, entity.getUniqueId());
if (entity instanceof Player) {
Expand Down
Expand Up @@ -3095,7 +3095,7 @@ && getBukkitEntity() instanceof Sheep) {
// Works with offline players.
// -->
if (mechanism.matches("hide_from_players")) {
NMSHandler.getEntityHelper().hideEntity(null, getBukkitEntity(), false);
NMSHandler.getEntityHelper().hideEntity(null, getBukkitEntity());
}

// <--[mechanism]
Expand Down
Expand Up @@ -3023,10 +3023,9 @@ public void adjust(Mechanism mechanism) {
// <--[mechanism]
// @object PlayerTag
// @name hide_entity
// @input EntityTag(|ElementTag(Boolean))
// @input EntityTag
// @description
// Hides an entity from the player.
// You can optionally also specify a boolean to determine whether the entity should be kept in the tab list (players only).
// -->
if (mechanism.matches("hide_entity")) {
if (!mechanism.getValue().asString().isEmpty()) {
Expand All @@ -3036,12 +3035,8 @@ public void adjust(Mechanism mechanism) {
if (!entity.isSpawnedOrValidForTag()) {
Debug.echoError("Can't hide the unspawned entity '" + split.get(0) + "'!");
}
else if (split.size() > 1 && new ElementTag(split.get(1)).isBoolean()) {
NMSHandler.getEntityHelper().hideEntity(getPlayerEntity(), entity.getBukkitEntity(),
new ElementTag(split.get(1)).asBoolean());
}
else {
NMSHandler.getEntityHelper().hideEntity(getPlayerEntity(), entity.getBukkitEntity(), false);
NMSHandler.getEntityHelper().hideEntity(getPlayerEntity(), entity.getBukkitEntity());
}
}
else {
Expand Down

0 comments on commit 6f39161

Please sign in to comment.