Package games.stendhal.server.entity.mapstuff.chest

Examples of games.stendhal.server.entity.mapstuff.chest.Chest


  public void testOnActionIteminChest() {
    MockStendlRPWorld.get();
    ChestTestHelper.generateRPClasses();
    final UseAction ua = new UseAction();
    final Player player = PlayerTestHelper.createPlayer("bob");
    final Chest chest = new Chest();
    final Item cheese = SingletonRepository.getEntityManager().getItem("cheese");
    chest.add(cheese);
    final StendhalRPZone zone = new StendhalRPZone("zone");
    zone.collisionMap.clear();
    player.setPosition(1, 1);
    chest.setPosition(1, 2);
    zone.add(player);
    zone.add(chest);
    chest.open();
    final RPAction action = new RPAction();
    action.put(BASEITEM, cheese.getID().getObjectID());
    action.put(BASEOBJECT, chest.getID().getObjectID());
    action.put(BASESLOT, "content");
    assertFalse(player.has("eating"));
    ua.onAction(player, action);
    assertTrue(player.has("eating"));
  }
View Full Code Here


    buildKalavanHouseAreaChest(zone);
  }

  private void buildKalavanHouseAreaChest(final StendhalRPZone zone) {
      // load the stuff in the house with presents
    final Chest chest = new Chest();
    chest.setPosition(22, 2);
    chest.add(SingletonRepository.getEntityManager().getItem("wine"));
    chest.add(SingletonRepository.getEntityManager().getItem("easter egg"));
    chest.add(SingletonRepository.getEntityManager().getItem("mega potion"));
    chest.add(SingletonRepository.getEntityManager().getItem("present"));
    chest.add(SingletonRepository.getEntityManager().getItem("pie"));
    zone.add(chest);
  }
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.mapstuff.chest.Chest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.