forked from SteamWar/SteamWar
Merge pull request 'fix(SchematicSystem): mixup of coordinates in size check' (#426) from fix-autochecker into main
Reviewed-on: SteamWar/SteamWar#426
This commit is contained in:
@@ -37,17 +37,27 @@ public class AutoChecker {
|
|||||||
public static final AutoChecker impl = new AutoChecker();
|
public static final AutoChecker impl = new AutoChecker();
|
||||||
|
|
||||||
public AutoCheckerResult check(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
public AutoCheckerResult check(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
||||||
return AutoCheckerResult.builder().type(type).height(clipboard.getDimensions().x()).width(clipboard.getDimensions().x())
|
return AutoCheckerResult.builder()
|
||||||
.depth(clipboard.getDimensions().z()).blockScanResult(scan(clipboard, type))
|
.type(type)
|
||||||
.entities(clipboard.getEntities().stream().map(Entity::getLocation)
|
.height(clipboard.getDimensions().y())
|
||||||
.map(blockVector3 -> new BlockPos(blockVector3.getBlockX(), blockVector3.getBlockY(), blockVector3.getBlockZ()))
|
.width(clipboard.getDimensions().x())
|
||||||
.collect(Collectors.toList()))
|
.depth(clipboard.getDimensions().z())
|
||||||
|
.blockScanResult(scan(clipboard, type))
|
||||||
|
.entities(
|
||||||
|
clipboard.getEntities().stream()
|
||||||
|
.map(Entity::getLocation)
|
||||||
|
.map(blockVector3 -> new BlockPos(blockVector3.getBlockX(), blockVector3.getBlockY(), blockVector3.getBlockZ()))
|
||||||
|
.collect(Collectors.toList()))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutoCheckerResult sizeCheck(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
public AutoCheckerResult sizeCheck(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
||||||
return AutoCheckerResult.builder().type(type).height(clipboard.getDimensions().y()).width(clipboard.getDimensions().x())
|
return AutoCheckerResult.builder()
|
||||||
.depth(clipboard.getDimensions().z()).build();
|
.type(type)
|
||||||
|
.height(clipboard.getDimensions().y())
|
||||||
|
.width(clipboard.getDimensions().x())
|
||||||
|
.depth(clipboard.getDimensions().z())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutoChecker.BlockScanResult scan(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
public AutoChecker.BlockScanResult scan(Clipboard clipboard, GameModeConfig<Material, String> type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user