Implement Authentic Interaction Subsystem
Implemented authentic script/interaction queues This does now mean we have a total of 3 interaction systems, but this additional system is necessary to fix certain categories of bug and implement some authentic features Converted mining to new system Converted fishing to new system Converted woodcutting to new system Provided an example of soft-queued scripts with GrandTreePodListener Implemented tick-eating (it is now possible to eat a shark, drink a potion, and eat a karambwan all on the same tick) Can now eat and drop items while stunned
This commit is contained in:
@@ -94,7 +94,7 @@ public class BunyipNPC extends Familiar {
|
||||
player.sendMessage("You can't use this special on an object like that.");
|
||||
return false;
|
||||
}
|
||||
Consumable consumable = Consumables.getConsumableById(special.getItem().getId() + 2);
|
||||
Consumable consumable = Consumables.getConsumableById(special.getItem().getId() + 2).getConsumable();
|
||||
if (consumable == null) {
|
||||
player.sendMessage("Error: Report to admin.");
|
||||
return false;
|
||||
@@ -138,7 +138,7 @@ public class BunyipNPC extends Familiar {
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Fish fish = Fish.forItem(event.getUsedItem());
|
||||
Consumable consumable = Consumables.getConsumableById(fish.getItem().getId() + 2);
|
||||
Consumable consumable = Consumables.getConsumableById(fish.getItem().getId() + 2).getConsumable();
|
||||
if (consumable == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ import core.plugin.ClassScanner;
|
||||
import core.plugin.Initializable;
|
||||
import core.tools.RandomFunction;
|
||||
|
||||
import static core.api.ContentAPIKt.stun;
|
||||
|
||||
/**
|
||||
* The plugin used to load the minotaur familiar npcs.
|
||||
* @author Vexia
|
||||
@@ -58,7 +60,7 @@ public final class MinotaurFamiliarNPC implements Plugin<Object> {
|
||||
GameWorld.getPulser().submit(new Pulse(ticks) {
|
||||
@Override
|
||||
public boolean pulse() {
|
||||
target.getStateManager().set(EntityState.STUNNED, 4);
|
||||
stun(target, 4);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -52,7 +52,7 @@ public class RavenousLocustNPC extends Familiar {
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
Consumable consumable = Consumables.getConsumableById(item.getId());
|
||||
Consumable consumable = Consumables.getConsumableById(item.getId()).getConsumable();
|
||||
if (consumable != null) {
|
||||
p.getInventory().remove(item);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user