From b0834fb640703442ce37ad9ed9f380bc46a8aeb8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 10 Aug 2019 11:06:41 +0200 Subject: [PATCH] Fixed brightness and solar panels in space/hyperspace --- .../warpdrive/world/HyperSpaceWorldProvider.java | 13 ++++++++++--- .../cr0s/warpdrive/world/SpaceWorldProvider.java | 15 +++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/world/HyperSpaceWorldProvider.java b/src/main/java/cr0s/warpdrive/world/HyperSpaceWorldProvider.java index 48fafd1c..0954ce17 100644 --- a/src/main/java/cr0s/warpdrive/world/HyperSpaceWorldProvider.java +++ b/src/main/java/cr0s/warpdrive/world/HyperSpaceWorldProvider.java @@ -24,6 +24,13 @@ public class HyperSpaceWorldProvider extends AbstractWorldProvider { nether = true; } + @Override + protected void init() { + super.init(); + + world.setSeaLevel(0); + } + @Nonnull @Override public DimensionType getDimensionType() { @@ -69,18 +76,18 @@ public class HyperSpaceWorldProvider extends AbstractWorldProvider { @Override public float calculateCelestialAngle(final long time, final float partialTick) { // returns the clock angle: 0 is noon, 0.5 is midnight on the vanilla clock - // daylight is required to enable IC2 and EnderIO solar panels + // daylight is required to enable IC2, NuclearCraft and EnderIO solar panels // we want no solar power in hyperspace => permanent midnight return 0.5F; } @Override protected void generateLightBrightnessTable() { - final float f = 0.0F; + final float ambient = 0.1F; for (int i = 0; i <= 15; ++i) { final float f1 = 1.0F - i / 15.0F; - lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - ambient) + ambient; } } diff --git a/src/main/java/cr0s/warpdrive/world/SpaceWorldProvider.java b/src/main/java/cr0s/warpdrive/world/SpaceWorldProvider.java index c578b831..d81057d7 100644 --- a/src/main/java/cr0s/warpdrive/world/SpaceWorldProvider.java +++ b/src/main/java/cr0s/warpdrive/world/SpaceWorldProvider.java @@ -24,6 +24,13 @@ public class SpaceWorldProvider extends AbstractWorldProvider { nether = false; } + @Override + protected void init() { + super.init(); + + world.setSeaLevel(0); + } + @Nonnull @Override public DimensionType getDimensionType() { @@ -69,17 +76,17 @@ public class SpaceWorldProvider extends AbstractWorldProvider { @Override public float calculateCelestialAngle(final long time, final float partialTick) { // returns the clock angle: 0 is noon, 0.5 is midnight on the vanilla clock - // daylight is required to enable IC2 and EnderIO solar panels - return 0.5F; + // daylight is required to enable IC2, NuclearCraft and EnderIO solar panels + return 0.0F; } @Override protected void generateLightBrightnessTable() { - final float f = 0.0F; + final float ambient = 0.0F; for (int i = 0; i <= 15; ++i) { final float f1 = 1.0F - i / 15.0F; - lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - ambient) + ambient; } }