Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
glowredman committed May 16, 2023
1 parent a98b13f commit 0ced96f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,16 @@ protected boolean isSiblingOf(final CelestialBody celestialBody, final Mothershi
}

protected List<Mothership> getMothershipListToRender() {
final LinkedList<Mothership> result = new LinkedList<>();
final List<Mothership> result = new LinkedList<>();

if (this.selectedBody != null) {
final MothershipWorldData msData = TickHandlerServer.mothershipData;

for (final Mothership ms : msData.getMotherships().values()) {
if ((ms == this.selectedBody || ms.getParent() == this.selectedBody && this.selectionCount != 1)
&& (this.ticksSinceSelection > 35 || this.selectedBody == ms
|| this.lastSelectedBody instanceof Mothership
&& ((Mothership) this.lastSelectedBody).getParent().equals(ms))
|| this.lastSelectedBody instanceof Mothership ship
&& ship.getParent().equals(ms))
|| this.isSiblingOf(this.selectedBody, ms)) {
result.add(ms);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public GuiShuttleSelection(final MapMode mapMode, final List<CelestialBody> poss
}

protected CelestialBody getParent(final CelestialBody body) {
if (body instanceof IChildBody) {// satellite apparently implements this already?
return ((IChildBody) body).getParentPlanet();
if (body instanceof IChildBody child) {// satellite apparently implements this already?
return child.getParentPlanet();
}
if (body instanceof Mothership) {
return ((Mothership) body).getParent();
if (body instanceof Mothership ship) {
return ship.getParent();
}
return body;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ public Chunk provideChunk(int p_73154_1_, int p_73154_2_) {

final Chunk chunk = new Chunk(this.worldObjNonPrivate, ids, meta, p_73154_1_, p_73154_2_);

final byte[] biomesArray = chunk.getBiomeArray();
for (int i = 0; i < biomesArray.length; ++i) {
biomesArray[i] = (byte) BiomeGenBaseOrbit.space.biomeID;
}
Arrays.fill(chunk.getBiomeArray(), (byte) BiomeGenBaseOrbit.space.biomeID);

chunk.generateSkylightMap();
return chunk;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public Mothership getByMothershipId(final int id) {
}

public Mothership getByName(final String name) {
return this.mothershipIdList.values().stream().filter(t -> t.getName().equals(name)).findFirst().orElse(null);
return this.mothershipIdList.values().stream().filter(ship -> ship.getName().equals(name)).findFirst().orElse(null);
}

@Override
Expand Down

0 comments on commit 0ced96f

Please sign in to comment.