public void setAddress(int address) { if (this.worldObj != null && address != this.address) { ShortRangeTelepadHandler.removeShortRangeTeleporter(this); } this.address = address; if (this.address >= 0) { ShortRangeTelepadHandler.TelepadEntry entry = ShortRangeTelepadHandler.getLocationFromAddress(this.address); this.addressValid = entry == null || (this.worldObj != null && (entry.dimensionID == this.worldObj.provider.getDimensionId() && entry.position.x == this.getPos().getX() && entry.position.y == this.getPos().getY() && entry.position.z == this.getPos().getZ())); } else { this.addressValid = false; } if (worldObj != null && !worldObj.isRemote) { ShortRangeTelepadHandler.addShortRangeTelepad(this); } }