13
0

Adding debug output for failing materials, changing to vanilla WE support

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-02-21 16:05:44 +01:00
Ursprung c90f82701e
Commit 99669d4d7c
4 geänderte Dateien mit 13 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -40,8 +40,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>FAWE</artifactId> <artifactId>WorldEdit</artifactId>
<version>1.14</version> <version>1.15</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

Datei anzeigen

@ -1,7 +1,6 @@
package de.steamwar.schematicsystem; package de.steamwar.schematicsystem;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
@ -28,12 +27,8 @@ class WorldEdit_14 {
BlockVector3 dimensions = clipboard.getDimensions(); BlockVector3 dimensions = clipboard.getDimensions();
BlockVector3 v = vector.subtract(dimensions.getX()/2 - dimensions.getX()%2, 0, dimensions.getZ()).subtract(offset); BlockVector3 v = vector.subtract(dimensions.getX()/2 - dimensions.getX()%2, 0, dimensions.getZ()).subtract(offset);
EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(weWorld, -1); EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(weWorld, -1);
try {
Operations.completeBlindly(new ClipboardHolder(clipboard).createPaste(e).to(v).build()); Operations.completeBlindly(new ClipboardHolder(clipboard).createPaste(e).to(v).build());
} catch (MaxChangedBlocksException ex) { e.flushSession();
throw new IOException(ex);
}
e.flushQueue();
return e; return e;
} }
} }

Datei anzeigen

@ -45,8 +45,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>FAWE</artifactId> <artifactId>WorldEdit</artifactId>
<version>1.14</version> <version>1.15</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

Datei anzeigen

@ -99,6 +99,10 @@ class CheckSchemType_15 {
for(int z = min.getBlockZ(); z <= max.getBlockZ(); z++){ for(int z = min.getBlockZ(); z <= max.getBlockZ(); z++){
final BaseBlock block = clipboard.getFullBlock(BlockVector3.at(x, y, z)); final BaseBlock block = clipboard.getFullBlock(BlockVector3.at(x, y, z));
final Material blockMaterial = Material.matchMaterial(block.getBlockType().getId()); final Material blockMaterial = Material.matchMaterial(block.getBlockType().getId());
if(blockMaterial == null)
throw new SecurityException("Unknown material, please resolve " + block.getBlockType().getName() + " " + block.getBlockType().getId());
result.checkMaterial(blockMaterial.name());
if(blockMaterial == Material.TNT || blockMaterial == Material.OBSIDIAN) if(blockMaterial == Material.TNT || blockMaterial == Material.OBSIDIAN)
tnt++; tnt++;
@ -109,12 +113,8 @@ class CheckSchemType_15 {
if(blockMaterial == Material.DISPENSER) if(blockMaterial == Material.DISPENSER)
dispenser++; dispenser++;
if(INVENTORY.contains(blockMaterial)){ if(INVENTORY.contains(blockMaterial))
checkInventory(result, block, blockMaterial, type); checkInventory(result, block, blockMaterial);
}
assert blockMaterial != null;
result.checkMaterial(blockMaterial.name());
} }
} }
} }
@ -126,7 +126,7 @@ class CheckSchemType_15 {
return result; return result;
} }
private static void checkInventory(AutoCheckResult result, BaseBlock block, Material blockMaterial, ICheckSchemType type){ private static void checkInventory(AutoCheckResult result, BaseBlock block, Material blockMaterial){
CompoundTag nbt = block.getNbtData(); CompoundTag nbt = block.getNbtData();
if(nbt == null){ if(nbt == null){
result.defunctNbt(blockMaterial.name()); result.defunctNbt(blockMaterial.name());