Added config-variants example
- IsolatedWorkspace will be reused in future updates as GLOBALS.MAKE_CONFIG access strategy.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
header.js
|
||||
|
||||
# Helpful features
|
||||
feature/block.js
|
||||
|
||||
translation.js
|
||||
@@ -0,0 +1,51 @@
|
||||
const BLOCK_TYPE_RADIACTIVE_LOG = Block.createSpecialType({
|
||||
base: 1,
|
||||
solid: true,
|
||||
renderlayer: EBlockRenderLayer.BLEND,
|
||||
lightopacity: 7,
|
||||
explosionres: 4.0,
|
||||
translucency: 1.0,
|
||||
lightlevel: 15,
|
||||
sound: "wood"
|
||||
});
|
||||
|
||||
IDRegistry.genBlockID("oxidized_log");
|
||||
Block.createBlock("oxidized_log", [{
|
||||
name: "Oxidized Log",
|
||||
texture: [
|
||||
["oxidized_log_top", 0],
|
||||
["oxidized_log_top", 0],
|
||||
["oxidized_log_side", 0]
|
||||
],
|
||||
inCreative: true
|
||||
}, {
|
||||
name: "Oxidized Log",
|
||||
texture: [
|
||||
["oxidized_log_side", 1],
|
||||
["oxidized_log_side", 1],
|
||||
["oxidized_log_top", 0],
|
||||
["oxidized_log_top", 0],
|
||||
["oxidized_log_side", 1]
|
||||
],
|
||||
inCreative: true
|
||||
}, {
|
||||
name: "Oxidized Log",
|
||||
texture: [
|
||||
["oxidized_log_side", 1],
|
||||
["oxidized_log_side", 1],
|
||||
["oxidized_log_side", 1],
|
||||
["oxidized_log_side", 1],
|
||||
["oxidized_log_top", 0]
|
||||
],
|
||||
inCreative: true
|
||||
}], BLOCK_TYPE_RADIACTIVE_LOG);
|
||||
|
||||
Callback.addCallback("ItemUse", function(coords, item, block, isExternal, playerUid) {
|
||||
if (block.id == BlockID.oxidized_log) {
|
||||
let source = BlockSource.getDefaultForActor(playerUid);
|
||||
if (source != null) {
|
||||
let data = source.getBlockData(coords.x, coords.y, coords.z);
|
||||
source.setBlock(coords.x, coords.y, coords.z, BlockID.oxidized_log, data >= 2 ? 0 : ++data);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
let ticking = 0;
|
||||
|
||||
Callback.addCallback("LocalTick", function() {
|
||||
ticking++;
|
||||
if (ticking % 20 == 0) {
|
||||
if (ticking == 1200) {
|
||||
ticking = 0;
|
||||
}
|
||||
Game.tipMessage(ticking / 20);
|
||||
}
|
||||
});
|
||||
|
||||
Callback.addCallback("LocalLevelLoaded", function() {
|
||||
ticking = 0;
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
Translation.addTranslation("Oxidized Log", {
|
||||
ru: "Окислевшееся бревно"
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "..\\.toolchain.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outFile": "C:\\Users\\RislaeD\\AppData\\Local\\icmtoolchain\\Cache\\build\\build-config-871a6\\sources\\main.js"
|
||||
},
|
||||
"exclude": [],
|
||||
"include": [
|
||||
"header.js",
|
||||
"feature/block.js",
|
||||
"translation.js"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user