Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Strays to the should_burn property #2638

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.denizenscript.denizen.objects.properties.entity.EntityProperty;
import com.denizenscript.denizencore.objects.Mechanism;
import com.denizenscript.denizencore.objects.core.ElementTag;
import org.bukkit.entity.AbstractSkeleton;
import org.bukkit.entity.Phantom;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Zombie;

public class EntityShouldBurn extends EntityProperty<ElementTag> {
Expand All @@ -16,12 +16,12 @@ public class EntityShouldBurn extends EntityProperty<ElementTag> {
// @input ElementTag(Boolean)
// @plugin Paper
// @description
// If the entity is a Zombie, Skeleton, or Phantom, controls whether it should burn in daylight.
// If the entity is a Zombie, Skeleton, Stray, or Phantom, controls whether it should burn in daylight.
// -->

public static boolean describes(EntityTag entity) {
return entity.getBukkitEntity() instanceof Zombie
|| entity.getBukkitEntity() instanceof Skeleton
|| entity.getBukkitEntity() instanceof AbstractSkeleton
|| entity.getBukkitEntity() instanceof Phantom;
}

Expand All @@ -30,7 +30,7 @@ public ElementTag getPropertyValue() {
if (getEntity() instanceof Zombie zombie) {
return new ElementTag(zombie.shouldBurnInDay());
}
else if (getEntity() instanceof Skeleton skeleton) {
else if (getEntity() instanceof AbstractSkeleton skeleton) {
return new ElementTag(skeleton.shouldBurnInDay());
}
else { // phantom
Expand All @@ -49,7 +49,7 @@ public void setPropertyValue(ElementTag param, Mechanism mechanism) {
if (getEntity() instanceof Zombie zombie) {
zombie.setShouldBurnInDay(param.asBoolean());
}
else if (getEntity() instanceof Skeleton skeleton) {
else if (getEntity() instanceof AbstractSkeleton skeleton) {
skeleton.setShouldBurnInDay(param.asBoolean());
}
else { // phantom
Expand Down