Skip to content

Commit

Permalink
Adds an option to reset the inventory via the console.
Browse files Browse the repository at this point in the history
  • Loading branch information
begla committed Mar 13, 2012
1 parent 424d3f3 commit f7cac5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/org/terasology/logic/characters/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,4 +678,9 @@ public void setRenderPlayerModel(boolean render) {
public boolean isRenderPlayerModel() {
return _renderPlayerModel;
}

public void resetInventory() {
_inventory = new Inventory();
loadDefaultItems();
}
}
5 changes: 5 additions & 0 deletions src/org/terasology/logic/manager/GroovyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,10 @@ public void gotoWorld(String title, String seed) {
spState.initWorld(title, seed);
}
}

public void resetInventory() {
Player player = Terasology.getInstance().getActiveWorldRenderer().getPlayer();
player.resetInventory();
}
}
}

0 comments on commit f7cac5b

Please sign in to comment.