fix SchematicGenerator offset

This commit is contained in:
CreepyCre 2021-02-10 16:51:03 +01:00
parent 5706cf5cd1
commit 21b860fbee
2 changed files with 5 additions and 7 deletions

View file

@ -57,16 +57,12 @@ public class PocketTemplateV2 {
}
*/
public void place(Pocket pocket, int xOffset, int yOffset, int zOffset) {
place(pocket, new Vec3i(xOffset, yOffset, zOffset));
}
public void place(Pocket pocket, Vec3i offset) {
public void place(Pocket pocket) {
pocket.setSize(schematic.getWidth(), schematic.getHeight(), schematic.getLength());
ServerWorld world = DimensionalDoorsInitializer.getWorld(pocket.world);
BlockPos origin = pocket.getOrigin();
LOGGER.info("Placing new pocket using schematic " + this.id + " at x = " + origin.getX() + ", z = " + origin.getZ());
SchematicPlacer.place(this.schematic, world, origin.add(offset));
SchematicPlacer.place(this.schematic, world, origin);
}
public static boolean isReplacingPlaceholders() {

View file

@ -102,7 +102,9 @@ public class SchematicGenerator extends PocketGenerator {
Pocket pocket = DimensionalRegistry.getPocketDirectory(world.getRegistryKey()).newPocket();
LOGGER.info("Generating pocket from template " + template.getId() + " at location " + pocket.getOrigin());
template.place(pocket, (int) offsetXEquation.apply(variableMap), (int) offsetYEquation.apply(variableMap), (int) offsetZEquation.apply(variableMap));
pocket.offsetOrigin((int) offsetXEquation.apply(variableMap), (int) offsetYEquation.apply(variableMap), (int) offsetZEquation.apply(variableMap));
template.place(pocket);
return pocket;
}