Advertisement
Guest User

Untitled

a guest
Jul 19th, 2015
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. My goal is having my TE execute the method vent() after is spits the output item. The thing is, of course, that it does not work. I decompiled Thaumcraft and saw that when the process is finished it sends a packet to all nearby client that executes a method that then leads to vent().
  2. I've tried to make one myself but since I've never done packets before I got lost pretty quickly....
  3. for example, in onMessageReceived, I can't even find a way to get my TE since there's no World in the signature...
  4.  
  5. public void vent() {
  6. if(this.worldObj.isRemote) {
  7. this.venting = -1;
  8. float fx = 0.1F - this.worldObj.rand.nextFloat() * 0.2F;
  9. float fz = 0.1F - this.worldObj.rand.nextFloat() * 0.2F;
  10. float fy = 0.1F - this.worldObj.rand.nextFloat() * 0.2F;
  11. float fx2 = 0.1F - this.worldObj.rand.nextFloat() * 0.2F;
  12. float fz2 = 0.1F - this.worldObj.rand.nextFloat() * 0.2F;
  13. float fy2 = 0.1F - this.worldObj.rand.nextFloat() * 0.2F;
  14. int color = 16777215;
  15. Thaumcraft.proxy.drawVentParticles(this.worldObj, this.xCoord + 0.5F + fx + this.face.offsetX / 2.0F, this.yCoord + 0.5F + fy, this.zCoord + 0.5F + fz + this.face.offsetZ / 2.0F, this.face.offsetX / 4.0F + fx2, fy2, this.face.offsetZ / 4.0F + fz2, color);
  16.  
  17. }
  18. }
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. private void EjectItems() {
  28.  
  29.  
  30. TileEntity inv = this.worldObj.getTileEntity(this.xCoord + this.face.offsetX, this.yCoord + this.face.offsetY, this.zCoord + this.face.offsetZ);
  31. if ((inv != null) && ((inv instanceof IInventory))) {
  32. insertItems();
  33. } else {
  34. spitItems(); vent();
  35. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement