Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5148340
Bump version to 3.7.2
PZDonny Sep 29, 2026
7ecacc8
Added DisplayStorage#isEnabled
PZDonny Sep 29, 2026
2660a6e
change default MongoDB `database` name to `displayentityutils`
PZDonny Sep 29, 2026
6ccc082
Add paginated `#getGroupTags` and `#getAnimationTags` to `DisplayStor…
PZDonny Sep 29, 2026
96fcf52
don't use `databaseName` parameter in generated connection string
PZDonny Sep 29, 2026
6435802
Use paginated `#getGroupTags` and `#getAnimationTags` from `DisplaySt…
PZDonny Sep 29, 2026
95d17a4
`Remove DisplayAnimationManager#getSavedDisplayAnimations`
PZDonny Sep 29, 2026
aafe8c3
Remove `DisplayGroupManager#getSavedDisplayEntityGroups`
PZDonny Sep 29, 2026
a16d788
Add `LoadMethod#getDisplayStorage`
PZDonny Sep 29, 2026
f87b4a9
Register all plugin permissions for permission manager discovery (LP)
PZDonny Sep 30, 2026
cbd656d
Added `Control#getControlType`
PZDonny Sep 30, 2026
1d706c8
Stop player movement when selecting a Gizmo control
PZDonny Sep 30, 2026
a373a55
Correctly make adding a tag to a cloned part optional
PZDonny Sep 30, 2026
4e8bd79
Register permissions on enable, rather than in static block
PZDonny Sep 30, 2026
b13ea71
update documentation
PZDonny Sep 30, 2026
64a9148
inform player that selection mode cannot change with single entity se…
PZDonny Sep 30, 2026
cb75a4c
Add GizmoSession#teleport
PZDonny Oct 1, 2026
d5364b4
Add `/deu display roundtranslation`
PZDonny Oct 1, 2026
361324c
Added `/deu gizmo snaptoblock`
PZDonny Oct 1, 2026
9828b77
Remove `/deu gizmo snaptoblock`
PZDonny Oct 1, 2026
6b3c56c
Clone selection when clicking gizmo pivot point (white cube)
PZDonny Oct 1, 2026
155e758
Add snapping to gizmo controls
PZDonny Oct 1, 2026
abec5c2
Bump version to 3.8.0
PZDonny Oct 1, 2026
824b2f4
add release notes
PZDonny Oct 1, 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.7.1</version>
<version>3.8.0</version>
</parent>

<artifactId>api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

public interface DisplayStorage {

boolean isEnabled();

boolean saveDisplayEntityGroup(@NotNull DisplayEntityGroup group, @Nullable Player saver);

void deleteDisplayEntityGroup(@NotNull String group, @Nullable Player deleter);
Expand All @@ -24,5 +26,9 @@ public interface DisplayStorage {

@NotNull List<String> getGroupTags();

@NotNull List<String> getGroupTags(int page, int size);

@NotNull List<String> getAnimationTags();

@NotNull List<String> getAnimationTags(int page, int size);
}
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,6 @@ private static void attemptCacheAnimation(String tag, SpawnedDisplayAnimation an
}
}


/**
* Get the animation tags of all saved {@link DisplayAnimation}s in a storage location.
* @param loadMethod of the search location
* @return a list of all animations by their group tag
*/
public static @NotNull List<String> getSavedDisplayAnimations(@NotNull LoadMethod loadMethod){
if (!loadMethod.isEnabled()) return Collections.emptyList();
return DisplayAPI.getStorage(loadMethod).getAnimationTags();
}

/**
* Get a {@link DisplayAnimation} from a JSON string
* @param json JSON of a saved {@link DisplayAnimation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,19 +738,6 @@ private static DisplayEntityGroup getGroupFromJson(JsonObject jsonObject){
.fromJson(jsonObject, DisplayEntityGroup.class);
}



/**
* Get the group tags of all saved {@link DisplayEntityGroup}s in a storage location.
* @param loadMethod of the search location
* @return a list of all groups by their group tag
*/
@ApiStatus.Internal
public static @NotNull List<String> getSavedDisplayEntityGroups(@NotNull LoadMethod loadMethod) {
if (!loadMethod.isEnabled()) return Collections.emptyList();
return DisplayAPI.getStorage(loadMethod).getGroupTags();
}

@ApiStatus.Internal
public static void addPersistentPacketGroup(@NotNull PacketDisplayEntityGroup group, @NotNull Location location){
if (group.isPersistent()) return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package net.donnypz.displayentityutils.managers;

import net.donnypz.displayentityutils.DisplayAPI;
import net.donnypz.displayentityutils.DisplayConfig;
import net.donnypz.displayentityutils.database.DisplayStorage;
import net.donnypz.displayentityutils.utils.DisplayEntities.DisplayAnimation;
import net.donnypz.displayentityutils.utils.DisplayEntities.DisplayEntityGroup;
import org.jetbrains.annotations.NotNull;

/**
* Storage locations for saving, deleting, and retrieving a saved {@link DisplayEntityGroup} or {@link DisplayAnimation}
Expand Down Expand Up @@ -44,6 +47,10 @@ public boolean isEnabled(){
}
}

public @NotNull DisplayStorage getDisplayStorage(){
return DisplayAPI.getStorage(this);
}

public String getDisplayName() {
return displayName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class DisplayAnimation implements Serializable {

@Serial
private static final long serialVersionUID = 99L;
public static final String fileExtension = ".deanim";
public static final String FILE_EXTENSION = ".deanim";


DisplayAnimation(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class DisplayEntityGroup implements Serializable{

@Serial
private static final long serialVersionUID = 99L;
public static final String fileExtension = ".deg";
public static final String FILE_EXTENSION = ".deg";

DisplayEntityGroup(SpawnedDisplayEntityGroup spawnedGroup){
this.tag = spawnedGroup.getTag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ public static boolean isInLoadedChunk(@NotNull Entity entity){
/**
* Get the {@link SpawnedDisplayEntityGroup} passengers, with a specific group tag, riding an entity
* @param vehicleEntity the entity
* @param groupTag the group tag
* @return a list
*/
public static List<SpawnedDisplayEntityGroup> getGroupPassengers(@NotNull Entity vehicleEntity, @NotNull String groupTag){
Expand Down Expand Up @@ -839,14 +840,16 @@ public static boolean isValidTag(@NotNull String tag){

/**
* Remove a part tag from an entity
* @param tag the tag to remove from this part
* @param entity the entity to remove the tag from
* @param tag the tag to remove
*/
public static void removeTag(@NotNull Entity entity, @NotNull String tag){
removeFromPDCList(entity, tag, DisplayKeys.Part.PART_TAGS);
}

/**
* Remove part tags from an entity
* @param entity the entity to remove the tag from
* @param tags the tags to remove from this part
*/
public static void removeTags(@NotNull Entity entity, @NotNull List<String> tags){
Expand Down Expand Up @@ -885,6 +888,7 @@ static void removeManyFromPDCList(@NotNull Entity entity, List<String> elements,

/**
* Gets the part tags belonging to an entity
* @param entity the entity
* @return The part's part tags.
*/
public static @NotNull List<String> getTags(@NotNull Entity entity){
Expand All @@ -902,6 +906,7 @@ static void removeManyFromPDCList(@NotNull Entity entity, List<String> elements,

/**
* Determine whether a part entity has a part tag
* @param entity the entity
* @param tag the tag to check for
* @return true if this part has the tag
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public interface GizmoSession {

void teleport(Vector direction);

void teleport(Location location);

void deselectHide();

void selectShow(Location spawnLocation);
Expand Down
47 changes: 47 additions & 0 deletions docs/release-notes/3.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
**Release Highlights**
- Gizmo Changes 📐
- New Commands 💻
- New and Breaking API Changes 🔨
- Bug Fixes 🐛

## Gizmo Changes
- Snapped movements can be toggled by using `SNEAK + OFFHAND`
- The snap value can be changed by `SCROLLING (With selected axis)`
- A selected group / entity can be cloned by `LEFT CLICKING` the pivot / white cube at the center of the Gizmo
- Translating in teleport mode snaps to world grid when snapping is enabled

## Command Changes

### <ins>New Commands</ins>
- Added `/deu display roundtranslation`
- Remove the decimal portion of your selected display's translation.
- (Ex: X translation of `12.25` would become `12.0`).
- Permission: `deu.display.transform`
- Added `/deu gizmo snapvalue`
- Set the snapping value for a selected Gizmo control
- Permission: `deu.gizmo.use`
- Added `/deu gizmo toggglesnap`
- Toggle the snapping of gizmo control movements
- Permission: `deu.gizmo.use`

## API Changes
> [!NOTE]
>**New Version:** `3.8.0`

### <ins>Additions/Changes</ins>
- Added `DisplayStorage#isEnabled` to see if a storage location is enabled
- Add paginated `#getGroupTags` and `#getAnimationTags` to `DisplayStorage`
- Added `LoadMethod#getDisplayStorage`

### <ins>Breaking Changes</ins>
- Removed `DisplayAnimationManager#getSavedDisplayAnimations` in favor of `DisplayStorage#getAnimationTags`
- Removed `DisplayGroupManager#getSavedDisplayEntityGroups` in favor of `DisplayStorage#getGroupTags`


## Bug Fixes / QOL
- Fixed an issue where using a `MongoDB` database without passing a `connectionString` in the config
generated an incorrect connection string
- Added minor optimization to listing group and animation tags from a database
- All plugin permissions are now correctly registered
- Player movement is now stopped after selecting a Gizmo control
- Fixed `/deu parts clone` requiring a tag to be added to a cloned part, rather than being optional
2 changes: 1 addition & 1 deletion plugin/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.7.1</version>
<version>3.8.0</version>
</parent>

<artifactId>plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import net.donnypz.displayentityutils.command.DisplayEntityPluginCommand;
import net.donnypz.displayentityutils.command.Permission;
import net.donnypz.displayentityutils.database.*;
import net.donnypz.displayentityutils.listeners.autogroup.DEULoadingListeners;
import net.donnypz.displayentityutils.listeners.bdengine.BDEngineConversionListener;
Expand Down Expand Up @@ -91,6 +92,8 @@ public void onEnable() {
else{
getComponentLogger().warn(Component.text("bStats disabled on server using dev version."));
}

Permission.registerPermissions();
getServer().getConsoleSender().sendMessage(DisplayAPI.pluginPrefix.append(Component.text("Plugin Enabled!", NamedTextColor.GREEN)));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package net.donnypz.displayentityutils.command;

import net.donnypz.displayentityutils.DisplayAPI;
import net.donnypz.displayentityutils.managers.DisplayAnimationManager;
import net.donnypz.displayentityutils.managers.DisplayGroupManager;
import net.donnypz.displayentityutils.database.DisplayStorage;
import net.donnypz.displayentityutils.managers.LoadMethod;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
Expand All @@ -19,6 +18,7 @@ public class ListCMD extends ConsoleUsableSubCommand {
int minLength;
private final int STORAGE_INDEX;
private final int PAGE_NUMBER_INDEX;
private final int PAGE_SIZE = 6;
boolean listsGroups;

public ListCMD(Component incorrectUsageMessage, int minLength, boolean listsGroups) {
Expand Down Expand Up @@ -54,38 +54,37 @@ public void list(CommandSender sender, String[] args) {
return;
}

List<String> tags = listsGroups ?
DisplayGroupManager.getSavedDisplayEntityGroups(loadMethod)
:
DisplayAnimationManager.getSavedDisplayAnimations(loadMethod);
int pageNumber = 1;
if (args.length > minLength) {
try {
pageNumber = Math.max(1, Integer.parseInt(args[PAGE_NUMBER_INDEX]));
} catch (NumberFormatException ignored) {
}
}

DisplayStorage storage = DisplayAPI.getStorage(loadMethod);

if (!storage.isEnabled()){
sender.sendMessage(DisplayAPI.pluginPrefix
.append(Component.text("Storage location is not enabled!", NamedTextColor.RED)));
return;
}
List<String> tags = listsGroups
? storage.getGroupTags(pageNumber, PAGE_SIZE)
: storage.getAnimationTags(pageNumber, PAGE_SIZE);

sender.sendMessage(DisplayAPI.pluginPrefixLong);
sender.sendMessage(MiniMessage.miniMessage().deserialize("Storage Location: <yellow>" + loadMethod.getDisplayName()));
if (tags.isEmpty()) {
sender.sendMessage(Component.text("That storage location is empty!", NamedTextColor.RED));
sender.sendMessage(Component.text("| Nothing to list on this page.", NamedTextColor.GRAY));
return;
}

if (sender instanceof Player) {
sender.sendMessage(Component.text("Click to a listed item to " + (listsGroups ? "spawn" : "select") + " it", NamedTextColor.GRAY));
}

int pageNumber = 1;
if (args.length > minLength) {
try {
pageNumber = Math.max(1, Integer.parseInt(args[PAGE_NUMBER_INDEX]));
} catch (NumberFormatException ignored) {
}
}

int end = pageNumber * 6;
int start = end - 6;

for (int i = start; i < end; i++) {
if (i >= tags.size()) {
break;
}
String tag = tags.get(i);
for (String tag : tags) {
sender.sendMessage(getMessage(tag, loadMethod));
}
sender.sendMessage(Component.text("----------" + "Page " + pageNumber + "----------", NamedTextColor.GRAY));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.donnypz.displayentityutils.command;

import net.donnypz.displayentityutils.DisplayAPI;
import org.bukkit.plugin.PluginManager;

public enum Permission {
HELP("deu.help"),
RELOAD("deu.reload"),
Expand Down Expand Up @@ -137,6 +140,21 @@ public enum Permission {
BDENGINE_IMPORT("deu.bdengine.import");


public static void registerPermissions(){
for (Permission permission : Permission.values()){
registerPermission(permission);
}
}

private static void registerPermission(Permission permission){
PluginManager pm = DisplayAPI.getPlugin().getServer().getPluginManager();
if (pm.getPermission(permission.getPermission()) == null){
pm.addPermission(new org.bukkit.permissions.Permission(permission.getPermission()));
}
}



private final String permission;
Permission(String permission){
this.permission = permission;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public DisplayCMD(){
new DisplayViewRangeCMD(this);
new DisplayBillboardCMD(this);
new DisplayTranslateCMD(this);
new DisplayRoundTranslationCMD(this);
new DisplayResetCMD(this);
new DisplayRotateCMD(this);
new DisplaySetRotationCMD(this);
Expand Down
Loading
Loading