Advertisement
Olivki

such gud

Jun 29th, 2014
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.33 KB | None | 0 0
  1. package se.proxus.mods.list.server;
  2.  
  3. import net.minecraft.src.Packet10Flying;
  4. import net.minecraft.src.Packet18Animation;
  5. import se.proxus.Gallium;
  6. import se.proxus.events.EventHandler;
  7. import se.proxus.events.list.server.EventPacketSent;
  8. import se.proxus.mods.Mod;
  9. import se.proxus.mods.ModCategory;
  10.  
  11. public class Derp extends Mod {
  12.  
  13.     public Derp(final Gallium client) {
  14.     super("Derp", ModCategory.SERVER, false, client);
  15.     }
  16.  
  17.     @Override
  18.     public void init() {
  19.     setDescription("Herp derp. 0:Normal 1:Head in body 2:Backwards 3:Normal with head in body 4:Hump");
  20.     registerSetting(0, 0, "Mode", 6.0D, true, false, true);
  21.     }
  22.  
  23.     @Override
  24.     public void onEnable() {
  25.     getClient().getEvents().registerListener(this);
  26.     }
  27.  
  28.     @Override
  29.     public void onDisable() {
  30.     getClient().getEvents().unregisterListener(this);
  31.     }
  32.  
  33.     @EventHandler
  34.     public void onEventPacketSent(final EventPacketSent event) {
  35.     if (!(event.getPacket() instanceof Packet10Flying))
  36.         return;
  37.     Packet10Flying packet = (Packet10Flying) event.getPacket();
  38.     switch ((Integer) getSetting(0)) {
  39.     case 0:
  40.         packet.yaw = getClient().getRNG().nextInt(360);
  41.         packet.pitch = getClient().getRNG().nextInt(360);
  42.         getClient().sendPacket(
  43.             new Packet18Animation(getClient().getMinecraft().thePlayer,
  44.                 1));
  45.         break;
  46.     case 1:
  47.         packet.pitch = -180;
  48.         getClient().sendPacket(
  49.             new Packet18Animation(getClient().getMinecraft().thePlayer,
  50.                 1));
  51.         break;
  52.     case 2:
  53.         packet.yaw = -180;
  54.         break;
  55.     case 3:
  56.         packet.pitch = -180;
  57.         packet.yaw = getClient().getRNG().nextInt(360);
  58.         getClient().sendPacket(
  59.             new Packet18Animation(getClient().getMinecraft().thePlayer,
  60.                 1));
  61.         break;
  62.     case 4:
  63.         getClient().sendPacket(
  64.             new Packet18Animation(getClient().getMinecraft().thePlayer,
  65.                 2));
  66.         try {
  67.         Thread.sleep(2);
  68.         } catch (InterruptedException e) {
  69.         e.printStackTrace();
  70.         }
  71.         getClient().sendPacket(
  72.             new Packet18Animation(getClient().getMinecraft().thePlayer,
  73.                 3));
  74.         break;
  75.     default:
  76.         packet.yaw = getClient().getRNG().nextInt(360);
  77.         packet.pitch = getClient().getRNG().nextInt(360);
  78.         getClient().sendPacket(
  79.             new Packet18Animation(getClient().getMinecraft().thePlayer,
  80.                 1));
  81.         break;
  82.     }
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement