Skip to content

Commit

Permalink
Adds Trunk blocks and prefabs (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwertygiy authored and skaldarnar committed Oct 31, 2019
1 parent 218fe58 commit 497083f
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 0 deletions.
17 changes: 17 additions & 0 deletions assets/blocks/TrunkLeft.block
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* A trunk is interesting for two reasons: they are two blocks wide and are asymmetrical (front texture differs from the sides)
*/
{
"basedOn": "CoreBlocks:Chest",
"attachmentAllowed": false,
"family": "horizontal",
// Graphics
"tile":"CoreAssets:TrunkLeftFront",
"tiles": {
"front": "CoreAssets:TrunkLeftFront",
"back": "CoreAssets:TrunkLeftBack",
"top": "CoreAssets:TrunkLeftTop",
"bottom": "CoreAssets:TrunkLeftBottom",
"sides": "CoreAssets:TrunkLeftLeft"
}
}
17 changes: 17 additions & 0 deletions assets/blocks/TrunkRight.block
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* A trunk is interesting for two reasons: they are two blocks wide and are asymmetrical (front texture differs from the sides)
*/
{
"basedOn": "CoreBlocks:Chest",
"attachmentAllowed": false,
"family": "horizontal",
// Graphics
"tile":"CoreAssets:TrunkRightFront",
"tiles": {
"front": "CoreAssets:TrunkRightFront",
"back": "CoreAssets:TrunkRightBack",
"top": "CoreAssets:TrunkRightTop",
"bottom": "CoreAssets:TrunkRightBottom",
"sides": "CoreAssets:TrunkRightRight"
}
}
24 changes: 24 additions & 0 deletions assets/prefabs/trunk.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parent": "engine:iconItem",
"DisplayName": {
"name": "Trunk"
},
"Item": {
"icon": "engine:items#trunk",
"stackId": "trunk",
"consumedOnUse": true,
"usage": "ON_BLOCK"
},
"Trunk": {
"leftBlockFamily": "CoreBlocks:TrunkLeft",
"rightBlockFamily": "CoreBlocks:TrunkRight",
"openSound": "CoreAssets:DoorOpen",
"closeSound": "CoreAssets:DoorClose",
"trunkRegionPrefab": "CoreBlocks:trunkRegion"
},
"BlockDropGrammar": {
"itemDrops": ["CoreBlocks:trunk"]
},
"Network": {
}
}
112 changes: 112 additions & 0 deletions assets/prefabs/trunkRegion.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"DisplayName": {
"name": "Trunk"
},
"Health": {
"currentHealth": 5,
"maxHealth": 5,
"regenRate": 1,
"waitBeforeRegen": 2,
"destroyEntityOnNoHealth": true
},
"BlockDropGrammar": {
"itemDrops": [
"CoreBlocks:trunk"
]
},
"ActAsBlock": {
"block": "CoreBlocks:TrunkLeft"
},
"InventoryAccess": {
"input": {
"top": "0..59",
"bottom": "0..59",
"left": "0..29",
"right": "30..59",
"front": "0..59",
"back": "0..59"
},
"output": {
"top": "0..59",
"bottom": "0..59",
"left": "0..29",
"right": "30..59",
"front": "0..59",
"back": "0..59"
}
},
"Inventory": {
"privateToOwner": false,
"itemSlots": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"RetainBlockInventory": {},
"PlaySoundAction": {
"sounds": "engine:click"
},
"InteractionTarget": {},
"InteractionScreen": {
"screen": "inventory:containerScreen"
},
"Network": {}
}

0 comments on commit 497083f

Please sign in to comment.