mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
Add hatchet functionality
This commit is contained in:
parent
5928ec5c98
commit
e7c48133cc
2 changed files with 18 additions and 0 deletions
|
@ -28,6 +28,7 @@ public enum Action {
|
|||
REFILL(new RefillConsumable()),
|
||||
SKILL(new SkillConsumable()),
|
||||
SKILL_RESET(new SkillResetConsumable()),
|
||||
SMASH,
|
||||
STEALTH(new StealthConsumable()),
|
||||
TELEPORT(new TeleportConsumable()),
|
||||
|
||||
|
|
|
@ -95,6 +95,23 @@ public class BlockMineRequest extends PlayerRequest {
|
|||
return;
|
||||
}
|
||||
|
||||
// Apply decay if block is being mined with a hatchet
|
||||
if(item.getMod() == ModType.DECAY && player.getHeldItem().getAction() == Action.SMASH) {
|
||||
int nextMod = Math.min(4, block.getMod(layer) + 1);
|
||||
zone.updateBlock(x, y, layer, item, nextMod);
|
||||
|
||||
// Send inventory message for v3 players
|
||||
if(player.isV3()) {
|
||||
Item decayItem = item.getDecayInventoryItem();
|
||||
|
||||
if(!decayItem.isAir()) {
|
||||
player.sendDelayedMessage(new InventoryMessage(player.getInventory().getClientConfig(decayItem)));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(metaBlock != null) {
|
||||
Map<String, Object> metadata = metaBlock.getMetadata();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue