SignChange listener now check if sign is valid

This commit is contained in:
Acrobot 2012-08-10 19:00:45 +02:00
parent d7c5aad271
commit 3d9edc4f3f

View File

@ -1,5 +1,6 @@
package com.Acrobot.ChestShop.Listeners.Block;
import com.Acrobot.Breeze.Utils.BlockUtil;
import com.Acrobot.Breeze.Utils.MaterialUtil;
import com.Acrobot.Breeze.Utils.PriceUtil;
import com.Acrobot.Breeze.Utils.StringUtil;
@ -40,6 +41,11 @@ public class SignChange implements Listener {
Block signBlock = event.getBlock();
String[] line = event.getLines();
if (!BlockUtil.isSign(signBlock)) {
ChestShop.getBukkitLogger().severe("Player " + event.getPlayer().getName() + " tried to create a fake sign. Hacking?");
return;
}
ItemStack stock = MaterialUtil.getItem(line[ITEM_LINE]);
if (!ChestShopSign.isValidPreparedSign(line)) {
@ -144,7 +150,7 @@ public class SignChange implements Listener {
private static String formatPriceLine(String thirdLine) {
String line = thirdLine;
String[] split = line.split(":");
String[] split = line.toUpperCase().split(":");
if (PriceUtil.textIsPrice(split[0])) {
line = "B " + line;