Beispiel #1
0
  public void c(OEntityPlayerMP paramOEntityPlayerMP) {
    int i = (int) paramOEntityPlayerMP.aK >> 4;
    int j = (int) paramOEntityPlayerMP.aM >> 4;

    double d1 = paramOEntityPlayerMP.d - paramOEntityPlayerMP.aK;
    double d2 = paramOEntityPlayerMP.e - paramOEntityPlayerMP.aM;
    double d3 = d1 * d1 + d2 * d2;
    if (d3 < 64.0D) return;

    int k = (int) paramOEntityPlayerMP.d >> 4;
    int m = (int) paramOEntityPlayerMP.e >> 4;

    int n = i - k;
    int i1 = j - m;
    if ((n == 0) && (i1 == 0)) return;

    // CanaryMod speed up teleporting.
    if (n > 10 || n < -10 || i1 > 10 || i1 < -10) {
      b(paramOEntityPlayerMP);
      a(paramOEntityPlayerMP);
      return;
    }

    for (int i2 = i - 10; i2 <= i + 10; i2++)
      for (int i3 = j - 10; i3 <= j + 10; i3++) {
        if (!a(i2, i3, k, m)) a(i2, i3, true).a(paramOEntityPlayerMP);
        if (!a(i2 - n, i3 - i1, i, j)) {
          OPlayerInstance localOPlayerInstance = a(i2 - n, i3 - i1, false);
          if (localOPlayerInstance == null) continue;
          localOPlayerInstance.b(paramOEntityPlayerMP);
        }
      }
    paramOEntityPlayerMP.d = paramOEntityPlayerMP.aK;
    paramOEntityPlayerMP.e = paramOEntityPlayerMP.aM;
  }
Beispiel #2
0
 public void a(int paramInt1, int paramInt2, int paramInt3) {
   int i = paramInt1 >> 4;
   int j = paramInt3 >> 4;
   OPlayerInstance localOPlayerInstance = a(i, j, false);
   if (localOPlayerInstance != null)
     localOPlayerInstance.a(paramInt1 & 0xF, paramInt2, paramInt3 & 0xF);
 }
Beispiel #3
0
 // CanaryMod: bring back old "send packet to chunk" method from alpha
 public void sendPacketToChunk(OPacket packetToSend, int globalx, int globaly, int globalz) {
   // Get chunk coordinates
   int chunkx = globalx >> 4;
   int chunkz = globalz >> 4;
   // Get the chunk
   OPlayerInstance localat = a(chunkx, chunkz, false);
   // if chunk != null, send packet
   if (localat != null) localat.a(packetToSend);
 }
Beispiel #4
0
  public void b(OEntityPlayerMP paramOEntityPlayerMP) {
    int i = (int) paramOEntityPlayerMP.d >> 4;
    int j = (int) paramOEntityPlayerMP.e >> 4;

    for (int k = i - 10; k <= i + 10; k++)
      for (int m = j - 10; m <= j + 10; m++) {
        OPlayerInstance localOPlayerInstance = a(k, m, false);
        if (localOPlayerInstance == null) continue;
        localOPlayerInstance.b(paramOEntityPlayerMP);
      }
    a.remove(paramOEntityPlayerMP);
  }