Skip to content

Commit 369f4ee

Browse files
committed
Merge from 1.18.x/main
2 parents 3c34496 + f71f5c3 commit 369f4ee

File tree

23 files changed

+222
-168
lines changed

23 files changed

+222
-168
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ body:
2424
- type: input
2525
attributes:
2626
label: Eureka version
27-
description: The version of Eureka ships
27+
description: What version of Eureka ships does this issue occur on?
28+
validations:
29+
required: true
30+
- type: input
31+
attributes:
32+
label: VS2 version
33+
description: What version of Valkyrien Skies 2 does this issue occur on?
2834
validations:
2935
required: true
3036
- type: dropdown

.github/ISSUE_TEMPLATE/compatibility_issue.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ body:
2929
- 1.16
3030
- 1.18
3131
- 1.19
32+
- 1.20
3233
validations:
3334
required: true
3435
- type: dropdown
@@ -41,6 +42,12 @@ body:
4142
- Quilt
4243
validations:
4344
required: true
45+
- type: input
46+
attributes:
47+
label: Eureka version
48+
description: What version of Eureka ships does this issue occur on?
49+
validations:
50+
required: true
4451
- type: textarea
4552
attributes:
4653
label: Issue description

changelogs/1.5.1-beta.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Updated `en_pt.json`
1111
* Updated helm hitbox.
1212
* Changed anchor blast resistance from 1200 to 6.
13-
* Halev the mass effect on max speed.
13+
* Halved the mass effect on max speed.
1414
# Fixes
1515
* Updated dependencies.
1616
* Fixed an issue where the helm GUI lost data.

changelogs/1.5.2-beta.1.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Additions
2+
* Added french translation [#381](https://github.com/ValkyrienSkies/Eureka/pull/381)
3+
* Added block tags for assembly blacklist [#413](https://github.com/ValkyrienSkies/Eureka/pull/413) *(tag available here `data/vs_eureka/tags/blocks/assemble_blacklist.json`)*
4+
# Changes
5+
* Stability decreases with high speed on low mass [#371](https://github.com/ValkyrienSkies/Eureka/pull/371)
6+
* Cleansed the blacklist config [#413](https://github.com/ValkyrienSkies/Eureka/pull/413) *(for now the blacklist config is still supported, use blacklist block tag instead)*
7+
# Fixes
8+
* Improved fuel compatibility [#406](https://github.com/ValkyrienSkies/Eureka/pull/406)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.valkyrienskies.eureka.registry;
2+
3+
import net.minecraft.world.item.ItemStack;
4+
5+
public abstract class FuelRegistry {
6+
public static FuelRegistry INSTANCE = null;
7+
8+
public abstract int get(ItemStack stack);
9+
}

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

Lines changed: 13 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ object EurekaConfig {
120120
@JsonSchema(description = "How fast a ship will stop. 1 = fast stop, 0 = slow stop")
121121
var linearStabilizeMaxAntiVelocity = 1.0
122122

123+
// Instability scaled with mass and squared speed
124+
@JsonSchema(description = "Stronger stabilization with higher mass, less at higher speeds.")
125+
var scaledInstability = 1000.0
126+
127+
// Unscaled linear instability cased by speed
128+
@JsonSchema(description = "Less stabilization at higher speed.")
129+
var unscaledInstability = 0.271828
130+
123131
@JsonSchema(description = "How fast a ship will stop and accelerate.")
124132
var linearMassScaling = 0.0002
125133

@@ -143,104 +151,6 @@ object EurekaConfig {
143151
@JsonSchema(description = "Chance for popped balloons to pop adjacent balloons, per side")
144152
var popSideBalloonChance = 0.3
145153

146-
// Blacklist of blocks that don't get added for ship building
147-
@JsonSchema(description = "Blacklist of blocks that don't get assembled")
148-
var blockBlacklist = setOf(
149-
"vs_eureka:ship_helm",
150-
"minecraft:dirt",
151-
"minecraft:grass_block",
152-
"minecraft:grass_path",
153-
"minecraft:stone",
154-
"minecraft:bedrock",
155-
"minecraft:sand",
156-
"minecraft:gravel",
157-
"minecraft:water",
158-
"minecraft:flowing_water",
159-
"minecraft:lava",
160-
"minecraft:flowing_lava",
161-
"minecraft:lily_pad",
162-
"minecraft:coarse_dirt",
163-
"minecraft:podzol",
164-
"minecraft:granite",
165-
"minecraft:diorite",
166-
"minecraft:andesite",
167-
"minecraft:deepslate",
168-
"minecraft:tuff",
169-
"minecraft:crimson_nylium",
170-
"minecraft:warped_nylium",
171-
"minecraft:red_sand",
172-
"minecraft:sandstone",
173-
"minecraft:end_stone",
174-
"minecraft:red_sandstone",
175-
"minecraft:blackstone",
176-
"minecraft:netherrack",
177-
"minecraft:soul_sand",
178-
"minecraft:soul_soil",
179-
"minecraft:grass",
180-
"minecraft:fern",
181-
"minecraft:dead_bush",
182-
"minecraft:seagrass",
183-
"minecraft:tall_seagrass",
184-
"minecraft:sea_pickle",
185-
"minecraft:kelp",
186-
"minecraft:bamboo",
187-
"minecraft:dandelion",
188-
"minecraft:poppy",
189-
"minecraft:blue_orchid",
190-
"minecraft:allium",
191-
"minecraft:azure_bluet",
192-
"minecraft:red_tulip",
193-
"minecraft:orange_tulip",
194-
"minecraft:white_tulip",
195-
"minecraft:pink_tulip",
196-
"minecraft:oxeye_daisy",
197-
"minecraft:cornflower",
198-
"minecraft:lily_of_the_valley",
199-
"minecraft:brown_mushroom",
200-
"minecraft:red_mushroom",
201-
"minecraft:crimson_fungus",
202-
"minecraft:warped_fungus",
203-
"minecraft:crimson_roots",
204-
"minecraft:warped_roots",
205-
"minecraft:nether_sprouts",
206-
"minecraft:weeping_vines",
207-
"minecraft:twisting_vines",
208-
"minecraft:chorus_plant",
209-
"minecraft:chorus_flower",
210-
"minecraft:snow",
211-
"minecraft:snow_block",
212-
"minecraft:cactus",
213-
"minecraft:vine",
214-
"minecraft:sunflower",
215-
"minecraft:lilac",
216-
"minecraft:rose_bush",
217-
"minecraft:peony",
218-
"minecraft:tall_grass",
219-
"minecraft:large_fern",
220-
"minecraft:air",
221-
"minecraft:ice",
222-
"minecraft:packed_ice",
223-
"minecraft:blue_ice",
224-
"minecraft:portal",
225-
"minecraft:bedrock",
226-
"minecraft:end_portal_frame",
227-
"minecraft:end_portal",
228-
"minecraft:end_gateway",
229-
"minecraft:portal",
230-
"minecraft:oak_sapling",
231-
"minecraft:spruce_sapling",
232-
"minecraft:birch_sapling",
233-
"minecraft:jungle_sapling",
234-
"minecraft:acacia_sapling",
235-
"minecraft:dark_oak_sapling",
236-
"minecraft:oak_leaves",
237-
"minecraft:spruce_leaves",
238-
"minecraft:birch_leaves",
239-
"minecraft:jungle_leaves",
240-
"minecraft:acacia_leaves",
241-
"minecraft:dark_oak_leaves"
242-
)
243-
244154
@JsonSchema(description = "Whether the ship helm assembles diagonally connected blocks or not")
245155
val diagonals = true
246156

@@ -255,5 +165,10 @@ object EurekaConfig {
255165

256166
@JsonSchema(description = "Maximum number of blocks allowed in a ship. Set to 0 for no limit")
257167
val maxShipBlocks = 32 * 32 * 32
168+
169+
// TODO: Remove blockBlacklist
170+
// Blacklist of blocks that don't get added for ship building
171+
@JsonSchema(description = "Blacklist of blocks that don't get assembled (Use Block Tag instead)")
172+
var blockBlacklist : Set<String> = emptySet()
258173
}
259174
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.valkyrienskies.eureka
22

3-
import org.valkyrienskies.core.impl.config.VSConfigClass
3+
import org.valkyrienskies.mod.common.ValkyrienSkiesMod
44

55
object EurekaMod {
66
const val MOD_ID = "vs_eureka"
@@ -13,7 +13,7 @@ object EurekaMod {
1313
EurekaScreens.register()
1414
EurekaEntities.register()
1515
EurekaWeights.register()
16-
VSConfigClass.registerConfig("vs_eureka", EurekaConfig::class.java)
16+
ValkyrienSkiesMod.vsCore.registerConfigLegacy("vs_eureka", EurekaConfig::class.java)
1717
}
1818

1919
@JvmStatic

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,10 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties
77
import org.valkyrienskies.core.apigame.world.chunks.BlockType
88
import org.valkyrienskies.mod.common.BlockStateInfo
99
import org.valkyrienskies.mod.common.BlockStateInfoProvider
10-
import org.valkyrienskies.physics_api.Lod1BlockStateId
11-
import org.valkyrienskies.physics_api.Lod1LiquidBlockStateId
12-
import org.valkyrienskies.physics_api.Lod1SolidBlockStateId
13-
import org.valkyrienskies.physics_api.voxel.Lod1LiquidBlockState
14-
import org.valkyrienskies.physics_api.voxel.Lod1SolidBlockState
1510

1611
object EurekaWeights : BlockStateInfoProvider {
17-
override val blockStateData: List<Triple<Lod1SolidBlockStateId, Lod1LiquidBlockStateId, Lod1BlockStateId>>
18-
get() = emptyList()
19-
override val liquidBlockStates: List<Lod1LiquidBlockState>
20-
get() = emptyList()
2112
override val priority: Int
2213
get() = 200
23-
override val solidBlockStates: List<Lod1SolidBlockState>
24-
get() = emptyList()
2514

2615
override fun getBlockStateMass(blockState: BlockState): Double? {
2716
if (blockState.block == EurekaBlocks.BALLAST.get()) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import net.minecraft.world.damagesource.DamageSource
77
import net.minecraft.world.entity.Entity
88
import net.minecraft.world.entity.projectile.Projectile
99
import net.minecraft.world.level.Level
10-
import net.minecraft.world.level.LevelAccessor
1110
import net.minecraft.world.level.block.Block
1211
import net.minecraft.world.level.block.state.BlockState
1312
import net.minecraft.world.phys.BlockHitResult
@@ -48,7 +47,7 @@ class BalloonBlock(properties: Properties) : Block(properties) {
4847
if (level.isClientSide) return
4948

5049
level.destroyBlock(hit.blockPos, false)
51-
Direction.values().forEach {
50+
Direction.entries.forEach {
5251
val neighbor = hit.blockPos.relative(it)
5352
if (level.getBlockState(neighbor).block == this &&
5453
level.random.nextFloat() < EurekaConfig.SERVER.popSideBalloonChance

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import net.minecraft.world.entity.player.StackedContents
1313
import net.minecraft.world.inventory.AbstractContainerMenu
1414
import net.minecraft.world.inventory.StackedContentsCompatible
1515
import net.minecraft.world.item.ItemStack
16-
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity
1716
import net.minecraft.world.level.block.entity.BaseContainerBlockEntity
18-
import net.minecraft.world.level.block.entity.FurnaceBlockEntity
1917
import net.minecraft.world.level.block.state.BlockState
2018
import org.joml.Math.lerp
2119
import org.joml.Math.min
@@ -24,6 +22,7 @@ import org.valkyrienskies.eureka.EurekaBlockEntities
2422
import org.valkyrienskies.eureka.EurekaConfig
2523
import org.valkyrienskies.eureka.EurekaProperties.HEAT
2624
import org.valkyrienskies.eureka.gui.engine.EngineScreenMenu
25+
import org.valkyrienskies.eureka.registry.FuelRegistry
2726
import org.valkyrienskies.eureka.ship.EurekaShipControl
2827
import org.valkyrienskies.eureka.util.KtContainerData
2928
import org.valkyrienskies.mod.common.getShipManagingPos
@@ -124,7 +123,8 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) :
124123
* @return scaled fuel ticks.
125124
*/
126125
private fun getScaledFuel(): Int =
127-
((FurnaceBlockEntity.getFuel()[fuel.item] ?: 0) * EurekaConfig.SERVER.engineFuelMultiplier).toInt()
126+
(FuelRegistry.INSTANCE.get(fuel) * EurekaConfig.SERVER.engineFuelMultiplier).toInt()
127+
128128

129129
/**
130130
* Absorb one fuel item into the engine.
@@ -222,10 +222,10 @@ class EngineBlockEntity(pos: BlockPos, state: BlockState) :
222222

223223
override fun canTakeItemThroughFace(index: Int, stack: ItemStack, direction: Direction): Boolean =
224224
// 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)
225+
index == 0 && direction == Direction.DOWN && !fuel.isEmpty && FuelRegistry.INSTANCE.get(fuel) <= 0
226226

227227
override fun canPlaceItem(index: Int, stack: ItemStack): Boolean =
228-
index == 0 && AbstractFurnaceBlockEntity.isFuel(stack)
228+
index == 0 && FuelRegistry.INSTANCE.get(stack) > 0
229229

230230
override fun fillStackedContents(helper: StackedContents) = helper.accountStack(fuel)
231231
// endregion Container Stuff

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ import net.minecraft.core.BlockPos
55
import net.minecraft.core.Direction.Axis
66
import net.minecraft.core.Registry
77
import net.minecraft.network.chat.Component
8+
import net.minecraft.resources.ResourceLocation
89
import net.minecraft.server.level.ServerLevel
10+
import net.minecraft.tags.TagKey
911
import net.minecraft.world.MenuProvider
1012
import net.minecraft.world.entity.player.Inventory
1113
import net.minecraft.world.entity.player.Player
1214
import net.minecraft.world.inventory.AbstractContainerMenu
15+
import net.minecraft.world.level.block.Block
1316
import net.minecraft.world.level.block.HorizontalDirectionalBlock
1417
import net.minecraft.world.level.block.StairBlock
1518
import net.minecraft.world.level.block.entity.BlockEntity
@@ -20,9 +23,9 @@ import org.joml.Vector3d
2023
import org.joml.Vector3dc
2124
import org.valkyrienskies.core.api.ships.ServerShip
2225
import org.valkyrienskies.core.api.ships.getAttachment
23-
import org.valkyrienskies.core.impl.util.logger
2426
import org.valkyrienskies.eureka.EurekaBlockEntities
2527
import org.valkyrienskies.eureka.EurekaConfig
28+
import org.valkyrienskies.eureka.EurekaMod
2629
import org.valkyrienskies.eureka.block.ShipHelmBlock
2730
import org.valkyrienskies.eureka.gui.shiphelm.ShipHelmScreenMenu
2831
import org.valkyrienskies.eureka.ship.EurekaShipControl
@@ -32,6 +35,10 @@ import org.valkyrienskies.mod.common.entity.ShipMountingEntity
3235
import org.valkyrienskies.mod.common.getShipObjectManagingPos
3336
import org.valkyrienskies.mod.common.util.toDoubles
3437
import org.valkyrienskies.mod.common.util.toJOMLD
38+
import org.valkyrienskies.mod.util.logger
39+
40+
var ASSEMBLE_BLACKLIST: TagKey<Block> =
41+
TagKey.create(Registry.BLOCK_REGISTRY, ResourceLocation(EurekaMod.MOD_ID, "assemble_blacklist"))
3542

3643
class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) :
3744
BlockEntity(EurekaBlockEntities.SHIP_HELM.get(), pos, state), MenuProvider {
@@ -119,14 +126,26 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) :
119126
val blockState = level.getBlockState(blockPos)
120127
if (blockState.block !is ShipHelmBlock) return
121128

129+
var helmCount = 0
122130
val builtShip = ShipAssembler.collectBlocks(
123131
level,
124132
blockPos
125-
) { !it.isAir && !EurekaConfig.SERVER.blockBlacklist.contains(Registry.BLOCK.getKey(it.block).toString()) }
133+
) {
134+
val allowed = !it.isAir && !it.`is`(ASSEMBLE_BLACKLIST) &&
135+
// TODO: Remove blockBlacklist
136+
!(EurekaConfig.SERVER.blockBlacklist.isNotEmpty() && EurekaConfig.SERVER.blockBlacklist.contains(Registry.BLOCK.getKey(it.block).toString()))
137+
// This isn't the best way to count helms, but it'll work I promise!
138+
if (allowed && it.block is ShipHelmBlock) {
139+
helmCount++
140+
}
141+
return@collectBlocks allowed
142+
}
126143

127144
if (builtShip == null) {
128145
player.displayClientMessage(Component.translatable("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks (changable in the config)"), true)
129146
logger.warn("Failed to assemble ship for ${player.name.string}")
147+
} else {
148+
EurekaShipControl.getOrCreate(builtShip).helms = helmCount
130149
}
131150
}
132151

common/src/main/kotlin/org/valkyrienskies/eureka/gui/engine/EngineScreenMenu.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import net.minecraft.world.entity.player.Player
77
import net.minecraft.world.inventory.AbstractContainerMenu
88
import net.minecraft.world.inventory.FurnaceFuelSlot.isBucket
99
import net.minecraft.world.item.ItemStack
10-
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity
1110
import org.valkyrienskies.eureka.EurekaScreens
1211
import org.valkyrienskies.eureka.blockentity.EngineBlockEntity
12+
import org.valkyrienskies.eureka.registry.FuelRegistry
1313
import org.valkyrienskies.eureka.util.KtContainerData
1414
import org.valkyrienskies.eureka.util.inventorySlots
1515

@@ -39,7 +39,7 @@ class EngineScreenMenu(syncId: Int, playerInv: Inventory, val blockEntity: Engin
3939

4040
override fun quickMoveStack(player: Player, index: Int): ItemStack {
4141
val slot = this.slots[index]
42-
if (slot != null && slot.hasItem() && (AbstractFurnaceBlockEntity.isFuel(slot.item) || isBucket(slot.item))) {
42+
if (slot != null && slot.hasItem() && (isBucket(slot.item) || FuelRegistry.INSTANCE.get(slot.item) > 0 )) {
4343
if (index != 0) {
4444
this.moveItemStackTo(slot.item, 0, 1, false)
4545
slot.setChanged()

common/src/main/kotlin/org/valkyrienskies/eureka/gui/engine/FuelSlot.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import net.minecraft.world.Container
44
import net.minecraft.world.inventory.Slot
55
import net.minecraft.world.item.ItemStack
66
import net.minecraft.world.item.Items
7-
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity
7+
import org.valkyrienskies.eureka.registry.FuelRegistry
88

99
class FuelSlot(container: Container, slot: Int, x: Int, y: Int) : Slot(container, slot, x, y) {
1010
override fun mayPlace(stack: ItemStack): Boolean {
11-
return AbstractFurnaceBlockEntity.isFuel(stack) || isBucket(stack)
11+
return FuelRegistry.INSTANCE.get(stack) > 0 || isBucket(stack)
1212
}
1313

1414
override fun getMaxStackSize(stack: ItemStack): Int {

0 commit comments

Comments
 (0)