1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-13 18:21:51 +00:00
tobspr_shapez.io/mod_examples/class_extensions.js

29 lines
726 B
JavaScript
Raw Normal View History

2022-01-16 19:30:51 +00:00
const METADATA = {
website: "https://tobspr.io",
author: "tobspr",
name: "Mod Example: Class Extensions",
version: "1",
id: "class-extensions",
description: "Shows how to extend builtin classes",
};
class Mod extends shapez.Mod {
init() {
this.modInterface.extendClass(shapez.MetaBeltBuilding, {
// this replaces a regular method
getShowWiresLayerPreview() {
return true;
},
// Instead of super, use this.$super()
getIsReplaceable() {
return this.$super.getIsReplaceable.call(this);
},
getIsRemoveable() {
return false;
},
});
}
}