Skip to content

Rename locking#893

Open
MrJeremyFisher wants to merge 4 commits intoCivMC:mainfrom
MrJeremyFisher:rename-locking
Open

Rename locking#893
MrJeremyFisher wants to merge 4 commits intoCivMC:mainfrom
MrJeremyFisher:rename-locking

Conversation

@MrJeremyFisher
Copy link
Contributor

Allows locking item names by combining them with honeycomb in an anvil. Locked items cannot be renamed by a player and cannot be wordbanked (though this is only necessary if items are locked with their default names as named items cannot be wordbanked). See my comments for bits I couldn't figure out but that would be nice, like changing the "Too Expensive!" text.

…king

# Conflicts:
#	plugins/simpleadminhacks-paper/src/main/java/com/programmerdan/minecraft/simpleadminhacks/hacks/basic/NameLocker.java
@MrJeremyFisher
Copy link
Contributor Author

Fixed combining items for repair with name-locked items and adding enchantments from books. Also fixed using >1 honeycomb casuing the rest of the honeycomb left in the anvil to be deleted.

@MrJeremyFisher
Copy link
Contributor Author

Review @okx-code 🥹?


public class NameLockerFMListener implements Listener {

NamespacedKey lockedKey;
Copy link
Contributor

@okx-code okx-code Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this package private? Should be private and final ideally


public class NameLocker extends BasicHack {

final NamespacedKey lockedKey = new NamespacedKey(plugin, "name-locked");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package private?

result.editMeta(meta -> {
meta.setDisplayName(event.getView().getRenameText());
meta.getPersistentDataContainer().set(lockedKey, PersistentDataType.BOOLEAN, true);
meta.lore(List.of(Component.text().content("Name-locked").build())); // Just to make it clear. If we can change the message in the anvil this should be removed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to wipe the lore for these kinds of items?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants