Skip to content

Commit

Permalink
8
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Mar 8, 2019
1 parent 1842a78 commit 800b6c4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Vivecraft-Spigot-Extensions
version: '1.13.2-r7'
version: '1.13.2-r8'
main: org.vivecraft.VSE
website: http://www.vivecraft.org/
author: jrbudda, jaron780
Expand Down
23 changes: 21 additions & 2 deletions src/org/vivecraft/listeners/VivecraftNetworkListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.util.Arrays;

import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
Expand All @@ -18,6 +18,7 @@
import com.google.common.base.Charsets;

import net.minecraft.server.v1_13_R2.EntityPlayer;
import net.minecraft.server.v1_13_R2.PlayerConnection;

public class VivecraftNetworkListener implements PluginMessageListener {
public VSE vse;
Expand All @@ -40,7 +41,8 @@ public enum PacketDiscriminators {
CLIMBING
}


Field floatingCount = null;
String floatinCountObf = "C";

@Override
public void onPluginMessageReceived(String channel, Player sender, byte[] payload) {
Expand Down Expand Up @@ -152,8 +154,25 @@ else if(mode.trim().equalsIgnoreCase("exclude"))

break;
case CLIMBING:

if(floatingCount == null) {
try {
floatingCount = PlayerConnection.class.getDeclaredField(floatinCountObf);
} catch (NoSuchFieldException e) {
} catch (SecurityException e) {
}
floatingCount.setAccessible(true);
}

EntityPlayer nms = ((CraftPlayer)sender).getHandle();
nms.fallDistance = 0;

try {
floatingCount.setInt(nms.playerConnection, 0);
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
}

default:
break;
}
Expand Down
3 changes: 2 additions & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#this file is used to check for updates
1.13.2-r6: VSE has a new version.
1.13.2-r7: VSE is up to date!
1.13.2-r7: VSE has a new version.
1.13.2-r8: VSE is up to date!

0 comments on commit 800b6c4

Please sign in to comment.