Changed: Players in creative mode are no longer ignored when using the

shop creation item.

This seems to cause more confusion than it helps. Also, this is less of
an issue, because the default shop creation item is a villager egg with
specific display name since some time now.
master
blablubbabc 2020-11-23 12:08:02 +01:00
parent b12616ecfc
commit ccc76cf363
2 changed files with 1 additions and 9 deletions

View File

@ -9,6 +9,7 @@ Date format: (YYYY-MM-DD)
* Config: Changed the default language from 'en' to 'en-default'. Existing configs get automatically migrated.
* Fixed: Text#parse can now also parse alternative color codes starting with '&'. This has an effect when some messages of the specified language file cannot be loaded and the plugin then uses the default messages instead.
* Added warning output when the language file misses messages, or contains unexpected messages.
* Changed: Players in creative mode are no longer ignored when using the shop creation item.
Migration notes:
* The folder structure has changed:

View File

@ -1,7 +1,6 @@
package com.nisovin.shopkeepers.shopcreation;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@ -52,7 +51,6 @@ class CreateListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
void onItemHeld(PlayerItemHeldEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.CREATIVE) return;
ItemStack newItemInHand = player.getInventory().getItem(event.getNewSlot());
if (!Settings.isShopCreationItem(newItemInHand)) {
return;
@ -88,12 +86,6 @@ class CreateListener implements Listener {
Player player = event.getPlayer();
Log.debug(() -> "Player " + player.getName() + " is interacting with the shop creation item");
// Ignore creative mode players:
if (player.getGameMode() == GameMode.CREATIVE) {
Log.debug(" Ignoring creative mode player");
return;
}
// Capture event's cancellation state:
Result useItemInHand = event.useItemInHand();
@ -240,7 +232,6 @@ class CreateListener implements Listener {
private void handleEntityInteraction(PlayerInteractEntityEvent event) {
if (!Settings.preventShopCreationItemRegularUsage) return;
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.CREATIVE) return; // Creative mode players are ignored
// We check the permission first since this check is fast:
if (PermissionUtils.hasPermission(player, ShopkeepersPlugin.BYPASS_PERMISSION)) return;
ItemStack itemInHand = ItemUtils.getItem(player.getInventory(), event.getHand());