From: Astrid S. <ast...@us...> - 2007-08-16 12:53:53
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv7265/src/games/stendhal/server/entity/item Modified Files: ConsumableItem.java Log Message: redid consumption to fix wasting food on being full Index: ConsumableItem.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/item/ConsumableItem.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ConsumableItem.java 15 Aug 2007 22:41:05 -0000 1.26 --- ConsumableItem.java 16 Aug 2007 12:53:53 -0000 1.27 *************** *** 15,18 **** --- 15,20 ---- import games.stendhal.server.entity.Entity; import games.stendhal.server.entity.RPEntity; + import games.stendhal.server.entity.item.consumption.Feeder; + import games.stendhal.server.entity.item.consumption.FeederFactory; import games.stendhal.server.entity.player.Player; import games.stendhal.server.events.UseListener; *************** *** 34,42 **** /** How much of this item has not yet been consumed. */ private int left; ! public ConsumableItem(String name, String clazz, String subclass, Map<String, String> attributes) { super(name, clazz, subclass, attributes); left = getAmount(); } --- 36,45 ---- /** How much of this item has not yet been consumed. */ private int left; ! Feeder feeder; public ConsumableItem(String name, String clazz, String subclass, Map<String, String> attributes) { super(name, clazz, subclass, attributes); left = getAmount(); + feeder = FeederFactory.get(this); } *************** *** 50,53 **** --- 53,57 ---- super(item); this.left = item.left; + this.feeder = item.feeder; } *************** *** 116,120 **** } } ! player.consumeItem((ConsumableItem) splitOff(1)); player.notifyWorldAboutChanges(); return true; --- 120,124 ---- } } ! feeder.feed(this, player); player.notifyWorldAboutChanges(); return true; |