Skip to content

Creating a store doesn't work out of the box when you click on a chest #2201

@golovin12

Description

@golovin12

After that 05d8a7c updates - The store's creation stopped working when clicking on the block due to changes in the PlayerListener:

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -168,6 +169,11 @@ public void onClick(final PlayerInteractEvent event) {
        }
      }
    }

    if(shop == null && b.getBlockData() instanceof Chest) {

      return new AbstractMap.SimpleImmutableEntry<>(shop, InteractionClick.CONTAINER);
    }

This is not described anywhere, but in order for the creation to work, I had to add in interactions.yml: STANDING_LEFT_CLICK_CONTAINER: TRADE_UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions