Start adding drawer trim class

This commit is contained in:
zontreck 2024-12-23 19:16:29 -07:00
parent ead7564222
commit 55657e8f0d
5 changed files with 67 additions and 9 deletions

View file

@ -0,0 +1,10 @@
using System;
using Vintagestory.API.Common;
public class BlockDrawerTrim : Block
{
public BlockDrawerTrim()
{
api.Logger.Notification("\n\n/!\\New Block Drawer Trim instance/!\\\n\n");
}
}

View file

@ -0,0 +1,9 @@
using Vintagestory.API.Common;
public class DrawerTrim : BlockEntity
{
public DrawerTrim()
{
Api.Logger.Notification("\n\n/!\\ New DrawerTrim block entity created /!\\\n\n");
}
}

View file

@ -9,20 +9,52 @@ namespace VintageStorage
public class VintageStorage : ModSystem
{
public static String MOD_ID = "vintagestorage";
/// <summary>
/// Method to register all mod blocks
/// </summary>
/// <param name="api"></param>
private void RegisterBlocks(ICoreAPI api)
{
api.Logger.Notification("Begin registering block classes for Vintage Storage...");
/**/// REGISTER STORAGE TYPE : DRAWERS
// TRIM: This is a decorative block that maintains network connection.
// Trim cannot contain items, but items can pass through it to get to a destination.
api.RegisterBlockClass("BlockDrawerTrim", typeof(BlockDrawerTrim));
api.Logger.Notification("Block Classes have been registered for Vintage Storage!");
}
private void RegisterBlockEntities(ICoreAPI api)
{
// Trim
//api.RegisterBlockEntityClass("DrawerTrim", typeof(DrawerTrim));
}
// Called on server and client
public override void Start(ICoreAPI api)
{
api.Logger.Notification(Lang.Get($"{MOD_ID}:start"));
RegisterBlocks(api);
RegisterBlockEntities(api);
}
public override void StartServerSide(ICoreServerAPI api)
{
api.Logger.Notification("Hello from template mod server side");
api.Logger.Notification(Lang.Get($"{MOD_ID}:start"));
}
public override void StartClientSide(ICoreClientAPI api)
{
api.Logger.Notification("Hello from template mod client side");
api.Logger.Notification(Lang.Get($"{MOD_ID}:start"));
}
}
}

View file

@ -1,9 +1,15 @@
{
"code": "drawertrim",
"class": "BlockDrawerTrim",
"creativeinventory": {
"general": ["*"],
"construction": ["*"]
},
"behaviors": [
{
"name": "Ignitable"
}
],
"shape": {
"base": "block/drawertrim"
},
@ -20,14 +26,14 @@
"replaceable": 400,
"resistance": 2.2,
"sounds": {
"place": "block/planks",
"break": "block/planks",
"hit": "block/wood",
"walk": "block/planks",
"place": "game:block/planks",
"break": "game:block/planks",
"hit": "game:block/wood",
"walk": "game:block/planks",
"byTool": {
"Axe": {
"hit": "block/chop",
"break": "block/planks"
"hit": "game:block/chop",
"break": "game:block/planks"
}
}
},

View file

@ -4,4 +4,5 @@ rm -rf Releases
./build.sh
vsleep 2
rm -rf Releases/vintagestorage
.game/Vintagestory --tracelog --addModPath "$(pwd)/Releases" -o modtest
#.game/Vintagestory --tracelog --addModPath "$(pwd)/Releases" -o modtest
.game/Vintagestory --tracelog --addModPath "$(pwd)/Releases"