Skip to content
New issue

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

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

Already on GitHub? # to your account

Enable all inventory type feature #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Catalyst105
Copy link

Purpose of the pull

Added feature to enable/disable if shulkers can be opened in all inventory type (chest, dispenser, crafting table, etc.)

I removed the rules IF the feature is enabled THEN IF clicked inventory is not an enderchest THEN return and added IF click in enderchest is disabled AND if the clicked inventory is an enderchest THEN return

I hope my code is clear and my explanations too !

Change maded

In the class ShulkerOpenListener (Line 54 to 67) :

final Player player = (Player) event.getWhoClicked();
	if (event.getClickedInventory() != null && !event.getClickedInventory().equals(event.getWhoClicked().getInventory())) {
	if (CONFIG.getBoolean("enable-shulker-opening-in-all-inventory-type")) {
		if (!CONFIG.getBoolean("opening-from-inventory.open-from-enderchest") && event.getClickedInventory().equals(event.getWhoClicked().getEnderChest())) return;
	} else {
		if (!event.getClickedInventory().equals(event.getWhoClicked().getEnderChest())) return;
		if (!CONFIG.getBoolean("opening-from-inventory.open-from-enderchest") && event.getClickedInventory().equals(event.getWhoClicked().getEnderChest())) return;
	}
}

In config.yml :

# If this is true then player can open shulkers from all type of inventory (chest, trapped chest, dispenser, etc.)
enable-shulker-opening-in-all-inventory-type: false 

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant