diff --git a/assets/mods/basegame/crafting/wires.json b/assets/mods/basegame/crafting/wires.json index 35db45218..1e3a7dbf6 100644 --- a/assets/mods/basegame/crafting/wires.json +++ b/assets/mods/basegame/crafting/wires.json @@ -40,5 +40,23 @@ "ingredients": [ [2, 1, "item@basegame:112", 1, "item@basegame:113"] /* 1 copper, 1 iron */ ] + }, + "item@basegame:44": { /* signal blocker */ + "workbench": "basiccrafting", + "ingredients": [ + [1, 2, "basegame:21", 1, "item@basegame:116", 1, "item@basegame:112"] /* 2 marbles, 1 tin, 1 copper */ + ] + }, + "item@basegame:45": { /* signal latch */ + "workbench": "basiccrafting", + "ingredients": [ + [1, 3, "basegame:21", 1, "item@basegame:116", 2, "item@basegame:112"] /* 3 marbles, 1 tin, 2 copper */ + ] + }, + "item@basegame:8": { /* signal emitter */ + "workbench": "basiccrafting", + "ingredients": [ + [2, 1, "basegame:21", 1, "item@basegame:116"] /* 1 marbles, 1 tin, 2 copper */ + ] } } \ No newline at end of file diff --git a/assets/mods/basegame/locales/en/itemdesc.json b/assets/mods/basegame/locales/en/itemdesc.json index efc8cac46..b3036ec29 100644 --- a/assets/mods/basegame/locales/en/itemdesc.json +++ b/assets/mods/basegame/locales/en/itemdesc.json @@ -19,7 +19,6 @@ "TOOLTIP_item@basegame:37": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */ "TOOLTIP_item@basegame:38": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */ "TOOLTIP_item@basegame:39": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */ - "TOOLTIP_item@basegame:8": "Emits a signal", "TOOLTIP_item@basegame:9": "An electricians’ best friend", "TOOLTIP_item@basegame:10": "“Who needs a Book and Quill when you’ve got this?”", /* a jab on the Minecraft item Book and Quill */ "TOOLTIP_item@basegame:11": "Tells what day it is", @@ -46,5 +45,12 @@ "TOOLTIP_item@basegame:114": "A precious fuel for the steel production", - "TOOLTIP_item@basegame:320": "Travel multiverse!\nWarning: a pair is needed for the return trip" + "TOOLTIP_item@basegame:320": "Travel multiverse!\nWarning: a pair is needed for the return trip", + + + "TOOLTIP_item@basegame:8": "Emits a signal", + "TOOLTIP_item@basegame:34": "Selectively emits a signal", + "TOOLTIP_item@basegame:35": "Shows a signal status", + "TOOLTIP_item@basegame:44": "Cuts the signal using the cutting signal", + "TOOLTIP_item@basegame:45": "Latches onto the signal on the latch signal" } \ No newline at end of file diff --git a/assets/mods/basegame/locales/en/items.json b/assets/mods/basegame/locales/en/items.json index e6591702b..bec74f6c7 100644 --- a/assets/mods/basegame/locales/en/items.json +++ b/assets/mods/basegame/locales/en/items.json @@ -39,6 +39,7 @@ "ITEM_JUKEBOX": "Jukebox", "ITEM_LOGIC_SIGNAL_BLOCKER": "Logic Signal Blocker", "ITEM_LOGIC_SIGNAL_EMITTER": "Logic Signal Emitter", + "ITEM_LOGIC_SIGNAL_LATCH": "Logic Signal Latch", "ITEM_LOGIC_SIGNAL_SWITCH": "Logic Signal Switch", "ITEM_LOGS_BIRCH": "Birch Logs", "ITEM_LOGS_EBONY": "Ebony Logs", diff --git a/assets/mods/basegame/locales/koKR/itemdesc.json b/assets/mods/basegame/locales/koKR/itemdesc.json index 8c8cfa580..87e96e6d0 100644 --- a/assets/mods/basegame/locales/koKR/itemdesc.json +++ b/assets/mods/basegame/locales/koKR/itemdesc.json @@ -19,7 +19,6 @@ "TOOLTIP_item@basegame:37": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */ "TOOLTIP_item@basegame:38": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */ "TOOLTIP_item@basegame:39": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */ - "TOOLTIP_item@basegame:8": "신호를 만들어냅니다", "TOOLTIP_item@basegame:9": "전기공의 친한 친구", "TOOLTIP_item@basegame:10": "“이게 있는데 책과 깃펜이 왜 필요하죠?”", /* a jab on the Minecraft item Book and Quill */ "TOOLTIP_item@basegame:11": "오늘이 무슨 날인지 알려줍니다", @@ -45,5 +44,11 @@ "TOOLTIP_item@basegame:114": "강철 생산의 소중한 연료입니다", - "TOOLTIP_item@basegame:320": "멀티버스를 여행하세요!\n경고: 2개를 만들어야 왕복이 가능합니다" + "TOOLTIP_item@basegame:320": "멀티버스를 여행하세요!\n경고: 2개를 만들어야 왕복이 가능합니다", + + "TOOLTIP_item@basegame:8": "신호를 만들어냅니다", + "TOOLTIP_item@basegame:34": "선택적으로 신호를 만들어냅니다", + "TOOLTIP_item@basegame:35": "신호의 상태를 보여줍니다", + "TOOLTIP_item@basegame:44": "지나가는 신호를 자르기 신호에 따라 자릅니다", + "TOOLTIP_item@basegame:45": "들어오는 신호를 걸쇠 신호에 따라 잠시 저장합니다" } \ No newline at end of file diff --git a/assets/mods/basegame/locales/koKR/items.json b/assets/mods/basegame/locales/koKR/items.json index 55e808463..5fd64500f 100644 --- a/assets/mods/basegame/locales/koKR/items.json +++ b/assets/mods/basegame/locales/koKR/items.json @@ -39,6 +39,7 @@ "ITEM_JUKEBOX": "주크박스", "ITEM_LOGIC_SIGNAL_BLOCKER": "신호 차단기", "ITEM_LOGIC_SIGNAL_EMITTER": "신호발생기", + "ITEM_LOGIC_SIGNAL_LATCH": "신호 걸쇠", "ITEM_LOGIC_SIGNAL_SWITCH": "신호 스위치", "ITEM_LOGS_BIRCH": "백단 통나무", "ITEM_LOGS_EBONY": "흑단 통나무", diff --git a/src/net/torvald/terrarum/gameworld/BlockLayerI16F16.kt b/src/net/torvald/terrarum/gameworld/BlockLayerI16F16.kt index 37bc2e036..b6ea9808c 100644 --- a/src/net/torvald/terrarum/gameworld/BlockLayerI16F16.kt +++ b/src/net/torvald/terrarum/gameworld/BlockLayerI16F16.kt @@ -1,12 +1,13 @@ package net.torvald.terrarum.gameworld import net.torvald.terrarum.App -import net.torvald.terrarum.gameworld.WorldSimulator.FLUID_MIN_MASS import net.torvald.terrarum.serialise.toUint import net.torvald.unsafe.UnsafeHelper import net.torvald.unsafe.UnsafePtr import net.torvald.util.Float16 +const val FLUID_MIN_MASS = 1f / 1024f //Ignore cells that are almost dry (smaller than epsilon of float16) + /** * * Memory layout: * * ``` diff --git a/src/net/torvald/terrarum/gameworld/GameWorld.kt b/src/net/torvald/terrarum/gameworld/GameWorld.kt index 4692fd268..7e355172c 100644 --- a/src/net/torvald/terrarum/gameworld/GameWorld.kt +++ b/src/net/torvald/terrarum/gameworld/GameWorld.kt @@ -12,6 +12,7 @@ import net.torvald.terrarum.gameitems.ItemID import net.torvald.terrarum.gameitems.isFluid import net.torvald.terrarum.itemproperties.ItemRemapTable import net.torvald.terrarum.itemproperties.ItemTable +import net.torvald.terrarum.modulebasegame.WorldSimulator import net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer import net.torvald.terrarum.realestate.LandUtil import net.torvald.terrarum.realestate.LandUtil.CHUNK_H diff --git a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt index eb3072da0..0c79f148c 100644 --- a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt +++ b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt @@ -28,7 +28,6 @@ import net.torvald.terrarum.gameitems.GameItem import net.torvald.terrarum.gameitems.mouseInInteractableRange import net.torvald.terrarum.gameparticles.ParticleBase import net.torvald.terrarum.gameworld.GameWorld -import net.torvald.terrarum.gameworld.WorldSimulator import net.torvald.terrarum.gameworld.fmod import net.torvald.terrarum.langpack.Lang import net.torvald.terrarum.modulebasegame.gameactors.* diff --git a/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt b/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt index c1b7fcb98..b853d18f3 100644 --- a/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt +++ b/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt @@ -45,7 +45,7 @@ object WorldSimulator { const val FLUID_MAX_MASS = 1f // The normal, un-pressurized mass of a full water cell const val FLUID_MAX_COMP = 0.02f // How much excess water a cell can store, compared to the cell above it. A tile of fluid can contain more than MaxMass water. - const val FLUID_MIN_MASS = 1f / 1024f //Ignore cells that are almost dry (smaller than epsilon of float16) + const val FLUID_MIN_MASS = net.torvald.terrarum.gameworld.FLUID_MIN_MASS //Ignore cells that are almost dry (smaller than epsilon of float16) const val WIRE_MIN_FLOW = 0.0001f const val minFlow = 0.01f const val maxSpeed = 1f // max units of water moved out of one block to another, per timestamp