Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
98b3ac1
remove unused permission
PZDonny May 24, 2026
0013099
Update version checking logic
PZDonny May 27, 2026
d3c7372
Remove Internal annotation
PZDonny May 27, 2026
7f85c6b
Tags can no longer contain spaces, in animations, groups, parts, fram…
PZDonny May 27, 2026
520d969
Tags can no longer contain spaces, in animations, groups, parts, fram…
PZDonny May 27, 2026
d34f944
Fix condition not being inverted
PZDonny May 27, 2026
347a1cf
Added DEUSound#fromCommand
PZDonny May 27, 2026
7ff4295
move folia checks into DisplayEntityPlugin
PZDonny May 29, 2026
8f0e89f
update #equals #hashCode and #clone for SpawnedDisplayAnimationFrame
PZDonny May 30, 2026
d50ce59
added DisplayTransformation#hashCode
PZDonny May 30, 2026
1cba9dd
Added #equals and #hashCode to AnimationCamera
PZDonny May 30, 2026
a55c847
Update command-based bdengine conversion logic
PZDonny May 30, 2026
affd0bf
End support for legacy datapack conversion
PZDonny May 30, 2026
2bdd11b
remove unused methods
PZDonny May 30, 2026
400de09
despawn group after converting datapack
PZDonny May 30, 2026
7883295
Added message for clarity
PZDonny May 30, 2026
cc2b445
Readded BDE project importing (api & cmd changes) and new util methods
PZDonny May 31, 2026
f27f769
Added events for BDE conversions
PZDonny May 31, 2026
708ef5c
Add a default frame point to animation frames
PZDonny May 31, 2026
4e3f302
Add "/deu anim adddefaultparticle"
PZDonny May 31, 2026
c37bfd9
No changes
PZDonny May 31, 2026
ea5d5a2
Update range and step of delta and extra of particle dialogs
PZDonny May 31, 2026
94fc2e6
Added PacketDisplayEntityGroup#getNearbyGroups and WorldUtils
PZDonny Jun 1, 2026
e31c920
Added "/deu group spawnat" and "/deu group despawnat"
PZDonny Jun 1, 2026
9bf99b3
Added optional arguments to commands, instead of args checking each c…
PZDonny Jun 1, 2026
6103747
List correct command
PZDonny Jun 1, 2026
b1bd371
improve cmd output for /deu group hidepacketgroups and showpacketgroups
PZDonny Jun 1, 2026
ebd8706
search for optional args at first index if there's no tab suggestions
PZDonny Jun 1, 2026
f2d5424
utilize optional args where applicable
PZDonny Jun 1, 2026
91850e8
fix NPE when attempting to remove an invalid part selection
PZDonny Jun 1, 2026
06a8ca7
update command feedback
PZDonny Jun 1, 2026
f9f77a7
Remove "clonehere" cmd and add "-here" flag to "clone"
PZDonny Jun 1, 2026
d4facd9
Add #removeParticle and #removeAllParticles to FramePoint
PZDonny Jun 1, 2026
388c9d1
Add removal of particles from frame points
PZDonny Jun 1, 2026
ec4d499
send error messages when user input for a collection of framepoints i…
PZDonny Jun 1, 2026
228bfbe
Add "/deu anim showpoints" and "/deu anim adddefaultsound"
PZDonny Jun 1, 2026
58b5b59
Update incorrect usage msgs
PZDonny Jun 1, 2026
0a0839e
fix sounds not playing from default frame point during animations
PZDonny Jun 1, 2026
0417042
Added -all parameter to anim cmds that accept frame-ids/frame-tag
PZDonny Jun 1, 2026
887c0dd
Remove "/deu anim editallframes"
PZDonny Jun 1, 2026
01e146d
Click to remove framepoint's deusound when viewing frameinfo
PZDonny Jun 1, 2026
c84414c
3.5.3
PZDonny Jun 1, 2026
4c0ae38
(3.5.3) Despawn imported project after conversion
PZDonny Jun 2, 2026
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
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>net.donnypz.displayentityutils</groupId>
<artifactId>deu</artifactId>
<version>3.5.2</version>
<version>3.5.3</version>
</parent>

<artifactId>api</artifactId>
Expand Down
17 changes: 7 additions & 10 deletions api/src/main/java/net/donnypz/displayentityutils/DisplayAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.donnypz.displayentityutils.managers.DisplayStorage;
import net.donnypz.displayentityutils.managers.LoadMethod;
import net.donnypz.displayentityutils.utils.DisplayEntities.AnimationPlayer;
import net.donnypz.displayentityutils.utils.bdengine.convert.common.BDEConversionHandler;
import net.donnypz.displayentityutils.utils.version.folia.Scheduler;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -53,8 +54,9 @@ public final class DisplayAPI {
static DisplayStorage MYSQL_STORAGE;
static DisplayStorage MONGODB_STORAGE;
static AnimationPlayer.AnimationPlayerProvider ANIMATION_PLAYER_SERVICE;
static BDEConversionHandler BDE_CONVERSION_HANDLER;
static Scheduler SCHEDULER;
private static boolean isFolia;
static boolean isFolia;

private DisplayAPI(){}

Expand All @@ -66,6 +68,10 @@ private DisplayAPI(){}
return ANIMATION_PLAYER_SERVICE;
}

public static @NotNull BDEConversionHandler getBDEConversionHandler(){
return BDE_CONVERSION_HANDLER;
}

public static @NotNull NamespacedKey getPartUUIDKey() {
return partUUIDKey;
}
Expand Down Expand Up @@ -236,13 +242,4 @@ public static boolean isFolia(){
return isFolia;
}

static void checkFolia(){
try {
Class.forName("io.papermc.paper.threadedregions.RegionizedServer");
isFolia = true;
} catch (ClassNotFoundException e) {
isFolia = false;
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package net.donnypz.displayentityutils.events;

import net.donnypz.displayentityutils.utils.DisplayEntities.DisplayEntityGroup;
import net.donnypz.displayentityutils.utils.DisplayEntities.SpawnedDisplayAnimation;
import net.donnypz.displayentityutils.utils.DisplayEntities.SpawnedDisplayEntityGroup;
import net.donnypz.displayentityutils.utils.bdengine.convert.api.BDEResult;
import org.bukkit.Location;
import org.bukkit.entity.Player;

import java.util.List;

/**
* Called sometime after {@link BDEResult#convert(String, Player, Location, String, String, boolean, boolean, boolean)}
* or similar is called, converting an import BDEngine project into a group and animations. This contains all information related to the conversion.
*/
public class BDEAPIConvertEvent extends BDEConvertEvent{
public BDEAPIConvertEvent(Player player,
String conversionId,
DisplayEntityGroup savedGroup,
SpawnedDisplayEntityGroup spawnedGroup,
List<SpawnedDisplayAnimation> animations,
boolean isSavedGroup,
boolean isSavedAnimations) {
super(player, conversionId, savedGroup, spawnedGroup, animations, isSavedGroup, isSavedAnimations);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package net.donnypz.displayentityutils.events;

import net.donnypz.displayentityutils.utils.DisplayEntities.DisplayEntityGroup;
import net.donnypz.displayentityutils.utils.DisplayEntities.SpawnedDisplayAnimation;
import net.donnypz.displayentityutils.utils.DisplayEntities.SpawnedDisplayEntityGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.List;

class BDEConvertEvent extends Event {

private static final HandlerList handlers = new HandlerList();

private final Player player;
private final String conversionId;
private final DisplayEntityGroup savedGroup;
private final SpawnedDisplayEntityGroup spawnedGroup;
private final List<SpawnedDisplayAnimation> animations;
private final boolean isSavedGroup;
private final boolean isSavedAnimations;

BDEConvertEvent(Player player,
String conversionId,
DisplayEntityGroup savedGroup,
SpawnedDisplayEntityGroup spawnedGroup,
List<SpawnedDisplayAnimation> animations,
boolean isSavedGroup,
boolean isSavedAnimations) {
this.player = player;
this.conversionId = conversionId;
this.savedGroup = savedGroup;
this.spawnedGroup = spawnedGroup;
this.animations = Collections.unmodifiableList(animations);
this.isSavedGroup = isSavedGroup;
this.isSavedAnimations = isSavedAnimations;
}

/**
* Get the player who initiated the conversion, if done through commands
* @return a {@link Player} or null
*/
public @Nullable Player getPlayer() {
return player;
}

/**
* Get the id used to identify a conversion process
* @return a string or null
*/
public @Nullable String getConversionId() {
return conversionId;
}

/**
* Get the {@link DisplayEntityGroup} representing the group created from the conversion
* return a {@link DisplayEntityGroup}
*/
public @NotNull DisplayEntityGroup getGroup(){
return savedGroup;
}

/**
* Get the group that created as a result of the conversion. Null if the group was despawned after conversion
* @return a {@link SpawnedDisplayEntityGroup} or null
*/
public @Nullable SpawnedDisplayEntityGroup getSpawnedGroup() {
return spawnedGroup;
}

/**
* Get the animations that were created as a result of the conversion
* @return an unmodifiable list of {@link SpawnedDisplayAnimation}s
*/
public @NotNull List<SpawnedDisplayAnimation> getAnimations() {
return animations;
}

/**
* Get whether the created group were saved after conversion
* @return a boolean
*/
public boolean isSavingGroups(){
return isSavedGroup;
}

/**
* Get whether the created animations were saved after conversion
* @return a boolean
*/
public boolean isSavingAnimations(){
return isSavedAnimations;
}

@Override
public HandlerList getHandlers() {
return handlers;
}

public static HandlerList getHandlerList() {
return handlers;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.donnypz.displayentityutils.events;

import net.donnypz.displayentityutils.utils.DisplayEntities.DisplayEntityGroup;
import net.donnypz.displayentityutils.utils.DisplayEntities.SpawnedDisplayAnimation;
import net.donnypz.displayentityutils.utils.DisplayEntities.SpawnedDisplayEntityGroup;
import net.donnypz.displayentityutils.utils.bdengine.BDEngineUtils;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
* Called sometime after {@link BDEngineUtils#convertDatapack(String, Player, String, String, boolean, boolean, boolean)}
* or similar is called, converting a datapack into a group and animations. This contains all information related to the conversion.
*/
public class BDEDatapackConvertEvent extends BDEConvertEvent{

private final String datapackName;
public BDEDatapackConvertEvent(String datapackName,
Player player,
String conversionId,
DisplayEntityGroup savedGroup,
SpawnedDisplayEntityGroup spawnedGroup,
List<SpawnedDisplayAnimation> animations,
boolean isSavedGroup,
boolean isSavedAnimations) {
super(player, conversionId, savedGroup, spawnedGroup, animations, isSavedGroup, isSavedAnimations);
this.datapackName = datapackName;
}

/**
* Get the name of the datapack that was converted
* @return a string
*/
public @NotNull String getDatapackName() {
return datapackName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ public boolean setSelectedGroup(@NotNull ActiveGroup<?> activeGroup) {
*/
public void setSelectedPartSelection(@NotNull ActivePartSelection<?> selection, boolean setGroup) {
deselectPartSelection();
if (selection instanceof MultiPartSelection<?> newSel && setGroup){
selectedGroup = newSel.getGroup();
if (selection instanceof MultiPartSelection<?> multiSel && setGroup){
selectedGroup = multiSel.getGroup();
}
selectedPartSelection = selection;
}
Expand Down Expand Up @@ -186,6 +186,7 @@ public void deselectSpawnedAnimation(){
public void deselectPartSelection(){
if (selectedPartSelection != null){
selectedPartSelection.remove();

selectedPartSelection = null;
}
selectedGroup = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.donnypz.displayentityutils.utils.DisplayEntities.*;
import net.donnypz.displayentityutils.utils.DisplayUtils;
import net.donnypz.displayentityutils.utils.GroupResult;
import net.donnypz.displayentityutils.utils.WorldUtils;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
Expand Down Expand Up @@ -168,7 +169,7 @@ public static void updateSpawnedGroup(Location lastLoc, Location newLoc, Spawned
if (holder == null) return Collections.emptySet();

Set<SpawnedDisplayEntityGroup> groups = new HashSet<>();
Set<Chunk> chunks = getNearbyChunks(location, radius);
Set<Chunk> chunks = WorldUtils.getNearbyChunks(location, radius);
double radiusSquared = radius*radius;
for (Chunk c : chunks){
for (SpawnedDisplayEntityGroup group : holder.getGroups(c.getChunkKey())){
Expand All @@ -189,7 +190,7 @@ public static void updateSpawnedGroup(Location lastLoc, Location newLoc, Spawned

SpawnedDisplayEntityGroup nearest = null;
double lastDistSq = Double.MAX_VALUE;
Set<Chunk> chunks = getNearbyChunks(location, radius);
Set<Chunk> chunks = WorldUtils.getNearbyChunks(location, radius);
double radiusSquared = radius*radius;

for (Chunk c : chunks){
Expand All @@ -215,30 +216,6 @@ public static void updateSpawnedGroup(Location lastLoc, Location newLoc, Spawned
return nearest;
}

private static Set<Chunk> getNearbyChunks(Location loc, double radiusInBlocks) {
World world = loc.getWorld();

double minX = loc.getX() - radiusInBlocks;
double maxX = loc.getX() + radiusInBlocks;
double minZ = loc.getZ() - radiusInBlocks;
double maxZ = loc.getZ() + radiusInBlocks;

int minChunkX = (int) minX >> 4;
int maxChunkX = (int) maxX >> 4;
int minChunkZ = (int) minZ >> 4;
int maxChunkZ = (int) maxZ >> 4;

Set<Chunk> chunks = new HashSet<>();

for (int cx = minChunkX; cx <= maxChunkX; cx++) {
for (int cz = minChunkZ; cz <= maxChunkZ; cz++) {
chunks.add(world.getChunkAt(cx, cz));
}
}

return chunks;
}

/**
* Get the {@link SpawnedDisplayEntityGroup} that has been registered during the current game session from a display entity.
* <br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

public class AnimationCamera implements Serializable {
double x, y, z;
Expand Down Expand Up @@ -68,4 +69,15 @@ public float getYaw() {
public float getPitch() {
return pitch;
}

@Override
public boolean equals(Object o) {
if (!(o instanceof AnimationCamera that)) return false;
return Double.compare(x, that.x) == 0 && Double.compare(y, that.y) == 0 && Double.compare(z, that.z) == 0 && Float.compare(yaw, that.yaw) == 0 && Float.compare(pitch, that.pitch) == 0;
}

@Override
public int hashCode() {
return Objects.hash(x, y, z, yaw, pitch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,36 @@ public DEUSound(@NotNull DEUSound sound){
this.existsInGameVersion = sound.existsInGameVersion;
}

/**
* Create a {@link DEUSound} from a "playsound" or "execute... run playsound" command.
* @param command the command
* @return a {@link DEUSound} or null
*/
public static @Nullable DEUSound fromCommand(@NotNull String command){
if (command.startsWith("execute") && command.contains("playsound")){
command = "."+command.split(" playsound ")[1]; //"." added so indexes are consistent
}
else if (!command.startsWith("playsound")){
return null;
}

String[] strings = command.split(" ");
String soundStr = strings[1];

float volume = getSoundValue(strings, 7);
float pitch = getSoundValue(strings, 8);
return new DEUSound(soundStr, volume, pitch, 0);
}

private static float getSoundValue(String[] args, int index){
try{
return args.length >= index+1 ? Float.parseFloat(args[index]) : 1;
}
catch(IndexOutOfBoundsException e){
return 1;
}
}

public void playSound(@NotNull Location location, @NotNull ActiveGroup<?> group, @Nullable DisplayAnimator animator){
if (delay == 0){
playSound(location);
Expand Down Expand Up @@ -211,7 +241,7 @@ public void sendInfo(Player player, Consumer<DEUSound> clickRemovalAction){

if (clickRemovalAction != null){
hoverComp = hoverComp.append(Component.newline())
.append(Component.text("Click to remove this sound", NamedTextColor.YELLOW));
.append(Component.text("Click to remove this sound", NamedTextColor.RED));
msgComp = msgComp.clickEvent(ClickEvent.callback(a -> {
clickRemovalAction.accept(this);
a.sendMessage(DisplayAPI.pluginPrefix.append(Component.text("Sound Removed!", NamedTextColor.YELLOW)));
Expand All @@ -226,10 +256,7 @@ public void sendInfo(Player player, Consumer<DEUSound> clickRemovalAction){
public static void sendInfo(Collection<DEUSound> sounds, Player player, String soundListTitle, Consumer<DEUSound> clickRemovalAction){
if (soundListTitle == null) soundListTitle = "Sounds";
player.sendMessage(MiniMessage.miniMessage().deserialize(soundListTitle+": <yellow>"+sounds.size()));
if (sounds.isEmpty()){
player.sendMessage(Component.text("| NONE", NamedTextColor.GRAY));
}
else{
if (!sounds.isEmpty()){
for (DEUSound sound : sounds){
sound.sendInfo(player, clickRemovalAction);
}
Expand Down
Loading
Loading