public Packet getDescriptionPacket() {
    S35PacketUpdateTileEntity datapacket = null;
    NBTTagCompound blockinfo = new NBTTagCompound();
    if (blockinfo.toString() != "") {
      this.writeToNBT(blockinfo);
    }

    datapacket = new S35PacketUpdateTileEntity(this.getPos(), 5, blockinfo);
    return datapacket;
  }
Beispiel #2
0
  public IChatComponent func_151000_E() {
    IChatComponent ichatcomponent =
        (new ChatComponentText("[")).appendText(this.getDisplayName()).appendText("]");

    if (this.field_151002_e != null) {
      NBTTagCompound nbttagcompound = new NBTTagCompound();
      this.writeToNBT(nbttagcompound);
      ichatcomponent
          .getChatStyle()
          .setChatHoverEvent(
              new HoverEvent(
                  HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString())));
      ichatcomponent.getChatStyle().setColor(this.getRarity().rarityColor);
    }

    return ichatcomponent;
  }
  public ItemStack compact(EntityLiving entity) {
    int id = EntityList.getEntityID(entity);
    ItemStack holder = new ItemStack(CompactMobsItems.fullMobHolder, 1);
    NBTTagCompound nbttag = holder.stackTagCompound;
    if (nbttag == null) {
      nbttag = new NBTTagCompound();
    }
    nbttag.setInteger("entityId", id);

    if (entity instanceof EntityAgeable) {
      EntityAgeable entityAge = (EntityAgeable) entity;
      nbttag.setInteger("entityGrowingAge", entityAge.getGrowingAge());
    }

    if (entity instanceof EntitySheep) {
      EntitySheep entitySheep = (EntitySheep) entity;
      nbttag.setBoolean("entitySheared", entitySheep.getSheared());
      nbttag.setInteger("entityColor", entitySheep.getFleeceColor());
    }

    if (CompactMobsCore.instance.useFullTagCompound) {
      NBTTagCompound entityTags = new NBTTagCompound();

      NBTTagCompound var2 = new NBTTagCompound();
      entity.writeToNBT(var2);

      nbttag.setCompoundTag("entityTags", var2);
      CompactMobsCore.instance.cmLog.info(var2.toString());
    }

    String name = entity.getEntityName();
    nbttag.setString("name", name);
    holder.setItemDamage(id);

    holder.setTagCompound(nbttag);
    entity.worldObj.removeEntity(entity);
    return holder;
  }
Beispiel #4
0
  public IChatComponent C() {
    ChatComponentText chatcomponenttext = new ChatComponentText(this.q());

    if (this.s()) {
      chatcomponenttext.b().b(Boolean.valueOf(true));
    }

    IChatComponent ichatcomponent = (new ChatComponentText("[")).a(chatcomponenttext).a("]");

    if (this.d != null) {
      NBTTagCompound nbttagcompound = new NBTTagCompound();

      this.b(nbttagcompound);
      ichatcomponent
          .b()
          .a(
              new HoverEvent(
                  HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString())));
      ichatcomponent.b().a(this.u().e);
    }

    return ichatcomponent;
  }
 @Override
 public String toString() {
   NBTTagCompound tags = new NBTTagCompound();
   writeEntityToNBT(tags);
   return tags.toString();
 }
Beispiel #6
0
 @Override
 public String toString() {
   return uuid.toString() + ", " + tags.toString();
 }