mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 05:24:06 +09:00
blocks now have properly formatted ids
This commit is contained in:
@@ -7,6 +7,7 @@ import net.torvald.terrarum.gamecontroller.Key
|
||||
import net.torvald.terrarum.itemproperties.InventoryItem
|
||||
import net.torvald.terrarum.itemproperties.Material
|
||||
import net.torvald.terrarum.realestate.LandUtil
|
||||
import net.torvald.terrarum.ui.UIInventory
|
||||
import org.newdawn.slick.GameContainer
|
||||
import org.newdawn.slick.Input
|
||||
import java.util.*
|
||||
@@ -479,12 +480,15 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
// ONLY FOR HAND_GRIPs!!
|
||||
val quickBarItem = inventory.getQuickBar(actorValue.getAsInt(key)!!)?.item
|
||||
|
||||
if (quickBarItem == null) {
|
||||
unequipSlot(InventoryItem.EquipPosition.HAND_GRIP)
|
||||
}
|
||||
else if (quickBarItem.equipPosition == InventoryItem.EquipPosition.HAND_GRIP) {
|
||||
if (quickBarItem != null && quickBarItem.equipPosition == InventoryItem.EquipPosition.HAND_GRIP) {
|
||||
equipItem(quickBarItem)
|
||||
}
|
||||
|
||||
// force update inventory UI
|
||||
try {
|
||||
(Terrarum.ingame!!.uiInventoryPlayer.UI as UIInventory).shutUpAndRebuild()
|
||||
}
|
||||
catch (LateInitMyArse: kotlin.UninitializedPropertyAccessException) { }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@ import org.newdawn.slick.Graphics
|
||||
*
|
||||
* Created by minjaesong on 2017-01-21.
|
||||
*/
|
||||
abstract class ActorVisible(renderOrder: RenderOrder) : Actor(renderOrder) {
|
||||
abstract class ActorWithBody(renderOrder: RenderOrder) : Actor(renderOrder) {
|
||||
open val hitbox = Hitbox(0.0, 0.0, 0.0, 0.0)
|
||||
override abstract fun update(gc: GameContainer, delta: Int)
|
||||
abstract fun drawBody(g: Graphics)
|
||||
abstract fun drawGlow(g: Graphics)
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import java.util.*
|
||||
*
|
||||
* Created by minjaesong on 16-01-13.
|
||||
*/
|
||||
open class ActorWithPhysics(renderOrder: RenderOrder, val immobileBody: Boolean = false, physics: Boolean = true) : ActorVisible(renderOrder) {
|
||||
open class ActorWithPhysics(renderOrder: RenderOrder, val immobileBody: Boolean = false, physics: Boolean = true) : ActorWithBody(renderOrder) {
|
||||
|
||||
/** !! ActorValue macros are on the very bottom of the source !! **/
|
||||
|
||||
|
||||
@@ -13,7 +13,11 @@ typealias AnyPlayer = HistoricalFigure
|
||||
*
|
||||
* Created by minjaesong on 16-10-10.
|
||||
*/
|
||||
open class HistoricalFigure(val born: GameDate, val dead: GameDate? = null, realAirFriction: Boolean = false) : ActorWithPhysics(Actor.RenderOrder.MIDDLE, realAirFriction) {
|
||||
open class HistoricalFigure(
|
||||
val born: GameDate,
|
||||
val dead: GameDate? = null,
|
||||
realAirFriction: Boolean = false
|
||||
) : ActorWithPhysics(Actor.RenderOrder.MIDDLE, realAirFriction) {
|
||||
|
||||
init {
|
||||
this.actorValue["_bornyear"] = born.year
|
||||
|
||||
Reference in New Issue
Block a user