mark all entities spawn by the plugin and allow other plugins to check for that

This commit is contained in:
2025-11-25 17:06:50 +01:00
parent ed7653aa66
commit 9fe536439b
4 changed files with 19 additions and 1 deletions
@@ -8,6 +8,7 @@ import io.papermc.paper.registry.data.dialog.body.DialogBody;
import io.papermc.paper.registry.data.dialog.input.DialogInput;
import io.papermc.paper.registry.data.dialog.input.SingleOptionDialogInput;
import io.papermc.paper.registry.data.dialog.type.DialogType;
import me.youhavetrouble.standin.StandIn;
import me.youhavetrouble.standin.converter.EntityConverter;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickCallback;
@@ -172,4 +173,13 @@ public abstract class EntityHandler<E extends Entity> {
CHANGE_TYPE,
}
/**
* Checks if entity is entity transformed by stand-in plugin
* @param entity entity to check
* @return boolean representing whether entity is a stand-in entity
*/
public static boolean isStandinEntity(@NotNull Entity entity) {
return entity.getPersistentDataContainer().has(StandIn.KEY);
}
}