mirror of
https://github.com/taoneill/war.git
synced 2025-01-20 22:31:20 +01:00
Merge branch 'no-save-air' into nimitz-v2
Conflicts: war/src/main/java/com/tommytony/war/mapper/ZoneVolumeMapper.java
This commit is contained in:
commit
78ef1dd4fc
@ -55,7 +55,7 @@ public class ZoneVolumeMapper {
|
|||||||
* @param onlyLoadCorners Should only the corners be loaded
|
* @param onlyLoadCorners Should only the corners be loaded
|
||||||
* @param start Starting position to load blocks at
|
* @param start Starting position to load blocks at
|
||||||
* @param total Amount of blocks to read
|
* @param total Amount of blocks to read
|
||||||
* @return integer Changed blocks
|
* @return Changed blocks
|
||||||
* @throws SQLException Error communicating with SQLite3 database
|
* @throws SQLException Error communicating with SQLite3 database
|
||||||
*/
|
*/
|
||||||
public static int load(ZoneVolume volume, String zoneName, World world, boolean onlyLoadCorners, int start, int total) throws SQLException {
|
public static int load(ZoneVolume volume, String zoneName, World world, boolean onlyLoadCorners, int start, int total) throws SQLException {
|
||||||
@ -119,10 +119,17 @@ public class ZoneVolumeMapper {
|
|||||||
int x = query.getInt("x"), y = query.getInt("y"), z = query.getInt("z");
|
int x = query.getInt("x"), y = query.getInt("y"), z = query.getInt("z");
|
||||||
BlockState modify = corner1.getRelative(x, y, z).getState();
|
BlockState modify = corner1.getRelative(x, y, z).getState();
|
||||||
ItemStack data = new ItemStack(Material.valueOf(query.getString("type")), 0, query.getShort("data"));
|
ItemStack data = new ItemStack(Material.valueOf(query.getString("type")), 0, query.getShort("data"));
|
||||||
modify.setType(data.getType());
|
if (modify.getType() != data.getType() || !modify.getData().equals(data.getData())) {
|
||||||
modify.setData(data.getData());
|
// Update the type & data if it has changed
|
||||||
modify.update(true, false); // No-physics update, preventing the need for deferring blocks
|
modify.setType(data.getType());
|
||||||
modify = corner1.getRelative(x, y, z).getState(); // Grab a new instance
|
modify.setData(data.getData());
|
||||||
|
modify.update(true, false); // No-physics update, preventing the need for deferring blocks
|
||||||
|
modify = corner1.getRelative(x, y, z).getState(); // Grab a new instance
|
||||||
|
}
|
||||||
|
changed++;
|
||||||
|
if (query.getString("metadata") == null || query.getString("metadata").isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (modify instanceof Sign) {
|
if (modify instanceof Sign) {
|
||||||
final String[] lines = query.getString("metadata").split("\n");
|
final String[] lines = query.getString("metadata").split("\n");
|
||||||
@ -184,7 +191,6 @@ public class ZoneVolumeMapper {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
War.war.getLogger().log(Level.WARNING, "Exception loading some tile data. x:" + x + " y:" + y + " z:" + z + " type:" + modify.getType().toString() + " data:" + modify.getData().toString(), ex);
|
War.war.getLogger().log(Level.WARNING, "Exception loading some tile data. x:" + x + " y:" + y + " z:" + z + " type:" + modify.getType().toString() + " data:" + modify.getData().toString(), ex);
|
||||||
}
|
}
|
||||||
changed++;
|
|
||||||
}
|
}
|
||||||
query.close();
|
query.close();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user