Fixed interact event exception

This commit is contained in:
Norbi Peti 2016-02-28 19:14:10 +01:00
parent 1495685a13
commit 330ab45b95
5 changed files with 10 additions and 7 deletions

Binary file not shown.

View file

@ -257,12 +257,13 @@ public class PlayerListener implements Listener { // 2015.07.16.
else else
rpc = 0; rpc = 0;
} }
/*System.out.println("item: " + item); // TO!DO: TMP /*
System.out.println("currentindex: " + currentindex); * System.out.println("item: " + item); // TO!DO: TMP
System.out.println("format: " * System.out.println("currentindex: " + currentindex);
+ String.format("§%s%s", RainbowPresserColors[rpc], * System.out.println("format: " + String.format("§%s%s",
item)); * RainbowPresserColors[rpc], item));
System.out.println("formattedmessage: " + formattedmessage);*/ * System.out.println("formattedmessage: " + formattedmessage);
*/
StringBuffer buf = new StringBuffer(formattedmessage); StringBuffer buf = new StringBuffer(formattedmessage);
buf.replace(currentindex, currentindex + item.length(), buf.replace(currentindex, currentindex + item.length(),
String.format("§%s%s", RainbowPresserColors[rpc], item)); String.format("§%s%s", RainbowPresserColors[rpc], item));
@ -1083,7 +1084,9 @@ public class PlayerListener implements Listener { // 2015.07.16.
.getPlayer()); .getPlayer());
if (mp == null) if (mp == null)
return; return;
if (mp.getMinigame().getName(false).equalsIgnoreCase("twohundred")) { if (mp.isInMinigame()
&& mp.getMinigame().getName(false)
.equalsIgnoreCase("twohundred")) {
if (e.getClickedBlock().getType() == Material.ENDER_CHEST) { if (e.getClickedBlock().getType() == Material.ENDER_CHEST) {
e.setCancelled(true); e.setCancelled(true);
e.getPlayer().sendMessage( e.getPlayer().sendMessage(