Advertisement
Guest User

Code

a guest
Dec 19th, 2011
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.35 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3) braces deadcode fieldsfirst
  4.  
  5. package net.minecraft.src;
  6.  
  7. import net.minecraft.client.Minecraft;
  8.  
  9. // Referenced classes of package net.minecraft.src:
  10. // EntityPlayerSP, MathHelper, World, Packet19EntityAction,
  11. // NetClientHandler, AxisAlignedBB, Packet11PlayerPosition, Packet13PlayerLookMove,
  12. // Packet12PlayerLook, Packet10Flying, Packet14BlockDig, Packet3Chat,
  13. // Packet18Animation, Packet9Respawn, Packet101CloseWindow, Container,
  14. // InventoryPlayer, StatBase, Session, DamageSource,
  15. // EntityItem
  16.  
  17. public class EntityClientPlayerMP extends EntityPlayerSP
  18. {
  19.  
  20. public NetClientHandler sendQueue;
  21. private int inventoryUpdateTickCounter;
  22. private boolean field_21093_bH;
  23. private double oldPosX;
  24. private double field_9378_bz;
  25. private double oldPosY;
  26. private double oldPosZ;
  27. private float oldRotationYaw;
  28. private float oldRotationPitch;
  29. private boolean field_9382_bF;
  30. private boolean field_35227_cs;
  31. private boolean wasSneaking;
  32. private int field_12242_bI;
  33.  
  34. public EntityClientPlayerMP(Minecraft minecraft, World world, Session session, NetClientHandler netclienthandler)
  35. {
  36. super(minecraft, world, session, 0);
  37. if(Hacks.fly)
  38. {
  39. onGround = false;
  40. }
  41. inventoryUpdateTickCounter = 0;
  42. field_21093_bH = false;
  43. field_9382_bF = false;
  44. field_35227_cs = false;
  45. wasSneaking = false;
  46. field_12242_bI = 0;
  47. sendQueue = netclienthandler;
  48. }
  49.  
  50. public boolean attackEntityFrom(DamageSource damagesource, int i)
  51. {
  52. return false;
  53. }
  54.  
  55. public void heal(int i)
  56. {
  57. }
  58.  
  59. public void onUpdate()
  60. {
  61. if(!worldObj.blockExists(MathHelper.floor_double(posX), worldObj.field_35472_c / 2, MathHelper.floor_double(posZ)))
  62. {
  63. return;
  64. } else
  65. {
  66. super.onUpdate();
  67. onUpdate2();
  68. return;
  69. }
  70. }
  71.  
  72. public void onUpdate2()
  73. {
  74. if(Hacks.nofall)
  75. {
  76. sendQueue.addToSendQueue(new Packet11PlayerPosition(motionX, -999D, -999D, motionZ, !onGround));
  77. }
  78. if(inventoryUpdateTickCounter++ == 20)
  79. {
  80. sendInventoryChanged();
  81. inventoryUpdateTickCounter = 0;
  82. if(Hacks.forcefield)
  83. {
  84. for(int i = 0; i < mc.theWorld.loadedEntityList.size(); i++)
  85. {
  86. if((Entity)mc.theWorld.loadedEntityList.get(i) != this && getDistanceSqToEntity((Entity)mc.theWorld.loadedEntityList.get(i)) < 25D && ((Entity)mc.theWorld.loadedEntityList.get(i) instanceof EntityLiving));
  87. {
  88. mc.playerController.attackEntity(this, (Entity)mc.theWorld.loadedEntityList.get(i));
  89. }
  90. }
  91. }
  92. }
  93. boolean flag = isSprinting();
  94. if(flag != wasSneaking)
  95. {
  96. if(flag)
  97. {
  98. sendQueue.addToSendQueue(new Packet19EntityAction(this, 4));
  99. } else
  100. {
  101. sendQueue.addToSendQueue(new Packet19EntityAction(this, 5));
  102. }
  103. wasSneaking = flag;
  104. }
  105. boolean flag1 = Hacks.sneak;
  106. if(flag1 != field_35227_cs)
  107. {
  108. if(flag1)
  109. {
  110. sendQueue.addToSendQueue(new Packet19EntityAction(this, 1));
  111. } else
  112. {
  113. sendQueue.addToSendQueue(new Packet19EntityAction(this, 2));
  114. }
  115. field_35227_cs = flag1;
  116. }
  117. double d = posX - oldPosX;
  118. double d1 = boundingBox.minY - field_9378_bz;
  119. double d2 = posY - oldPosY;
  120. double d3 = posZ - oldPosZ;
  121. double d4 = rotationYaw - oldRotationYaw;
  122. double d5 = rotationPitch - oldRotationPitch;
  123. boolean flag2 = d1 != 0.0D || d2 != 0.0D || d != 0.0D || d3 != 0.0D;
  124. boolean flag3 = d4 != 0.0D || d5 != 0.0D;
  125. if(ridingEntity != null)
  126. {
  127. if(flag3)
  128. {
  129. sendQueue.addToSendQueue(new Packet11PlayerPosition(motionX, -999D, -999D, motionZ, onGround));
  130. } else
  131. {
  132. sendQueue.addToSendQueue(new Packet13PlayerLookMove(motionX, -999D, -999D, motionZ, rotationYaw, rotationPitch, onGround));
  133. }
  134. flag2 = false;
  135. } else
  136. if(flag2 && flag3)
  137. {
  138. sendQueue.addToSendQueue(new Packet13PlayerLookMove(posX, boundingBox.minY, posY, posZ, rotationYaw, rotationPitch, onGround));
  139. field_12242_bI = 0;
  140. } else
  141. if(flag2)
  142. {
  143. sendQueue.addToSendQueue(new Packet11PlayerPosition(posX, boundingBox.minY, posY, posZ, onGround));
  144. field_12242_bI = 0;
  145. } else
  146. if(flag3)
  147. {
  148. sendQueue.addToSendQueue(new Packet12PlayerLook(rotationYaw, rotationPitch, onGround));
  149. field_12242_bI = 0;
  150. } else
  151. {
  152. sendQueue.addToSendQueue(new Packet10Flying(onGround));
  153. if(field_9382_bF != onGround || field_12242_bI > 200)
  154. {
  155. field_12242_bI = 0;
  156. } else
  157. {
  158. field_12242_bI++;
  159. }
  160. }
  161. field_9382_bF = onGround;
  162. if(flag2)
  163. {
  164. oldPosX = posX;
  165. field_9378_bz = boundingBox.minY;
  166. oldPosY = posY;
  167. oldPosZ = posZ;
  168. }
  169. if(flag3)
  170. {
  171. oldRotationYaw = rotationYaw;
  172. oldRotationPitch = rotationPitch;
  173. }
  174. }
  175.  
  176. public void dropCurrentItem()
  177. {
  178. sendQueue.addToSendQueue(new Packet14BlockDig(4, 0, 0, 0, 0));
  179. }
  180.  
  181. public void sendInventoryChanged()
  182. {
  183. }
  184.  
  185. protected void joinEntityItemWithWorld(EntityItem entityitem)
  186. {
  187. }
  188.  
  189. public void sendChatMessage(String s)
  190. {
  191. if(s.startsWith(".credits"))
  192. mc.thePlayer.addChatMessage("Client Do TeamRain");
  193. mc.thePlayer.addChatMessage("Coded By Amehecka");
  194. mc.thePlayer.addChatMessage("Ideias para features by Soul");
  195. return;
  196.  
  197. {
  198. mc.thePlayer.addChatMessage("Bem vindo ao menu de keys!");
  199. mc.thePlayer.addChatMessage(".norender - No Render = Nao atualiza os blocos quando você quebra eles.");
  200. mc.thePlayer.addChatMessage(".fp - Fastplace = Coloca os blocos 3x mais rápido.");
  201. mc.thePlayer.addChatMessage(".coord - Coordenadas/Seed = Mostra na tela as cordenadas/seeds");
  202. return;
  203. }
  204. if(s.startsWith(".norender"))
  205. {
  206. mc.thePlayer.addChatMessage("= Para abrir menu.");
  207. mc.thePlayer.addChatMessage("Z - Sneak = Se camufla atrás de blocos.");
  208. mc.thePlayer.addChatMessage("U - Speedy = Quebra o bloco 2x mais rápido.");
  209. mc.thePlayer.addChatMessage("J - Jump = Um pulo maior.");
  210. mc.thePlayer.addChatMessage("K - Step = Deixa você andar por cima de 3x mais blocos.");
  211. mc.thePlayer.addChatMessage("X - XRay = Mostra algumas ores.");
  212. mc.thePlayer.addChatMessage("C - Fullbright = Deixa tudo claro.");
  213. mc.thePlayer.addChatMessage("G - Push = Você entra em mobs/players começa a empurrar eles.");
  214. mc.thePlayer.addChatMessage("F - Fly = Você voa.");
  215. return;
  216. }
  217. if(s.startsWith(".norender"))
  218. {
  219. Hacks.norender = !Hacks.norender;
  220. mc.thePlayer.addChatMessage("Norender ativado/desativado.");
  221. return;
  222. }
  223. if(s.startsWith(".coord"))
  224. {
  225. Hacks.coord = !Hacks.coord;
  226. mc.thePlayer.addChatMessage("Cordenadas ativadas/desativadas.");
  227. return;
  228. }
  229. if(s.startsWith(".fp"))
  230. {
  231. Hacks.fastplace = !Hacks.fastplace;
  232. mc.thePlayer.addChatMessage("Fastplace ativado/desativado");
  233. return;
  234. }
  235.  
  236. if(s.startsWith(".help"))
  237. {
  238. mc.thePlayer.addChatMessage("Menu de ajuda do client RainCraft.");
  239. mc.thePlayer.addChatMessage("Para ver as keys, digite : .keys");
  240. mc.thePlayer.addChatMessage("Para ver os comandos por chat digite : .commands");
  241. mc.thePlayer.addChatMessage("Para ver os créditos digite : .credits");
  242. return;
  243. }
  244. if(s.startsWith(".menu"))
  245. {
  246. Hacks.menu = !Hacks.menu;
  247. return;
  248. }
  249. if(s.startsWith(".fb"))
  250. { mc.renderGlobal.loadRenderers();
  251. Hacks.fb = !Hacks.fb;
  252. return;
  253. }
  254. if(s.startsWith(".xray"))
  255. {
  256. mc.renderGlobal.loadRenderers();
  257.  
  258. Hacks.xray = !Hacks.xray;
  259. return;
  260. }
  261. if(s.startsWith(".follow"))
  262. {
  263. Hacks.follow = !Hacks.follow;
  264. return;
  265. }
  266. sendQueue.addToSendQueue(new Packet3Chat(s));
  267. }
  268.  
  269. public void swingItem()
  270. {
  271. super.swingItem();
  272. if(Hacks.noswing)
  273. {
  274.  
  275. }else
  276. {
  277. sendQueue.addToSendQueue(new Packet18Animation(this, 1));
  278. }
  279.  
  280.  
  281. }
  282.  
  283. public void respawnPlayer()
  284. {
  285. sendInventoryChanged();
  286. sendQueue.addToSendQueue(new Packet9Respawn((byte)dimension, (byte)worldObj.difficultySetting, worldObj.getWorldSeed(), worldObj.field_35472_c, 0));
  287. }
  288.  
  289. protected void damageEntity(DamageSource damagesource, int i)
  290. {
  291. setEntityHealth(getEntityHealth() - i);
  292. }
  293.  
  294. public void closeScreen()
  295. {
  296. sendQueue.addToSendQueue(new Packet101CloseWindow(craftingInventory.windowId));
  297. inventory.setItemStack(null);
  298. super.closeScreen();
  299. }
  300.  
  301. public void setHealth(int i)
  302. {
  303. if(field_21093_bH)
  304. {
  305. super.setHealth(i);
  306. } else
  307. {
  308. setEntityHealth(i);
  309. field_21093_bH = true;
  310. }
  311. }
  312.  
  313. public void addStat(StatBase statbase, int i)
  314. {
  315. if(statbase == null)
  316. {
  317. return;
  318. }
  319. if(statbase.isIndependent)
  320. {
  321. super.addStat(statbase, i);
  322. }
  323. }
  324.  
  325. public void func_27027_b(StatBase statbase, int i)
  326. {
  327. if(statbase == null)
  328. {
  329. return;
  330. }
  331. if(!statbase.isIndependent)
  332. {
  333. super.addStat(statbase, i);
  334. }
  335. }
  336. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement