@Redirect(
     method = "collideWithPlayer",
     at = @At(value = "INVOKE", target = PLAYER_COLLIDE_ENTITY))
 public void onPlayerCollideEntity(net.minecraft.entity.Entity entity, EntityPlayer player) {
   this.collidingEntityUuid = entity.getUniqueID();
   entity.onCollideWithPlayer(player);
   this.collidingEntityUuid = null;
 }
示例#2
0
 public void func_181140_a(Entity p_181140_1_) {
   if (p_181140_1_ != null
       && !(p_181140_1_ instanceof EntityPlayer)
       && !p_181140_1_.isEntityAlive()) {
     String s = p_181140_1_.getUniqueID().toString();
     this.removeObjectiveFromEntity(s, (ScoreObjective) null);
     this.removePlayerFromTeams(s);
   }
 }
示例#3
0
 @Override
 public Optional<Entity> getEntity(UUID uuid) {
   // Note that MixinWorldServer is properly overriding this to use it's own mapping.
   for (net.minecraft.entity.Entity entity : this.loadedEntityList) {
     if (entity.getUniqueID().equals(uuid)) {
       return Optional.of((Entity) entity);
     }
   }
   return Optional.empty();
 }
  @Override
  public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer player, Entity entity) {
    if (itemStack.getItemDamage() != 19) return false;

    // Frequency module
    if (!player.worldObj.isRemote && entity != null && !(entity instanceof EntityPlayer)) {
      if (itemStack.stackTagCompound == null) {
        itemStack.setTagCompound(new NBTTagCompound());
      }

      itemStack.stackTagCompound.setLong(
          "linkedUUIDMost", entity.getUniqueID().getMostSignificantBits());
      itemStack.stackTagCompound.setLong(
          "linkedUUIDLeast", entity.getUniqueID().getLeastSignificantBits());

      player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.tracking.message")));
      return true;
    }
    return false;
  }
示例#5
0
 @Override
 public void collideWithEntity(Entity entity) {
   if (target != null) {
     if (entity.getUniqueID().compareTo(target.getUniqueID()) == 0) {
       target.attackEntityFrom(DamageSource.generic, damage);
       this.getEntityWorld().removeEntity(this);
       for (int i = 0; i < 80; i++) {
         Roots.proxy.spawnParticleMagicAuraFX(
             getEntityWorld(),
             posX,
             posY + height / 2.0f,
             posZ,
             Math.pow(1.15f * (random.nextFloat() - 0.5f), 3.0),
             Math.pow(1.15f * (random.nextFloat() - 0.5f), 3.0),
             Math.pow(1.15f * (random.nextFloat() - 0.5f), 3.0),
             76,
             230,
             0);
       }
     }
   }
 }