fix stuff for v7

This commit is contained in:
tezlm 2022-05-08 13:18:17 -07:00
parent e455ab9649
commit f062eff892
7 changed files with 13 additions and 10 deletions

3
.gitignore vendored
View file

@ -154,3 +154,6 @@ gradle-app.setting
.DS_Store
Thumbs.db
android/libs/
## yes
justfile

View file

@ -1,4 +1,4 @@
const exit = extendContent(UnitType, "exit", { flying: true });
const exit = extend(UnitType, "exit", { flying: true });
exit.isCounted = false;
exit.constructor = () => extend(MechUnit, {});
module.exports = exit;

View file

@ -1,7 +1,7 @@
const { createDimension } = require(this.modName + "/lib/create");
const data = require(this.modName + "/lib/data");
const state = require(this.modName + "/lib/state");
const facc = extendContent(Block, "factory-building", {
const facc = extend(Block, "factory-building", {
// basic factory stuff
requirements: ItemStack.with(Items.lead, 10, Items.copper, 20),
size: 4,
@ -18,8 +18,8 @@ const facc = extendContent(Block, "factory-building", {
});
const sounds = {
open: loadSound("open"),
close: loadSound("close"),
open: Vars.tree.loadSound("open"),
close: Vars.tree.loadSound("close"),
};
facc.buildType = () =>

View file

@ -1,3 +1,3 @@
module.exports = extendContent(Floor, "factory-floor", {
module.exports = extend(Floor, "factory-floor", {
variants: 1,
});

View file

@ -1,7 +1,7 @@
const exit = require(this.modName + "/content/exit");
["factory-wall", "factory-wall-storage"].forEach((i) => {
const wall = extendContent(CoreBlock, i, {
const wall = extend(CoreBlock, i, {
unitType: exit,
size: 1,
breakable: false,
@ -15,7 +15,7 @@ const exit = require(this.modName + "/content/exit");
// wall.outputsPower = true;
// wall.unitType = exit;
wall.buildType = () =>
extendContent(CoreBlock.CoreBuild, wall, {
extend(CoreBlock.CoreBuild, wall, {
tapped() {
this.onControlSelect(Vars.player.unit())
},

View file

@ -26,11 +26,11 @@ function onExit(call) {
const unit = Vars.player.unit();
if (unit.type === null) return;
if (unit.type === exit) {
Events.remove(Trigger.update.class, listener);
Events.remove(UnitChangeEvent, listener);
call();
}
};
Events.on(Trigger.update.class, listener);
Events.on(UnitChangeEvent, listener);
}
module.exports = {

View file

@ -5,6 +5,6 @@
"author": "tezlm",
"version": "0.0.1",
"main": "factory.Buildings",
"minGameVersion": "129",
"minGameVersion": "139",
"java": "true"
}