Wolvereness/PhysicalShop — pull request #4 by AgentME (2012-02-15 11:30:41+00:00)
Title: If LWC is enabled, then make sure that ChestShops are LWC protected

This makes it so when a ChestShop is accessed and LWC is enabled, it's checked if the chest is protected by LWC.

If it's not LWC protected, then a new LWC protection is made.

If the chest is protected by LWC, then it's checked that the ChestShop owner is either the owner of the chest or has admin access to the chest. If neither of these is true, then the ChestShop owner is given admin access to the chest.

The initial reason for this was when I noticed if someone made a ChestShop without locking it with LWC, then someone else that wasn't the ChestShop owner could lock the chest with LWC, and then no one could access the chest. I also wanted to keep the use of PhysicalShop on my server simple; someone shouldn't have to make a shop sign AND lock the chest with LWC themselves. I also wanted to make it so I could safely turn off the protect-chest-access config option on my server but still have chestshops lock themselves after being created.

This also searches the NameCollection config to deal with the case of a shortened owner name being on the shop sign. I added a method to NameCollection that takes a shortened name and returns the full name to do this.