Skip to content

Instantly share code, notes, and snippets.

@Double0negative
Created February 16, 2013 08:10
Show Gist options
  • Save Double0negative/4966039 to your computer and use it in GitHub Desktop.
Save Double0negative/4966039 to your computer and use it in GitHub Desktop.
ResultSet result;
try{
String query = "SELECT * FROM "+SettingsManager.getSqlPrefix()+"blocks WHERE gameid="+id+" ORDER BY time DESC";
Statement s = dbman.createStatement();
result = s.executeQuery(query);
}catch(Exception e){}
while(result.next()){
Location l = new Location(p.getServer().getWorld(result.getString(2)), result.getInt(7), result.getInt(8), result.getInt(9));
Block b = l.getBlock();
b.setTypeId(result.getInt(3));
b.setData(result.getByte(4));
b.getState().update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment