mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-10 14:26:45 +00:00
Cubot drill module now functional
This commit is contained in:
parent
4be1bf2e8a
commit
6a9cfb3acb
@ -1,8 +1,10 @@
|
||||
package net.simon987.cubotplugin;
|
||||
|
||||
import net.simon987.server.assembly.Status;
|
||||
import net.simon987.server.game.item.Item;
|
||||
import net.simon987.server.game.objects.Action;
|
||||
import net.simon987.server.game.objects.ControllableUnit;
|
||||
import net.simon987.server.game.world.Tile;
|
||||
import org.bson.Document;
|
||||
|
||||
public class CubotDrill extends CubotHardwareModule {
|
||||
@ -43,9 +45,13 @@ public class CubotDrill extends CubotHardwareModule {
|
||||
if (cubot.spendEnergy(1400)) {
|
||||
if (cubot.getCurrentAction() == Action.IDLE) {
|
||||
|
||||
//TODO: Get Tile instance and call onDig()
|
||||
//int tile = cubot.getWorld().getTileMap().getTileIdAt(cubot.getX(), cubot.getY());
|
||||
//cubot.setCurrentAction(Action.DIGGING);
|
||||
Tile tile = cubot.getWorld().getTileMap().getTileAt(cubot.getX(), cubot.getY());
|
||||
|
||||
Item newItem = tile.drill();
|
||||
if (newItem != null) {
|
||||
cubot.setCurrentAction(Action.DIGGING);
|
||||
cubot.giveItem(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import org.bson.Document;
|
||||
|
||||
public class ItemCopper extends Item {
|
||||
|
||||
public static final int ID = 0x0003;
|
||||
public static final int ID = 0x0004;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
|
@ -4,7 +4,7 @@ import org.bson.Document;
|
||||
|
||||
public class ItemIron extends Item {
|
||||
|
||||
public static final int ID = 0x0004;
|
||||
public static final int ID = 0x0003;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
|
13
Server/src/main/resources/static/js/mar.js
vendored
13
Server/src/main/resources/static/js/mar.js
vendored
@ -1,7 +1,14 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({__proto__: []} instanceof Array && function (d, b) {
|
||||
d.__proto__ = b;
|
||||
}) ||
|
||||
function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
};
|
||||
return extendStatics(d, b);
|
||||
}
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user