@Override public void execute(WorldObject performer, WorldObject target, int[] args, World world) { int x = (Integer) target.getProperty(Constants.X); int y = (Integer) target.getProperty(Constants.Y); int workbenchId = BuildingGenerator.generateWorkbench(x, y, world, performer); SkillUtils.useSkill( performer, Constants.CARPENTRY_SKILL, world.getWorldStateChangedListeners()); performer.getProperty(Constants.INVENTORY).removeQuantity(Constants.STONE, REQUIRED_STONE); performer.getProperty(Constants.BUILDINGS).add(workbenchId, BuildingType.WORKBENCH); }
private WorldObject createVotingBox(World world) { int id = BuildingGenerator.generateVotingBox(0, 0, world); WorldObject target = world.findWorldObjectById(id); return target; }
private WorldObject createSmith(World world, WorldObject performer) { int smithId = BuildingGenerator.generateSmith(0, 0, world, performer); WorldObject target = world.findWorldObjectById(smithId); return target; }