{
final SpaceStationRecipe recipe = WorldUtil.getSpaceStationRecipe(this.selectedBody.getDimensionID());
if (recipe != null && recipe.matches(this.mc.thePlayer, false))
{
GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_BIND_SPACE_STATION_ID, new Object[] { this.selectedBody.getDimensionID() }));
//Zoom in on Overworld to show the new SpaceStation if not already zoomed
if (this.selectionCount < 2)
{
this.selectionCount = 2;
this.preSelectZoom = this.zoom;
this.ticksSinceSelection = 0;
this.doneZooming = false;
}
}
clickHandled = true;
}
}
}
if (this.mapMode)
{
if (x > width - BORDER_WIDTH - BORDER_EDGE_WIDTH - 88 && x < width - BORDER_WIDTH - BORDER_EDGE_WIDTH && y > BORDER_WIDTH + BORDER_EDGE_WIDTH && y < BORDER_WIDTH + BORDER_EDGE_WIDTH + 13)
{
this.mc.displayGuiScreen(null);
this.mc.setIngameFocus();
clickHandled = true;
}
}
if (this.selectedBody != null && !this.mapMode)
{
if (x > width - BORDER_WIDTH - BORDER_EDGE_WIDTH - 88 && x < width - BORDER_WIDTH - BORDER_EDGE_WIDTH && y > BORDER_WIDTH + BORDER_EDGE_WIDTH && y < BORDER_WIDTH + BORDER_EDGE_WIDTH + 13)
{
if (!(this.selectedBody instanceof Satellite) || !this.selectedStationOwner.equals(""))
{
this.teleportToSelectedBody();
}
clickHandled = true;
}
}
// Need unscaled mouse coords
int mouseX = Mouse.getX();
int mouseY = Mouse.getY() * -1 + Minecraft.getMinecraft().displayHeight - 1;
if (this.selectedBody instanceof Satellite)
{
if (this.renamingSpaceStation)
{
if (x >= width / 2 - 90 && x <= width / 2 + 90 && y >= this.height / 2 - 38 && y <= this.height / 2 + 38)
{
// Apply
if (x >= width / 2 - 90 + 17 && x <= width / 2 - 90 + 17 + 72 && y >= this.height / 2 - 38 + 59 && y <= this.height / 2 - 38 + 59 + 12)
{
String strName = this.mc.thePlayer.getGameProfile().getName();
Integer spacestationID = this.spaceStationIDs.get(strName);
if (spacestationID == null) spacestationID = this.spaceStationIDs.get(strName.toLowerCase());
if (spacestationID != null)
{
this.spaceStationNames.put(strName, this.renamingString);
GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_RENAME_SPACE_STATION, new Object[] { this.renamingString, spacestationID }));
}
this.renamingSpaceStation = false;
}
// Cancel
if (x >= width / 2 && x <= width / 2 + 72 && y >= this.height / 2 - 38 + 59 && y <= this.height / 2 - 38 + 59 + 12)