Skip to content

Commit 57543b2

Browse files
Merge branch '1.19.2/main' into 1.20.1/main
2 parents 88b99b0 + 3cafb8e commit 57543b2

39 files changed

+264
-163
lines changed

build.gradle

+11-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ if (project.hasProperty("CustomReleaseVersion")) {
1818
// Remove release/ from the version if present
1919
version = project.property("CustomReleaseVersion").replaceFirst("^release/", "")
2020
} else {
21-
String gitRevision = "git rev-parse HEAD".execute().text.trim()
22-
23-
version = eureka_version + '+' + gitRevision.substring(0, 10)
21+
try {
22+
String gitRevision = "git rev-parse HEAD".execute().text.trim()
23+
version = eureka_version + '+' + gitRevision.substring(0, 10)
24+
} catch (Exception e) {
25+
version = eureka_version
26+
}
2427
}
2528

2629
architectury {
@@ -86,6 +89,10 @@ subprojects {
8689
reporter "checkstyle"
8790
}
8891
}
92+
93+
kotlin {
94+
jvmToolchain(17)
95+
}
8996
}
9097

9198
allprojects {
@@ -124,4 +131,4 @@ allprojects {
124131
java {
125132
withSourcesJar()
126133
}
127-
}
134+
}

changelogs/1.5.0-beta.1.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Additions
2+
* Added hip name/slug and speed to the helm UI.
3+
* Added support for item extraction from the engine.
4+
* Added config `linearBaseMass`
5+
* Added config `linearMassScaling`
6+
* Added config `linearMaxMass`
7+
* Added config `linearMaxSpeed`
8+
# Changes
9+
* Descending speed is now constant.
10+
* Update Russian translation.
11+
* Optimized textures.
12+
* Updated the input acceleration system to scale with mass.
13+
* Disable the align button in the helm UI when ship is disassembled.
14+
# Fixes
15+
* Fixed so that ships can no longer accumulate momentum while anchored.
16+
* Fixed orientation changes on disassembly.
17+
* Fixed an issue where explosions do not affect ship buoyancy.
18+
* Fixed side drift when ascending and descending.

common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt

+19-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object EurekaConfig {
1414
class Server {
1515

1616
@JsonSchema(description = "Movement power per engine when heated fully")
17-
val enginePowerLinear: Float = 2000000f
17+
val enginePowerLinear: Float = 500000f
1818

1919
@JsonSchema(description = "Movement power per engine with minimal heat")
2020
val enginePowerLinearMin: Float = 10000f
@@ -64,9 +64,12 @@ object EurekaConfig {
6464

6565
// Sensitivity of the up/down impulse buttons.
6666
// TODO maybe should be moved to VS2 client-side config?
67-
@JsonSchema(description = "Vertical sensitivity up ascend/descend")
67+
@JsonSchema(description = "Vertical sensitivity when ascending")
6868
var baseImpulseElevationRate = 2.0
6969

70+
@JsonSchema(description = "Vertical sensitivity when descending")
71+
var baseImpulseDescendRate = 4.0
72+
7073
@JsonSchema(description = "The max elevation speed boost gained by having extra extra balloons")
7174
var balloonElevationMaxSpeed = 5.5
7275

@@ -105,6 +108,20 @@ object EurekaConfig {
105108
@JsonSchema(description = "How fast a ship will stop. 1 = fast stop, 0 = slow stop")
106109
var linearStabilizeMaxAntiVelocity = 1.0
107110

111+
@JsonSchema(description = "How fast a ship will stop and accelerate.")
112+
var linearMassScaling = 0.0002
113+
114+
// Must be positive. higher value will case slower acceleration and deceleration.
115+
@JsonSchema(description = "Base mass for linear acceleration in Kg.")
116+
var linearBaseMass = 50.0
117+
118+
//when value is same as linearMaxMass, actual value will be 1/3. actual value will be close to linearMaxMass when 5 times over
119+
@JsonSchema(description = "Max smoothing value, will smooth out before reaching max value.")
120+
var linearMaxMass = 10000.0
121+
122+
@JsonSchema(description = "Max unscaled speed in m/s.")
123+
var linearMaxSpeed = 15.0
124+
108125
// Anti-velocity mass relevance when stopping the ship
109126
// Max 10.0 (means no mass irrelevance)
110127
@JsonSchema(description = "How much inertia affects Eureka ships. Max 10 = full inertia")

common/src/main/kotlin/org/valkyrienskies/eureka/block/AnchorBlock.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ class AnchorBlock :
9191
attachment.anchorsActive += if (bl) 1 else 0
9292
}
9393

94-
override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) {
95-
super.destroy(level, pos, state)
94+
override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) {
95+
super.onRemove(state, level, pos, newState, isMoving)
96+
9697
if (level.isClientSide) return
9798
level as ServerLevel
9899

common/src/main/kotlin/org/valkyrienskies/eureka/block/BalloonBlock.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class BalloonBlock(properties: Properties) : Block(properties) {
3333
EurekaShipControl.getOrCreate(ship).balloons += 1
3434
}
3535

36-
override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) {
37-
super.destroy(level, pos, state)
36+
override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) {
37+
super.onRemove(state, level, pos, newState, isMoving)
3838

3939
if (level.isClientSide) return
4040
level as ServerLevel

common/src/main/kotlin/org/valkyrienskies/eureka/block/FloaterBlock.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class FloaterBlock : Block(
6262
level.setBlock(pos, state.setValue(POWER, signal), 2)
6363
}
6464

65-
override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) {
66-
super.destroy(level, pos, state)
65+
override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) {
66+
super.onRemove(state, level, pos, newState, isMoving)
6767

6868
if (level.isClientSide) return
6969
level as ServerLevel

common/src/main/kotlin/org/valkyrienskies/eureka/block/ShipHelmBlock.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class ShipHelmBlock(properties: Properties, val woodType: WoodType) : BaseEntity
5555
EurekaShipControl.getOrCreate(ship).helms += 1
5656
}
5757

58-
override fun destroy(level: LevelAccessor, pos: BlockPos, state: BlockState) {
59-
super.destroy(level, pos, state)
58+
override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, isMoving: Boolean) {
59+
super.onRemove(state, level, pos, newState, isMoving)
6060

6161
if (level.isClientSide) return
6262
level as ServerLevel

common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/EngineBlockEntity.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,14 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) :
215215
) <= 64.0
216216
}
217217

218-
override fun getSlotsForFace(side: Direction): IntArray =
219-
if (side == Direction.DOWN) intArrayOf() else intArrayOf(0)
218+
override fun getSlotsForFace(side: Direction): IntArray = intArrayOf(0)
220219

221220
override fun canPlaceItemThroughFace(index: Int, itemStack: ItemStack, direction: Direction?): Boolean =
222221
direction != Direction.DOWN && canPlaceItem(index, itemStack)
223222

224-
override fun canTakeItemThroughFace(index: Int, stack: ItemStack, direction: Direction): Boolean = false
223+
override fun canTakeItemThroughFace(index: Int, stack: ItemStack, direction: Direction): Boolean =
224+
// Allow extraction from slot 0 (fuel slot) when the hopper is below the block entity
225+
index == 0 && direction == Direction.DOWN && !fuel.isEmpty && !AbstractFurnaceBlockEntity.isFuel(fuel)
225226

226227
override fun canPlaceItem(index: Int, stack: ItemStack): Boolean =
227228
index == 0 && AbstractFurnaceBlockEntity.isFuel(stack)

common/src/main/kotlin/org/valkyrienskies/eureka/gui/shiphelm/ShipHelmScreen.kt

+14-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import net.minecraft.network.chat.Component
99
import net.minecraft.resources.ResourceLocation
1010
import net.minecraft.world.entity.player.Inventory
1111
import net.minecraft.world.phys.BlockHitResult
12+
import org.valkyrienskies.core.api.ships.Ship
1213
import org.valkyrienskies.eureka.EurekaConfig
1314
import org.valkyrienskies.eureka.EurekaMod
1415
import org.valkyrienskies.mod.common.getShipManagingPos
@@ -20,10 +21,12 @@ class ShipHelmScreen(handler: ShipHelmScreenMenu, playerInventory: Inventory, te
2021
private lateinit var alignButton: ShipHelmButton
2122
private lateinit var disassembleButton: ShipHelmButton
2223

23-
private val pos = (Minecraft.getInstance().hitResult as? BlockHitResult)?.blockPos
24+
private var pos = (Minecraft.getInstance().hitResult as? BlockHitResult)?.blockPos
25+
private var ship: Ship? = pos?.let { Minecraft.getInstance().level?.getShipManagingPos(it) }
2426

2527
init {
26-
titleLabelX = 120
28+
titleLabelX = 6
29+
titleLabelY = 6
2730
}
2831

2932
override fun init() {
@@ -54,10 +57,14 @@ class ShipHelmScreen(handler: ShipHelmScreenMenu, playerInventory: Inventory, te
5457
}
5558

5659
private fun updateButtons() {
57-
val level = Minecraft.getInstance().level ?: return
58-
val isLookingAtShip = level.getShipManagingPos(pos ?: return) != null
60+
pos = (Minecraft.getInstance().hitResult as? BlockHitResult)?.blockPos
61+
ship = pos?.let { Minecraft.getInstance().level?.getShipManagingPos(it) }
62+
63+
val isLookingAtShip = ship != null
64+
5965
assembleButton.active = !isLookingAtShip
6066
disassembleButton.active = EurekaConfig.SERVER.allowDisassembly && isLookingAtShip
67+
alignButton.active = disassembleButton.active
6168
}
6269

6370
override fun renderBg(guiGraphics: GuiGraphics, partialTicks: Float, mouseX: Int, mouseY: Int) {
@@ -72,8 +79,6 @@ class ShipHelmScreen(handler: ShipHelmScreenMenu, playerInventory: Inventory, te
7279
}
7380

7481
override fun renderLabels(guiGraphics: GuiGraphics, i: Int, j: Int) {
75-
guiGraphics.drawString(font, title, titleLabelX, titleLabelY, 0x404040, false)
76-
7782
if (this.menu.aligning) {
7883
alignButton.message = ALIGNING_TEXT
7984
alignButton.active = false
@@ -83,6 +88,9 @@ class ShipHelmScreen(handler: ShipHelmScreenMenu, playerInventory: Inventory, te
8388
}
8489

8590
// TODO render stats
91+
if (ship == null) return
92+
ship!!.slug?.let { guiGraphics.drawString(font, it, titleLabelX, titleLabelY, 0x404040, false) }
93+
guiGraphics.drawString(font, String.format("%.2f", ship!!.velocity.length()) + "m/s", 8, 25, 0x404040, false)
8694
}
8795

8896
// mojank doesn't check mouse release for their widgets for some reason

0 commit comments

Comments
 (0)