com.yungnickyoung.minecraft.yungsapi.world.structure.context.StructureContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of YungsApi-1.21-Fabric Show documentation
Show all versions of YungsApi-1.21-Fabric Show documentation
A common API for YUNG's Minecraft mods
The newest version!
package com.yungnickyoung.minecraft.yungsapi.world.structure.context;
import com.yungnickyoung.minecraft.yungsapi.world.structure.jigsaw.PieceEntry;
import java.util.List;
import net.minecraft.class_2338;
import net.minecraft.class_2470;
import net.minecraft.class_3485;
import net.minecraft.class_5819;
/**
* Context class capable of holding various arguments used for jigsaw structure generation and modification.
* A Builder class is provided for instantiation since various arguments will likely not be needed
* when using this class.
*/
public class StructureContext {
private final int pieceMinY;
private final int pieceMaxY;
private final int depth;
private final class_2338 pos;
private final class_2470 rotation;
private final class_3485 structureTemplateManager;
private final List pieces;
private final PieceEntry pieceEntry;
private final class_5819 random;
private StructureContext(StructureContext.Builder builder) {
this.pieceMinY = builder.pieceMinY;
this.pieceMaxY = builder.pieceMaxY;
this.depth = builder.depth;
this.pos = builder.pos;
this.structureTemplateManager = builder.structureTemplateManager;
this.pieces = builder.pieces;
this.pieceEntry = builder.pieceEntry;
this.rotation = builder.rotation;
this.random = builder.random;
}
public int pieceMinY() {
return pieceMinY;
}
public int pieceMaxY() {
return pieceMaxY;
}
public int depth() {
return depth;
}
public class_2338 pos() {
return pos;
}
public class_2470 rotation() {
return rotation;
}
public class_3485 structureTemplateManager() {
return structureTemplateManager;
}
public List pieces() {
return pieces;
}
public PieceEntry pieceEntry() {
return this.pieceEntry;
}
public class_5819 random() {
return this.random;
}
public static class Builder {
private int pieceMinY = 0;
private int pieceMaxY = 0;
private int depth = 0;
private class_2338 pos = null;
private class_2470 rotation = null;
private class_3485 structureTemplateManager = null;
private List pieces = null;
private PieceEntry pieceEntry = null;
private class_5819 random = null;
public Builder() {
}
public Builder pieceMinY(int pieceMinY) {
this.pieceMinY = pieceMinY;
return this;
}
public Builder pieceMaxY(int pieceMaxY) {
this.pieceMaxY = pieceMaxY;
return this;
}
public Builder depth(int depth) {
this.depth = depth;
return this;
}
public Builder pos(class_2338 pos) {
this.pos = pos;
return this;
}
public Builder rotation(class_2470 rotation) {
this.rotation = rotation;
return this;
}
public Builder structureTemplateManager(class_3485 structureTemplateManager) {
this.structureTemplateManager = structureTemplateManager;
return this;
}
public Builder pieces(List pieces) {
this.pieces = pieces;
return this;
}
public Builder pieceEntry(PieceEntry pieceEntry) {
this.pieceEntry = pieceEntry;
return this;
}
public Builder random(class_5819 random) {
this.random = random;
return this;
}
public StructureContext build() {
return new StructureContext(this);
}
}
}