Skip to content

Commit

Permalink
corrections to those PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 31, 2022
1 parent 19e5adb commit c861ad0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
Expand Up @@ -39,10 +39,11 @@ public static void registerTags() {
// <--[tag]
// @attribute <EntityTag.carrying_egg>
// @returns ElementTag(Boolean)
// @mechanism EntityTag.carrying_egg
// @group properties
// @Plugin Paper
// @description
// If the entity is a turtle, returns whether it is carrying an egg.
// If the entity is a turtle, returns whether it is carrying an egg. A turtle that is carrying an egg isn't visually different, but can't breed and will eventually lay the egg.
// -->
PropertyParser.<EntityCarryingEgg, ElementTag>registerTag(ElementTag.class, "carrying_egg", (attribute, entity) -> {
return new ElementTag(((Turtle) entity.entity.getBukkitEntity()).hasEgg());
Expand Down
Expand Up @@ -113,7 +113,9 @@ public static void registerMainProperties() {
PropertyParser.registerProperty(EntityPatrolTarget.class, EntityTag.class);
PropertyParser.registerProperty(EntityPickupStatus.class, EntityTag.class);
PropertyParser.registerProperty(EntityPlayerCreated.class, EntityTag.class);
PropertyParser.registerProperty(EntityPlayingDead.class, EntityTag.class);
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_17)) {
PropertyParser.registerProperty(EntityPlayingDead.class, EntityTag.class);
}
PropertyParser.registerProperty(EntityPotion.class, EntityTag.class);
PropertyParser.registerProperty(EntityPowered.class, EntityTag.class);
PropertyParser.registerProperty(EntityProfession.class, EntityTag.class);
Expand Down
Expand Up @@ -8,7 +8,6 @@
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.objects.properties.Property;
import com.denizenscript.denizencore.objects.properties.PropertyParser;
import com.denizenscript.denizencore.tags.Attribute;
import org.bukkit.entity.Entity;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.Vindicator;
Expand Down
Expand Up @@ -97,6 +97,7 @@ public void adjust(Mechanism mechanism) {
// @input ElementTag(Boolean)
// @description
// If the entity is wither_skull, changes whether the skull is charged. Charged skulls are blue.
// If the entity is a vex, changes whether the vex is charging. Charging vexes have red lines. This is a visual effect, and does not cause the vex to actually charge at anyone.
// @tags
// <EntityTag.charged>
// -->
Expand Down
@@ -1,7 +1,5 @@
package com.denizenscript.denizen.objects.properties.entity;

import com.denizenscript.denizen.nms.NMSHandler;
import com.denizenscript.denizen.nms.NMSVersion;
import com.denizenscript.denizen.objects.EntityTag;
import com.denizenscript.denizencore.objects.Mechanism;
import com.denizenscript.denizencore.objects.core.ElementTag;
Expand All @@ -16,7 +14,7 @@ public static boolean describes(ObjectTag entity) {
if (!(entity instanceof EntityTag)) {
return false;
}
return NMSHandler.getVersion().isAtLeast(NMSVersion.v1_17) && ((EntityTag) entity).getBukkitEntity() instanceof Axolotl;
return ((EntityTag) entity).getBukkitEntity() instanceof Axolotl;
}

public static EntityPlayingDead getFrom(ObjectTag entity) {
Expand All @@ -38,6 +36,15 @@ private EntityPlayingDead(EntityTag _entity) {
EntityTag entity;

public static void registerTags() {

// <--[tag]
// @attribute <EntityTag.playing_dead>
// @returns ElementTag(Boolean)
// @mechanism EntityTag.playing_dead
// @group properties
// @description
// If the entity is an axolotl, returns whether the entity is playing dead.
// -->
PropertyParser.<EntityPlayingDead, ElementTag>registerTag(ElementTag.class, "playing_dead", (attribute, entity) -> {
return new ElementTag(((Axolotl) entity.entity.getBukkitEntity()).isPlayingDead());
});
Expand Down

0 comments on commit c861ad0

Please sign in to comment.