Either write this entity to the NBT tag given and return true, or return false without doing anything. If this returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider.
(NBTTagCompound tagCompund)
| 1640 | * rider. |
| 1641 | */ |
| 1642 | public boolean writeToNBTOptional(NBTTagCompound tagCompund) |
| 1643 | { |
| 1644 | String s = this.getEntityString(); |
| 1645 | |
| 1646 | if (!this.isDead && s != null && this.riddenByEntity == null) |
| 1647 | { |
| 1648 | tagCompund.setString("id", s); |
| 1649 | this.writeToNBT(tagCompund); |
| 1650 | return true; |
| 1651 | } |
| 1652 | else |
| 1653 | { |
| 1654 | return false; |
| 1655 | } |
| 1656 | } |
| 1657 | |
| 1658 | /** |
| 1659 | * Save the entity to NBT (calls an abstract helper method to write extra data) |
no test coverage detected