Skip to content

Commit

Permalink
fix climbey blocklist
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Feb 28, 2017
1 parent 26f66fc commit c40fb77
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/org/vivecraft/listeners/VivecraftNetworkListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ public void onPluginMessageReceived(String channel, Player sender, byte[] payloa
if(vse.getConfig().getBoolean("climbey.enabled") == true){

final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

byteArrayOutputStream.write(PacketDiscriminators.CLIMBING.ordinal());

final ObjectOutputStream objectOutputStream =
new ObjectOutputStream(byteArrayOutputStream);
objectOutputStream.writeByte(PacketDiscriminators.CLIMBING.ordinal());
String mode = vse.getConfig().getString("climbey.blockmode","none");
byte m = 0;
if(!sender.hasPermission(vse.getConfig().getString("permissions.climbgroup"))){
Expand All @@ -138,12 +140,18 @@ else if(mode.trim().equalsIgnoreCase("exclude"))
objectOutputStream.writeByte(m);
objectOutputStream.writeObject(vse.blocklist);
objectOutputStream.flush();
objectOutputStream.close();

final byte[] p = byteArrayOutputStream.toByteArray();

sender.sendPluginMessage(vse, vse.CHANNEL, p);
for (byte b : p) {
vse.getLogger().info(b+ " ");
}
vse.getLogger().info("sent climb " + p.length);
objectOutputStream.close();

}

sender.sendPluginMessage(vse, vse.CHANNEL, new byte[]{(byte) PacketDiscriminators.TELEPORT.ordinal()});


Expand Down

0 comments on commit c40fb77

Please sign in to comment.