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