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>
<groupId>steamwar</groupId>
<artifactId>FAWE</artifactId>
<version>1.14</version>
<artifactId>WorldEdit</artifactId>
<version>1.15</version>
<scope>provided</scope>
</dependency>
</dependencies>

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -99,6 +99,10 @@ class CheckSchemType_15 {
for(int z = min.getBlockZ(); z <= max.getBlockZ(); z++){
final BaseBlock block = clipboard.getFullBlock(BlockVector3.at(x, y, z));
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)
tnt++;
@ -109,12 +113,8 @@ class CheckSchemType_15 {
if(blockMaterial == Material.DISPENSER)
dispenser++;
if(INVENTORY.contains(blockMaterial)){
checkInventory(result, block, blockMaterial, type);
}
assert blockMaterial != null;
result.checkMaterial(blockMaterial.name());
if(INVENTORY.contains(blockMaterial))
checkInventory(result, block, blockMaterial);
}
}
}
@ -126,7 +126,7 @@ class CheckSchemType_15 {
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();
if(nbt == null){
result.defunctNbt(blockMaterial.name());