mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-27 00:41:19 +01:00
Should fix the Mac issues
This commit is contained in:
parent
2cde9da196
commit
6982ef38d1
@ -0,0 +1,30 @@
|
|||||||
|
package com.Acrobot.ChestShop.Listeners;
|
||||||
|
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.SignChangeEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes garbage characters from the sign
|
||||||
|
*
|
||||||
|
* @author Andrzej Pomirski
|
||||||
|
*/
|
||||||
|
public class GarbageTextListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public static void filterGarbage(SignChangeEvent event) {
|
||||||
|
for (int i = 0; i < 4; ++i) {
|
||||||
|
String line = event.getLine(i);
|
||||||
|
StringBuilder output = new StringBuilder(line.length());
|
||||||
|
|
||||||
|
for (char character : line.toCharArray()) {
|
||||||
|
if (character < 0xF700 || character > 0xF747) {
|
||||||
|
output.append(character);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setLine(i, output.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user