mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-24 17:17:49 +01:00
SignChange listener now check if sign is valid
This commit is contained in:
parent
d7c5aad271
commit
3d9edc4f3f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user