forked from 2009Scape/Server
Players can now correctly burn meat
This commit is contained in:
parent
6f541049ae
commit
c4d742a3a4
1 changed files with 7 additions and 1 deletions
|
|
@ -5,8 +5,12 @@ import org.crandor.game.content.global.consumable.Food;
|
|||
import org.crandor.game.interaction.NodeUsageEvent;
|
||||
import org.crandor.game.interaction.UseWithHandler;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.node.item.Item;
|
||||
import org.crandor.game.node.object.GameObject;
|
||||
import org.crandor.game.world.update.flag.context.Animation;
|
||||
import org.crandor.net.packet.PacketRepository;
|
||||
import org.crandor.net.packet.context.GameMessageContext;
|
||||
import org.crandor.net.packet.out.GameMessage;
|
||||
import org.crandor.plugin.InitializablePlugin;
|
||||
import org.crandor.plugin.Plugin;
|
||||
|
||||
|
|
@ -53,11 +57,13 @@ public final class BurnMeatPlugin extends UseWithHandler {
|
|||
final Player player = event.getPlayer();
|
||||
final Food food = Consumables.forFood(event.getUsedItem());
|
||||
final GameObject object = (GameObject) event.getUsedWith();
|
||||
final Item usedItem = event.getUsedItem();
|
||||
if (food.getBurnt() == null) {
|
||||
player.getPacketDispatch().sendMessage("You can't burn this piece of food.");
|
||||
return true;
|
||||
}
|
||||
if (player.getInventory().remove(event.getUsedItem())) {
|
||||
if (player.getInventory().containsItem(usedItem)) {
|
||||
player.getInventory().remove(usedItem);
|
||||
player.lock(3);
|
||||
player.animate(!object.getName().toLowerCase().equals("fire") ? RANGE_ANIMATION : FIRE_ANIMATION);
|
||||
player.getInventory().add(food.getBurnt());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue