From 28ac280341d672cece2913f9e3fe2609af42c5eb Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 09:38:37 +1200 Subject: [PATCH 01/56] Create tok.json --- common/src/main/resources/assets/vs_eureka/lang/tok.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 common/src/main/resources/assets/vs_eureka/lang/tok.json diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -0,0 +1 @@ + From 2cf2bfbdc29d112dd1ad0715aa7febeaaed2d6da Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 09:49:59 +1200 Subject: [PATCH 02/56] Update tok.json --- .../resources/assets/vs_eureka/lang/tok.json | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index 8b137891..e8048772 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -1 +1,41 @@ - +{ + "itemGroup.vs_eureka.eureka_tab": "ilo VS Eureka", + "block.vs_eureka.oak_ship_helm": "ilo lawa pi tomo tawa telo pi kasi kili", + "block.vs_eureka.spruce_ship_helm": "ilo lawa pi tomo tawa telo pi kasi lete", + "block.vs_eureka.birch_ship_helm": "ilo lawa kasi walo pi tomo tawa telo", + "block.vs_eureka.jungle_ship_helm": "ilo lawa pi tomo tawa telo pi kasi suli", + "block.vs_eureka.acacia_ship_helm": "ilo lawa kasi loje jelo pi tomo tawa telo", + "block.vs_eureka.dark_oak_ship_helm": "ilo lawa kasi pimeja pi tomo tawa telo", + "block.vs_eureka.crimson_ship_helm": "ilo lawa loje pi tomo tawa telo", + "block.vs_eureka.warped_ship_helm": "ilo lawa laso pi tomo tawa telo pi", + "block.vs_eureka.anchor": "Anchor", + "block.vs_eureka.engine": "Ship Engine", + "block.vs_eureka.balloon": "Balloon", + "block.vs_eureka.white_balloon": "White Balloon", + "block.vs_eureka.light_gray_balloon": "Light Gray Balloon", + "block.vs_eureka.gray_balloon": "Gray Balloon", + "block.vs_eureka.black_balloon": "Black Balloon", + "block.vs_eureka.red_balloon": "Red Balloon", + "block.vs_eureka.orange_balloon": "Orange Balloon", + "block.vs_eureka.yellow_balloon": "Yellow Balloon", + "block.vs_eureka.lime_balloon": "Lime Balloon", + "block.vs_eureka.green_balloon": "Green Balloon", + "block.vs_eureka.light_blue_balloon": "Light Blue Balloon", + "block.vs_eureka.cyan_balloon": "Cyan Balloon", + "block.vs_eureka.blue_balloon": "Blue Balloon", + "block.vs_eureka.purple_balloon": "Purple Balloon", + "block.vs_eureka.magenta_balloon": "Magenta Balloon", + "block.vs_eureka.pink_balloon": "Pink Balloon", + "block.vs_eureka.brown_balloon": "Brown Balloon", + "block.vs_eureka.floater": "Floater", + "block.vs_eureka.ballast": "Ballast", + "gui.vs_eureka.ship_helm": "Ship Helm", + "gui.vs_eureka.engine": "Engine", + "gui.vs_eureka.assemble": "Assemble", + "gui.vs_eureka.disassemble": "Disassemble", + "gui.vs_eureka.align": "Align", + "gui.vs_eureka.aligning": "Aligning...", + "gui.vs_eureka.todo": "Disassemble", + "hud.vs_eureka.start_cruising": "Cruise control enabled", + "hud.vs_eureka.stop_cruising": "Cruise control disabled" +} From d353ddda51ce507e47c2aef6cdc012541c56e5d6 Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 09:58:22 +1200 Subject: [PATCH 03/56] Update tok.json --- common/src/main/resources/assets/vs_eureka/lang/tok.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index e8048772..3388dd39 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -8,7 +8,7 @@ "block.vs_eureka.dark_oak_ship_helm": "ilo lawa kasi pimeja pi tomo tawa telo", "block.vs_eureka.crimson_ship_helm": "ilo lawa loje pi tomo tawa telo", "block.vs_eureka.warped_ship_helm": "ilo lawa laso pi tomo tawa telo pi", - "block.vs_eureka.anchor": "Anchor", + "block.vs_eureka.anchor": "ilo awen", "block.vs_eureka.engine": "Ship Engine", "block.vs_eureka.balloon": "Balloon", "block.vs_eureka.white_balloon": "White Balloon", From 613f56dce835a438d6308720092ad2c00fd8fb9e Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 10:04:33 +1200 Subject: [PATCH 04/56] Update tok.json --- .../resources/assets/vs_eureka/lang/tok.json | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index 3388dd39..881acee7 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -1,32 +1,32 @@ { "itemGroup.vs_eureka.eureka_tab": "ilo VS Eureka", - "block.vs_eureka.oak_ship_helm": "ilo lawa pi tomo tawa telo pi kasi kili", - "block.vs_eureka.spruce_ship_helm": "ilo lawa pi tomo tawa telo pi kasi lete", - "block.vs_eureka.birch_ship_helm": "ilo lawa kasi walo pi tomo tawa telo", - "block.vs_eureka.jungle_ship_helm": "ilo lawa pi tomo tawa telo pi kasi suli", - "block.vs_eureka.acacia_ship_helm": "ilo lawa kasi loje jelo pi tomo tawa telo", - "block.vs_eureka.dark_oak_ship_helm": "ilo lawa kasi pimeja pi tomo tawa telo", - "block.vs_eureka.crimson_ship_helm": "ilo lawa loje pi tomo tawa telo", - "block.vs_eureka.warped_ship_helm": "ilo lawa laso pi tomo tawa telo pi", + "block.vs_eureka.oak_ship_helm": "ilo lawa pi tomo tawa pi kasi kili", + "block.vs_eureka.spruce_ship_helm": "ilo lawa pi tomo tawa pi kasi lete", + "block.vs_eureka.birch_ship_helm": "ilo lawa kasi walo pi tomo tawa", + "block.vs_eureka.jungle_ship_helm": "ilo lawa pi tomo tawa pi kasi suli", + "block.vs_eureka.acacia_ship_helm": "ilo lawa kasi loje jelo pi tomo tawa", + "block.vs_eureka.dark_oak_ship_helm": "ilo lawa kasi pimeja pi tomo tawa", + "block.vs_eureka.crimson_ship_helm": "ilo lawa loje pi tomo tawa", + "block.vs_eureka.warped_ship_helm": "ilo lawa laso pi tomo tawa", "block.vs_eureka.anchor": "ilo awen", - "block.vs_eureka.engine": "Ship Engine", - "block.vs_eureka.balloon": "Balloon", - "block.vs_eureka.white_balloon": "White Balloon", - "block.vs_eureka.light_gray_balloon": "Light Gray Balloon", - "block.vs_eureka.gray_balloon": "Gray Balloon", - "block.vs_eureka.black_balloon": "Black Balloon", - "block.vs_eureka.red_balloon": "Red Balloon", - "block.vs_eureka.orange_balloon": "Orange Balloon", - "block.vs_eureka.yellow_balloon": "Yellow Balloon", - "block.vs_eureka.lime_balloon": "Lime Balloon", - "block.vs_eureka.green_balloon": "Green Balloon", - "block.vs_eureka.light_blue_balloon": "Light Blue Balloon", - "block.vs_eureka.cyan_balloon": "Cyan Balloon", - "block.vs_eureka.blue_balloon": "Blue Balloon", - "block.vs_eureka.purple_balloon": "Purple Balloon", - "block.vs_eureka.magenta_balloon": "Magenta Balloon", - "block.vs_eureka.pink_balloon": "Pink Balloon", - "block.vs_eureka.brown_balloon": "Brown Balloon", + "block.vs_eureka.engine": "ilo wawa pi tomo tawa", + "block.vs_eureka.balloon": "poki pi kon seli", + "block.vs_eureka.white_balloon": "poki walo pi kon seli", + "block.vs_eureka.light_gray_balloon": "poki walo pimeja pi kon seli", + "block.vs_eureka.gray_balloon": "poki pimeja walo pi kon seli", + "block.vs_eureka.black_balloon": "poki pimeja pi kon seli", + "block.vs_eureka.red_balloon": "poki loje pi kon seli", + "block.vs_eureka.orange_balloon": "poki loje jelo pi kon seli", + "block.vs_eureka.yellow_balloon": "poki jelo pi kon seli", + "block.vs_eureka.lime_balloon": "poki laso jelo pi kon seli", + "block.vs_eureka.green_balloon": "poki pi laso kasi pi kon seli", + "block.vs_eureka.light_blue_balloon": "poki pi laso telo walo pi kon seli", + "block.vs_eureka.cyan_balloon": "poki laso pi kon seli", + "block.vs_eureka.blue_balloon": "poki pi laso telo pi kon seli", + "block.vs_eureka.purple_balloon": "poki laso loje pi kon seli", + "block.vs_eureka.magenta_balloon": "poki loje laso pi kon seli", + "block.vs_eureka.pink_balloon": "poki walo lejo pi kon seli", + "block.vs_eureka.brown_balloon": "poki pi kule ma pi kon seli", "block.vs_eureka.floater": "Floater", "block.vs_eureka.ballast": "Ballast", "gui.vs_eureka.ship_helm": "Ship Helm", From 4d01660c9a665b4fcc17541ba9bf4cc7c78d075a Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 11:43:37 +1200 Subject: [PATCH 05/56] added toki pona translation --- .../resources/assets/vs_eureka/lang/tok.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index 881acee7..69bceedb 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -27,15 +27,15 @@ "block.vs_eureka.magenta_balloon": "poki loje laso pi kon seli", "block.vs_eureka.pink_balloon": "poki walo lejo pi kon seli", "block.vs_eureka.brown_balloon": "poki pi kule ma pi kon seli", - "block.vs_eureka.floater": "Floater", - "block.vs_eureka.ballast": "Ballast", - "gui.vs_eureka.ship_helm": "Ship Helm", - "gui.vs_eureka.engine": "Engine", - "gui.vs_eureka.assemble": "Assemble", - "gui.vs_eureka.disassemble": "Disassemble", - "gui.vs_eureka.align": "Align", - "gui.vs_eureka.aligning": "Aligning...", - "gui.vs_eureka.todo": "Disassemble", - "hud.vs_eureka.start_cruising": "Cruise control enabled", - "hud.vs_eureka.stop_cruising": "Cruise control disabled" + "block.vs_eureka.floater": "leko pi tawa sewi lon telo", + "block.vs_eureka.ballast": "leko pi tawa anpa lon telo", + "gui.vs_eureka.ship_helm": "ilo lawa pi tomo tawa", + "gui.vs_eureka.engine": "ilo wawa pi tomo tawa", + "gui.vs_eureka.assemble": "o pali", + "gui.vs_eureka.disassemble": "o leko", + "gui.vs_eureka.align": "o lon nasin leko", + "gui.vs_eureka.aligning": "mi tawa nasin leko", + "gui.vs_eureka.todo": "o leko", + "hud.vs_eureka.start_cruising": "tomo tawa li tawa sama ni", + "hud.vs_eureka.stop_cruising": "sina ken lawa e tomo tawa" } From 94ffd77c31251e88c192d387c08452c80d9afd71 Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 11:50:07 +1200 Subject: [PATCH 06/56] added Toki Pona translation --- .../resources/assets/vs_eureka/lang/tok.json | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index 69bceedb..d8e3762c 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -10,23 +10,23 @@ "block.vs_eureka.warped_ship_helm": "ilo lawa laso pi tomo tawa", "block.vs_eureka.anchor": "ilo awen", "block.vs_eureka.engine": "ilo wawa pi tomo tawa", - "block.vs_eureka.balloon": "poki pi kon seli", - "block.vs_eureka.white_balloon": "poki walo pi kon seli", - "block.vs_eureka.light_gray_balloon": "poki walo pimeja pi kon seli", - "block.vs_eureka.gray_balloon": "poki pimeja walo pi kon seli", - "block.vs_eureka.black_balloon": "poki pimeja pi kon seli", - "block.vs_eureka.red_balloon": "poki loje pi kon seli", - "block.vs_eureka.orange_balloon": "poki loje jelo pi kon seli", - "block.vs_eureka.yellow_balloon": "poki jelo pi kon seli", - "block.vs_eureka.lime_balloon": "poki laso jelo pi kon seli", - "block.vs_eureka.green_balloon": "poki pi laso kasi pi kon seli", - "block.vs_eureka.light_blue_balloon": "poki pi laso telo walo pi kon seli", - "block.vs_eureka.cyan_balloon": "poki laso pi kon seli", - "block.vs_eureka.blue_balloon": "poki pi laso telo pi kon seli", - "block.vs_eureka.purple_balloon": "poki laso loje pi kon seli", - "block.vs_eureka.magenta_balloon": "poki loje laso pi kon seli", - "block.vs_eureka.pink_balloon": "poki walo lejo pi kon seli", - "block.vs_eureka.brown_balloon": "poki pi kule ma pi kon seli", + "block.vs_eureka.balloon": "poki kon", + "block.vs_eureka.white_balloon": "poki kon walo", + "block.vs_eureka.light_gray_balloon": "poki kon walo pimeja", + "block.vs_eureka.gray_balloon": "poki kon pimeja walo", + "block.vs_eureka.black_balloon": "poki kon pimeja", + "block.vs_eureka.red_balloon": "poki kon loje", + "block.vs_eureka.orange_balloon": "poki kon loje jelo", + "block.vs_eureka.yellow_balloon": "poki kon jelo", + "block.vs_eureka.lime_balloon": "poki kon laso jelo", + "block.vs_eureka.green_balloon": "poki kon pi laso kasi", + "block.vs_eureka.light_blue_balloon": "poki kon pi laso telo walo", + "block.vs_eureka.cyan_balloon": "poki kon laso", + "block.vs_eureka.blue_balloon": "poki kon pi laso telo", + "block.vs_eureka.purple_balloon": "poki kon laso loje", + "block.vs_eureka.magenta_balloon": "poki kon loje laso", + "block.vs_eureka.pink_balloon": "poki kon walo lejo", + "block.vs_eureka.brown_balloon": "poki kon pi kule ma", "block.vs_eureka.floater": "leko pi tawa sewi lon telo", "block.vs_eureka.ballast": "leko pi tawa anpa lon telo", "gui.vs_eureka.ship_helm": "ilo lawa pi tomo tawa", From 8820d5757d2e31681a4a572489d4dfaf1801a7d6 Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Tue, 23 May 2023 11:51:10 +1200 Subject: [PATCH 07/56] Added Toki Pona translation --- .../main/resources/assets/vs_eureka/lang/tok.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index d8e3762c..5d745841 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -12,20 +12,20 @@ "block.vs_eureka.engine": "ilo wawa pi tomo tawa", "block.vs_eureka.balloon": "poki kon", "block.vs_eureka.white_balloon": "poki kon walo", - "block.vs_eureka.light_gray_balloon": "poki kon walo pimeja", - "block.vs_eureka.gray_balloon": "poki kon pimeja walo", + "block.vs_eureka.light_gray_balloon": "poki kon pi walo pimeja", + "block.vs_eureka.gray_balloon": "poki kon pi pimeja walo", "block.vs_eureka.black_balloon": "poki kon pimeja", "block.vs_eureka.red_balloon": "poki kon loje", - "block.vs_eureka.orange_balloon": "poki kon loje jelo", + "block.vs_eureka.orange_balloon": "poki kon pi loje jelo", "block.vs_eureka.yellow_balloon": "poki kon jelo", - "block.vs_eureka.lime_balloon": "poki kon laso jelo", + "block.vs_eureka.lime_balloon": "poki kon pi laso jelo", "block.vs_eureka.green_balloon": "poki kon pi laso kasi", "block.vs_eureka.light_blue_balloon": "poki kon pi laso telo walo", "block.vs_eureka.cyan_balloon": "poki kon laso", "block.vs_eureka.blue_balloon": "poki kon pi laso telo", - "block.vs_eureka.purple_balloon": "poki kon laso loje", - "block.vs_eureka.magenta_balloon": "poki kon loje laso", - "block.vs_eureka.pink_balloon": "poki kon walo lejo", + "block.vs_eureka.purple_balloon": "poki kon pi laso loje", + "block.vs_eureka.magenta_balloon": "poki kon pi loje laso", + "block.vs_eureka.pink_balloon": "poki kon pi walo lejo", "block.vs_eureka.brown_balloon": "poki kon pi kule ma", "block.vs_eureka.floater": "leko pi tawa sewi lon telo", "block.vs_eureka.ballast": "leko pi tawa anpa lon telo", From 8d69c2a7ce6c866f7baf5985517e1d01b8da4160 Mon Sep 17 00:00:00 2001 From: greybeetle213 <65577606+greybeetle213@users.noreply.github.com> Date: Sat, 27 May 2023 19:56:27 +1200 Subject: [PATCH 08/56] fixed typo --- common/src/main/resources/assets/vs_eureka/lang/tok.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/tok.json b/common/src/main/resources/assets/vs_eureka/lang/tok.json index 5d745841..be5ad106 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/tok.json +++ b/common/src/main/resources/assets/vs_eureka/lang/tok.json @@ -25,7 +25,7 @@ "block.vs_eureka.blue_balloon": "poki kon pi laso telo", "block.vs_eureka.purple_balloon": "poki kon pi laso loje", "block.vs_eureka.magenta_balloon": "poki kon pi loje laso", - "block.vs_eureka.pink_balloon": "poki kon pi walo lejo", + "block.vs_eureka.pink_balloon": "poki kon pi walo loje", "block.vs_eureka.brown_balloon": "poki kon pi kule ma", "block.vs_eureka.floater": "leko pi tawa sewi lon telo", "block.vs_eureka.ballast": "leko pi tawa anpa lon telo", From 7b6d7b9a9ea7bc3923352a9ffb002f7b79c56a24 Mon Sep 17 00:00:00 2001 From: SimonAlteruna <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Tue, 6 Jun 2023 23:32:24 +0200 Subject: [PATCH 09/56] Several changes to engines * Redstone now prevents fuel consumption instead of pausing it. * Bugfix for the heat level not effecting power correctly. * Heat rises faster the lower the heat is and so on. See config "engineHeatChangeExponent". * Added a fuel saving mode to not use fuel when heat is at capacity. See config "engineFuelSaving". * Fixed small floriations in speed when at 100% heat. * Fixed incorrect gauge readout on the art on engine_on_1. * Made the engines effect turning speed. See config "engineTurnPower". * Changes to how fuel is feed into the engine. See config "engineMinCapacity". --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 14 ++- .../eureka/blockentity/EngineBlockEntity.kt | 88 ++++++++++++------ .../eureka/ship/EurekaShipControl.kt | 3 +- .../textures/block/engine_front_on_1.png | Bin 2742 -> 736 bytes 4 files changed, 76 insertions(+), 29 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 5b204c21..fa999580 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -17,7 +17,10 @@ object EurekaConfig { val enginePower: Float = 2000000f @JsonSchema(description = "Movement power per engine with minimal heat") - val minEnginePower: Float = 700000f + val minEnginePower: Float = 10000f + + @JsonSchema(description = "Turning power per engine heated fully") + val engineTurnPower = 1f @JsonSchema(description = "The amount of heat a engine loses per tick") val engineHeatLoss = 0.01f @@ -25,6 +28,15 @@ object EurekaConfig { @JsonSchema(description = "The amount of heat a gain per tick (when burning)") val engineHeatGain = 0.03f + @JsonSchema(description = "Increases heat gain at low heat level and increased heat decrees at high heat while not consuming fuel") + val engineHeatChangeExponent = 0.1f + + @JsonSchema(description = "Avoids consuming fuel when heat is 100%") + val engineFuelSaving = false + + @JsonSchema(description = "Increasing this value will result in more items being able to converted to fuel") + val engineMinCapacity = 2000 + @JsonSchema(description = "Max speed of a ship without boosting") val maxCasualSpeed = 20f diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 3c0d423f..78b0b05c 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -31,6 +31,7 @@ import org.valkyrienskies.eureka.ship.EurekaShipControl import org.valkyrienskies.eureka.util.KtContainerData import org.valkyrienskies.mod.common.getShipManagingPos import kotlin.math.ceil +import kotlin.math.max class EngineBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlockEntity(EurekaBlockEntities.ENGINE.get(), pos, state), @@ -45,6 +46,8 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : var fuelLeft by data var fuelTotal by data private var fuel: ItemStack = ItemStack.EMPTY + private var maxEffectiveFuel = 100f - EurekaConfig.SERVER.engineHeatGain + private var lastFuelValue = 1600; // coal: 1600 override fun createMenu(containerId: Int, inventory: Inventory): AbstractContainerMenu = EngineScreenMenu(containerId, inventory, this) @@ -54,24 +57,42 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : private var heat = 0f fun tick() { if (!this.level!!.isClientSide) { - // Disable engines when they are receiving a redstone signal - if (level!!.hasNeighborSignal(blockPos)) { - heatLevel = 0 - level!!.setBlock(blockPos, this.blockState.setValue(HEAT, 0), 11) - return - } - - if (this.fuelLeft > 0) { - this.fuelLeft-- - - if (this.heat < 100f) { - this.heat += EurekaConfig.SERVER.engineHeatGain + // Disable engine feeding when they are receiving a redstone signal + if (!level!!.hasNeighborSignal(blockPos)) { + if (fuelLeft > 0) { + + if (EurekaConfig.SERVER.engineFuelSaving) { + if (heat <= maxEffectiveFuel) { + heat += heatEngine(EurekaConfig.SERVER.engineHeatGain) + fuelLeft-- + } + } else { + fuelLeft-- + + if (heat <= maxEffectiveFuel) { + heat += heatEngine(EurekaConfig.SERVER.engineHeatGain) + } + } + + // Refill while burning + if (!fuel.isEmpty && lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { + lastFuelValue = (FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * 2 + + if (lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { + fuelLeft += lastFuelValue + fuelTotal = max(lastFuelValue, EurekaConfig.SERVER.engineMinCapacity) + removeItem(0, 1) + setChanged() + } + } + + } else if (!fuel.isEmpty) { + lastFuelValue = (FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * 2 + fuelLeft = lastFuelValue + fuelTotal = max(lastFuelValue, EurekaConfig.SERVER.engineMinCapacity) + removeItem(0, 1) + setChanged() } - } else if (!fuel.isEmpty && this.heat < 100f) { - fuelTotal = (FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * 2 - fuelLeft = fuelTotal - removeItem(0, 1) - setChanged() } val prevHeatLevel = heatLevel @@ -80,24 +101,37 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : level!!.setBlock(blockPos, this.blockState.setValue(HEAT, heatLevel), 11) } - if (heat > 0 && ship != null && eurekaShipControl != null) { - eurekaShipControl!!.power += lerp( - heat / 100f, - EurekaConfig.SERVER.minEnginePower, - EurekaConfig.SERVER.enginePower - ) + if (heat > 0) { - heat -= eurekaShipControl!!.consumed - } + if (ship != null && eurekaShipControl != null) { - if (heat > 0) { - heat -= min(EurekaConfig.SERVER.engineHeatLoss, heat) + // Avoid fluctuations in speed + var effectiveHeat = 1f + if (heat < maxEffectiveFuel) { + effectiveHeat = heat / 100f; + } + + eurekaShipControl!!.power += lerp( + EurekaConfig.SERVER.minEnginePower, + EurekaConfig.SERVER.enginePower, + effectiveHeat, + ) + + heat -= eurekaShipControl!!.consumed; + } + + heat = max(heat - coolEngine(EurekaConfig.SERVER.engineHeatLoss),0f) } } } fun isBurning() = fuelLeft > 0 + private fun heatEngine(value: Float) = (100 * EurekaConfig.SERVER.engineHeatChangeExponent - + this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + + private fun coolEngine(value: Float) = (this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + override fun saveAdditional(tag: CompoundTag) { tag.put("FuelSlot", fuel.save(CompoundTag())) tag.putInt("FuelLeft", fuelLeft) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index a26174b5..dcf098f4 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -216,7 +216,8 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { }.coerceIn(0.5, EurekaConfig.SERVER.maxSizeForTurnSpeedPenalty) val maxLinearAcceleration = EurekaConfig.SERVER.turnAcceleration - val maxLinearSpeed = EurekaConfig.SERVER.turnSpeed + val maxLinearSpeed = EurekaConfig.SERVER.turnSpeed + + extraForce / EurekaConfig.SERVER.enginePower * EurekaConfig.SERVER.engineTurnPower // acceleration = alpha * r // therefore: maxAlpha = maxAcceleration / r diff --git a/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_1.png b/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_1.png index c19d67315e53df3c65dd3bc6782e299615891336..d7c0143f9df35804dec506bdda67fd03f7cc1192 100644 GIT binary patch delta 704 zcmV;x0zdt>72pMs85IKn001mk2>t*700DDSM?wMF$t-`7As2rEN>EHxMa9L%tE{V! zkB?|*XmoURKR!Z9NJvjlPgz)4a(QkuGBP$cHZn3YIyyQ#IyyZ)J!NENE-o*Be}Br# z%6E5o!@|U0UtcOJDu{=OGcq(KB_+YZ!PnN-&d$!u%gevNzbq^)aZyp$*4D(t#B+0V zFfcH!o}Qqfpr3!ApF~4LG&3_WFEO>XwVa%skdKdidU}0&dUSDdaBOXfhloW$Jw-k` zL_9c0J~}`dSdov9etLR!adB~NZACpeMn5`1JUBNpEk!CEL@OFYDj7s88$>A^HZd$lHx_DW zW<@p@Mm82?URYvXSYQC$0{{R4FG)l}RCt`#ka<&rP!z?lyvG9~v!X>sEZQt914_*b zEX7<(TikyO+ZWot|GzzGn(8BT=FXinXXY;R0|+n-!k89Do`(QS5Jy;+5W;#M7{Uu= zNEC;IBO%WN7KG6;7?&m{r>3b717aglITlltxI7b$u!sh;sye5{C23w>SmY64BFgfT zs!CEKu^i+uU~VNSCPi^INn40uIzsRH@($A-%-Vk+F@VDBsSQonblosE>C-ew8C&U0 zHk(Or>p4Hz+1)cO%gUSk2SyG7pDPq?s?uS(RH@c@;A_>R<9egfIH{kWoqIvE)$VkA z{eG|8X}6j@{3{+8+NG{J&JT})&*SR)#`)q=y}dKAB$Z7!+OGwM%Z#DI-lf*v8nkrGkHbEa}txJ@4~A-}~tE3$7(4*;8jtMGz$0QEDrP=UjN8S(D*!!)193JUtXHeO5t` z$0EW+QUuA|Ex9YzO6OCYAP2R)D0_f59t^{11ThuH!@RH@sHg|{q>x!N@aAC+ zDv4&zGkPcC3|oO;DqR%;6|0uGg;mQ1R@4+OLQQcF0tA7|qw!!Mq;PSwCW*_z>%=gw zL6afsarb-Bg)370BR3<1G9_Pb2sU;F6B?Cnv9T%>N1d_=`0S5sP z1R+&{v1B?n?3Yzp@yqvsPCx!k0w}H1na(jGmtZiRLQ(BeSjMOz6GkiUm0^IF14XWh z2*4hNG-oHO33Jv6;8i)|mgT_MLb=8$qZF(fo%f6s66KgOf7}FM<5ghRPz2PPFkl4j zCTR|SX$D?%1d$4L%A(|5IX={gQF=GQa)gm1iO+<>mJxZCzi+T8a9%kQ5koN&R z9P(+{bKG8VnevC6jcWPRMteLY#sHeac$TFwN@vg$JVP-AC63Lv$wEz{1rqa9ZV+Vw zVth(Z(9i5y@BU38d@HsSQfi999xFMG^nvT9TgON~J_?D@R#WfE8&zXwoJeFC^@5)(DBd2XN(5!_ovR|D`k@ zogec92>JznNTpF^uNvbcz~X~la$mpU_ad+G(fd$00!9QPw3tWd!AOcWVhq6>py;GQ zC$a*`h{mzf|ChR+BPmV~-^3{^e--MZvIu@YCF?~q_Q5;Hh2|dBl!v%73WMwcK1-I56}LQ}^M!y^lFFUs};} z@Zi*U5Y3C5^1oa5ZDB#@&W7X1j^$TvSl@tDR#a5HI~;3j*!{hs{crTtjtriw0>UdM z_Sd(*ImNQa{X6#)`-3?-IrSGVT)1=R&cppXa?9p#%Rk+Wyw}`0^MSfWe>(eGV|U@! zUsZ4Yr1z~W2cvoQj%?@b{@%?8_?gP_vo~+vym5mb(Ow$l_MTZrZOZs*##=oj(dd&% zo=w|0y%=%*;DPG6dOF(tpR(6tccZs2c7F6~&&CrkoIJO4M$u0Fj+QO{&HVO(Z@p+o z-d@6TpfZ+RYlH&SOqk(!rne=+&@^c6hjKWd$^ z_#e2dKK^)}aS;3X#0WtLXTYWwnWamJa(8 K+rHxJ=l%<>TiQ Date: Wed, 7 Jun 2023 16:50:34 +0200 Subject: [PATCH 10/56] Updated config descriptions --- .../main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index fa999580..16f2dda8 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -13,13 +13,13 @@ object EurekaConfig { class Server { - @JsonSchema(description = "Movement power per engine heated fully") + @JsonSchema(description = "Movement power per engine when heated fully") val enginePower: Float = 2000000f @JsonSchema(description = "Movement power per engine with minimal heat") val minEnginePower: Float = 10000f - @JsonSchema(description = "Turning power per engine heated fully") + @JsonSchema(description = "Turning power per engine when heated fully") val engineTurnPower = 1f @JsonSchema(description = "The amount of heat a engine loses per tick") @@ -28,7 +28,7 @@ object EurekaConfig { @JsonSchema(description = "The amount of heat a gain per tick (when burning)") val engineHeatGain = 0.03f - @JsonSchema(description = "Increases heat gain at low heat level and increased heat decrees at high heat while not consuming fuel") + @JsonSchema(description = "Increases heat gained at low heat level, and increased heat decreases when at high heat and not consuming fuel") val engineHeatChangeExponent = 0.1f @JsonSchema(description = "Avoids consuming fuel when heat is 100%") From 16f41f03a955fc3790c11e1613ffaca37d9ac770 Mon Sep 17 00:00:00 2001 From: SimonAlteruna <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 7 Jun 2023 19:22:13 +0200 Subject: [PATCH 11/56] Intensifies the fire of the engine at heat 4 and optimized PNGs --- .../textures/block/engine_front_on_2.png | Bin 2778 -> 818 bytes .../textures/block/engine_front_on_3.png | Bin 2778 -> 857 bytes .../textures/block/engine_front_on_4.png | Bin 2769 -> 1028 bytes .../block/engine_front_on_4.png.mcmeta | 3 +-- 4 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_2.png b/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_2.png index 8d0b00e33ef480fa7e592f199507313b7cce8170..6fc3fa1475e84e2fa41852a794f349e004e80ba0 100644 GIT binary patch delta 786 zcmV+t1MU3U6|x4985IKn001mk2>t*700DDSM?wMF$t-`7As2rEk5EihMa9L%tE{V! zkB?|*XmoURKR!Z9NJvjlPgz)4a(QkuGBP$cHZn3YIyyQ#IyyZ)J!NENE-o*Be}Br# z%6E5o!@|U0UtcOJDu{=OGcq(KB_(lDQPXwYIgjoSdAIkB@$OdVhL)cX4rmdU|tgZE|dF ziie1hkB^Cmh;waiOhP?QK{`)BI8j16M?E-!e}8LdW<4}5YB?clJ0NH}9%wopXgM8e zJ0NH{AUrcHa&2vZe}6wVEN4R&XhargL>6g87HLHmW~fU|4HoSZ-xlZDm-JkB@Lpj8CW@)bp&SexVIkoW zkx_C{(NQt6aq$U2fyAWbl+?7ewDi=JcV^dRFa|86Kdiub}pXRHBwlmXs=Wb{;#AohgXG0&dLmSRq2FJrjWB ztXsoa2#Y%%lsZ`r}4I>N!p)7^%+*N8tz_~2ppaM97 z%cDVCGHmNERXmDTs@wrO{Q64{U}`Ovu#aiEIGte^nkSid5w<0ss1-8e~O+ z7+=t%?UJ43>~@T?(>9C{AsR193?|D2OBsN{z!8vkVE=_2)d2-5R!l|pvyveq0{~^@ zDFAaQOPG(Wkq}v! zbdoj5yhIvhZZh=$rOpT>B{1+y9F+1mp&m+$R4Tek0PH2W?wbem^%NLnIW?GRKQ{lr zU;?EXtT6n)i!bnQO1ps@8JL1S%s&h_PxugSzrY3aq{8O<%LMf-Y~F91O{w|D?f-l_ zN4YO6wr^jpxB9}52H(z{eYo{dVq0dt_ONxsP}er&>knO6lDObOHFfXRDD*dvOduO) zx!RY#Tt9zv8T-Pnm?N>hX`LOL`#J{qd?c=&x$`2941e^@TZZ9VXW~CAY&*-xEgruz z7GcVZdE%k^hs~!Be$27#^0FHv@7?J6?8=tw$GbfaBKG}9K+)V4Gmma;0ux2i!`(x3 zt}+XwD|=2qb?)TJZEx`P#-)iZv!ni4*Q`~0tE&cUuZE3y-i-=8nq{eZ-BT)8$z z99esOG^!=DVEH?jFLw>Px;Kr=z=0WO+VJv)z#g-FTtDu@?tW})y2pwJ~bOT z_1ocFV(0qKfxnq|HQwH__4+@aFaGx9kLC8f;_g_Mvug{E<44=u>&}sT@eK#BT)K2E zFXr$zU$=2z-^i0!nXJX@!n)lqmqG)8}u_4QN@7WVSbVa_{=i9SjPUen*4?n$KI@Y#tm9jBu;YsCp z!xN^*e$o8G9wqX%XPL#3i)Jwe4&RQf__^q5D^no0$88#qd!q67_^t0YB2S))OmNOZ&TMW*MnAv0 ze{;=W>c$?JcYYyZy?7(;=$X3yH#VKCoA`L7fQvZteP`Q&MXTOyKlV&Y+}c}}eNo%9 z;`yET|9QrdjwT;^ZNdGKy^$ZVpS*thUFAS$LduDTGX;guZP-4(?#+8%Mq&@PT`zyH win`Z&_}QBeCb@k8AkzNmgtIwGpGJ+JUcKj&rxv{9|MzLm$TmHnw(e*D0nC8x0ssI2 diff --git a/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_3.png b/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_3.png index aeeac5c983fed8c317303980933a3b7e32060bc5..cd2e9a20814b7a7ede80b3c27dcc15b56cf86593 100644 GIT binary patch delta 826 zcmV-A1I7H>71;)m85IKn001mk2>t*700DDSM?wMF$t-`7As2rEwopt|Ma9L%tE{V! zkB?|*XmoURKR!Z9NJvjlPgz)4a(QkuGBP$cHZn3YIyyQ#IyyZ)J!NENE-o*Be}Br# z%6E5oaZyoUUtcOJDu{=OGcq(KB_+YZ!PnN-&d$!u%gevNzbq^)*4Ea<#Kd!Rb1*P4 z)zs9WprD_hpG1E{Lo_opFfTE+wY9djwTXv_ot&JKkB@!l(xtbKWl@_#+7PXKTwUHLIj~2F*7PXcbM?ETNV_#cY zSYKRNXJJ@zXIOb`Sbc6-er{NNZdiD0SY}{Yl#h>tdwPa?dVXrB))PRUxNXC#F*-OFJxhZ*6&SZLNJ4u6`DBYi6x}7OZ*} zt$P-KZ&-kDSblF8r~F-B3^%B>YTt>*2TMN&u;c7o6YV{Lw^z|3tO|l`I zG)Yl`wm2YG7_q%W+un_pyCNef%HUmq!g1oAas>}WkApd|cpa(y2~v+@xi4uN>s=AY zxlA_u?f1Rk^FHtUz0bZ`S6)_06z#!K zmu$oy)muo5&je~+^BVkMQA3$cYN(TV87r8L=7$9c-~j;<4SU>PRR|lgIIaN4v1tNB z<0gSRBUTi1h*nz4QIp~as9wwB62)++f!9(jL+aQ(lqM;jAUT54;Up!Hte`ibi4O+7 z`DKStVV;}t1)q#qZ6M$i2qF{;X+t`#;&&1h&qEBFplKXh;A+Gh5W~1voi&PJ2CC$D z`2sG*i^dQ|yAli-G01cz1dlHX>s1qJf(awSqK}}oWGtk(p)4isd_liE?p&4#;07Mx z4XDtTO4|Brm4KqwDz|}7E`Q4bOs&O|^f4|Mk0R3+$_ zz?^zWb5<-GpJ4I>F`)QuisBwUsPa+DC=H`Va~^ehWhJEMj@barVgML1nuNI~S)62S z6eGYd!@;pYk|U-TMRqwNV@(Y>t+$c9K*i4ZTc)sNWHBJ#(O8xQhvN5$FkqKQbOOTX zbz*2Tje<#WD}Lx0veS*7FEyFU{ffioh6`#%NikYF$HY=R%i^?_iqo}Ngi@~>5WNy8 zH5)OQ9IeYG3pAwzyn&=~olcf^LVm>^Q^dSVjh{jG~jWXg#zVBnga$pR`%a`9z`jF@u~2{)r72yMQ38 z6swbYiQ;6#Xz2e-T`y3ypoeeb5h?!=>WQ>SwW8MvU@sxCA0Ev2Q{V{8vB8Y{vibi7 z6EDq?3M2lz_~L70+6_F&_!R76v0<`#!iQx01zwmZKWwf?qt#ns^ZvNhTx8=~E^LZ= zXOv_;eQWdm7r|S5{=U<)XwoNTzu)-y=d&}=U2SQTtXrzqOdrzRM2eb`#y_BuyFY5& zsP#>0D4jdCX7O=6bIabty*_R3iFIH??>!Ix?ncJtUpF<)?4K2lM&I4k*JUU{o_}y% z-+hH`ptbwj`Sa%svg`Bt;j=?C`N4vfmuu+FIl1eLHD^xknD|Wb>1(gU4edj(J+glH zlfj%Ly}kK|kXJURAKZu>zv^w+^Hfhk&(T+R_y0|$!X0jp$2#A@vai?%!L(qs@5j%sf3NS|m-9X(BR6hFtXXw+bprzfEe*QoW-NVb zOKq^*_UZNOERwo*Cvyn#^+q~Nav!g*W*-SfLz<)9bNnFRkG!1YKe6n!m60o-{N+t2 za;WdhfdfT5KI&`#N%5bSFJKLZk}hi}Sd&>*SNG#D^O5^PWq*Ix z#^PqHZL+5D$Xl9=c;4$|clGLr>%L%~jP|Vj)y;n$EU%oqb;7f6v>koI@%8k3X0$YH z`_Y-x`@j0K=GwAL(e109EysHK{RdW8{PVA;7Oo(MGJ19)NWH$J?fxkfHQV^p`_Qa( zq)?N2m|2#6MeBVCzl!y|ST=1Hc4SMNb#J8qgLNHN-2_eHnY^5)t823he?Bb*`SYgM zd*|=ZZ`S)}ifPa8TmMeV$--slrdF6{RHlAWka3I8HosV1-M%7yO{SQY`vB6t^6c4j zzFQj(q~;?hrdAzxpL?_FYg2am+@=qb+V*!=WDlpLH!j}Vn)C4sv45YXbIQ!yi)$MH1B3J3mH+?% diff --git a/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_4.png b/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_4.png index 87126b567346c906d91c7b99fde909217dc8a166..152c3f3cc8822bd162738e58e982f4e5993a0721 100644 GIT binary patch delta 1000 zcmV_7hln#WG$kb^!NI}T*4EC>&dbZozrVjMEG*X6*2Kibb8~Yr zFfi5B)NxT!L_MFEO>XwYIgjx3#s2hlrh=oRg1_gnD|1dU}9yafo_)d~9ua zY;BE)h>?$vkdKdwhlqP_ZDC10YD+q9OE_{(I&n=pZb~?6N;+IcIDc_*gnxf=Xl7GB zE#7J|-fk}1Y$@4mDA{W#*=Z)?gDBc&EmA!!cy4Wie}962e}8&!ZCOMt*nt+>eH+<% z9@v8x+k_U|g%;wS7TbdtS3@duYG!wJba-}ja%*N_Q9Jg`6!XLu=9M7kmmlh>8}7Uo z^1>GCtQ}HBDr;q5cy)AKT3BISSZriidTdyQb6ARYSd4a9iFR0oa#(9)SeB2EhkJU8 zdU}I#aer`ae{xPZZcaL3NjQUZadm5ESVAq|Z7|$&C)#c&+HNM=Y$e@rE!$}QZD!@97Vo_l@V*xCzZT=47UiK9@5LC6cvz2k zSd4gBhjdteZ&>7pC){l=;g%KZuNB~y73;4R-jfyYf3X|$#uf0r7VN4U?5Z5!g(BdG zAm5Z1;FTBTlpN}wAn2_Z>#rN@up8!@A-T>t0RR92dr3q=RCt_YU|?ioVrF3hA{J&4 zn}Ly)jhUT|m6eT+jTOXZU}EFoWaHxI=Hcbz2eBDgI5`Cb8H9vIM8(8`YzYQtR!J#o z85vnwe>rJ+DM?mlpn!tBw4$t>u&|P}vI++?0}C6sys)aUuo?*Pva>L-u&eWOYjAUG zY5)m-HWr{3pnYHfvKVLvla{u&whkBoSz1gC%({B|28Kq)Mn)#4X66<^TP*dhtZi)V z>>V7PoL$U80}l)(+2>K WoUA{F-rKkU0000z7%?^=m~=(qt||GXgvWZ~>oy23$_J$_I>^2rdt=!^5}+ zjfD8t8a3JBgy>3h37V^T0m^9gm`KtrYT&e_o+fnq1t>+398Rz}sly18C-gjHK%*ZG z%;uGBe5q-1G#9)xY8*bFhsSZh->>!Sw2Ie`lN<*zD4e1&7=fu(Zl4gq+-lkgf(fXi zSN8a1#f^p$1*=lwGio5yVF@lz4A!ki%LEIC2LumJYKgF%qh9Y3C2|Y&8 z7Lw-SmuBHLPY}bQW<`>1Rii@<7{yo!jwdOeB)$_0TSgLm!aai}k+&&cmjDIJF2N3P zkK3+6V`b!X6{q5bi6J}P=<&kb+!C*1lb!H^TAH7O7Ut#ZNlvfFC@mSGYc}(RZq+Ba zMNnumYG84+vMliin$vN5R*$hZs}-YcG>KVRk-%t);Q+&lq9BSR^G%9a5pIF-{9!jp ziU={jrAONYy+r94%*NU{Oyp<=;|z=e)9D0*l@SF-(#6niNn#wM*7X_~T8 zEEG=Bm_Wj09Ah;=6HBzfGLk3}Oa>ly6oeQy>s_%7uw@v%AYe4KJVtRezywa>Fese1 zilWuV*@RJ85!7Ld`1fmxc!n>K!`iB%EXu&T7#}oZ6J8L*_BU$8aNh$-6CIYvSot4R z)-wOwe zXXQ`tXt;G?u=Ue(1&H`p>$6hYob2T<{d;#>Q{TpiQ``PnZCXFczoO)4riRRSf|Jj8 zwEW^$i+y8f*5yR@T5{X*-rf`Wn}bucT873A?EdT#lf6L*$n_ z);)lBUT6buH3GTJjQ4&AtTGyR(T#QO>NZz`ReT7)b=-<6P4H_dqa;??xc?UilG zH5)+jA9n5}PK=Y@nzHdpr0&h+=7I(D4h-Fy4@ZkKC$QFnKDaNbWpdE(@T z(>*;sJL>EA7|WU;Y1zO3qpGv-U*Egexo_`Y9m7q`diXv>tWJDqbz5ue$3-1q9;gWI z=-GFtY2NdFeJ*55ZJtnlYW2dTd_AS$bY1rwn-?s6{NTTy=-0gb^igk7a(Q*vE_<+lX8WmM&+gMBzv}$7 zcws!=u;})dO*38dL$f|FPd@k5&o6JcZ&ik_zHlFM^^|Aj()Ui@G7yq%5Y?9A63e{ZWpDX! zY8xE{{n)-Z`Z0R?SA#QmeULbN@q>Rdf$|0au%|5IQY#QZgD!LW5^A zucX%J-iPfx diff --git a/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_4.png.mcmeta b/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_4.png.mcmeta index b4e1b3cd..f6730e30 100644 --- a/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_4.png.mcmeta +++ b/common/src/main/resources/assets/vs_eureka/textures/block/engine_front_on_4.png.mcmeta @@ -1,6 +1,5 @@ { "animation": { - "interpolate": true, - "frametime": 10 + "frametime": 4 } } \ No newline at end of file From c385619d3afe7324b4404114d877d73bbb7132b8 Mon Sep 17 00:00:00 2001 From: SimonAlteruna <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 7 Jun 2023 23:20:32 +0200 Subject: [PATCH 12/56] engine return bucket and fuel burn time multiplier --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 3 ++ .../eureka/blockentity/EngineBlockEntity.kt | 29 ++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 16f2dda8..30779b37 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -37,6 +37,9 @@ object EurekaConfig { @JsonSchema(description = "Increasing this value will result in more items being able to converted to fuel") val engineMinCapacity = 2000 + @JsonSchema(description = "Fuel burn time multiplier") + val engineFuelMultiplier = 2f + @JsonSchema(description = "Max speed of a ship without boosting") val maxCasualSpeed = 20f diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 78b0b05c..78a38efa 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -76,22 +76,16 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : // Refill while burning if (!fuel.isEmpty && lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { - lastFuelValue = (FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * 2 + lastFuelValue = ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() if (lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { - fuelLeft += lastFuelValue - fuelTotal = max(lastFuelValue, EurekaConfig.SERVER.engineMinCapacity) - removeItem(0, 1) - setChanged() + useFuel(lastFuelValue) } } } else if (!fuel.isEmpty) { - lastFuelValue = (FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * 2 - fuelLeft = lastFuelValue - fuelTotal = max(lastFuelValue, EurekaConfig.SERVER.engineMinCapacity) - removeItem(0, 1) - setChanged() + lastFuelValue = ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() + useFuel(lastFuelValue) } } @@ -130,6 +124,21 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : private fun heatEngine(value: Float) = (100 * EurekaConfig.SERVER.engineHeatChangeExponent - this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + private fun useFuel(value: Int) { + if (value > 0) { + fuelLeft += value + fuelTotal = max(value, EurekaConfig.SERVER.engineMinCapacity) + + // Handle items like lava buckets + if (fuel.item.hasCraftingRemainingItem()) { + fuel = ItemStack(fuel.item.craftingRemainingItem!!, 1) + } else { + removeItem(0, 1) + } + setChanged() + } + } + private fun coolEngine(value: Float) = (this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value override fun saveAdditional(tag: CompoundTag) { From 2d04e7e6313bbfe46aa03f4c39f37ba1c4b1764f Mon Sep 17 00:00:00 2001 From: SimonAlteruna <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Thu, 8 Jun 2023 11:49:07 +0200 Subject: [PATCH 13/56] Moved getting fuel to the use fuel method and added more documentation * Added documentation according to KDoc syntax. * Renamed some methods to make their purpose more clear. * Created method for getting scaled fuel ticks. * Moved getting fuel and handling of mid burn consumption into the `consumeFuel` method --- .../eureka/blockentity/EngineBlockEntity.kt | 58 +++++++++++++------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 78a38efa..411a530c 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -63,29 +63,24 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : if (EurekaConfig.SERVER.engineFuelSaving) { if (heat <= maxEffectiveFuel) { - heat += heatEngine(EurekaConfig.SERVER.engineHeatGain) + heat += scaleEngineHeating(EurekaConfig.SERVER.engineHeatGain) fuelLeft-- } } else { fuelLeft-- if (heat <= maxEffectiveFuel) { - heat += heatEngine(EurekaConfig.SERVER.engineHeatGain) + heat += scaleEngineHeating(EurekaConfig.SERVER.engineHeatGain) } } // Refill while burning if (!fuel.isEmpty && lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { - lastFuelValue = ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() - - if (lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { - useFuel(lastFuelValue) - } + consumeFuel() } } else if (!fuel.isEmpty) { - lastFuelValue = ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() - useFuel(lastFuelValue) + consumeFuel() } } @@ -114,20 +109,34 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : heat -= eurekaShipControl!!.consumed; } - heat = max(heat - coolEngine(EurekaConfig.SERVER.engineHeatLoss),0f) + heat = max(heat - scaleEngineCooling(EurekaConfig.SERVER.engineHeatLoss),0f) } } } - fun isBurning() = fuelLeft > 0 + fun isBurning(): Boolean = fuelLeft > 0 - private fun heatEngine(value: Float) = (100 * EurekaConfig.SERVER.engineHeatChangeExponent - - this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + /** + * Get fuel value from the item type stored in the engine. + * + * @return scaled fuel ticks. + */ + private fun getScaledFuel(): Int = ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() - private fun useFuel(value: Int) { - if (value > 0) { - fuelLeft += value - fuelTotal = max(value, EurekaConfig.SERVER.engineMinCapacity) + /** + * Absorb one fuel item into the engine. + */ + private fun consumeFuel() { + + lastFuelValue = getScaledFuel() + + if (lastFuelValue > 0) { + if (fuelLeft > 0 && lastFuelValue > EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { + return + } + + fuelLeft += lastFuelValue + fuelTotal = max(lastFuelValue, EurekaConfig.SERVER.engineMinCapacity) // Handle items like lava buckets if (fuel.item.hasCraftingRemainingItem()) { @@ -139,7 +148,20 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : } } - private fun coolEngine(value: Float) = (this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + /** + * Scale given heating [value] based on current heat. + * + * @return the scaled value. + */ + private fun scaleEngineHeating(value: Float): Float = (100 * EurekaConfig.SERVER.engineHeatChangeExponent - + this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + + /** + * Scale given cooling [value] based on current heat. + * + * @return the scaled value. + */ + private fun scaleEngineCooling(value: Float): Float = (this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value override fun saveAdditional(tag: CompoundTag) { tag.put("FuelSlot", fuel.save(CompoundTag())) From 80762cd7b0bda2f650d90a421d760abd2e9fb2ae Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Fri, 9 Jun 2023 21:39:23 +0200 Subject: [PATCH 14/56] Resolved incorrect recipe noted in issue #182 --- .../main/resources/data/vs_eureka/recipes/brown_balloon.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json index 0ada9051..3c99b894 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json @@ -5,11 +5,11 @@ "item": "vs_eureka:balloon" }, { - "item": "minecraft:cyan_dye" + "item": "minecraft:brown_dye" } ], "result": { - "item": "vs_eureka:cyan_balloon", + "item": "vs_eureka:brown_balloon", "count": 1 } } \ No newline at end of file From 5ac7ef02319d1244ada1e48aff08c06759e46d1e Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Fri, 9 Jun 2023 22:53:15 +0200 Subject: [PATCH 15/56] Fixed engine not dropping inventory when broken #208 --- .../org/valkyrienskies/eureka/block/EngineBlock.kt | 14 ++++++++++++++ .../eureka/blockentity/EngineBlockEntity.kt | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt index e5d43995..00a187eb 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt @@ -7,6 +7,7 @@ import net.minecraft.sounds.SoundEvents import net.minecraft.sounds.SoundSource import net.minecraft.world.InteractionHand import net.minecraft.world.InteractionResult +import net.minecraft.world.entity.item.ItemEntity import net.minecraft.world.entity.player.Player import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.BlockGetter @@ -119,4 +120,17 @@ class EngineBlock : BaseEntityBlock( blockEntity.tick() } } + + override fun playerWillDestroy(level: Level, pos: BlockPos, state: BlockState, player: Player) { + if (!level.isClientSide) { + val blockEntity = level.getBlockEntity(pos) as EngineBlockEntity + + // Drop inventory + if (!blockEntity.fuel.isEmpty) { + level.addFreshEntity(ItemEntity(level, pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble(), blockEntity.fuel)) + } + } + + super.playerWillDestroy(level, pos, state, player) + } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 78b0b05c..6539fd7e 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -42,10 +42,10 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : override val ship: ServerShip? get() = (this.level as ServerLevel).getShipManagingPos(this.blockPos) private val eurekaShipControl by shipValue() val data = KtContainerData() - var heatLevel by data - var fuelLeft by data - var fuelTotal by data - private var fuel: ItemStack = ItemStack.EMPTY + private var heatLevel by data + private var fuelLeft by data + private var fuelTotal by data + var fuel: ItemStack = ItemStack.EMPTY private var maxEffectiveFuel = 100f - EurekaConfig.SERVER.engineHeatGain private var lastFuelValue = 1600; // coal: 1600 From a9ec5fa26c62660be8a8bbe92ee6fa69b8218b57 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Fri, 9 Jun 2023 17:45:26 +0200 Subject: [PATCH 16/56] Resolved Java [ant:checkstyle] [ERROR] --- .../eureka/forge/DeferredRegisterImpl.java | 16 +++++++++------- .../eureka/forge/EurekaModForge.java | 12 ++++++++---- .../mixin/ValkyrienForgeMixinConfigPlugin.java | 5 ++--- .../services/DeferredRegisterBackendForge.java | 5 ++++- .../services/EurekaPlatformHelperForge.java | 8 ++++++-- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java index 8e915986..0d48ca5d 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java @@ -1,5 +1,6 @@ package org.valkyrienskies.eureka.forge; +import java.util.Iterator; import kotlin.jvm.functions.Function0; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; @@ -8,19 +9,20 @@ import org.valkyrienskies.eureka.registry.DeferredRegister; import org.valkyrienskies.eureka.registry.RegistrySupplier; -import java.util.Iterator; - public class DeferredRegisterImpl implements DeferredRegister { private final net.minecraftforge.registries.DeferredRegister forge; - public DeferredRegisterImpl(String modId, ResourceKey> registry) { + public DeferredRegisterImpl(final String modId, final ResourceKey> registry) { forge = net.minecraftforge.registries.DeferredRegister.create(registry.location(), modId); } @NotNull @Override - public RegistrySupplier register(@NotNull String name, @NotNull Function0 builder) { - RegistryObject result = forge.register(name, builder::invoke); + public RegistrySupplier register( + @NotNull final String name, + @NotNull final Function0 builder + ) { + final RegistryObject result = forge.register(name, builder::invoke); return new RegistrySupplier() { @NotNull @@ -44,7 +46,7 @@ public void applyAll() { @NotNull @Override public Iterator> iterator() { - Iterator> iterator = forge.getEntries().iterator(); + final Iterator> iterator = forge.getEntries().iterator(); return new Iterator>() { @Override @@ -54,7 +56,7 @@ public boolean hasNext() { @Override public RegistrySupplier next() { - RegistryObject result = iterator.next(); + final RegistryObject result = iterator.next(); return new RegistrySupplier() { @NotNull diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java index 96bd78d7..95081a73 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java @@ -45,14 +45,17 @@ public EurekaModForge() { } void clientSetup(final FMLClientSetupEvent event) { - if (happendClientSetup) return; + if (happendClientSetup) { + return; + } happendClientSetup = true; EurekaMod.initClient(); WheelModels.INSTANCE.setModelGetter(woodType -> ForgeModelBakery.instance().getBakedTopLevelModels() .getOrDefault( - new ResourceLocation(EurekaMod.MOD_ID, "block/" + woodType.getResourceName() + "_ship_helm_wheel"), + new ResourceLocation(EurekaMod.MOD_ID, + "block/" + woodType.getResourceName() + "_ship_helm_wheel"), Minecraft.getInstance().getModelManager().getMissingModel() )); } @@ -65,8 +68,9 @@ void entityRenderers(final EntityRenderersEvent.RegisterRenderers event) { } void onModelRegistry(final ModelRegistryEvent event) { - for (WoodType woodType : WoodType.values()) { - ForgeModelBakery.addSpecialModel(new ResourceLocation(EurekaMod.MOD_ID, "block/" + woodType.getResourceName() + "_ship_helm_wheel")); + for (final WoodType woodType : WoodType.values()) { + ForgeModelBakery.addSpecialModel(new ResourceLocation( + EurekaMod.MOD_ID, "block/" + woodType.getResourceName() + "_ship_helm_wheel")); } } } diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/mixin/ValkyrienForgeMixinConfigPlugin.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/mixin/ValkyrienForgeMixinConfigPlugin.java index 57268241..9ca5f567 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/mixin/ValkyrienForgeMixinConfigPlugin.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/mixin/ValkyrienForgeMixinConfigPlugin.java @@ -1,12 +1,11 @@ package org.valkyrienskies.eureka.forge.mixin; +import java.util.List; +import java.util.Set; import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; -import java.util.List; -import java.util.Set; - /** * For now, just using this class as an abusive early entrypoint to run the updater */ diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/services/DeferredRegisterBackendForge.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/services/DeferredRegisterBackendForge.java index 25165896..16707975 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/services/DeferredRegisterBackendForge.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/services/DeferredRegisterBackendForge.java @@ -11,7 +11,10 @@ public class DeferredRegisterBackendForge implements DeferredRegisterBackend { @NotNull @Override - public DeferredRegister makeDeferredRegister(@NotNull String id, @NotNull ResourceKey> registry) { + public DeferredRegister makeDeferredRegister( + @NotNull final String id, + @NotNull final ResourceKey> registry + ) { return new DeferredRegisterImpl(id, registry); } } diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/services/EurekaPlatformHelperForge.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/services/EurekaPlatformHelperForge.java index 3988b9b1..c35d0dc7 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/services/EurekaPlatformHelperForge.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/services/EurekaPlatformHelperForge.java @@ -12,7 +12,10 @@ public class EurekaPlatformHelperForge implements EurekaPlatformHelper { @NotNull @Override - public CreativeModeTab createCreativeTab(@NotNull ResourceLocation id, @NotNull Function0 stack) { + public CreativeModeTab createCreativeTab( + @NotNull final ResourceLocation id, + @NotNull final Function0 stack + ) { return new CreativeModeTab(id.toString()) { @Override public ItemStack makeIcon() { @@ -21,7 +24,8 @@ public ItemStack makeIcon() { @Override public Component getDisplayName() { - return new TranslatableComponent("itemGroup." + String.format("%s.%s", id.getNamespace(), id.getPath())); + return new TranslatableComponent( + "itemGroup." + String.format("%s.%s", id.getNamespace(), id.getPath())); } }; } From fe2af40969f7f13b85e76e22d49b179b46b39d2f Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 10 Jun 2023 04:22:30 +0200 Subject: [PATCH 17/56] Fixed issue where player became soft-locked when help was destroyed. * Resolved #125 and #27 * Right clicking on the helm while already controlling it will open the GUI instead of recreating the seat. --- .../org/valkyrienskies/eureka/block/ShipHelmBlock.kt | 11 +++++++++-- .../eureka/blockentity/ShipHelmBlockEntity.kt | 9 +++++++++ .../valkyrienskies/eureka/ship/EurekaShipControl.kt | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt index b5b9938a..f7b49a21 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt @@ -29,6 +29,7 @@ import org.valkyrienskies.eureka.blockentity.ShipHelmBlockEntity import org.valkyrienskies.eureka.ship.EurekaShipControl import org.valkyrienskies.eureka.util.DirectionalShape import org.valkyrienskies.eureka.util.RotShapes +import org.valkyrienskies.mod.common.ValkyrienSkiesMod import org.valkyrienskies.mod.common.getShipManagingPos import org.valkyrienskies.mod.common.getShipObjectManagingPos @@ -58,8 +59,14 @@ class ShipHelmBlock(properties: Properties, val woodType: WoodType) : BaseEntity if (level.isClientSide) return level as ServerLevel - level.getShipManagingPos(pos)?.getAttachment()?.let { - it.helms -= 1 + level.getShipManagingPos(pos)?.getAttachment()?.let { control -> + + if (control.helms <= 1 && control.seatedPlayer?.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE) { + control.seatedPlayer!!.unRide() + control.seatedPlayer = null + } + + control.helms -= 1 } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 2402aa30..0a8e02d5 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -8,6 +8,7 @@ import net.minecraft.network.chat.Component import net.minecraft.network.chat.TranslatableComponent import net.minecraft.server.level.ServerLevel import net.minecraft.world.MenuProvider +import net.minecraft.world.entity.EntityType import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu @@ -41,6 +42,7 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : override var ship: ServerShip? = null // TODO ship is not being set in vs2? get() = field ?: (level as ServerLevel).getShipObjectManagingPos(this.blockPos) val control by shipValue() + val seats = mutableListOf() val assembled get() = ship != null val aligning get() = control?.aligning ?: false var shouldDisassembleWhenPossible = false @@ -137,6 +139,13 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : } fun sit(player: Player, force: Boolean = false): Boolean { + // If player is already controlling the ship, open the helm menu + if (!force && player.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE && control?.seatedPlayer == player) + { + player.openMenu(this); + return true; + } + val seat = spawnSeat(blockPos, blockState, level as ServerLevel) control?.seatedPlayer = player return player.startRiding(seat, force) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index dcf098f4..7ccbbc12 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -367,7 +367,7 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { } private fun deleteIfEmpty() { - if (helms == 0 && floaters == 0 && anchors == 0 && balloons == 0) { + if (helms <= 0 && floaters <= 0 && anchors <= 0 && balloons <= 0) { ship?.saveAttachment(null) } } From 9689e9c8043b14120c0f8fd8acaad8b337d66272 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 10 Jun 2023 04:57:22 +0200 Subject: [PATCH 18/56] Resolved #175 --- .../eureka/blockentity/ShipHelmBlockEntity.kt | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 0a8e02d5..0d65dc11 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -87,6 +87,28 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : return entity } + fun startRiding(player: Player, force: Boolean, blockPos: BlockPos, state: BlockState, level: ServerLevel): Boolean { + + for (i in seats.size-1 downTo 0) { + if (!seats[i].isVehicle) { + seats[i].kill() + seats.removeAt(i) + } else if (!seats[i].isAlive) { + seats.removeAt(i) + } + } + + val seat = spawnSeat(blockPos, blockState, level) + val ride = player.startRiding(seat, force) + + if (ride) { + control?.seatedPlayer = player + seats.add(seat) + } + + return ride; + } + fun tick() { if (shouldDisassembleWhenPossible && ship?.getAttachment()?.canDisassemble == true) { this.disassemble() @@ -138,16 +160,30 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : control.aligning = !control.aligning } + override fun setRemoved() { + + if (level?.isClientSide == false) { + for (i in seats.indices) { + seats[i].kill() + } + seats.clear() + } + + super.setRemoved() + } + fun sit(player: Player, force: Boolean = false): Boolean { // If player is already controlling the ship, open the helm menu - if (!force && player.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE && control?.seatedPlayer == player) + if (!force && player.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE && seats.contains(player.vehicle as ShipMountingEntity)) { player.openMenu(this); return true; } - val seat = spawnSeat(blockPos, blockState, level as ServerLevel) - control?.seatedPlayer = player - return player.startRiding(seat, force) + //val seat = spawnSeat(blockPos, blockState, level as ServerLevel) + //control?.seatedPlayer = player + //return player.startRiding(seat, force) + return startRiding(player, force, blockPos, blockState, level as ServerLevel) + } } From 54ed46cd41feebb6c4f9f52f3c271909011c3532 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 10 Jun 2023 05:43:41 +0200 Subject: [PATCH 19/56] Removed dublicate listener * removed duplicate of `MOD_BUS.addListener(this::clientSetup);` --- .../java/org/valkyrienskies/eureka/forge/EurekaModForge.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java index 95081a73..11acf9be 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java @@ -30,6 +30,8 @@ public EurekaModForge() { // Submit our event bus to let architectury register our content on the right time MOD_BUS = FMLJavaModLoadingContext.get().getModEventBus(); MOD_BUS.addListener(this::clientSetup); + MOD_BUS.addListener(this::onModelRegistry); + MOD_BUS.addListener(this::entityRenderers); ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, () -> new ConfigGuiHandler.ConfigGuiFactory((Minecraft client, Screen parent) -> @@ -37,9 +39,6 @@ public EurekaModForge() { VSConfigClass.Companion.getRegisteredConfig(EurekaConfig.class))) ); - MOD_BUS.addListener(this::onModelRegistry); - MOD_BUS.addListener(this::clientSetup); - MOD_BUS.addListener(this::entityRenderers); EurekaMod.init(); } From 89adb53e8776a931afb8dd5578db120abde42413 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sun, 11 Jun 2023 16:11:54 +0200 Subject: [PATCH 20/56] resolved some deprecations and removed some corrected some nullables --- .../main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt | 2 +- .../kotlin/org/valkyrienskies/eureka/EurekaWeights.kt | 4 ++-- .../kotlin/org/valkyrienskies/eureka/block/AnchorBlock.kt | 6 +++--- .../org/valkyrienskies/eureka/block/BalloonBlock.kt | 5 +++-- .../kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt | 8 ++++---- .../org/valkyrienskies/eureka/block/FloaterBlock.kt | 5 +++-- .../org/valkyrienskies/eureka/block/ShipHelmBlock.kt | 5 +++-- .../eureka/blockentity/EngineBlockEntity.kt | 4 ++-- .../org/valkyrienskies/eureka/gui/engine/EngineScreen.kt | 2 +- 9 files changed, 22 insertions(+), 19 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt index 6860b352..cd34ec4e 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt @@ -172,7 +172,7 @@ object EurekaBlocks { // region Flammables // TODO make this part of the registration sequence - fun flammableBlock(block: Block?, flameOdds: Int, burnOdds: Int) { + fun flammableBlock(block: Block, flameOdds: Int, burnOdds: Int) { val fire = Blocks.FIRE as FireBlock fire.setFlammable(block, flameOdds, burnOdds) } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt index 6379f84c..316397c3 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt @@ -4,7 +4,7 @@ import net.minecraft.core.Registry import net.minecraft.resources.ResourceLocation import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.properties.BlockStateProperties -import org.valkyrienskies.core.game.VSBlockType +import org.valkyrienskies.core.apigame.world.chunks.BlockType import org.valkyrienskies.mod.common.BlockStateInfo import org.valkyrienskies.mod.common.BlockStateInfoProvider @@ -26,7 +26,7 @@ object EurekaWeights : BlockStateInfoProvider { return null } - override fun getBlockStateType(blockState: BlockState): VSBlockType? { + override fun getBlockStateType(blockState: BlockState): BlockType? { return null } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/AnchorBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/AnchorBlock.kt index e4255bf8..9b133e6f 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/AnchorBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/AnchorBlock.kt @@ -6,6 +6,7 @@ import net.minecraft.server.level.ServerLevel import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.Level +import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.HorizontalDirectionalBlock import net.minecraft.world.level.block.SoundType @@ -90,9 +91,8 @@ class AnchorBlock : attachment.anchorsActive += if (bl) 1 else 0 } - override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) { - super.onRemove(state, level, pos, newState, isMoving) - + override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) { + super.destroy(level, pos, state) if (level.isClientSide) return level as ServerLevel diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/BalloonBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/BalloonBlock.kt index 9964df5d..9ed3b21e 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/BalloonBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/BalloonBlock.kt @@ -7,6 +7,7 @@ import net.minecraft.world.damagesource.DamageSource import net.minecraft.world.entity.Entity import net.minecraft.world.entity.projectile.Projectile import net.minecraft.world.level.Level +import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.BlockHitResult @@ -32,8 +33,8 @@ class BalloonBlock(properties: Properties) : Block(properties) { EurekaShipControl.getOrCreate(ship).balloons += 1 } - override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) { - super.onRemove(state, level, pos, newState, isMoving) + override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) { + super.destroy(level, pos, state) if (level.isClientSide) return level as ServerLevel diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt index 00a187eb..4527f81d 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/EngineBlock.kt @@ -77,11 +77,11 @@ class EngineBlock : BaseEntityBlock( return RenderShape.MODEL } - override fun getShadeBrightness(state: BlockState?, level: BlockGetter?, pos: BlockPos?): Float { - if (state?.getValue(HEAT) ?: 0 > 0) { - return 1.0f + override fun getShadeBrightness(state: BlockState, level: BlockGetter, pos: BlockPos): Float { + return if ((state.getValue(HEAT) ?: 0) > 0) { + 1.0f } else { - return super.getShadeBrightness(state, level, pos) + super.getShadeBrightness(state, level, pos) } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/FloaterBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/FloaterBlock.kt index d7b4b8f8..c9aa97b4 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/FloaterBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/FloaterBlock.kt @@ -3,6 +3,7 @@ package org.valkyrienskies.eureka.block import net.minecraft.core.BlockPos import net.minecraft.server.level.ServerLevel import net.minecraft.world.level.Level +import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.SoundType import net.minecraft.world.level.block.state.BlockState @@ -61,8 +62,8 @@ class FloaterBlock : Block( level.setBlock(pos, state.setValue(POWER, signal), 2) } - override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) { - super.onRemove(state, level, pos, newState, isMoving) + override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) { + super.destroy(level, pos, state) if (level.isClientSide) return level as ServerLevel diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt index f7b49a21..1501dc32 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt @@ -10,6 +10,7 @@ import net.minecraft.world.entity.player.Player import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.Level +import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.block.BaseEntityBlock import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.RenderShape @@ -53,8 +54,8 @@ class ShipHelmBlock(properties: Properties, val woodType: WoodType) : BaseEntity EurekaShipControl.getOrCreate(ship).helms += 1 } - override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) { - super.onRemove(state, level, pos, newState, isMoving) + override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) { + super.destroy(level, pos, state) if (level.isClientSide) return level as ServerLevel diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index bebcc10f..31f5aac6 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -214,13 +214,13 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : ) <= 64.0 } - override fun getSlotsForFace(side: Direction?): IntArray = + override fun getSlotsForFace(side: Direction): IntArray = if (side == Direction.DOWN) intArrayOf() else intArrayOf(0) override fun canPlaceItemThroughFace(index: Int, itemStack: ItemStack, direction: Direction?): Boolean = direction != Direction.DOWN && canPlaceItem(index, itemStack) - override fun canTakeItemThroughFace(index: Int, stack: ItemStack?, direction: Direction?): Boolean = false + override fun canTakeItemThroughFace(index: Int, stack: ItemStack, direction: Direction): Boolean = false override fun canPlaceItem(index: Int, stack: ItemStack): Boolean = index == 0 && AbstractFurnaceBlockEntity.isFuel(stack) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/gui/engine/EngineScreen.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/gui/engine/EngineScreen.kt index 7bbc6bee..c3b68902 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/gui/engine/EngineScreen.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/gui/engine/EngineScreen.kt @@ -65,7 +65,7 @@ class EngineScreen(handler: EngineScreenMenu, playerInventory: Inventory, text: matrixStack.popPose() } - override fun renderLabels(poseStack: PoseStack?, mouseX: Int, mouseY: Int) { + override fun renderLabels(poseStack: PoseStack, mouseX: Int, mouseY: Int) { // super.renderLabels(poseStack, mouseX, mouseY) } From 826a43446f1aeed57208d770970d7a7ae4bcf282 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sun, 11 Jun 2023 17:39:44 +0200 Subject: [PATCH 21/56] Recipes and mass balancing --- .../src/main/resources/data/vs_eureka/recipes/anchor.json | 6 +++--- .../resources/data/vs_eureka/recipes/balloon_leather.json | 2 +- .../data/vs_eureka/recipes/balloon_membrane.json | 2 +- .../resources/data/vs_eureka/recipes/balloon_paper.json | 2 +- .../resources/data/vs_eureka/recipes/balloon_string.json | 2 +- .../resources/data/vs_eureka/recipes/balloon_wool.json | 2 +- .../src/main/resources/data/vs_eureka/vs_mass/eureka.json | 8 ++++++++ 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/common/src/main/resources/data/vs_eureka/recipes/anchor.json b/common/src/main/resources/data/vs_eureka/recipes/anchor.json index f3fad2e1..247fe20e 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/anchor.json +++ b/common/src/main/resources/data/vs_eureka/recipes/anchor.json @@ -3,17 +3,17 @@ "pattern": [ "#i#", " i ", - "IiI" + "iIi" ], "key": { "#": { - "item": "minecraft:string" + "item": "minecraft:lead" }, "i": { "item": "minecraft:iron_ingot" }, "I": { - "item": "minecraft:iron_nugget" + "item": "minecraft:iron_block" } }, "result": { diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json index 11f4be31..e0ceb761 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 32 + "count": 14 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json index 5f8e9162..1a9cb9d7 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 32 + "count": 16 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json index a2708426..1cda12b3 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 16 + "count": 2 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json index a463943f..3c567cfd 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 8 + "count": 2 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json index 96707d45..5c8c7ab5 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 32 + "count": 8 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/vs_mass/eureka.json b/common/src/main/resources/data/vs_eureka/vs_mass/eureka.json index 531f8555..e6472de3 100644 --- a/common/src/main/resources/data/vs_eureka/vs_mass/eureka.json +++ b/common/src/main/resources/data/vs_eureka/vs_mass/eureka.json @@ -2,5 +2,13 @@ { "block": "vs_eureka:ship_helm", "mass": 350.0 + }, + { + "block": "vs_eureka:engine", + "mass": 3200.0 + }, + { + "block": "vs_eureka:anchor", + "mass": 8840.0 } ] From 8e9b89d6d42a1a7e831e170efcfe34653bd23733 Mon Sep 17 00:00:00 2001 From: ewoudje <7384674+ewoudje@users.noreply.github.com> Date: Tue, 13 Jun 2023 23:53:30 +0200 Subject: [PATCH 22/56] Create en_au.json From discord https://discord.com/channels/244934352092397568/593535519263293460/1118296098642071592 --- .../assets/vs_eureka/lang/en_au.json | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 common/src/main/resources/assets/vs_eureka/lang/en_au.json diff --git a/common/src/main/resources/assets/vs_eureka/lang/en_au.json b/common/src/main/resources/assets/vs_eureka/lang/en_au.json new file mode 100644 index 00000000..eaca238c --- /dev/null +++ b/common/src/main/resources/assets/vs_eureka/lang/en_au.json @@ -0,0 +1,41 @@ +{ + "itemGroup.vs_eureka.eureka_tab": "Vis ya-eeka?", + "block.vs_eureka.oak_ship_helm": "Oyshelm", + "block.vs_eureka.spruce_ship_helm": "Spruy shelm", + "block.vs_eureka.birch_ship_helm": "Bury shelm", + "block.vs_eureka.jungle_ship_helm": "Junga shelm", + "block.vs_eureka.acacia_ship_helm": "Acky shelm", + "block.vs_eureka.dark_oak_ship_helm": "Droaka' shelm", + "block.vs_eureka.crimson_ship_helm": "Crimy shelm", + "block.vs_eureka.warped_ship_helm": "Wapa shelm", + "block.vs_eureka.anchor": "Ancha", + "block.vs_eureka.engine": "Enin'", + "block.vs_eureka.balloon": "Loony", + "block.vs_eureka.white_balloon": "White Loony", + "block.vs_eureka.light_gray_balloon": "Light Gray Loony, + "block.vs_eureka.gray_balloon": "Gray Loony", + "block.vs_eureka.black_balloon": "Black Loony", + "block.vs_eureka.red_balloon": "Red Loony", + "block.vs_eureka.orange_balloon": "Orange Loony", + "block.vs_eureka.yellow_balloon": "Yellow Loony", + "block.vs_eureka.lime_balloon": "Lime Loony", + "block.vs_eureka.green_balloon": "Green Loony", + "block.vs_eureka.light_blue_balloon": "Light Blue Loony", + "block.vs_eureka.cyan_balloon": "Cyan Loony", + "block.vs_eureka.blue_balloon": "Blue Loony", + "block.vs_eureka.purple_balloon": "Purple Loony", + "block.vs_eureka.magenta_balloon": "Magenta Loony", + "block.vs_eureka.pink_balloon": "Pink Loony", + "block.vs_eureka.brown_balloon": "Brown Loony", + "block.vs_eureka.floater": "Doodoo", + "block.vs_eureka.ballast": "Ballis", + "gui.vs_eureka.ship_helm": "Shelm", + "gui.vs_eureka.engine": "Enin", + "gui.vs_eureka.assemble": "Bang'n a twist", + "gui.vs_eureka.disassemble": "Right, now yoowh put it down", + "gui.vs_eureka.align": "M8", + "gui.vs_eureka.aligning": "M8ing...", + "gui.vs_eureka.todo": "Right, now yoowh put it down", + "hud.vs_eureka.start_cruising": "Cruise is on, watch out for roo's", + "hud.vs_eureka.stop_cruising": "Cruise is out" +} From 97a9ec1e08c9aebf41125dee4ab5b3b3904656fd Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 14 Jun 2023 01:36:42 +0200 Subject: [PATCH 23/56] Fixed json error Missing " character --- common/src/main/resources/assets/vs_eureka/lang/en_au.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/resources/assets/vs_eureka/lang/en_au.json b/common/src/main/resources/assets/vs_eureka/lang/en_au.json index eaca238c..861c3927 100644 --- a/common/src/main/resources/assets/vs_eureka/lang/en_au.json +++ b/common/src/main/resources/assets/vs_eureka/lang/en_au.json @@ -12,7 +12,7 @@ "block.vs_eureka.engine": "Enin'", "block.vs_eureka.balloon": "Loony", "block.vs_eureka.white_balloon": "White Loony", - "block.vs_eureka.light_gray_balloon": "Light Gray Loony, + "block.vs_eureka.light_gray_balloon": "Light Gray Loony", "block.vs_eureka.gray_balloon": "Gray Loony", "block.vs_eureka.black_balloon": "Black Loony", "block.vs_eureka.red_balloon": "Red Loony", From 92901f4a934a36703a9bd1e0e1bb07dc3642b122 Mon Sep 17 00:00:00 2001 From: Rubydesic Date: Sat, 20 May 2023 01:40:23 -0400 Subject: [PATCH 24/56] feat: reduce default max engine speed --- .../src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 2 +- .../kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 30779b37..6b11e420 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -41,7 +41,7 @@ object EurekaConfig { val engineFuelMultiplier = 2f @JsonSchema(description = "Max speed of a ship without boosting") - val maxCasualSpeed = 20f + val maxCasualSpeed = 15.0 @JsonSchema(description = "The speed at which the ship stabilizes") var stabilizationSpeed = 10.0 diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index 7ccbbc12..a9dbe076 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -288,7 +288,7 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { val baseForwardForce = Vector3d(baseForwardVel).sub(velOrthogonalToPlayerUp).mul(mass * 10) // This is the maximum speed we want to go in any scenario (when not sprinting) - val idealForwardVel = Vector3d(forwardVector).mul(EurekaConfig.SERVER.maxCasualSpeed.toDouble()) + val idealForwardVel = Vector3d(forwardVector).mul(EurekaConfig.SERVER.maxCasualSpeed) val idealForwardForce = Vector3d(idealForwardVel).sub(velOrthogonalToPlayerUp).mul(mass * 10) val extraForceNeeded = Vector3d(idealForwardForce).sub(baseForwardForce) From a0f226420ca5c70f1dc833261447dd34400d8cf8 Mon Sep 17 00:00:00 2001 From: Rubydesic Date: Wed, 14 Jun 2023 17:08:42 -0400 Subject: [PATCH 25/56] add issue templates --- .github/ISSUE_TEMPLATE/bug_report.yml | 48 +++++++++++++++ .../ISSUE_TEMPLATE/compatibility_issue.yml | 59 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/compatibility_issue.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..5d9341bb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,48 @@ +name: Bug report +description: Let us know about a bug that occurs without other mods +title: '' +labels: bug +assignees: [] +body: +- type: checkboxes + attributes: + label: This issue occurs when only Valkyrien Skies and addons are installed and no other mods + options: + - label: I have tested this issue and it occurs when no other mods are installed + required: true +- type: dropdown + attributes: + label: Minecraft Version + description: What Minecraft version does this issue occur on? + options: + - 1.16 + - 1.18 + - 1.19 + validations: + required: true +- type: dropdown + attributes: + label: Mod Loader + description: What mod loader does this issue occur on? + options: + - Forge + - Fabric + - Quilt + validations: + required: true +- type: textarea + attributes: + label: Issue description + description: Describe what happens, and what you expect to happen instead + validations: + required: true +- type: textarea + attributes: + label: Issue reproduction + description: Describe how to reproduce your issue + validations: + required: true +- type: textarea + attributes: + label: Logs + description: Go to `.minecraft/logs` and drag and drop the `latest.log` and `debug.log` file into this text field diff --git a/.github/ISSUE_TEMPLATE/compatibility_issue.yml b/.github/ISSUE_TEMPLATE/compatibility_issue.yml new file mode 100644 index 00000000..1fa48e82 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/compatibility_issue.yml @@ -0,0 +1,59 @@ +name: Compatibility issue +description: Let us know about a bug that occurs when another mod is installed +title: '<title>' +labels: compat +assignees: [] +body: +- type: markdown + attributes: + value: | + **Note:** do not report issues with the following mods: + - Optifine + - Magma Server (maybe try Arclight?) +- type: input + attributes: + label: Mod Name + description: The name of the mod that causes the compatibility issue + validations: + required: true +- type: checkboxes + attributes: + label: This issue occurs when only Valkyrien Skies, addons, and the mod I have specified are installed and no other mods + options: + - label: I have tested this issue and it occurs with only Valkyrien Skies, addons, and the mod I have specified +- type: dropdown + attributes: + label: Minecraft Version + description: What Minecraft version does this issue occur on? + options: + - 1.16 + - 1.18 + - 1.19 + validations: + required: true +- type: dropdown + attributes: + label: Mod Loader + description: What mod loader does this issue occur on? + options: + - Forge + - Fabric + - Quilt + validations: + required: true +- type: textarea + attributes: + label: Issue description + description: Describe what happens, and what you expect to happen instead + validations: + required: true +- type: textarea + attributes: + label: Issue reproduction + description: Describe how to reproduce your issue + validations: + required: true +- type: textarea + attributes: + label: Logs + description: Go to `.minecraft/logs` and drag and drop the `latest.log` and `debug.log` file into this text field From 400be5d0159f1cb57ed454c72308a8a2d86eb6c5 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 21 Jun 2023 20:17:41 +0200 Subject: [PATCH 26/56] Extra balloons now increases elevation speed (#221) --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 9 +++++++- .../eureka/ship/EurekaShipControl.kt | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 6b11e420..95344c96 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -59,7 +59,14 @@ object EurekaConfig { // Sensitivity of the up/down impulse buttons. // TODO maybe should be moved to VS2 client-side config? @JsonSchema(description = "Vertical sensitivity up ascend/descend") - var impulseElevationRate = 7 + var baseImpulseElevationRate = 2.0 + + @JsonSchema(description = "The max elevation speed boost gained by having extra extra balloons") + var balloonElevationMaxSpeed = 5.5 + + // Higher numbers make the ship accelerate to max speed faster + @JsonSchema(description = "Ascend and descend acceleration") + var elevationSnappiness = 1.0 // Allow Eureka controlled ships to be affected by fluid drag @JsonSchema(description = "Allow Eureka controlled ships to be affected by fluid drag") diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index a9dbe076..b8a801d2 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -100,12 +100,13 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { physShip as PhysShipImpl + val ship = ship ?: return val mass = physShip.inertia.shipMass val moiTensor = physShip.inertia.momentOfInertiaTensor val segment = physShip.segments.segments[0]?.segmentDisplacement!! val omega: Vector3dc = SegmentUtils.getOmega(physShip.poseVel, segment, Vector3d()) val vel = SegmentUtils.getVelocity(physShip.poseVel, segment, Vector3d()) - val ship = ship ?: return + val balloonForceProvided = balloons * forcePerBalloon val buoyantFactorPerFloater = min( @@ -305,20 +306,19 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { if (control.upImpulse != 0.0f) { idealUpwardVel = Vector3d(0.0, 1.0, 0.0) .mul(control.upImpulse.toDouble()) - .mul(EurekaConfig.SERVER.impulseElevationRate.toDouble()) + .mul(EurekaConfig.SERVER.baseImpulseElevationRate + + // Smoothing for how the elevation scales as you approaches the balloonElevationMaxSpeed + smoothing(2.0, EurekaConfig.SERVER.balloonElevationMaxSpeed, balloonForceProvided / mass) + ) } } // region Elevation - // Higher numbers make the ship accelerate to max speed faster - val elevationSnappiness = 10.0 val idealUpwardForce = Vector3d( 0.0, - idealUpwardVel.y() - vel.y() - (GRAVITY / elevationSnappiness), + idealUpwardVel.y() - vel.y() - (GRAVITY / EurekaConfig.SERVER.elevationSnappiness), 0.0 - ).mul(mass * elevationSnappiness) - - val balloonForceProvided = balloons * forcePerBalloon + ).mul(mass * EurekaConfig.SERVER.elevationSnappiness) val actualUpwardForce = Vector3d(0.0, min(balloonForceProvided, max(idealUpwardForce.y(), 0.0)), 0.0) physShip.applyInvariantForce(actualUpwardForce) @@ -372,6 +372,11 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { } } + /** + * f(x) = max - smoothing / (x + (smoothing / max)) + */ + private fun smoothing(smoothing: Double, max: Double, x: Double): Double = max - smoothing / (x + (smoothing / max)) + companion object { fun getOrCreate(ship: ServerShip): EurekaShipControl { return ship.getAttachment<EurekaShipControl>() From 9b129ee31aef5eb151d9460afe9ee5e8f8565cfa Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Thu, 22 Jun 2023 01:03:25 -0400 Subject: [PATCH 27/56] limit BFS search size --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 3 +++ .../eureka/blockentity/ShipHelmBlockEntity.kt | 10 ++++++++-- .../eureka/gui/shiphelm/ShipHelmScreenMenu.kt | 2 +- .../valkyrienskies/eureka/util/ShipAssembler.kt | 17 +++++++++++++---- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 95344c96..3e3b2948 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -199,5 +199,8 @@ object EurekaConfig { @JsonSchema(description = "Whether or not disassembly is permitted") val allowDisassembly = true + + @JsonSchema(description = "Maximum number of blocks allowed in a ship") + val maxShipBlocks = 262144 } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 0d65dc11..3a57e45a 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -1,10 +1,12 @@ package org.valkyrienskies.eureka.blockentity +import net.minecraft.Util import net.minecraft.commands.arguments.EntityAnchorArgument import net.minecraft.core.BlockPos import net.minecraft.core.Direction.Axis import net.minecraft.core.Registry import net.minecraft.network.chat.Component +import net.minecraft.network.chat.TextComponent import net.minecraft.network.chat.TranslatableComponent import net.minecraft.server.level.ServerLevel import net.minecraft.world.MenuProvider @@ -116,17 +118,21 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : } // Needs to get called server-side - fun assemble() { + fun assemble(player: Player) { val level = level as ServerLevel // Check the block state before assembling to avoid creating an empty ship val blockState = level.getBlockState(blockPos) if (blockState.block !is ShipHelmBlock) return - ShipAssembler.collectBlocks( + val builtShip = ShipAssembler.collectBlocks( level, blockPos ) { !it.isAir && !EurekaConfig.SERVER.blockBlacklist.contains(Registry.BLOCK.getKey(it.block).toString()) } + + if (builtShip == null){ + player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks"), Util.NIL_UUID) + } } fun disassemble() { diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/gui/shiphelm/ShipHelmScreenMenu.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/gui/shiphelm/ShipHelmScreenMenu.kt index 1a4e775e..b0a689b4 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/gui/shiphelm/ShipHelmScreenMenu.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/gui/shiphelm/ShipHelmScreenMenu.kt @@ -22,7 +22,7 @@ class ShipHelmScreenMenu(syncId: Int, playerInv: Inventory, val blockEntity: Shi if (blockEntity == null) return false if (id == 0 && !assembled && !player.level.isClientSide) { - blockEntity.assemble() + blockEntity.assemble(player) return true } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index 44df1c78..e5996c45 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -33,12 +33,16 @@ import kotlin.math.round import kotlin.math.sign object ShipAssembler { - fun collectBlocks(level: ServerLevel, center: BlockPos, predicate: (BlockState) -> Boolean): ServerShip { + fun collectBlocks(level: ServerLevel, center: BlockPos, predicate: (BlockState) -> Boolean): ServerShip? { val blocks = DenseBlockPosSet() blocks.add(center.toJOML()) - bfs(level, center, blocks, predicate) - return createNewShipWithBlocks(center, blocks, level) + val result = bfs(level, center, blocks, predicate) + if (result) { + return createNewShipWithBlocks(center, blocks, level) + } else { + return null + } } private fun roundToNearestMultipleOf(number: Double, multiple: Double) = multiple * round(number / multiple) @@ -154,7 +158,7 @@ object ShipAssembler { start: BlockPos, blocks: DenseBlockPosSet, predicate: (BlockState) -> Boolean - ) { + ):Boolean { val blacklist = DenseBlockPosSet() val stack = ObjectArrayList<BlockPos>() @@ -173,7 +177,12 @@ object ShipAssembler { } } } + if (blocks.size > EurekaConfig.SERVER.maxShipBlocks) { + return false + } } + logger.info("Found ${blocks.size} blocks, out of ${EurekaConfig.SERVER.maxShipBlocks} allowed") + return true; } private fun directions(center: BlockPos, lambda: (BlockPos) -> Unit) { From a477504c51e20a44888238cf0b32e4f629635f81 Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Thu, 22 Jun 2023 11:10:59 -0400 Subject: [PATCH 28/56] clean up a bit --- .../main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 2 +- .../valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt | 3 +++ .../kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 3e3b2948..3843baf2 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -201,6 +201,6 @@ object EurekaConfig { val allowDisassembly = true @JsonSchema(description = "Maximum number of blocks allowed in a ship") - val maxShipBlocks = 262144 + val maxShipBlocks = 64*64*64 } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 3a57e45a..aa09a97f 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -26,6 +26,7 @@ import org.valkyrienskies.core.api.ships.ServerShip import org.valkyrienskies.core.api.ships.getAttachment import org.valkyrienskies.core.impl.api.ServerShipProvider import org.valkyrienskies.core.impl.api.shipValue +import org.valkyrienskies.core.impl.util.logger import org.valkyrienskies.eureka.EurekaBlockEntities import org.valkyrienskies.eureka.EurekaConfig import org.valkyrienskies.eureka.block.ShipHelmBlock @@ -132,6 +133,7 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : if (builtShip == null){ player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks"), Util.NIL_UUID) + logger.warn("${player.name.string} tried to assemble a ship that was too big") } } @@ -192,4 +194,5 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : return startRiding(player, force, blockPos, blockState, level as ServerLevel) } + private val logger by logger() } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index e5996c45..36bf1ff0 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -178,11 +178,12 @@ object ShipAssembler { } } if (blocks.size > EurekaConfig.SERVER.maxShipBlocks) { + logger.info("Stopped ship assembly by: too many blocks") return false } } - logger.info("Found ${blocks.size} blocks, out of ${EurekaConfig.SERVER.maxShipBlocks} allowed") - return true; + logger.info("Assembled ship with ${blocks.size} blocks, out of ${EurekaConfig.SERVER.maxShipBlocks} allowed") + return true } private fun directions(center: BlockPos, lambda: (BlockPos) -> Unit) { From 5738944d2da02630df0d654e4871e6ae363d5067 Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Thu, 22 Jun 2023 11:46:37 -0400 Subject: [PATCH 29/56] clarify a few prints --- .../valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt | 2 +- .../main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index aa09a97f..9a0c5d62 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -133,7 +133,7 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : if (builtShip == null){ player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks"), Util.NIL_UUID) - logger.warn("${player.name.string} tried to assemble a ship that was too big") + logger.warn("Failed to assemble ship for ${player.name.string}") } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index 36bf1ff0..df373175 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -178,7 +178,7 @@ object ShipAssembler { } } if (blocks.size > EurekaConfig.SERVER.maxShipBlocks) { - logger.info("Stopped ship assembly by: too many blocks") + logger.info("Stopped ship assembly due too many blocks") return false } } From 4a42af8acfc1458cdfa838bd96b9af5cfa038219 Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Thu, 22 Jun 2023 18:59:05 -0400 Subject: [PATCH 30/56] allow disabling maxShipBlocks --- .../main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 2 +- .../kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 3843baf2..2005af5d 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -200,7 +200,7 @@ object EurekaConfig { @JsonSchema(description = "Whether or not disassembly is permitted") val allowDisassembly = true - @JsonSchema(description = "Maximum number of blocks allowed in a ship") + @JsonSchema(description = "Maximum number of blocks allowed in a ship. Set to 0 for no limit") val maxShipBlocks = 64*64*64 } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index df373175..8e5deb03 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -177,12 +177,14 @@ object ShipAssembler { } } } - if (blocks.size > EurekaConfig.SERVER.maxShipBlocks) { + if ((EurekaConfig.SERVER.maxShipBlocks > 0) and (blocks.size > EurekaConfig.SERVER.maxShipBlocks)) { logger.info("Stopped ship assembly due too many blocks") return false } } - logger.info("Assembled ship with ${blocks.size} blocks, out of ${EurekaConfig.SERVER.maxShipBlocks} allowed") + if (EurekaConfig.SERVER.maxShipBlocks > 0){ + logger.info("Assembled ship with ${blocks.size} blocks, out of ${EurekaConfig.SERVER.maxShipBlocks} allowed") + } return true } From 835a0364e43cbd6f2cc0388f98d6033a8af76ad7 Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Fri, 30 Jun 2023 21:01:17 -0400 Subject: [PATCH 31/56] better max BFS default --- .../src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 2005af5d..1c6c6e5d 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -201,6 +201,6 @@ object EurekaConfig { val allowDisassembly = true @JsonSchema(description = "Maximum number of blocks allowed in a ship. Set to 0 for no limit") - val maxShipBlocks = 64*64*64 + val maxShipBlocks = 32*32*32 } } From 74aa9bb2f49d1857c109f8547bd8684fde71ddd6 Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Fri, 30 Jun 2023 21:02:07 -0400 Subject: [PATCH 32/56] Tell player that max ship size is editable --- .../valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 9a0c5d62..2c7d95f9 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -132,7 +132,7 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : ) { !it.isAir && !EurekaConfig.SERVER.blockBlacklist.contains(Registry.BLOCK.getKey(it.block).toString()) } if (builtShip == null){ - player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks"), Util.NIL_UUID) + player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks (changable in the config)"), Util.NIL_UUID) logger.warn("Failed to assemble ship for ${player.name.string}") } } From 6afb118536d53af97aad3c54ed2176673c1470d6 Mon Sep 17 00:00:00 2001 From: Kurt Wilson <kurt4wilson@gmail.com> Date: Fri, 30 Jun 2023 21:02:54 -0400 Subject: [PATCH 33/56] fix style error --- .../main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index 8e5deb03..4a00cfa0 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -158,7 +158,7 @@ object ShipAssembler { start: BlockPos, blocks: DenseBlockPosSet, predicate: (BlockState) -> Boolean - ):Boolean { + ): Boolean { val blacklist = DenseBlockPosSet() val stack = ObjectArrayList<BlockPos>() From 9d323c59d49d2d5c351c546ba9dc7612412e7464 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 15 Jul 2023 17:53:23 +0200 Subject: [PATCH 34/56] Updated recipes according to poll results --- .../data/vs_eureka/recipes/balloon_leather.json | 2 +- .../vs_eureka/recipes/balloon_membrane.json | 2 +- .../data/vs_eureka/recipes/balloon_string.json | 17 ----------------- .../data/vs_eureka/recipes/balloon_wool.json | 2 +- 4 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 common/src/main/resources/data/vs_eureka/recipes/balloon_string.json diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json index e0ceb761..188215b1 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 14 + "count": 4 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json index 1a9cb9d7..5f8e9162 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 16 + "count": 32 } } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json deleted file mode 100644 index 3c567cfd..00000000 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_string.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " # ", - "# #", - " # " - ], - "key": { - "#": { - "item": "minecraft:string" - } - }, - "result": { - "item": "vs_eureka:balloon", - "count": 2 - } -} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json index 5c8c7ab5..46e05c32 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json @@ -12,6 +12,6 @@ }, "result": { "item": "vs_eureka:balloon", - "count": 8 + "count": 4 } } \ No newline at end of file From adbb5a1e9475ccad8f9823b2795eac46bf4e4104 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:27:52 +0200 Subject: [PATCH 35/56] Added 1.20 as an option in the bug report template --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5d9341bb..53b704ac 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -18,6 +18,7 @@ body: - 1.16 - 1.18 - 1.19 + - 1.20 validations: required: true - type: dropdown From 37a577b9a119acf15f13edc01b3e15e7c9b9b86b Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:34:51 +0200 Subject: [PATCH 36/56] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 53b704ac..f61ff7a1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -18,7 +18,7 @@ body: - 1.16 - 1.18 - 1.19 - - 1.20 + - 1.20​ validations: required: true - type: dropdown From 7f1190576b57e97370fef83d468f9e474590fdfd Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sun, 13 Aug 2023 17:30:05 +0200 Subject: [PATCH 37/56] Updated blacklist --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 1c6c6e5d..6999c9ca 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -141,6 +141,7 @@ object EurekaConfig { "minecraft:fern", "minecraft:dead_bush", "minecraft:seagrass", + "minecraft:tall_seagrass", "minecraft:sea_pickle", "minecraft:kelp", "minecraft:bamboo", @@ -185,7 +186,19 @@ object EurekaConfig { "minecraft:end_portal_frame", "minecraft:end_portal", "minecraft:end_gateway", - "minecraft:portal" + "minecraft:portal", + "minecraft:oak_sapling", + "minecraft:spruce_sapling", + "minecraft:birch_sapling", + "minecraft:jungle_sapling", + "minecraft:acacia_sapling", + "minecraft:dark_oak_sapling", + "minecraft:oak_leaves", + "minecraft:spruce_leaves", + "minecraft:birch_leaves", + "minecraft:jungle_leaves", + "minecraft:acacia_leaves", + "minecraft:dark_oak_leaves" ) @JsonSchema(description = "Whether the ship helm assembles diagonally connected blocks or not") From 652a4bdebac9c0f2caf98d1f8bdb10e83874fc78 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:58:57 +0200 Subject: [PATCH 38/56] Update VS2 version to 2.1.0 beta.14 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 26722f1a..f518d294 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ enabled_platforms=fabric,forge archives_base_name=eureka maven_group=org.valkyrienskies # Dependencies -vs2_version=2.1.0-beta.10+f520a5c13d +vs2_version=2.1.0-beta.14+acba7d4175 minecraft_version=1.18.2 architectury_version=4.10.86 fabric_loader_version=0.14.10 From 25f6aa134ab2426f31224223978a9bce3335a410 Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Thu, 31 Aug 2023 03:56:25 -0600 Subject: [PATCH 39/56] Updated to latest VS2 --- .../valkyrienskies/eureka/EurekaWeights.kt | 11 +++++++ .../eureka/ship/EurekaShipControl.kt | 30 +++++-------------- .../valkyrienskies/eureka/ship/Stabilize.kt | 19 +++--------- gradle.properties | 2 +- 4 files changed, 23 insertions(+), 39 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt index 316397c3..2778c0e3 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt @@ -7,10 +7,21 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties import org.valkyrienskies.core.apigame.world.chunks.BlockType import org.valkyrienskies.mod.common.BlockStateInfo import org.valkyrienskies.mod.common.BlockStateInfoProvider +import org.valkyrienskies.physics_api.Lod1BlockStateId +import org.valkyrienskies.physics_api.Lod1LiquidBlockStateId +import org.valkyrienskies.physics_api.Lod1SolidBlockStateId +import org.valkyrienskies.physics_api.voxel.Lod1LiquidBlockState +import org.valkyrienskies.physics_api.voxel.Lod1SolidBlockState object EurekaWeights : BlockStateInfoProvider { + override val blockStateData: List<Triple<Lod1SolidBlockStateId, Lod1LiquidBlockStateId, Lod1BlockStateId>> + get() = emptyList() + override val liquidBlockStates: List<Lod1LiquidBlockState> + get() = emptyList() override val priority: Int get() = 200 + override val solidBlockStates: List<Lod1SolidBlockState> + get() = emptyList() override fun getBlockStateMass(blockState: BlockState): Double? { if (blockState.block == EurekaBlocks.BALLAST.get()) { diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index b8a801d2..0e08cc92 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -14,14 +14,13 @@ import org.joml.Vector3dc import org.valkyrienskies.core.api.VSBeta import org.valkyrienskies.core.api.ships.PhysShip import org.valkyrienskies.core.api.ships.ServerShip +import org.valkyrienskies.core.api.ships.ShipForcesInducer import org.valkyrienskies.core.api.ships.getAttachment import org.valkyrienskies.core.api.ships.saveAttachment import org.valkyrienskies.core.impl.api.ServerShipUser -import org.valkyrienskies.core.impl.api.ShipForcesInducer import org.valkyrienskies.core.impl.api.Ticked import org.valkyrienskies.core.impl.api.shipValue import org.valkyrienskies.core.impl.game.ships.PhysShipImpl -import org.valkyrienskies.core.impl.pipelines.SegmentUtils import org.valkyrienskies.eureka.EurekaConfig import org.valkyrienskies.mod.api.SeatedControllingPlayer import org.valkyrienskies.mod.common.util.toJOMLD @@ -103,9 +102,8 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { val ship = ship ?: return val mass = physShip.inertia.shipMass val moiTensor = physShip.inertia.momentOfInertiaTensor - val segment = physShip.segments.segments[0]?.segmentDisplacement!! - val omega: Vector3dc = SegmentUtils.getOmega(physShip.poseVel, segment, Vector3d()) - val vel = SegmentUtils.getVelocity(physShip.poseVel, segment, Vector3d()) + val omega: Vector3dc = physShip.poseVel.omega + val vel: Vector3dc = physShip.poseVel.vel val balloonForceProvided = balloons * forcePerBalloon @@ -160,7 +158,6 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { physShip, omega, vel, - segment, physShip, controllingPlayer == null && !aligning, controllingPlayer == null @@ -250,18 +247,10 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { rotationVector.mul(idealAlphaY * -1.5) - SegmentUtils.transformDirectionWithScale( - physShip.poseVel, - segment, + physShip.poseVel.rot.transform( moiTensor.transform( - SegmentUtils.invTransformDirectionWithScale( - physShip.poseVel, - segment, - rotationVector, - rotationVector - ) - ), - rotationVector + physShip.poseVel.rot.transformInverse(rotationVector) + ) ) physShip.applyInvariantTorque(rotationVector) @@ -269,12 +258,7 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { // region Player controlled forward and backward thrust val forwardVector = control.seatInDirection.normal.toJOMLD() - SegmentUtils.transformDirectionWithoutScale( - physShip.poseVel, - segment, - forwardVector, - forwardVector - ) + physShip.poseVel.rot.transform(forwardVector) forwardVector.y *= 0.1 // Reduce vertical thrust forwardVector.normalize() diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/Stabilize.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/Stabilize.kt index 86971301..4174f674 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/Stabilize.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/Stabilize.kt @@ -4,22 +4,19 @@ import org.joml.Vector3d import org.joml.Vector3dc import org.valkyrienskies.core.api.ships.PhysShip import org.valkyrienskies.core.impl.game.ships.PhysShipImpl -import org.valkyrienskies.core.impl.pipelines.SegmentUtils import org.valkyrienskies.eureka.EurekaConfig -import org.valkyrienskies.physics_api.SegmentDisplacement fun stabilize( ship: PhysShipImpl, omega: Vector3dc, vel: Vector3dc, - segment: SegmentDisplacement, forces: PhysShip, linear: Boolean, yaw: Boolean ) { val shipUp = Vector3d(0.0, 1.0, 0.0) val worldUp = Vector3d(0.0, 1.0, 0.0) - SegmentUtils.transformDirectionWithoutScale(ship.poseVel, segment, shipUp, shipUp) + ship.poseVel.rot.transform(shipUp) val angleBetween = shipUp.angle(worldUp) val idealAngularAcceleration = Vector3d() @@ -42,18 +39,10 @@ fun stabilize( omega.z() ) - val stabilizationTorque = SegmentUtils.transformDirectionWithScale( - ship.poseVel, - segment, + val stabilizationTorque = ship.poseVel.rot.transform( ship.inertia.momentOfInertiaTensor.transform( - SegmentUtils.invTransformDirectionWithScale( - ship.poseVel, - segment, - idealAngularAcceleration, - idealAngularAcceleration - ) - ), - idealAngularAcceleration + ship.poseVel.rot.transformInverse(idealAngularAcceleration) + ) ) stabilizationTorque.mul(EurekaConfig.SERVER.stabilizationTorqueConstant) diff --git a/gradle.properties b/gradle.properties index f518d294..995120cc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ enabled_platforms=fabric,forge archives_base_name=eureka maven_group=org.valkyrienskies # Dependencies -vs2_version=2.1.0-beta.14+acba7d4175 +vs2_version=2.1.0-beta.15+ff2f775e37 minecraft_version=1.18.2 architectury_version=4.10.86 fabric_loader_version=0.14.10 From ff45ea36292228f33cc55c40db154adca65b1dab Mon Sep 17 00:00:00 2001 From: StewStrong <83003027+StewStrong@users.noreply.github.com> Date: Sun, 1 Oct 2023 04:11:57 -0700 Subject: [PATCH 40/56] 1.18.x/feature/update latest vs2 (#256) * Initial work to update vs2 * It builds, but it also crashes * Ships can move again! * Forge almost works * Forge works :D --- build.gradle | 13 +++-- common/build.gradle | 10 +++- .../eureka/blockentity/EngineBlockEntity.kt | 57 ++++++++----------- .../eureka/blockentity/ShipHelmBlockEntity.kt | 21 +++---- .../eureka/ship/EurekaShipControl.kt | 26 +++------ .../eureka/util/ShipAssembler.kt | 8 +-- fabric/build.gradle | 8 +-- forge/build.gradle | 15 +++-- gradle.properties | 5 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 10 files changed, 78 insertions(+), 87 deletions(-) diff --git a/build.gradle b/build.gradle index 158e4d37..83168528 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ plugins { // Needed for Forge+Fabric - id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false + id "architectury-plugin" version "3.4.146" + id "dev.architectury.loom" version "1.3.355" apply false // Kotlin - id "org.jetbrains.kotlin.jvm" version "1.7.21" apply false + id "org.jetbrains.kotlin.jvm" version "1.9.10" apply false // Kotlin linter id "org.jlleitschuh.gradle.ktlint" version "10.3.0" // Java linter @@ -52,6 +52,9 @@ subprojects { officialMojangMappings() parchment("org.parchmentmc.data:parchment-1.18.2:2022.09.04@zip") }) + + implementation("org.joml:joml:1.10.4") { transitive = false } + implementation("org.joml:joml-primitives:1.10.0") { transitive = false } } checkstyle { @@ -68,9 +71,9 @@ subprojects { tasks.withType(Checkstyle) { reports { // Do not output html reports - html.enabled = false + html.required = false // Output xml reports - xml.enabled = true + xml.required = true } } diff --git a/common/build.gradle b/common/build.gradle index 3618c03d..2f3f81b2 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -13,10 +13,14 @@ dependencies { // Remove the next line if you don't want to depend on the API // modApi "me.shedaniel:architectury:${rootProject.architectury_version}" modApi("org.valkyrienskies:valkyrienskies-118-common:${rootProject.vs2_version}") - implementation("org.valkyrienskies.core:api:1.1.0+c92814e9b7") { transitive = false } - api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21" - api "org.jetbrains.kotlin:kotlin-reflect:1.7.21" + compileOnly("org.valkyrienskies.core:api:${rootProject.vs_core_version}") + compileOnly("org.valkyrienskies.core:api-game:${rootProject.vs_core_version}") + compileOnly("org.valkyrienskies.core:util:${rootProject.vs_core_version}") + compileOnly("org.valkyrienskies.core:impl:${rootProject.vs_core_version}") + + api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10" + api "org.jetbrains.kotlin:kotlin-reflect:1.9.10" } publishing { diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 31f5aac6..78a52e40 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -21,8 +21,6 @@ import net.minecraft.world.level.block.state.BlockState import org.joml.Math.lerp import org.joml.Math.min import org.valkyrienskies.core.api.ships.ServerShip -import org.valkyrienskies.core.impl.api.ServerShipProvider -import org.valkyrienskies.core.impl.api.shipValue import org.valkyrienskies.eureka.EurekaBlockEntities import org.valkyrienskies.eureka.EurekaConfig import org.valkyrienskies.eureka.EurekaProperties.HEAT @@ -34,13 +32,10 @@ import kotlin.math.ceil import kotlin.math.max class EngineBlockEntity(pos: BlockPos, state: BlockState) : - BaseContainerBlockEntity(EurekaBlockEntities.ENGINE.get(), pos, state), - ServerShipProvider, - StackedContentsCompatible, + BaseContainerBlockEntity(EurekaBlockEntities.ENGINE.get(), pos, state), StackedContentsCompatible, WorldlyContainer { - override val ship: ServerShip? get() = (this.level as ServerLevel).getShipManagingPos(this.blockPos) - private val eurekaShipControl by shipValue<EurekaShipControl>() + private val ship: ServerShip? get() = (this.level as ServerLevel).getShipManagingPos(this.blockPos) val data = KtContainerData() private var heatLevel by data private var fuelLeft by data @@ -91,25 +86,24 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : } if (heat > 0) { + val eurekaShipControl = ship?.getAttachment(EurekaShipControl::class.java) + if (ship != null && eurekaShipControl != null) { + // Avoid fluctuations in speed + var effectiveHeat = 1f + if (heat < maxEffectiveFuel) { + effectiveHeat = heat / 100f; + } - if (ship != null && eurekaShipControl != null) { - - // Avoid fluctuations in speed - var effectiveHeat = 1f - if (heat < maxEffectiveFuel) { - effectiveHeat = heat / 100f; - } - - eurekaShipControl!!.power += lerp( - EurekaConfig.SERVER.minEnginePower, - EurekaConfig.SERVER.enginePower, - effectiveHeat, - ) + eurekaShipControl.power += lerp( + EurekaConfig.SERVER.minEnginePower, + EurekaConfig.SERVER.enginePower, + effectiveHeat, + ) - heat -= eurekaShipControl!!.consumed; - } + heat -= eurekaShipControl.consumed + } - heat = max(heat - scaleEngineCooling(EurekaConfig.SERVER.engineHeatLoss),0f) + heat = max(heat - scaleEngineCooling(EurekaConfig.SERVER.engineHeatLoss), 0f) } } } @@ -121,7 +115,8 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : * * @return scaled fuel ticks. */ - private fun getScaledFuel(): Int = ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() + private fun getScaledFuel(): Int = + ((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt() /** * Absorb one fuel item into the engine. @@ -153,15 +148,16 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : * * @return the scaled value. */ - private fun scaleEngineHeating(value: Float): Float = (100 * EurekaConfig.SERVER.engineHeatChangeExponent - - this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + private fun scaleEngineHeating(value: Float): Float = + (100 * EurekaConfig.SERVER.engineHeatChangeExponent - this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value /** * Scale given cooling [value] based on current heat. * * @return the scaled value. */ - private fun scaleEngineCooling(value: Float): Float = (this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value + private fun scaleEngineCooling(value: Float): Float = + (this.heat * EurekaConfig.SERVER.engineHeatChangeExponent + 1f) * value override fun saveAdditional(tag: CompoundTag) { tag.put("FuelSlot", fuel.save(CompoundTag())) @@ -188,8 +184,7 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : override fun isEmpty(): Boolean = fuel.isEmpty - override fun getItem(slot: Int): ItemStack = - if (slot == 0) fuel else ItemStack.EMPTY + override fun getItem(slot: Int): ItemStack = if (slot == 0) fuel else ItemStack.EMPTY override fun removeItem(slot: Int, amount: Int): ItemStack { return ContainerHelper.removeItem(listOf(fuel), slot, amount) @@ -208,9 +203,7 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : return if (level!!.getBlockEntity(worldPosition) !== this) { false } else player.distanceToSqr( - worldPosition.x.toDouble() + 0.5, - worldPosition.y.toDouble() + 0.5, - worldPosition.z.toDouble() + 0.5 + worldPosition.x.toDouble() + 0.5, worldPosition.y.toDouble() + 0.5, worldPosition.z.toDouble() + 0.5 ) <= 64.0 } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 2c7d95f9..78de22a4 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -10,7 +10,6 @@ import net.minecraft.network.chat.TextComponent import net.minecraft.network.chat.TranslatableComponent import net.minecraft.server.level.ServerLevel import net.minecraft.world.MenuProvider -import net.minecraft.world.entity.EntityType import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu @@ -24,8 +23,6 @@ import org.joml.Vector3d import org.joml.Vector3dc import org.valkyrienskies.core.api.ships.ServerShip import org.valkyrienskies.core.api.ships.getAttachment -import org.valkyrienskies.core.impl.api.ServerShipProvider -import org.valkyrienskies.core.impl.api.shipValue import org.valkyrienskies.core.impl.util.logger import org.valkyrienskies.eureka.EurekaBlockEntities import org.valkyrienskies.eureka.EurekaConfig @@ -40,15 +37,14 @@ import org.valkyrienskies.mod.common.util.toDoubles import org.valkyrienskies.mod.common.util.toJOMLD class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : - BlockEntity(EurekaBlockEntities.SHIP_HELM.get(), pos, state), MenuProvider, ServerShipProvider { + BlockEntity(EurekaBlockEntities.SHIP_HELM.get(), pos, state), MenuProvider { - override var ship: ServerShip? = null // TODO ship is not being set in vs2? - get() = field ?: (level as ServerLevel).getShipObjectManagingPos(this.blockPos) - val control by shipValue<EurekaShipControl>() - val seats = mutableListOf<ShipMountingEntity>() + private val ship: ServerShip? get() = (level as ServerLevel).getShipObjectManagingPos(this.blockPos) + private val control: EurekaShipControl? get() = ship?.getAttachment(EurekaShipControl::class.java) + private val seats = mutableListOf<ShipMountingEntity>() val assembled get() = ship != null val aligning get() = control?.aligning ?: false - var shouldDisassembleWhenPossible = false + private var shouldDisassembleWhenPossible = false override fun createMenu(id: Int, playerInventory: Inventory, player: Player): AbstractContainerMenu { return ShipHelmScreenMenu(id, playerInventory, this) @@ -109,13 +105,14 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : seats.add(seat) } - return ride; + return ride } fun tick() { if (shouldDisassembleWhenPossible && ship?.getAttachment<EurekaShipControl>()?.canDisassemble == true) { this.disassemble() } + control?.ship = ship } // Needs to get called server-side @@ -184,8 +181,8 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : // If player is already controlling the ship, open the helm menu if (!force && player.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE && seats.contains(player.vehicle as ShipMountingEntity)) { - player.openMenu(this); - return true; + player.openMenu(this) + return true } //val seat = spawnSeat(blockPos, blockState, level as ServerLevel) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index 0e08cc92..5832efb7 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -17,14 +17,15 @@ import org.valkyrienskies.core.api.ships.ServerShip import org.valkyrienskies.core.api.ships.ShipForcesInducer import org.valkyrienskies.core.api.ships.getAttachment import org.valkyrienskies.core.api.ships.saveAttachment -import org.valkyrienskies.core.impl.api.ServerShipUser -import org.valkyrienskies.core.impl.api.Ticked -import org.valkyrienskies.core.impl.api.shipValue import org.valkyrienskies.core.impl.game.ships.PhysShipImpl import org.valkyrienskies.eureka.EurekaConfig import org.valkyrienskies.mod.api.SeatedControllingPlayer import org.valkyrienskies.mod.common.util.toJOMLD -import kotlin.math.* +import kotlin.math.PI +import kotlin.math.abs +import kotlin.math.floor +import kotlin.math.max +import kotlin.math.min @JsonAutoDetect( fieldVisibility = JsonAutoDetect.Visibility.ANY, @@ -33,13 +34,10 @@ import kotlin.math.* setterVisibility = JsonAutoDetect.Visibility.NONE ) @JsonIgnoreProperties(ignoreUnknown = true) -class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { +class EurekaShipControl : ShipForcesInducer { @JsonIgnore - override var ship: ServerShip? = null - - @delegate:JsonIgnore - private val controllingPlayer by shipValue<SeatedControllingPlayer>() + internal var ship: ServerShip? = null private var extraForce = 0.0 var aligning = false @@ -133,7 +131,7 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { val invRotationAxisAngle = AxisAngle4d(invRotation) // Floor makes a number 0 to 3, which corresponds to direction alignTarget = floor((invRotationAxisAngle.angle / (PI * 0.5)) + 4.5).toInt() % 4 - angleUntilAligned = (alignTarget.toDouble() * (0.5 * Math.PI)) - invRotationAxisAngle.angle + angleUntilAligned = (alignTarget.toDouble() * (0.5 * PI)) - invRotationAxisAngle.angle if (disassembling) { val pos = ship.transform.positionInWorld positionUntilAligned = pos.floor(Vector3d()) @@ -154,6 +152,7 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { } // endregion + val controllingPlayer = ship.getAttachment(SeatedControllingPlayer::class.java) stabilize( physShip, omega, @@ -343,13 +342,6 @@ class EurekaShipControl : ShipForcesInducer, ServerShipUser, Ticked { field = v; deleteIfEmpty() } - override fun tick() { - extraForce = power - power = 0.0 - consumed = physConsumption * /* should be phyics ticks based*/ 0.1f - physConsumption = 0.0f - } - private fun deleteIfEmpty() { if (helms <= 0 && floaters <= 0 && anchors <= 0 && balloons <= 0) { ship?.saveAttachment<EurekaShipControl>(null) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index 4a00cfa0..7c8192b7 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -12,10 +12,8 @@ import org.joml.AxisAngle4d import org.joml.Matrix4d import org.joml.Vector3d import org.valkyrienskies.core.api.ships.ServerShip -import org.valkyrienskies.core.impl.datastructures.DenseBlockPosSet -import org.valkyrienskies.core.impl.game.ships.ShipObjectServer import org.valkyrienskies.core.impl.networking.simple.sendToClient -import org.valkyrienskies.core.impl.util.logger +import org.valkyrienskies.core.util.datastructures.DenseBlockPosSet import org.valkyrienskies.eureka.EurekaConfig import org.valkyrienskies.mod.common.assembly.createNewShipWithBlocks import org.valkyrienskies.mod.common.executeIf @@ -24,6 +22,7 @@ import org.valkyrienskies.mod.common.networking.PacketRestartChunkUpdates import org.valkyrienskies.mod.common.networking.PacketStopChunkUpdates import org.valkyrienskies.mod.common.playerWrapper import org.valkyrienskies.mod.common.util.toJOML +import org.valkyrienskies.mod.util.logger import org.valkyrienskies.mod.util.relocateBlock import org.valkyrienskies.mod.util.updateBlock import kotlin.collections.set @@ -64,8 +63,7 @@ object ShipAssembler { } fun unfillShip(level: ServerLevel, ship: ServerShip, direction: Direction, shipCenter: BlockPos, center: BlockPos) { - ship as ShipObjectServer - ship.shipData.isStatic = true + ship.isStatic = true // ship's rotation rounded to nearest 90* val shipToWorld = ship.transform.run { diff --git a/fabric/build.gradle b/fabric/build.gradle index 97648c20..e7063c50 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -26,7 +26,7 @@ configurations { dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" - modImplementation("net.fabricmc:fabric-language-kotlin:1.8.5+kotlin.1.7.20") + include(modImplementation("net.fabricmc:fabric-language-kotlin:1.10.10+kotlin.1.9.10")) // Mod menu modImplementation("com.terraformersmc:modmenu:3.2.3") @@ -51,18 +51,18 @@ shadowJar { exclude "architectury.common.json" configurations = [project.configurations.shadowCommon] - classifier "dev-shadow" + archiveClassifier.set "dev-shadow" } remapJar { injectAccessWidener = true input.set shadowJar.archiveFile dependsOn shadowJar - classifier null + archiveClassifier.set null } jar { - classifier "dev" + archiveClassifier.set "dev" } sourcesJar { diff --git a/forge/build.gradle b/forge/build.gradle index 76659956..0e6b1e3a 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -52,13 +52,16 @@ configurations { dependencies { forge "net.minecraftforge:forge:${rootProject.forge_version}" modApi("org.valkyrienskies:valkyrienskies-118-forge:${rootProject.vs2_version}") { transitive = false } - implementation("org.valkyrienskies.core:api:1.1.0+c92814e9b7") { transitive = false } + + implementation("org.valkyrienskies.core:api:${rootProject.vs_core_version}") + implementation("org.valkyrienskies.core:api-game:${rootProject.vs_core_version}") + implementation("org.valkyrienskies.core:util:${rootProject.vs_core_version}") + implementation("org.valkyrienskies.core:impl:${rootProject.vs_core_version}") common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } - // Add Kotlin for Forge. - forgeRuntimeLibrary('curse.maven:kotlinforforge-351264:3925887') + implementation 'thedarkcolour:kotlinforforge:3.12.0' } processResources { @@ -79,17 +82,17 @@ shadowJar { exclude "architectury.common.json" configurations = [project.configurations.shadowCommon] - classifier "dev-shadow" + archiveClassifier.set "dev-shadow" } remapJar { input.set shadowJar.archiveFile dependsOn shadowJar - classifier null + archiveClassifier.set null } jar { - classifier "dev" + archiveClassifier.set "dev" } sourcesJar { diff --git a/gradle.properties b/gradle.properties index 995120cc..8768118f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,14 +7,15 @@ enabled_platforms=fabric,forge archives_base_name=eureka maven_group=org.valkyrienskies # Dependencies -vs2_version=2.1.0-beta.15+ff2f775e37 +vs2_version=2.1.0-beta.15+15518313c1 +vs_core_version=1.1.0+01023bdb65 minecraft_version=1.18.2 architectury_version=4.10.86 fabric_loader_version=0.14.10 fabric_api_version=0.59.0+1.18.2 forge_version=1.18.2-40.1.85 forge_kotlin_version=3.6.0 -kotlin_version=1.7.21 +kotlin_version=1.9.10 cloth_config_version=6.4.90 # Maven publishing vs_maven_url= diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb879..27313fbc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From b7c63849ba6169728f8b45ef58b6910d58240442 Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Mon, 2 Oct 2023 02:55:16 -0600 Subject: [PATCH 41/56] Make Eureka fabric depend on "fabricloader": ">=0.14.21" --- fabric/src/main/resources/fabric.mod.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 6c373b8d..5fd80194 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -41,6 +41,7 @@ ], "depends": { "minecraft": ">=1.18.2", - "valkyrienskies": ">=${vs2_version}" + "valkyrienskies": ">=${vs2_version}", + "fabricloader": ">=0.14.21" } } \ No newline at end of file From 235d1b690a010bc0c2e48f966ba4e02cd04729cc Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Tue, 10 Oct 2023 05:53:20 -0600 Subject: [PATCH 42/56] Incremented version to 1.1.1-beta.1 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8768118f..be6b59b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,12 +2,12 @@ org.gradle.jvmargs=-Xmx4096M # Identity mod_name=eureka mod_id=vs_eureka -eureka_version=1.1.0-beta.10 +eureka_version=1.1.1-beta.1 enabled_platforms=fabric,forge archives_base_name=eureka maven_group=org.valkyrienskies # Dependencies -vs2_version=2.1.0-beta.15+15518313c1 +vs2_version=2.1.1-beta.1+60312f90ce vs_core_version=1.1.0+01023bdb65 minecraft_version=1.18.2 architectury_version=4.10.86 From 0af663c543f389f33a70f2a336ba88e1f687324d Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:38:23 +0200 Subject: [PATCH 43/56] Cleenup and fix for kotlinforforge version (#258) --- .../mixin/client/PlayerEntityModelMixin.java | 4 ++-- .../org/valkyrienskies/eureka/EurekaBlocks.kt | 1 - .../org/valkyrienskies/eureka/EurekaConfig.kt | 8 ++++--- .../org/valkyrienskies/eureka/EurekaMod.kt | 1 - .../valkyrienskies/eureka/EurekaWeights.kt | 12 +++++----- .../eureka/block/ShipHelmBlock.kt | 8 +++---- .../eureka/blockentity/EngineBlockEntity.kt | 6 ++--- .../eureka/blockentity/ShipHelmBlockEntity.kt | 14 +++++------ .../eureka/registry/CreativeTabs.kt | 2 +- .../eureka/registry/DeferredRegister.kt | 2 +- .../eureka/registry/RegistrySupplier.kt | 3 +-- .../services/DeferredRegisterBackend.kt | 2 +- .../eureka/services/EurekaPlatformHelper.kt | 2 +- .../eureka/ship/EurekaShipControl.kt | 24 +++++++++---------- .../valkyrienskies/eureka/util/RotShapes.kt | 3 ++- .../eureka/util/ShipAssembler.kt | 3 +-- .../eureka/fabric/DeferredRegisterImpl.java | 17 ++++++------- .../eureka/fabric/EurekaModFabric.java | 12 +++++++--- .../DeferredRegisterBackendFabric.java | 4 +++- .../services/EurekaPlatformHelperFabric.java | 4 +++- forge/build.gradle | 2 +- gradle.properties | 2 +- 22 files changed, 72 insertions(+), 64 deletions(-) diff --git a/common/src/main/java/org/valkyrienskies/eureka/mixin/client/PlayerEntityModelMixin.java b/common/src/main/java/org/valkyrienskies/eureka/mixin/client/PlayerEntityModelMixin.java index f23bf6a0..ffd64dfc 100644 --- a/common/src/main/java/org/valkyrienskies/eureka/mixin/client/PlayerEntityModelMixin.java +++ b/common/src/main/java/org/valkyrienskies/eureka/mixin/client/PlayerEntityModelMixin.java @@ -14,8 +14,8 @@ @Mixin(PlayerModel.class) public abstract class PlayerEntityModelMixin<T extends LivingEntity> extends HumanoidModel<T> { - public PlayerEntityModelMixin(ModelPart $$0) { - super($$0); + public PlayerEntityModelMixin(final ModelPart model) { + super(model); } @SuppressWarnings("unchecked") diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt index cd34ec4e..8b8a99d3 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt @@ -212,5 +212,4 @@ object EurekaBlocks { items.register(it.name) { BlockItem(it.get(), Item.Properties().tab(EurekaItems.TAB)) } } } - } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 6999c9ca..469f5a13 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -83,10 +83,12 @@ object EurekaConfig { @JsonSchema(description = "The maximum linear acceleration at any point on the ship caused by helm torque") var turnAcceleration = 10.0 - @JsonSchema(description = "The maximum distance from center of mass to one end of the ship considered by " + + @JsonSchema( + description = "The maximum distance from center of mass to one end of the ship considered by " + "the turn speed. At it's default of 16, it ensures that really large ships will turn at the same " + "speed as a ship with a center of mass only 16 blocks away from the farthest point in the ship. " + - "That way, large ships do not turn painfully slowly") + "That way, large ships do not turn painfully slowly" + ) var maxSizeForTurnSpeedPenalty = 16.0 // The strength used when trying to level the ship @@ -214,6 +216,6 @@ object EurekaConfig { val allowDisassembly = true @JsonSchema(description = "Maximum number of blocks allowed in a ship. Set to 0 for no limit") - val maxShipBlocks = 32*32*32 + val maxShipBlocks = 32 * 32 * 32 } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaMod.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaMod.kt index 4e595d7e..e6b56363 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaMod.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaMod.kt @@ -2,7 +2,6 @@ package org.valkyrienskies.eureka import org.valkyrienskies.core.impl.config.VSConfigClass - object EurekaMod { const val MOD_ID = "vs_eureka" diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt index 2778c0e3..c5159069 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaWeights.kt @@ -26,12 +26,12 @@ object EurekaWeights : BlockStateInfoProvider { override fun getBlockStateMass(blockState: BlockState): Double? { if (blockState.block == EurekaBlocks.BALLAST.get()) { return EurekaConfig.SERVER.ballastWeight + (EurekaConfig.SERVER.ballastNoWeight - EurekaConfig.SERVER.ballastWeight) * ( - ( - blockState.getValue( - BlockStateProperties.POWER - ) + 1 - ) / 16.0 - ) + ( + blockState.getValue( + BlockStateProperties.POWER + ) + 1 + ) / 16.0 + ) } return null diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt index 1501dc32..85721817 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt @@ -124,10 +124,10 @@ class ShipHelmBlock(properties: Properties, val woodType: WoodType) : BaseEntity } override fun isPathfindable( - blockState: BlockState, - blockGetter: BlockGetter, - blockPos: BlockPos, - pathComputationType: PathComputationType + blockState: BlockState, + blockGetter: BlockGetter, + blockPos: BlockPos, + pathComputationType: PathComputationType ): Boolean { return false } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 78a52e40..7edf2a05 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -32,7 +32,8 @@ import kotlin.math.ceil import kotlin.math.max class EngineBlockEntity(pos: BlockPos, state: BlockState) : - BaseContainerBlockEntity(EurekaBlockEntities.ENGINE.get(), pos, state), StackedContentsCompatible, + BaseContainerBlockEntity(EurekaBlockEntities.ENGINE.get(), pos, state), + StackedContentsCompatible, WorldlyContainer { private val ship: ServerShip? get() = (this.level as ServerLevel).getShipManagingPos(this.blockPos) @@ -73,7 +74,6 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : if (!fuel.isEmpty && lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { consumeFuel() } - } else if (!fuel.isEmpty) { consumeFuel() } @@ -91,7 +91,7 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : // Avoid fluctuations in speed var effectiveHeat = 1f if (heat < maxEffectiveFuel) { - effectiveHeat = heat / 100f; + effectiveHeat = heat / 100f } eurekaShipControl.power += lerp( diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt index 78de22a4..e51ca50b 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt @@ -88,7 +88,7 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : fun startRiding(player: Player, force: Boolean, blockPos: BlockPos, state: BlockState, level: ServerLevel): Boolean { - for (i in seats.size-1 downTo 0) { + for (i in seats.size - 1 downTo 0) { if (!seats[i].isVehicle) { seats[i].kill() seats.removeAt(i) @@ -128,7 +128,7 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : blockPos ) { !it.isAir && !EurekaConfig.SERVER.blockBlacklist.contains(Registry.BLOCK.getKey(it.block).toString()) } - if (builtShip == null){ + if (builtShip == null) { player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks (changable in the config)"), Util.NIL_UUID) logger.warn("Failed to assemble ship for ${player.name.string}") } @@ -179,17 +179,15 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) : fun sit(player: Player, force: Boolean = false): Boolean { // If player is already controlling the ship, open the helm menu - if (!force && player.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE && seats.contains(player.vehicle as ShipMountingEntity)) - { + if (!force && player.vehicle?.type == ValkyrienSkiesMod.SHIP_MOUNTING_ENTITY_TYPE && seats.contains(player.vehicle as ShipMountingEntity)) { player.openMenu(this) return true } - //val seat = spawnSeat(blockPos, blockState, level as ServerLevel) - //control?.seatedPlayer = player - //return player.startRiding(seat, force) + // val seat = spawnSeat(blockPos, blockState, level as ServerLevel) + // control?.seatedPlayer = player + // return player.startRiding(seat, force) return startRiding(player, force, blockPos, blockState, level as ServerLevel) - } private val logger by logger() } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/registry/CreativeTabs.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/registry/CreativeTabs.kt index 1ff4298a..31a014d8 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/registry/CreativeTabs.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/registry/CreativeTabs.kt @@ -15,4 +15,4 @@ class CreativeTabs { .createCreativeTab(id, stack) } } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/registry/DeferredRegister.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/registry/DeferredRegister.kt index 8d249d5d..3b80c48e 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/registry/DeferredRegister.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/registry/DeferredRegister.kt @@ -21,4 +21,4 @@ interface DeferredRegister<T> : Iterable<RegistrySupplier<T>> { .findFirst() .orElseThrow { NullPointerException("Failed to load service for DeferredRegisterBackend") } } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/registry/RegistrySupplier.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/registry/RegistrySupplier.kt index 055ff24e..5c9cecbe 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/registry/RegistrySupplier.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/registry/RegistrySupplier.kt @@ -4,5 +4,4 @@ interface RegistrySupplier<T> { val name: String fun get(): T - -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/services/DeferredRegisterBackend.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/services/DeferredRegisterBackend.kt index 6afade06..4bbe96fd 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/services/DeferredRegisterBackend.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/services/DeferredRegisterBackend.kt @@ -6,4 +6,4 @@ import org.valkyrienskies.eureka.registry.DeferredRegister interface DeferredRegisterBackend { fun <T> makeDeferredRegister(id: String, registry: ResourceKey<Registry<T>>): DeferredRegister<T> -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/services/EurekaPlatformHelper.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/services/EurekaPlatformHelper.kt index 6b420eff..5db647cb 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/services/EurekaPlatformHelper.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/services/EurekaPlatformHelper.kt @@ -6,4 +6,4 @@ import net.minecraft.world.item.ItemStack interface EurekaPlatformHelper { fun createCreativeTab(id: ResourceLocation, stack: () -> ItemStack): CreativeModeTab -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index 5832efb7..0bc63d58 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -50,9 +50,9 @@ class EurekaShipControl : ShipForcesInducer { private var alignTarget = 0 val canDisassemble get() = ship != null && - disassembling && - abs(angleUntilAligned) < DISASSEMBLE_THRESHOLD && - positionUntilAligned.distanceSquared(this.ship!!.transform.positionInWorld) < 4.0 + disassembling && + abs(angleUntilAligned) < DISASSEMBLE_THRESHOLD && + positionUntilAligned.distanceSquared(this.ship!!.transform.positionInWorld) < 4.0 val aligningTo: Direction get() = Direction.from2DDataValue(alignTarget) var consumed = 0f private set @@ -104,7 +104,6 @@ class EurekaShipControl : ShipForcesInducer { val vel: Vector3dc = physShip.poseVel.vel val balloonForceProvided = balloons * forcePerBalloon - val buoyantFactorPerFloater = min( EurekaConfig.SERVER.floaterBuoyantFactorPerKg / 15 / mass, EurekaConfig.SERVER.maxFloaterBuoyantFactor @@ -174,10 +173,10 @@ class EurekaShipControl : ShipForcesInducer { // the player pressed the cruise button isCruising = !isCruising showCruiseStatus() - } else if (!player.cruise - && isCruising - && (player.leftImpulse != 0.0f || player.sprintOn || player.upImpulse != 0.0f || player.forwardImpulse != 0.0f) - && currentControlData != controlData + } else if (!player.cruise && + isCruising && + (player.leftImpulse != 0.0f || player.sprintOn || player.upImpulse != 0.0f || player.forwardImpulse != 0.0f) && + currentControlData != controlData ) { // The player pressed another button isCruising = false @@ -214,7 +213,7 @@ class EurekaShipControl : ShipForcesInducer { val maxLinearAcceleration = EurekaConfig.SERVER.turnAcceleration val maxLinearSpeed = EurekaConfig.SERVER.turnSpeed + - extraForce / EurekaConfig.SERVER.enginePower * EurekaConfig.SERVER.engineTurnPower + extraForce / EurekaConfig.SERVER.enginePower * EurekaConfig.SERVER.engineTurnPower // acceleration = alpha * r // therefore: maxAlpha = maxAcceleration / r @@ -289,9 +288,10 @@ class EurekaShipControl : ShipForcesInducer { if (control.upImpulse != 0.0f) { idealUpwardVel = Vector3d(0.0, 1.0, 0.0) .mul(control.upImpulse.toDouble()) - .mul(EurekaConfig.SERVER.baseImpulseElevationRate + - // Smoothing for how the elevation scales as you approaches the balloonElevationMaxSpeed - smoothing(2.0, EurekaConfig.SERVER.balloonElevationMaxSpeed, balloonForceProvided / mass) + .mul( + EurekaConfig.SERVER.baseImpulseElevationRate + + // Smoothing for how the elevation scales as you approaches the balloonElevationMaxSpeed + smoothing(2.0, EurekaConfig.SERVER.balloonElevationMaxSpeed, balloonForceProvided / mass) ) } } diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/RotShapes.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/RotShapes.kt index d06f6009..6d08e8dd 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/RotShapes.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/RotShapes.kt @@ -45,7 +45,8 @@ object RotShapes { min(z1, z2) / 16, max(x1, x2) / 16, max(y1, y2) / 16, - max(z1, z2) / 16) + max(z1, z2) / 16 + ) } private class Union(val shapes: List<RotShape>) : RotShape { diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt index 7c8192b7..fddce508 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/util/ShipAssembler.kt @@ -74,7 +74,6 @@ object ShipAssembler { .translate(-positionInShip.x(), -positionInShip.y(), -positionInShip.z()) } - val alloc0 = Vector3d() // Direction comes from direction ship is aligning to @@ -180,7 +179,7 @@ object ShipAssembler { return false } } - if (EurekaConfig.SERVER.maxShipBlocks > 0){ + if (EurekaConfig.SERVER.maxShipBlocks > 0) { logger.info("Assembled ship with ${blocks.size} blocks, out of ${EurekaConfig.SERVER.maxShipBlocks} allowed") } return true diff --git a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/DeferredRegisterImpl.java b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/DeferredRegisterImpl.java index 97c7d3d9..248ebd72 100644 --- a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/DeferredRegisterImpl.java +++ b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/DeferredRegisterImpl.java @@ -1,5 +1,8 @@ package org.valkyrienskies.eureka.fabric; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import kotlin.jvm.functions.Function0; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; @@ -8,26 +11,24 @@ import org.valkyrienskies.eureka.registry.DeferredRegister; import org.valkyrienskies.eureka.registry.RegistrySupplier; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - public class DeferredRegisterImpl<T> implements DeferredRegister<T> { private final String modId; private final Registry<T> registry; private final List<RegistrySupplier<T>> everMade = new ArrayList<>(); - public DeferredRegisterImpl(String modId, ResourceKey<Registry<T>> registry) { + public DeferredRegisterImpl(final String modId, final ResourceKey<Registry<T>> registry) { this.modId = modId; this.registry = (Registry<T>) Registry.REGISTRY.get(registry.location()); } @NotNull @Override - public <I extends T> RegistrySupplier<I> register(@NotNull String name, @NotNull Function0<? extends I> builder) { - I result = Registry.register(registry, new ResourceLocation(modId, name), builder.invoke()); + public <I extends T> RegistrySupplier<I> register( + @NotNull final String name, + @NotNull final Function0<? extends I> builder) { + final I result = Registry.register(registry, new ResourceLocation(modId, name), builder.invoke()); - RegistrySupplier<I> r = new RegistrySupplier<I>() { + final RegistrySupplier<I> r = new RegistrySupplier<I>() { @NotNull @Override diff --git a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/EurekaModFabric.java b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/EurekaModFabric.java index a05c91bd..c1b6be14 100644 --- a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/EurekaModFabric.java +++ b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/EurekaModFabric.java @@ -42,14 +42,20 @@ public void onInitializeClient() { ); ModelLoadingRegistry.INSTANCE.registerModelProvider((manager, out) -> { - for (WoodType woodType : WoodType.values()) { - out.accept(new ResourceLocation(EurekaMod.MOD_ID, "block/" + woodType.getResourceName() + "_ship_helm_wheel")); + for (final WoodType woodType : WoodType.values()) { + out.accept(new ResourceLocation( + EurekaMod.MOD_ID, + "block/" + woodType.getResourceName() + "_ship_helm_wheel" + )); } }); WheelModels.INSTANCE.setModelGetter(woodType -> BakedModelManagerHelper.getModel(Minecraft.getInstance().getModelManager(), - new ResourceLocation(EurekaMod.MOD_ID, "block/" + woodType.getResourceName() + "_ship_helm_wheel"))); + new ResourceLocation( + EurekaMod.MOD_ID, + "block/" + woodType.getResourceName() + "_ship_helm_wheel" + ))); } } diff --git a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/DeferredRegisterBackendFabric.java b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/DeferredRegisterBackendFabric.java index 5c25d6b0..47e2b53e 100644 --- a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/DeferredRegisterBackendFabric.java +++ b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/DeferredRegisterBackendFabric.java @@ -11,7 +11,9 @@ public class DeferredRegisterBackendFabric implements DeferredRegisterBackend { @NotNull @Override - public <T> DeferredRegister<T> makeDeferredRegister(@NotNull String id, @NotNull ResourceKey<Registry<T>> registry) { + public <T> DeferredRegister<T> makeDeferredRegister( + @NotNull final String id, + @NotNull final ResourceKey<Registry<T>> registry) { return new DeferredRegisterImpl<>(id, registry); } } diff --git a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/EurekaPlatformHelperFabric.java b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/EurekaPlatformHelperFabric.java index a26deedf..395a4b9a 100644 --- a/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/EurekaPlatformHelperFabric.java +++ b/fabric/src/main/java/org/valkyrienskies/eureka/fabric/services/EurekaPlatformHelperFabric.java @@ -11,7 +11,9 @@ public class EurekaPlatformHelperFabric implements EurekaPlatformHelper { @NotNull @Override - public CreativeModeTab createCreativeTab(@NotNull ResourceLocation id, @NotNull Function0<ItemStack> stack) { + public CreativeModeTab createCreativeTab( + @NotNull final ResourceLocation id, + @NotNull final Function0<ItemStack> stack) { return FabricItemGroupBuilder.build(id, stack::invoke); } } diff --git a/forge/build.gradle b/forge/build.gradle index 0e6b1e3a..62d5a70b 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -61,7 +61,7 @@ dependencies { common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } - implementation 'thedarkcolour:kotlinforforge:3.12.0' + implementation("thedarkcolour:kotlinforforge:${rootProject.forge_kotlin_version}") } processResources { diff --git a/gradle.properties b/gradle.properties index be6b59b2..831c5aad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ architectury_version=4.10.86 fabric_loader_version=0.14.10 fabric_api_version=0.59.0+1.18.2 forge_version=1.18.2-40.1.85 -forge_kotlin_version=3.6.0 +forge_kotlin_version=3.11.0 kotlin_version=1.9.10 cloth_config_version=6.4.90 # Maven publishing From 5268aae5c4fe200017a333d25edcdb634ef9459b Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Wed, 11 Oct 2023 03:51:20 -0600 Subject: [PATCH 44/56] Make Eureka forge use kotlinforforge 3.12.0 --- build.gradle | 5 + forge/build.gradle | 21 ++-- forge/gradle.properties | 1 + .../eureka/forge/DeferredRegisterImpl.java | 2 +- .../eureka/forge/EurekaModForge.java | 75 ------------- .../eureka/forge/EurekaModForge.kt | 101 ++++++++++++++++++ forge/src/main/resources/META-INF/mods.toml | 4 +- gradle.properties | 5 +- 8 files changed, 119 insertions(+), 95 deletions(-) delete mode 100644 forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java create mode 100644 forge/src/main/kotlin/org/valkyrienskies/eureka/forge/EurekaModForge.kt diff --git a/build.gradle b/build.gradle index 83168528..5a58f51f 100644 --- a/build.gradle +++ b/build.gradle @@ -98,6 +98,11 @@ allprojects { repositories { mavenLocal() + maven { + name = 'Kotlin for Forge' + url = 'https://thedarkcolour.github.io/KotlinForForge/' + content { includeGroup "thedarkcolour" } + } maven { name = "Valkyrien Skies Internal" url = project.vs_maven_url ?: 'https://maven.valkyrienskies.org' diff --git a/forge/build.gradle b/forge/build.gradle index 62d5a70b..cc3c43b9 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -34,13 +34,6 @@ loom { } } -repositories { - maven { - name = 'Kotlin for Forge' - url = 'https://thedarkcolour.github.io/KotlinForForge/' - } -} - configurations { common shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. @@ -50,18 +43,18 @@ configurations { } dependencies { - forge "net.minecraftforge:forge:${rootProject.forge_version}" - modApi("org.valkyrienskies:valkyrienskies-118-forge:${rootProject.vs2_version}") { transitive = false } + forge "net.minecraftforge:forge:$forge_version" + modApi("org.valkyrienskies:valkyrienskies-118-forge:$vs2_version") { transitive = false } - implementation("org.valkyrienskies.core:api:${rootProject.vs_core_version}") - implementation("org.valkyrienskies.core:api-game:${rootProject.vs_core_version}") - implementation("org.valkyrienskies.core:util:${rootProject.vs_core_version}") - implementation("org.valkyrienskies.core:impl:${rootProject.vs_core_version}") + implementation("org.valkyrienskies.core:api:$vs_core_version") + implementation("org.valkyrienskies.core:api-game:$vs_core_version") + implementation("org.valkyrienskies.core:util:$vs_core_version") + implementation("org.valkyrienskies.core:impl:$vs_core_version") common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } - implementation("thedarkcolour:kotlinforforge:${rootProject.forge_kotlin_version}") + implementation 'thedarkcolour:kotlinforforge:3.12.0' } processResources { diff --git a/forge/gradle.properties b/forge/gradle.properties index eb7acab6..20e9de38 100644 --- a/forge/gradle.properties +++ b/forge/gradle.properties @@ -1,2 +1,3 @@ loom.platform=forge loader_platform=Forge +kotlin.stdlib.default.dependency=false diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java index 0d48ca5d..ff09fee8 100644 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java +++ b/forge/src/main/java/org/valkyrienskies/eureka/forge/DeferredRegisterImpl.java @@ -40,7 +40,7 @@ public I get() { @Override public void applyAll() { - forge.register(EurekaModForge.MOD_BUS); + forge.register(EurekaModForge.Companion.getModBus()); } @NotNull diff --git a/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java b/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java deleted file mode 100644 index 11acf9be..00000000 --- a/forge/src/main/java/org/valkyrienskies/eureka/forge/EurekaModForge.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.valkyrienskies.eureka.forge; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.client.ConfigGuiHandler; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.client.event.ModelRegistryEvent; -import net.minecraftforge.client.model.ForgeModelBakery; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import org.valkyrienskies.core.impl.config.VSConfigClass; -import org.valkyrienskies.eureka.EurekaBlockEntities; -import org.valkyrienskies.eureka.EurekaConfig; -import org.valkyrienskies.eureka.EurekaMod; -import org.valkyrienskies.eureka.block.WoodType; -import org.valkyrienskies.eureka.blockentity.renderer.ShipHelmBlockEntityRenderer; -import org.valkyrienskies.eureka.blockentity.renderer.WheelModels; -import org.valkyrienskies.mod.compat.clothconfig.VSClothConfig; - -@Mod(EurekaMod.MOD_ID) -public class EurekaModForge { - boolean happendClientSetup = false; - static IEventBus MOD_BUS; - - public EurekaModForge() { - // Submit our event bus to let architectury register our content on the right time - MOD_BUS = FMLJavaModLoadingContext.get().getModEventBus(); - MOD_BUS.addListener(this::clientSetup); - MOD_BUS.addListener(this::onModelRegistry); - MOD_BUS.addListener(this::entityRenderers); - - ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, - () -> new ConfigGuiHandler.ConfigGuiFactory((Minecraft client, Screen parent) -> - VSClothConfig.createConfigScreenFor(parent, - VSConfigClass.Companion.getRegisteredConfig(EurekaConfig.class))) - ); - - - EurekaMod.init(); - } - - void clientSetup(final FMLClientSetupEvent event) { - if (happendClientSetup) { - return; - } - happendClientSetup = true; - - EurekaMod.initClient(); - - WheelModels.INSTANCE.setModelGetter(woodType -> ForgeModelBakery.instance().getBakedTopLevelModels() - .getOrDefault( - new ResourceLocation(EurekaMod.MOD_ID, - "block/" + woodType.getResourceName() + "_ship_helm_wheel"), - Minecraft.getInstance().getModelManager().getMissingModel() - )); - } - - void entityRenderers(final EntityRenderersEvent.RegisterRenderers event) { - event.registerBlockEntityRenderer( - EurekaBlockEntities.INSTANCE.getSHIP_HELM().get(), - ShipHelmBlockEntityRenderer::new - ); - } - - void onModelRegistry(final ModelRegistryEvent event) { - for (final WoodType woodType : WoodType.values()) { - ForgeModelBakery.addSpecialModel(new ResourceLocation( - EurekaMod.MOD_ID, "block/" + woodType.getResourceName() + "_ship_helm_wheel")); - } - } -} diff --git a/forge/src/main/kotlin/org/valkyrienskies/eureka/forge/EurekaModForge.kt b/forge/src/main/kotlin/org/valkyrienskies/eureka/forge/EurekaModForge.kt new file mode 100644 index 00000000..dfe94bbe --- /dev/null +++ b/forge/src/main/kotlin/org/valkyrienskies/eureka/forge/EurekaModForge.kt @@ -0,0 +1,101 @@ +package org.valkyrienskies.eureka.forge + +import net.minecraft.client.Minecraft +import net.minecraft.client.gui.screens.Screen +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider +import net.minecraft.resources.ResourceLocation +import net.minecraftforge.client.ConfigGuiHandler.ConfigGuiFactory +import net.minecraftforge.client.event.EntityRenderersEvent.RegisterRenderers +import net.minecraftforge.client.event.ModelRegistryEvent +import net.minecraftforge.client.model.ForgeModelBakery +import net.minecraftforge.eventbus.api.IEventBus +import net.minecraftforge.fml.common.Mod +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent +import org.valkyrienskies.core.impl.config.VSConfigClass.Companion.getRegisteredConfig +import org.valkyrienskies.eureka.EurekaBlockEntities.SHIP_HELM +import org.valkyrienskies.eureka.EurekaConfig +import org.valkyrienskies.eureka.EurekaMod +import org.valkyrienskies.eureka.EurekaMod.init +import org.valkyrienskies.eureka.EurekaMod.initClient +import org.valkyrienskies.eureka.block.WoodType +import org.valkyrienskies.eureka.blockentity.renderer.ShipHelmBlockEntityRenderer +import org.valkyrienskies.eureka.blockentity.renderer.WheelModels.setModelGetter +import org.valkyrienskies.mod.compat.clothconfig.VSClothConfig.createConfigScreenFor +import thedarkcolour.kotlinforforge.forge.LOADING_CONTEXT +import thedarkcolour.kotlinforforge.forge.MOD_BUS + +@Mod(EurekaMod.MOD_ID) +class EurekaModForge { + private var happendClientSetup = false + + init { + // Submit our event bus to let architectury register our content on the right time + MOD_BUS.addListener { event: FMLClientSetupEvent? -> + clientSetup( + event + ) + } + MOD_BUS.addListener { event: ModelRegistryEvent? -> + onModelRegistry( + event + ) + } + MOD_BUS.addListener { event: RegisterRenderers -> + entityRenderers( + event + ) + } + LOADING_CONTEXT.registerExtensionPoint( + ConfigGuiFactory::class.java + ) { + ConfigGuiFactory { _: Minecraft?, parent: Screen? -> + createConfigScreenFor( + parent!!, + getRegisteredConfig(EurekaConfig::class.java) + ) + } + } + init() + } + + private fun clientSetup(event: FMLClientSetupEvent?) { + if (happendClientSetup) { + return + } + happendClientSetup = true + initClient() + setModelGetter { woodType: WoodType -> + ForgeModelBakery.instance()!! + .bakedTopLevelModels + .getOrDefault( + ResourceLocation( + EurekaMod.MOD_ID, + "block/" + woodType.resourceName + "_ship_helm_wheel" + ), + Minecraft.getInstance().modelManager.missingModel + ) + } + } + + private fun entityRenderers(event: RegisterRenderers) { + event.registerBlockEntityRenderer(SHIP_HELM.get()) { ctx: BlockEntityRendererProvider.Context -> + ShipHelmBlockEntityRenderer( + ctx + ) + } + } + + private fun onModelRegistry(event: ModelRegistryEvent?) { + for (woodType in WoodType.values()) { + ForgeModelBakery.addSpecialModel( + ResourceLocation( + EurekaMod.MOD_ID, "block/" + woodType.resourceName + "_ship_helm_wheel" + ) + ) + } + } + + companion object { + fun getModBus(): IEventBus = MOD_BUS + } +} diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 7a0d413a..cd005f50 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ -modLoader = "javafml" -loaderVersion = "[40,)" +modLoader = "kotlinforforge" +loaderVersion = "[3.12.0,)" issueTrackerURL = "https://github.com/ValkyrienSkies/Valkyrien-Skies-2/issues" license = "Apache-2.0" diff --git a/gradle.properties b/gradle.properties index 831c5aad..e0061e62 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,14 +7,13 @@ enabled_platforms=fabric,forge archives_base_name=eureka maven_group=org.valkyrienskies # Dependencies -vs2_version=2.1.1-beta.1+60312f90ce -vs_core_version=1.1.0+01023bdb65 +vs2_version=2.1.1-beta.1+9445389ac1 +vs_core_version=1.1.0+8a93383ce5 minecraft_version=1.18.2 architectury_version=4.10.86 fabric_loader_version=0.14.10 fabric_api_version=0.59.0+1.18.2 forge_version=1.18.2-40.1.85 -forge_kotlin_version=3.11.0 kotlin_version=1.9.10 cloth_config_version=6.4.90 # Maven publishing From 83e2cbf14c00d20df0db501fc20e0b623ba590e4 Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Wed, 11 Oct 2023 05:11:46 -0600 Subject: [PATCH 45/56] Fixed engine blocks not working --- .../eureka/blockentity/EngineBlockEntity.kt | 2 +- .../valkyrienskies/eureka/ship/EurekaShipControl.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index 7edf2a05..cb21f443 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -87,7 +87,7 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : if (heat > 0) { val eurekaShipControl = ship?.getAttachment(EurekaShipControl::class.java) - if (ship != null && eurekaShipControl != null) { + if (ship != null && eurekaShipControl != null && !level!!.hasNeighborSignal(blockPos)) { // Avoid fluctuations in speed var effectiveHeat = 1f if (heat < maxEffectiveFuel) { diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index 0bc63d58..004312f3 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -14,6 +14,7 @@ import org.joml.Vector3dc import org.valkyrienskies.core.api.VSBeta import org.valkyrienskies.core.api.ships.PhysShip import org.valkyrienskies.core.api.ships.ServerShip +import org.valkyrienskies.core.api.ships.ServerTickListener import org.valkyrienskies.core.api.ships.ShipForcesInducer import org.valkyrienskies.core.api.ships.getAttachment import org.valkyrienskies.core.api.ships.saveAttachment @@ -34,7 +35,7 @@ import kotlin.math.min setterVisibility = JsonAutoDetect.Visibility.NONE ) @JsonIgnoreProperties(ignoreUnknown = true) -class EurekaShipControl : ShipForcesInducer { +class EurekaShipControl : ShipForcesInducer, ServerTickListener { @JsonIgnore internal var ship: ServerShip? = null @@ -365,4 +366,11 @@ class EurekaShipControl : ShipForcesInducer { private const val GRAVITY = -10.0 } + + override fun onServerTick() { + extraForce = power + power = 0.0 + consumed = physConsumption * /* should be physics ticks based*/ 0.1f + physConsumption = 0.0f + } } From 4f816d5c7e99cb95471f70c8b73a45bf94dd215f Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 11 Oct 2023 20:50:06 +0200 Subject: [PATCH 46/56] Added minecraft:snow_block to blacklist #248 --- common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 469f5a13..c294ec85 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -171,6 +171,7 @@ object EurekaConfig { "minecraft:chorus_plant", "minecraft:chorus_flower", "minecraft:snow", + "minecraft:snow_block", "minecraft:cactus", "minecraft:vine", "minecraft:sunflower", From b21c05e23784326542fea39fb19a920e5fba9214 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:23:18 +0200 Subject: [PATCH 47/56] Add forge_kotlin_version to gradle.properties (#261) --- forge/build.gradle | 2 +- gradle.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/forge/build.gradle b/forge/build.gradle index cc3c43b9..5573e300 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -54,7 +54,7 @@ dependencies { common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } - implementation 'thedarkcolour:kotlinforforge:3.12.0' + implementation "thedarkcolour:kotlinforforge:$forge_kotlin_version" } processResources { diff --git a/gradle.properties b/gradle.properties index e0061e62..0f1cf557 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,7 @@ architectury_version=4.10.86 fabric_loader_version=0.14.10 fabric_api_version=0.59.0+1.18.2 forge_version=1.18.2-40.1.85 +forge_kotlin_version=3.12.0 kotlin_version=1.9.10 cloth_config_version=6.4.90 # Maven publishing From a0b90765540c0d6ddc2d4c4ff81aebcbd23c7592 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:27:30 +0200 Subject: [PATCH 48/56] Added config for pause behaviour for engine (#262) pause behaviour like how it used to work. --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 3 + .../eureka/blockentity/EngineBlockEntity.kt | 85 ++++++++++--------- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index c294ec85..f6d15aed 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -31,6 +31,9 @@ object EurekaConfig { @JsonSchema(description = "Increases heat gained at low heat level, and increased heat decreases when at high heat and not consuming fuel") val engineHeatChangeExponent = 0.1f + @JsonSchema(description = "Pause fuel consumption and power when block is powered") + val engineRedstoneBehaviorPause = false + @JsonSchema(description = "Avoids consuming fuel when heat is 100%") val engineFuelSaving = false diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index cb21f443..edb56e7b 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -52,59 +52,62 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : private var heat = 0f fun tick() { - if (!this.level!!.isClientSide) { - // Disable engine feeding when they are receiving a redstone signal - if (!level!!.hasNeighborSignal(blockPos)) { - if (fuelLeft > 0) { - - if (EurekaConfig.SERVER.engineFuelSaving) { - if (heat <= maxEffectiveFuel) { - heat += scaleEngineHeating(EurekaConfig.SERVER.engineHeatGain) - fuelLeft-- - } - } else { - fuelLeft-- + if (this.level!!.isClientSide) return + + val isPowered = level!!.hasNeighborSignal(blockPos) + if (EurekaConfig.SERVER.engineRedstoneBehaviorPause && isPowered) return - if (heat <= maxEffectiveFuel) { - heat += scaleEngineHeating(EurekaConfig.SERVER.engineHeatGain) - } + // Disable engine feeding when they are receiving a redstone signal + if (!isPowered) { + if (fuelLeft > 0) { + + if (EurekaConfig.SERVER.engineFuelSaving) { + if (heat <= maxEffectiveFuel) { + heat += scaleEngineHeating(EurekaConfig.SERVER.engineHeatGain) + fuelLeft-- } + } else { + fuelLeft-- - // Refill while burning - if (!fuel.isEmpty && lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { - consumeFuel() + if (heat <= maxEffectiveFuel) { + heat += scaleEngineHeating(EurekaConfig.SERVER.engineHeatGain) } - } else if (!fuel.isEmpty) { - consumeFuel() } - } - val prevHeatLevel = heatLevel - heatLevel = min(ceil(heat * 4f / 100f).toInt(), 4) - if (prevHeatLevel != heatLevel) { - level!!.setBlock(blockPos, this.blockState.setValue(HEAT, heatLevel), 11) + // Refill while burning + if (!fuel.isEmpty && lastFuelValue <= EurekaConfig.SERVER.engineMinCapacity - fuelLeft) { + consumeFuel() + } + } else if (!fuel.isEmpty) { + consumeFuel() } + } - if (heat > 0) { - val eurekaShipControl = ship?.getAttachment(EurekaShipControl::class.java) - if (ship != null && eurekaShipControl != null && !level!!.hasNeighborSignal(blockPos)) { - // Avoid fluctuations in speed - var effectiveHeat = 1f - if (heat < maxEffectiveFuel) { - effectiveHeat = heat / 100f - } - - eurekaShipControl.power += lerp( - EurekaConfig.SERVER.minEnginePower, - EurekaConfig.SERVER.enginePower, - effectiveHeat, - ) + val prevHeatLevel = heatLevel + heatLevel = min(ceil(heat * 4f / 100f).toInt(), 4) + if (prevHeatLevel != heatLevel) { + level!!.setBlock(blockPos, this.blockState.setValue(HEAT, heatLevel), 11) + } - heat -= eurekaShipControl.consumed + if (heat > 0) { + val eurekaShipControl = ship?.getAttachment(EurekaShipControl::class.java) + if (ship != null && eurekaShipControl != null) { + // Avoid fluctuations in speed + var effectiveHeat = 1f + if (heat < maxEffectiveFuel) { + effectiveHeat = heat / 100f } - heat = max(heat - scaleEngineCooling(EurekaConfig.SERVER.engineHeatLoss), 0f) + eurekaShipControl.power += lerp( + EurekaConfig.SERVER.minEnginePower, + EurekaConfig.SERVER.enginePower, + effectiveHeat, + ) + + heat -= eurekaShipControl.consumed } + + heat = max(heat - scaleEngineCooling(EurekaConfig.SERVER.engineHeatLoss), 0f) } } From 8fe9a0bde12e81d5df107cc46dac99f6533a49dd Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:36:31 +0200 Subject: [PATCH 49/56] Separate external forces into Linear and Angular (#263) --- .../org/valkyrienskies/eureka/EurekaConfig.kt | 9 +++++--- .../eureka/blockentity/EngineBlockEntity.kt | 12 +++++++--- .../eureka/ship/EurekaShipControl.kt | 22 ++++++++++++------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index f6d15aed..694cdf3d 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -14,13 +14,16 @@ object EurekaConfig { class Server { @JsonSchema(description = "Movement power per engine when heated fully") - val enginePower: Float = 2000000f + val enginePowerLinear: Float = 2000000f @JsonSchema(description = "Movement power per engine with minimal heat") - val minEnginePower: Float = 10000f + val enginePowerLinearMin: Float = 10000f @JsonSchema(description = "Turning power per engine when heated fully") - val engineTurnPower = 1f + val enginePowerAngular = 1.0f + + @JsonSchema(description = "Turning power per engine when minimal heat") + val enginePowerAngularMin = 0.0f @JsonSchema(description = "The amount of heat a engine loses per tick") val engineHeatLoss = 0.01f diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt index edb56e7b..59aac8d4 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt @@ -98,9 +98,15 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) : effectiveHeat = heat / 100f } - eurekaShipControl.power += lerp( - EurekaConfig.SERVER.minEnginePower, - EurekaConfig.SERVER.enginePower, + eurekaShipControl.powerLinear += lerp( + EurekaConfig.SERVER.enginePowerLinearMin, + EurekaConfig.SERVER.enginePowerLinear, + effectiveHeat, + ) + + eurekaShipControl.powerAngular += lerp( + EurekaConfig.SERVER.enginePowerAngularMin, + EurekaConfig.SERVER.enginePowerAngular, effectiveHeat, ) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt index 004312f3..ac869348 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt @@ -40,7 +40,9 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { @JsonIgnore internal var ship: ServerShip? = null - private var extraForce = 0.0 + private var extraForceLinear = 0.0 + private var extraForceAngular = 0.0 + var aligning = false var disassembling = false // Disassembling also affects position private var physConsumption = 0f @@ -213,8 +215,7 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { }.coerceIn(0.5, EurekaConfig.SERVER.maxSizeForTurnSpeedPenalty) val maxLinearAcceleration = EurekaConfig.SERVER.turnAcceleration - val maxLinearSpeed = EurekaConfig.SERVER.turnSpeed + - extraForce / EurekaConfig.SERVER.enginePower * EurekaConfig.SERVER.engineTurnPower + val maxLinearSpeed = EurekaConfig.SERVER.turnSpeed + extraForceAngular // acceleration = alpha * r // therefore: maxAlpha = maxAcceleration / r @@ -278,8 +279,8 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { val extraForceNeeded = Vector3d(idealForwardForce).sub(baseForwardForce) val actualExtraForce = Vector3d(baseForwardForce) - if (extraForce != 0.0) { - actualExtraForce.fma(min(extraForce / extraForceNeeded.length(), 1.0), extraForceNeeded) + if (extraForceLinear != 0.0) { + actualExtraForce.fma(min(extraForceLinear / extraForceNeeded.length(), 1.0), extraForceNeeded) } physShip.applyInvariantForce(actualExtraForce) @@ -321,7 +322,8 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { seatedPlayer?.displayClientMessage(TranslatableComponent(cruiseKey), true) } - var power = 0.0 + var powerLinear = 0.0 + var powerAngular = 0.0 var anchors = 0 // Amount of anchors set(v) { field = v; deleteIfEmpty() @@ -368,8 +370,12 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener { } override fun onServerTick() { - extraForce = power - power = 0.0 + extraForceLinear = powerLinear + powerLinear = 0.0 + + extraForceAngular = powerAngular + powerAngular = 0.0; + consumed = physConsumption * /* should be physics ticks based*/ 0.1f physConsumption = 0.0f } From 544eef8a9f37b6218fcb94a3e1d63b9bb22a4dc1 Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Wed, 11 Oct 2023 21:24:03 -0600 Subject: [PATCH 50/56] Increment version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0f1cf557..63928ce0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx4096M # Identity mod_name=eureka mod_id=vs_eureka -eureka_version=1.1.1-beta.1 +eureka_version=1.1.1-beta.2 enabled_platforms=fabric,forge archives_base_name=eureka maven_group=org.valkyrienskies From 4c7988ec2f5fcd80042ea35741efa1b5431ae0b0 Mon Sep 17 00:00:00 2001 From: StewStrong <stew.strong.420@gmail.com> Date: Fri, 13 Oct 2023 03:12:44 -0600 Subject: [PATCH 51/56] Don't shade fabric language kotlin --- fabric/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index e7063c50..fe4d6e3c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -26,7 +26,7 @@ configurations { dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" - include(modImplementation("net.fabricmc:fabric-language-kotlin:1.10.10+kotlin.1.9.10")) + modImplementation("net.fabricmc:fabric-language-kotlin:1.10.10+kotlin.1.9.10") // Mod menu modImplementation("com.terraformersmc:modmenu:3.2.3") From 6139855ad99f39969ec33ed591811ef5c3b34449 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:38:48 +0200 Subject: [PATCH 52/56] changelogs (#265) --- changelogs/1.1.0-beta.10.md | 30 ++++++++++++++++++++++++++++++ changelogs/1.1.1-beta.1.md | 9 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 changelogs/1.1.0-beta.10.md create mode 100644 changelogs/1.1.1-beta.1.md diff --git a/changelogs/1.1.0-beta.10.md b/changelogs/1.1.0-beta.10.md new file mode 100644 index 00000000..1b229654 --- /dev/null +++ b/changelogs/1.1.0-beta.10.md @@ -0,0 +1,30 @@ +# Blacklist changes + * added `minecraft:tall_seagrass` + * added `minecraft:oak_sapling` + * added `minecraft:spruce_sapling` + * added `minecraft:birch_sapling` + * added `minecraft:jungle_sapling` + * added `minecraft:acacia_sapling` + * added `minecraft:dark_oak_sapling` + * added `minecraft:oak_leaves` + * added `minecraft:spruce_leaves` + * added `minecraft:birch_leaves` + * added `minecraft:jungle_leaves` + * added `minecraft:acacia_leaves` + * added `minecraft:dark_oak_leaves` +# Config Changes + * `engineTurnPower` + * `engineHeatChangeExponent` + * `engineFuelSaving` + * `engineMinCapacity` +* Updated balloon crafting recipes +* Having extra balloons now increases elevation speed +* Updated mass info for engine and anchor +* Added a more intense animation for when engine is fully heated +* Made engines effect turn speed +* Redstone will now stop fuel consumption on engines instead of pausing it +* **bugfixes** + * Fixed bug that caused engine heat to not work properly + * Fixed engine not dropping inventory when broken + * Fixed issues where player became soft-locked when helm was destroyed + * Fixed engine not returning bucket \ No newline at end of file diff --git a/changelogs/1.1.1-beta.1.md b/changelogs/1.1.1-beta.1.md new file mode 100644 index 00000000..3ede9364 --- /dev/null +++ b/changelogs/1.1.1-beta.1.md @@ -0,0 +1,9 @@ +# Blacklist changes + * added `minecraft:snow_block` +# Config Changes + * added `engineRedstoneBehaviorPause` + * added `enginePowerAngularMin` + * renamed `enginePower` to `enginePowerLinear` + * renamed `minEnginePower` to `enginePowerLinearMin` + * renamed `engineTurnPower` to `enginePowerAngular` +* Updated Kotlin and VS2. From 993e0006a718d7454de6ed2e893e4b03d874039a Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 4 Nov 2023 02:21:55 +0100 Subject: [PATCH 53/56] Block and recipe improvements (#272) * Increased break time for balloons. * Grouped balloon color recipes. * Grouped hull recipes. * Grouped balloon recipes. * Added recipe unlock conditions. * Updated some recipes to use tags instead of specific items. --- .../org/valkyrienskies/eureka/EurekaBlocks.kt | 34 +- .../advancements/recipes/balloon_color.json | 317 ++++++++++++++++++ .../advancements/recipes/balloon_leather.json | 32 ++ .../recipes/balloon_membrane.json | 32 ++ .../advancements/recipes/balloon_paper.json | 32 ++ .../advancements/recipes/balloon_wool.json | 32 ++ .../advancements/recipes/ship_helm.json | 31 ++ .../vs_eureka/recipes/acacia_ship_helm.json | 3 +- .../vs_eureka/recipes/balloon_leather.json | 3 +- .../vs_eureka/recipes/balloon_membrane.json | 3 +- .../data/vs_eureka/recipes/balloon_paper.json | 3 +- .../data/vs_eureka/recipes/balloon_wool.json | 5 +- .../vs_eureka/recipes/birch_ship_helm.json | 3 +- .../data/vs_eureka/recipes/black_balloon.json | 5 +- .../data/vs_eureka/recipes/blue_balloon.json | 5 +- .../data/vs_eureka/recipes/brown_balloon.json | 5 +- .../vs_eureka/recipes/crimson_ship_helm.json | 3 +- .../data/vs_eureka/recipes/cyan_balloon.json | 5 +- .../vs_eureka/recipes/dark_oak_ship_helm.json | 3 +- .../data/vs_eureka/recipes/gray_balloon.json | 5 +- .../data/vs_eureka/recipes/green_balloon.json | 5 +- .../vs_eureka/recipes/jungle_ship_helm.json | 3 +- .../vs_eureka/recipes/light_blue_balloon.json | 5 +- .../vs_eureka/recipes/light_gray_balloon.json | 5 +- .../data/vs_eureka/recipes/lime_balloon.json | 5 +- .../vs_eureka/recipes/magenta_balloon.json | 5 +- .../data/vs_eureka/recipes/oak_ship_helm.json | 3 +- .../vs_eureka/recipes/orange_balloon.json | 5 +- .../data/vs_eureka/recipes/pink_balloon.json | 5 +- .../vs_eureka/recipes/purple_balloon.json | 5 +- .../data/vs_eureka/recipes/red_balloon.json | 5 +- .../vs_eureka/recipes/spruce_ship_helm.json | 3 +- .../vs_eureka/recipes/warped_ship_helm.json | 3 +- .../data/vs_eureka/recipes/white_balloon.json | 5 +- .../vs_eureka/recipes/yellow_balloon.json | 5 +- .../data/vs_eureka/tags/items/balloons.json | 22 ++ .../data/vs_eureka/tags/items/ship_helms.json | 13 + 37 files changed, 601 insertions(+), 62 deletions(-) create mode 100644 common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_color.json create mode 100644 common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_leather.json create mode 100644 common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_membrane.json create mode 100644 common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_paper.json create mode 100644 common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_wool.json create mode 100644 common/src/main/resources/data/vs_eureka/advancements/recipes/ship_helm.json create mode 100644 common/src/main/resources/data/vs_eureka/tags/items/balloons.json create mode 100644 common/src/main/resources/data/vs_eureka/tags/items/ship_helms.json diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt index 8b8a99d3..64ec3dc3 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaBlocks.kt @@ -77,87 +77,87 @@ object EurekaBlocks { // region Balloons val BALLOON = BLOCKS.register("balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.WOOL).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.WOOL).strength(0.8F).sound(SoundType.WOOL) ) } val WHITE_BALLOON = BLOCKS.register("white_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.SNOW).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.SNOW).strength(0.8F).sound(SoundType.WOOL) ) } val LIGHT_GRAY_BALLOON = BLOCKS.register("light_gray_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_LIGHT_GRAY).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_LIGHT_GRAY).strength(0.8F).sound(SoundType.WOOL) ) } val GRAY_BALLOON = BLOCKS.register("gray_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_GRAY).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_GRAY).strength(0.8F).sound(SoundType.WOOL) ) } val BLACK_BALLOON = BLOCKS.register("black_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_BLACK).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_BLACK).strength(0.8F).sound(SoundType.WOOL) ) } val RED_BALLOON = BLOCKS.register("red_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_RED).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_RED).strength(0.8F).sound(SoundType.WOOL) ) } val ORANGE_BALLOON = BLOCKS.register("orange_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_ORANGE).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_ORANGE).strength(0.8F).sound(SoundType.WOOL) ) } val YELLOW_BALLOON = BLOCKS.register("yellow_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_YELLOW).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_YELLOW).strength(0.8F).sound(SoundType.WOOL) ) } val LIME_BALLOON = BLOCKS.register("lime_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_LIGHT_GREEN).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_LIGHT_GREEN).strength(0.8F).sound(SoundType.WOOL) ) } val GREEN_BALLOON = BLOCKS.register("green_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_GREEN).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_GREEN).strength(0.8F).sound(SoundType.WOOL) ) } val LIGHT_BLUE_BALLOON = BLOCKS.register("light_blue_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_LIGHT_BLUE).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_LIGHT_BLUE).strength(0.8F).sound(SoundType.WOOL) ) } val CYAN_BALLOON = BLOCKS.register("cyan_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_CYAN).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_CYAN).strength(0.8F).sound(SoundType.WOOL) ) } val BLUE_BALLOON = BLOCKS.register("blue_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_BLUE).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_BLUE).strength(0.8F).sound(SoundType.WOOL) ) } val PURPLE_BALLOON = BLOCKS.register("purple_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_PURPLE).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_PURPLE).strength(0.8F).sound(SoundType.WOOL) ) } val MAGENTA_BALLOON = BLOCKS.register("magenta_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_MAGENTA).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_MAGENTA).strength(0.8F).sound(SoundType.WOOL) ) } val PINK_BALLOON = BLOCKS.register("pink_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_PINK).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_PINK).strength(0.8F).sound(SoundType.WOOL) ) } val BROWN_BALLOON = BLOCKS.register("brown_balloon") { BalloonBlock( - BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_BROWN).sound(SoundType.WOOL) + BlockBehaviour.Properties.of(Material.WOOL, MaterialColor.COLOR_BROWN).strength(0.8F).sound(SoundType.WOOL) ) } // endregion diff --git a/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_color.json b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_color.json new file mode 100644 index 00000000..cf65bd93 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_color.json @@ -0,0 +1,317 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "vs_eureka:black_balloon", + "vs_eureka:blue_balloon", + "vs_eureka:brown_balloon", + "vs_eureka:cyan_balloon", + "vs_eureka:gray_balloon", + "vs_eureka:green_balloon", + "vs_eureka:light_blue_balloon", + "vs_eureka:light_gray_balloon", + "vs_eureka:lime_balloon", + "vs_eureka:magenta_balloon", + "vs_eureka:orange_balloon", + "vs_eureka:pink_balloon", + "vs_eureka:purple_balloon", + "vs_eureka:red_balloon", + "vs_eureka:white_balloon", + "vs_eureka:yellow_balloon" + ] + }, + "criteria": { + "has_black_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:black_balloon" + } + ] + } + }, + "has_black_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:black_balloon" + } + }, + "has_blue_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:blue_balloon" + } + ] + } + }, + "has_blue_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:blue_balloon" + } + }, + "has_brown_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:brown_balloon" + } + ] + } + }, + "has_brown_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:brown_balloon" + } + }, + "has_cyan_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:cyan_balloon" + } + ] + } + }, + "has_cyan_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:cyan_balloon" + } + }, + "has_gray_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:gray_balloon" + } + ] + } + }, + "has_gray_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:gray_balloon" + } + }, + "has_green_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:green_balloon" + } + ] + } + }, + "has_green_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:green_balloon" + } + }, + "has_light_blue_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:light_blue_balloon" + } + ] + } + }, + "has_light_blue_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:light_blue_balloon" + } + }, + "has_light_gray_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:light_gray_balloon" + } + ] + } + }, + "has_light_gray_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:light_gray_balloon" + } + }, + "has_lime_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:lime_balloon" + } + ] + } + }, + "has_lime_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:lime_balloon" + } + }, + "has_magenta_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:magenta_balloon" + } + ] + } + }, + "has_magenta_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:magenta_balloon" + } + }, + "has_orange_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:orange_balloon" + } + ] + } + }, + "has_orange_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:orange_balloon" + } + }, + "has_pink_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:pink_balloon" + } + ] + } + }, + "has_pink_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:pink_balloon" + } + }, + "has_purple_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:purple_balloon" + } + ] + } + }, + "has_purple_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:purple_balloon" + } + }, + "has_red_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:red_balloon" + } + ] + } + }, + "has_red_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:red_balloon" + } + }, + "has_white_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:white_balloon" + } + ] + } + }, + "has_white_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:white_balloon" + } + }, + "has_yellow_balloon": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "vs_balloon:yellow_balloon" + } + ] + } + }, + "has_yellow_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:yellow_balloon" + } + } + }, + "requirements": [ + [ + "has_black_balloon", + "has_black_recipe", + "has_blue_balloon", + "has_blue_recipe", + "has_brown_balloon", + "has_brown_recipe", + "has_cyan_balloon", + "has_cyan_recipe", + "has_gray_balloon", + "has_gray_recipe", + "has_green_balloon", + "has_green_recipe", + "has_light_blue_balloon", + "has_light_blue_recipe", + "has_light_gray_balloon", + "has_light_gray_recipe", + "has_lime_balloon", + "has_lime_recipe", + "has_magenta_balloon", + "has_magenta_recipe", + "has_orange_balloon", + "has_orange_recipe", + "has_pink_balloon", + "has_pink_recipe", + "has_purple_balloon", + "has_purple_recipe", + "has_red_balloon", + "has_red_recipe", + "has_white_balloon", + "has_white_recipe", + "has_yellow_balloon", + "has_yellow_recipe" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_leather.json b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_leather.json new file mode 100644 index 00000000..73e6f73c --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_leather.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "vs_eureka:balloon_leather" + ] + }, + "criteria": { + "has_leather": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:leather" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:balloon_leather" + } + } + }, + "requirements": [ + [ + "has_leather", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_membrane.json b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_membrane.json new file mode 100644 index 00000000..8941e4e4 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_membrane.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "vs_eureka:balloon_membrane" + ] + }, + "criteria": { + "has_membrane": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:membrane" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:balloon_membrane" + } + } + }, + "requirements": [ + [ + "has_membrane", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_paper.json b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_paper.json new file mode 100644 index 00000000..40170469 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_paper.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "vs_eureka:balloon_paper" + ] + }, + "criteria": { + "has_paper": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:paper" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:balloon_paper" + } + } + }, + "requirements": [ + [ + "has_paper", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_wool.json b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_wool.json new file mode 100644 index 00000000..0c7786b1 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/advancements/recipes/balloon_wool.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "vs_eureka:balloon_wool" + ] + }, + "criteria": { + "has_wool": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "minecraft:wool" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "vs_eureka:balloon_wool" + } + } + }, + "requirements": [ + [ + "has_wool", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/advancements/recipes/ship_helm.json b/common/src/main/resources/data/vs_eureka/advancements/recipes/ship_helm.json new file mode 100644 index 00000000..eccf8125 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/advancements/recipes/ship_helm.json @@ -0,0 +1,31 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "vs_eureka:acacia_ship_helm", + "vs_eureka:crimson_ship_helm", + "vs_eureka:dark_oak_ship_helm", + "vs_eureka:jungle_ship_helm", + "vs_eureka:oak_ship_helm", + "vs_eureka:spruce_ship_helm", + "vs_eureka:warped_ship_helm" + ] + }, + "criteria": { + "has_gold": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:gold" + } + ] + } + } + }, + "requirements": [ + [ + "has_gold" + ] + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/acacia_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/acacia_ship_helm.json index 052ae099..6251534a 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/acacia_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/acacia_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:acacia_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json index 188215b1..a813066f 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_leather.json @@ -13,5 +13,6 @@ "result": { "item": "vs_eureka:balloon", "count": 4 - } + }, + "group": "balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json index 5f8e9162..199b5d7e 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_membrane.json @@ -13,5 +13,6 @@ "result": { "item": "vs_eureka:balloon", "count": 32 - } + }, + "group": "balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json index 1cda12b3..aa1aa416 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_paper.json @@ -13,5 +13,6 @@ "result": { "item": "vs_eureka:balloon", "count": 2 - } + }, + "group": "balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json b/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json index 46e05c32..be38013f 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json +++ b/common/src/main/resources/data/vs_eureka/recipes/balloon_wool.json @@ -7,11 +7,12 @@ ], "key": { "#": { - "item": "minecraft:white_wool" + "tag": "minecraft:wool" } }, "result": { "item": "vs_eureka:balloon", "count": 4 - } + }, + "group": "balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/birch_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/birch_ship_helm.json index 3e7edbae..46792335 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/birch_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/birch_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:birch_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/black_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/black_balloon.json index ba2eee3b..da57ce88 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/black_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/black_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:black_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:black_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/blue_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/blue_balloon.json index 89f8b2b2..7914fe12 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/blue_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/blue_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:blue_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:blue_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json index 3c99b894..ceee6ca2 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/brown_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:brown_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:brown_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/crimson_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/crimson_ship_helm.json index b8fe13c9..2afde7b5 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/crimson_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/crimson_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:crimson_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/cyan_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/cyan_balloon.json index 0ada9051..2ee5857a 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/cyan_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/cyan_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:cyan_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:cyan_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/dark_oak_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/dark_oak_ship_helm.json index 3e54edfb..1b988f6a 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/dark_oak_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/dark_oak_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:dark_oak_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/gray_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/gray_balloon.json index c85912a7..49f17145 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/gray_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/gray_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:gray_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:gray_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/green_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/green_balloon.json index 36192fce..2895b28c 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/green_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/green_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:green_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:green_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/jungle_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/jungle_ship_helm.json index c8b198a7..e1a8c214 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/jungle_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/jungle_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:jungle_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/light_blue_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/light_blue_balloon.json index 3d1d21bb..302cec72 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/light_blue_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/light_blue_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:light_blue_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:light_blue_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/light_gray_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/light_gray_balloon.json index ca0a83a0..afd84e89 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/light_gray_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/light_gray_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:light_gray_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:light_gray_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/lime_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/lime_balloon.json index d8b7a9bb..b1f28ef2 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/lime_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/lime_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:lime_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:lime_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/magenta_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/magenta_balloon.json index a6664639..230d77d3 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/magenta_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/magenta_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:magenta_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:magenta_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/oak_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/oak_ship_helm.json index 96e9e692..ab2eeeba 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/oak_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/oak_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:oak_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/orange_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/orange_balloon.json index 53dfe3cd..b193d669 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/orange_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/orange_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:orange_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:orange_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/pink_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/pink_balloon.json index bf143114..92091247 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/pink_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/pink_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:pink_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:pink_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/purple_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/purple_balloon.json index 018671a9..64b63a2c 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/purple_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/purple_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:purple_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:purple_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/red_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/red_balloon.json index f101c1e0..77d48e43 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/red_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/red_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:red_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:red_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/spruce_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/spruce_ship_helm.json index 1748b47f..cee55023 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/spruce_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/spruce_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:spruce_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/warped_ship_helm.json b/common/src/main/resources/data/vs_eureka/recipes/warped_ship_helm.json index 90417d6b..98df1560 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/warped_ship_helm.json +++ b/common/src/main/resources/data/vs_eureka/recipes/warped_ship_helm.json @@ -22,5 +22,6 @@ "result": { "item": "vs_eureka:warped_ship_helm", "count": 1 - } + }, + "group": "ship_helm" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/white_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/white_balloon.json index a72a5f85..78a3a291 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/white_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/white_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:white_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:white_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/recipes/yellow_balloon.json b/common/src/main/resources/data/vs_eureka/recipes/yellow_balloon.json index f468845c..add79728 100644 --- a/common/src/main/resources/data/vs_eureka/recipes/yellow_balloon.json +++ b/common/src/main/resources/data/vs_eureka/recipes/yellow_balloon.json @@ -2,7 +2,7 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "item": "vs_eureka:balloon" + "tag": "vs_eureka:balloons" }, { "item": "minecraft:yellow_dye" @@ -11,5 +11,6 @@ "result": { "item": "vs_eureka:yellow_balloon", "count": 1 - } + }, + "group": "colored_balloons" } \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/tags/items/balloons.json b/common/src/main/resources/data/vs_eureka/tags/items/balloons.json new file mode 100644 index 00000000..f74a1305 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/tags/items/balloons.json @@ -0,0 +1,22 @@ +{ + "replace": false, + "values": [ + "vs_eureka:balloon", + "vs_eureka:white_balloon", + "vs_eureka:light_gray_balloon", + "vs_eureka:gray_balloon", + "vs_eureka:black_balloon", + "vs_eureka:red_balloon", + "vs_eureka:orange_balloon", + "vs_eureka:yellow_balloon", + "vs_eureka:lime_balloon", + "vs_eureka:green_balloon", + "vs_eureka:light_blue_balloon", + "vs_eureka:cyan_balloon", + "vs_eureka:blue_balloon", + "vs_eureka:purple_balloon", + "vs_eureka:magenta_balloon", + "vs_eureka:pink_balloon", + "vs_eureka:brown_balloon" + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/vs_eureka/tags/items/ship_helms.json b/common/src/main/resources/data/vs_eureka/tags/items/ship_helms.json new file mode 100644 index 00000000..010f59d1 --- /dev/null +++ b/common/src/main/resources/data/vs_eureka/tags/items/ship_helms.json @@ -0,0 +1,13 @@ +{ + "replace": false, + "values": [ + "vs_eureka:oak_ship_helm", + "vs_eureka:spruce_ship_helm", + "vs_eureka:birch_ship_helm", + "vs_eureka:jungle_ship_helm", + "vs_eureka:acacia_ship_helm", + "vs_eureka:dark_oak_ship_helm", + "vs_eureka:crimson_ship_helm", + "vs_eureka:warped_ship_helm" + ] +} \ No newline at end of file From b65a318e8d4e3598db0a635fe74986575ce46e59 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 4 Nov 2023 02:39:25 +0100 Subject: [PATCH 54/56] Resolved block blacklist issue #128 --- .../src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt index 694cdf3d..57585906 100644 --- a/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt +++ b/common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt @@ -135,6 +135,8 @@ object EurekaConfig { "minecraft:granite", "minecraft:diorite", "minecraft:andesite", + "minecraft:deepslate", + "minecraft:tuff", "minecraft:crimson_nylium", "minecraft:warped_nylium", "minecraft:red_sand", From 16fa9959684e087b244b530fc178b228dc1fef44 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 18 Nov 2023 15:41:38 +0100 Subject: [PATCH 55/56] Update changelog 1.1.0-beta.10.md --- changelogs/1.1.0-beta.10.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/changelogs/1.1.0-beta.10.md b/changelogs/1.1.0-beta.10.md index 1b229654..0bcadf5e 100644 --- a/changelogs/1.1.0-beta.10.md +++ b/changelogs/1.1.0-beta.10.md @@ -17,14 +17,15 @@ * `engineHeatChangeExponent` * `engineFuelSaving` * `engineMinCapacity` -* Updated balloon crafting recipes -* Having extra balloons now increases elevation speed -* Updated mass info for engine and anchor -* Added a more intense animation for when engine is fully heated -* Made engines effect turn speed -* Redstone will now stop fuel consumption on engines instead of pausing it -* **bugfixes** +# Changes + * Updated balloon crafting recipes + * Having extra balloons now increases elevation speed + * Updated mass info for engine and anchor + * Added a more intense animation for when the engine is fully heated + * Made engines affect turn speed + * Redstone will now stop fuel consumption on engines instead of pausing it +# bugfixes * Fixed bug that caused engine heat to not work properly * Fixed engine not dropping inventory when broken - * Fixed issues where player became soft-locked when helm was destroyed - * Fixed engine not returning bucket \ No newline at end of file + * Fixed issues where the player became soft-locked when the helm was destroyed + * Fixed engine not returning bucket From af8279f7fec8bd2e1c5aef39a72340e24a51fff5 Mon Sep 17 00:00:00 2001 From: millennIumAMbiguity <37588844+millennIumAMbiguity@users.noreply.github.com> Date: Sat, 18 Nov 2023 15:45:57 +0100 Subject: [PATCH 56/56] Create 1.4.0-beta.1.md --- changelogs/1.4.0-beta.1.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 changelogs/1.4.0-beta.1.md diff --git a/changelogs/1.4.0-beta.1.md b/changelogs/1.4.0-beta.1.md new file mode 100644 index 00000000..a76c0c3a --- /dev/null +++ b/changelogs/1.4.0-beta.1.md @@ -0,0 +1,11 @@ +# Blacklist changes + * added `minecraft:deepslate` + * added `minecraft:tuff` +# Recipe Changes + * Grouped balloon color recipes. + * Grouped helm recipes. + * Grouped balloon recipes. + * Added recipe unlock conditions. + * Updated some recipes to use tags instead of specific items +# Changes + * Increased break time for balloons.