diff --git a/src/generated/resources/data/gcyr/worldgen/biome/space.json b/src/generated/resources/data/gcyr/worldgen/biome/space.json index d6c42016..4754f07a 100644 --- a/src/generated/resources/data/gcyr/worldgen/biome/space.json +++ b/src/generated/resources/data/gcyr/worldgen/biome/space.json @@ -1,6 +1,6 @@ { "carvers": {}, - "downfall": 0.5, + "downfall": 0.0, "effects": { "fog_color": 12638463, "sky_color": 8103167, @@ -8,7 +8,7 @@ "water_fog_color": 329011 }, "features": [], - "has_precipitation": true, + "has_precipitation": false, "spawn_costs": {}, "spawners": { "ambient": [], diff --git a/src/main/java/argent_matter/gcyr/common/data/GCYRBiomes.java b/src/main/java/argent_matter/gcyr/common/data/GCYRBiomes.java index 1f87b6e2..09387d85 100644 --- a/src/main/java/argent_matter/gcyr/common/data/GCYRBiomes.java +++ b/src/main/java/argent_matter/gcyr/common/data/GCYRBiomes.java @@ -30,15 +30,28 @@ public static void bootstrap(BootstapContext ctx) { public static Biome space(HolderGetter placedFeatures, HolderGetter> worldCarvers) { BiomeGenerationSettings.Builder builder = new BiomeGenerationSettings.Builder(placedFeatures, worldCarvers); - return biome(0.0f, 0.5F, 0.5F, new MobSpawnSettings.Builder(), builder, null); + return biome(0.0f, 0.5F, false, new MobSpawnSettings.Builder(), builder, null); } - private static Biome biome(float downfall, float temp, float rainfall, MobSpawnSettings.Builder spawn, BiomeGenerationSettings.Builder gen, @Nullable Music music) { - return biome(downfall, temp, rainfall, 4159204, 329011, spawn, gen, music); + private static Biome biome(float downfall, float temp, boolean hasRain, MobSpawnSettings.Builder spawn, BiomeGenerationSettings.Builder gen, @Nullable Music music) { + return biome(downfall, temp, hasRain, 4159204, 329011, spawn, gen, music); } - private static Biome biome(float downfall, float temp, float rainfall, int waterColor, int waterFogColor, MobSpawnSettings.Builder mobSpawning, BiomeGenerationSettings.Builder generation, @Nullable Music music) { - return new Biome.BiomeBuilder().downfall(downfall).temperature(temp).downfall(rainfall).specialEffects((new BiomeSpecialEffects.Builder()).waterColor(waterColor).waterFogColor(waterFogColor).fogColor(12638463).skyColor(calculateSkyColor(temp)).backgroundMusic(music).build()).mobSpawnSettings(mobSpawning.build()).generationSettings(generation.build()).build(); + private static Biome biome(float downfall, float temp, boolean hasRain, int waterColor, int waterFogColor, MobSpawnSettings.Builder mobSpawning, BiomeGenerationSettings.Builder generation, @Nullable Music music) { + return new Biome.BiomeBuilder() + .downfall(downfall) + .temperature(temp) + .hasPrecipitation(hasRain) + .specialEffects(new BiomeSpecialEffects.Builder() + .waterColor(waterColor) + .waterFogColor(waterFogColor) + .fogColor(12638463) + .skyColor(calculateSkyColor(temp)) + .backgroundMusic(music) + .build()) + .mobSpawnSettings(mobSpawning.build()) + .generationSettings(generation.build()) + .build(); } protected static int calculateSkyColor(float temperature) { diff --git a/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java b/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java index 3d0a7157..7091c0d5 100644 --- a/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java +++ b/src/main/java/argent_matter/gcyr/common/data/GCYREntityDataSerializers.java @@ -70,11 +70,7 @@ public List read(FriendlyByteBuf buffer) { @Override public List copy(List value) { - ArrayList newValue = new ArrayList<>(); - for (PosWithState val : value) { - newValue.add(new PosWithState(val.pos(), val.state())); - } - return newValue; + return new ArrayList<>(value); } }; diff --git a/src/main/java/argent_matter/gcyr/common/entity/RocketEntity.java b/src/main/java/argent_matter/gcyr/common/entity/RocketEntity.java index ce0421f6..6e40a029 100644 --- a/src/main/java/argent_matter/gcyr/common/entity/RocketEntity.java +++ b/src/main/java/argent_matter/gcyr/common/entity/RocketEntity.java @@ -136,9 +136,6 @@ public class RocketEntity extends Entity implements HasCustomInventoryScreen, IU private final Set thrusterPositions = new HashSet<>(); - @Getter - private ThreadLocal hasRequestedBlockSync = ThreadLocal.withInitial(() -> false); - public RocketEntity(EntityType entityType, Level level) { super(entityType, level); @@ -458,7 +455,7 @@ public boolean countdown() { // movement must happen both server + client side public void flightMovement() { var vec = getDeltaMovement(); - if (speed < getRocketSpeed()-0.01) { + if (speed < getRocketSpeed() - 0.01) { speed += 0.05; } @@ -871,13 +868,21 @@ public void addBlock(PosWithState state) { // resolve average tier of used motors this.motorTiersTotal += rocketMotorBlock.getTier(); - this.motorTier = this.motorTiersTotal / this.partCounts.object2IntEntrySet().stream().filter(p -> p.getKey() instanceof RocketMotorBlock).map(Map.Entry::getValue).reduce(0, Integer::sum); + this.motorTier = this.motorTiersTotal / this.partCounts.object2IntEntrySet() + .stream() + .filter(p -> p.getKey() instanceof RocketMotorBlock) + .map(Map.Entry::getValue) + .reduce(0, Integer::sum); } else if (block instanceof FuelTankBlock fuelTankBlock) { this.setFuelCapacity(this.getFuelCapacity() + fuelTankBlock.getTankProperties().getFuelStorage()); // resolve average tier of used fuel tanks this.fuelTankTiersTotal += fuelTankBlock.getTier(); - this.fuelTankTier = this.fuelTankTiersTotal / this.partCounts.object2IntEntrySet().stream().filter(p -> p.getKey() instanceof FuelTankBlock).map(Map.Entry::getValue).reduce(0, Integer::sum); + this.fuelTankTier = this.fuelTankTiersTotal / this.partCounts.object2IntEntrySet() + .stream() + .filter(p -> p.getKey() instanceof FuelTankBlock) + .map(Map.Entry::getValue) + .reduce(0, Integer::sum); } else if (state.state().is(GCYRBlocks.SEAT.get())) { this.addSeatPos(pos); } @@ -1010,7 +1015,6 @@ protected void addAdditionalSaveData(CompoundTag compound) { public void onSyncedDataUpdated(EntityDataAccessor key) { if (POSITIONED_STATES.equals(key) || SIZE.equals(key)) { this.setBoundingBox(makeBoundingBox()); - hasRequestedBlockSync.set(false); } super.onSyncedDataUpdated(key); } diff --git a/src/main/resources/assets/gcyr/gcyr/planet_assets/sky_renderers/space.json b/src/main/resources/assets/gcyr/gcyr/planet_assets/sky_renderers/space.json new file mode 100644 index 00000000..770765da --- /dev/null +++ b/src/main/resources/assets/gcyr/gcyr/planet_assets/sky_renderers/space.json @@ -0,0 +1,29 @@ +{ + "world": "gcyr:overworld_orbit", + "stars": { + "fancy_count": 16000, + "fast_count": 8000, + "colored_stars": true, + "daylight_visible": true + }, + "sunset_color": "none", + "dimension_effects": { + "type": "none" + }, + "cloud_effects": "none", + "weather_effects": "none", + "horizon_angle": 0, + "sky_objects": [ + { + "texture": "gcyr:textures/sky/earth.png", + "blending": true, + "render_type": "dynamic", + "scale": 90.0, + "rotation": [ + 0.0, + -90.0, + 0.0 + ] + } + ] +}