mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 14:34:04 +09:00
fixture pickup and mining works except for the dropping of a mined fixture
This commit is contained in:
@@ -12,8 +12,10 @@ import net.torvald.terrarum.gameitems.GameItem
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.CanBeAnItem
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureBase
|
||||
import net.torvald.terrarum.worlddrawer.BlocksDrawer
|
||||
import java.util.*
|
||||
import kotlin.collections.HashMap
|
||||
|
||||
/**
|
||||
* ItemCodex holds information of every item in the game, including blocks despite the 'item' naming
|
||||
@@ -34,6 +36,11 @@ class ItemCodex {
|
||||
|
||||
internal constructor()
|
||||
|
||||
/**
|
||||
* Pair of <Fully Qualified class name for the Fixture, Corresponding ItemID of the spawner Item>
|
||||
*/
|
||||
@Transient val fixtureToSpawnerItemID = HashMap<String, ItemID>()
|
||||
|
||||
fun clear() {
|
||||
itemCodex.clear()
|
||||
dynamicItemDescription.clear()
|
||||
@@ -84,6 +91,7 @@ class ItemCodex {
|
||||
}
|
||||
|
||||
fun dynamicToStaticID(dynamicID: ItemID) = dynamicToStaticTable[dynamicID]!!
|
||||
fun fixtureToItemID(fixture: FixtureBase) = fixtureToSpawnerItemID[fixture.javaClass.canonicalName]!!
|
||||
|
||||
/**
|
||||
* Mainly used by GameItemLoader
|
||||
|
||||
Reference in New Issue
Block a user