2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.messages.outgoing.crafting;
|
|
|
|
|
|
|
|
import com.eu.habbo.habbohotel.crafting.CraftingRecipe;
|
|
|
|
import com.eu.habbo.messages.ServerMessage;
|
|
|
|
import com.eu.habbo.messages.outgoing.MessageComposer;
|
|
|
|
import com.eu.habbo.messages.outgoing.Outgoing;
|
|
|
|
|
|
|
|
public class CraftingResultComposer extends MessageComposer
|
|
|
|
{
|
|
|
|
private final CraftingRecipe recipe;
|
2018-12-22 11:39:00 +01:00
|
|
|
private final boolean succes;
|
2018-07-06 15:30:00 +02:00
|
|
|
|
|
|
|
public CraftingResultComposer(CraftingRecipe recipe)
|
|
|
|
{
|
|
|
|
this.recipe = recipe;
|
2018-12-22 11:39:00 +01:00
|
|
|
this.succes = this.recipe != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CraftingResultComposer(CraftingRecipe recipe, boolean success)
|
|
|
|
{
|
|
|
|
this.recipe = recipe;
|
|
|
|
this.succes = success;
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ServerMessage compose()
|
|
|
|
{
|
|
|
|
this.response.init(Outgoing.CraftingResultComposer);
|
|
|
|
|
2018-12-22 11:39:00 +01:00
|
|
|
this.response.appendBoolean(this.succes); //succes
|
2018-07-06 15:30:00 +02:00
|
|
|
|
|
|
|
if(this.recipe != null)
|
|
|
|
{
|
|
|
|
this.response.appendString(this.recipe.getName());
|
|
|
|
this.response.appendString(this.recipe.getReward().getName());
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.response;
|
|
|
|
}
|
|
|
|
}
|