📔
TerraCraft
  • TerraCraft
  • English
    • Mod Document
      • Mod Dev Official Tutorial
      • Mod API Document
        • Data Types and Enums
        • JSON
        • Entity
        • NPC
  • 简体中文(旧版教程)
    • 模组文档
      • Engine API
        • App
        • AssetBundle
        • AtlasInfo
        • AtlasTextureManager
        • Audio
        • Bytes
        • File
        • GameObject
        • GlobalHook
        • Graphics
        • Hotfix
        • Image
        • ImageInfo
        • IntegratedClient : IntegratedEnv
        • IntegratedEnv
        • JsonUtil
        • Log
        • MathHelper
        • Matrix
        • Path
        • Random
        • Rect
        • Rigidbody
        • TextureLocation
        • TextureManager
        • Transform
        • Vector2
        • Vector3
        • Vector4
      • Game API
        • Attack
        • ArrayList<T>
        • EffectUtils
        • Entity
        • LightingUtils
        • ModNpc
        • ModProjectile
        • Npc : Entity
        • NpcUtils
        • Projectile : Entity
        • ProjectileUtils
        • Reg
        • SoundUtils
        • Utils
      • 模组API文档
        • 数据类型、枚举类型
        • JSON API
        • 引用API
        • 注册信息API
        • 语言API
        • 通用API
        • 物品API
        • 实体API
        • 特效API
        • 抛射物API
        • 状态效果API
        • 附魔API
        • 玩家API
        • NPC API
        • 骨骼模型API
        • 光照API
        • 音效API
        • 方块API
        • 方块实体API
        • 地图API
        • 渲染API
        • 指令API
        • 用户图形界面UI
        • 其他API
      • 模组开发官方教程
        • ExampleMod源代码仓库
        • 1.0 教程对应游戏版本(Indev 1.1)
        • 1.1 开始
        • 1.2 安装Visual Studio Code
        • 1.3 配置模组环境
        • 1.4 认识模组路径
        • 1.5 认识JSON数据表
        • 1.6 第一个物品
        • 1.7 认识地图元素
        • 1.8 第一个图块TODO
        • 1.9 第一个家具TODO
        • 1.10 加入合成表TODO
        • 未完待续……
      • 模组数据表文档
        • 基本JSON类型
        • 模组配置表(tcmod.json)
        • 物品表(contents/items/...)
        • 物品配置表
        • 弹药表(ammos.json)
        • 状态效果表(buffs.json)
        • 音效配置表(sound_config.json)
        • 音效表(sounds.json)
        • 背景表(backgrounds.json)
        • 皮肤表(skins.json)
        • 着色器表(shaders.json)
  • 新版教程
    • 1 基础部分
      • 1.1 安装集成开发环境
      • 1.2 获取TerraCraft源码
      • 1.3 认识Lua
      • 1.4 Mod架构
      • 1.5 游戏主生命周期和主状态机
      • 1.6 Lua实战
      • 1.7 第一个物品
      • 1.8 本地化翻译
      • 1.9 配方系统初探和矿物字典
Powered by GitBook
On this page
  • 创建方块文件夹
  • 创建一个图块(Tile)

Was this helpful?

  1. 简体中文(旧版教程)
  2. 模组文档
  3. 模组开发官方教程

1.8 第一个图块TODO

Previous1.7 认识地图元素Next1.9 第一个家具TODO

Last updated 4 years ago

Was this helpful?

创建方块文件夹

在contents文件夹中创建blocks文件夹作为方块文件夹。

创建一个图块(Tile)

我们希望木板可以被染色!那么我们加入一个黄色木板作为模组的第一个图块,id命名为yellow_plank。

在方块文件夹任意路径内添加yellow_plank.png、yellow_plank_icon.png作为贴图路径,并在同级文件夹创建yellow_plank.json文件作为JSON数据表文件。JSON文件为如下内容:

{
  "block": {
    "yellow_plank": {
      "textureData": "yellow_plank.png",
      "color": [ 255, 255, 0 ],
      "renderMode": "RENDER_BORDER_CUT",
      "renderSortedInterval": 8,
      "type": "TILE",
      "group": "ARTIFICAL",
      "collision": "SOLID",
      "lightOpacity": 3,
      "toolType": "AXE",
      "mineGrade": "GRASS",
      "hardness": 100,
      "slipperiness": 1.0,
      "gravity": false,
      "allowSlope": false,
      "isWallDark": false,
      "wallCheck": "NO_GENERABLE",
      "soundGroupId": "wood",
      "stepSoundGroupId": "step_wood",
      "particleColor": [ 255, 173, 137, 80 ]
    }
  },
  "item": {
    "yellow_plank": {
      "type": "BLOCKS",
      "iconTextureData": "yellow_plank_icon.png",
      "group": "GROUP_WOODEN_PLANK",
      "oreDictionaries": [ "plank" ],
      "blockId": "yellow_plank",
      "fuelTime": 60
    }
  }
}

yellow_plank_icon.png
yellow_plank.png