net.minecraft.world.gen.structure.template.TemplateManager Java Examples

The following examples show how to use net.minecraft.world.gen.structure.template.TemplateManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound compound, TemplateManager manager) {
    super.readStructureFromNBT(compound, manager);
    this.isAleadyBossRoomGen = compound.getBoolean("BossRoom");
    this.templateName = compound.getString("Template");
    this.rotation = Rotation.valueOf(compound.getString("Rot"));
    this.mirror = Mirror.valueOf(compound.getString("Mi"));
    this.loadTemplate(manager);
}
 
Example #2
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 5 votes vote down vote up
private TofuCastleTemplate(TemplateManager manager, BlockPos pos, Rotation rotation, Mirror mirror, String templateName) {
    super(0);
    this.templatePosition = pos;
    this.rotation = rotation;
    this.mirror = mirror;
    this.templateName = templateName;
    this.loadTemplate(manager);
}
 
Example #3
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 5 votes vote down vote up
private static void generatesub(TemplateManager templateManager, BlockPos pos, Rotation rotation, List<TofuCastleTemplate> list, Random random) {
    //generate entrance
    BlockPos pos1 = new BlockPos(pos.south(23).east(4));
    BlockPos pos2 = new BlockPos(pos.south(-15).east(4));
    list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos1, rotation, "tofucastle_entrance"));
    list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos2, rotation, "tofucastle_entrance"));
}
 
Example #4
Source File: StructureTofuMineshaftPieces.java    From TofuCraftReload with MIT License 5 votes vote down vote up
/**
 * (abstract) Helper method to read subclass data from NBT
 */
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound, p_143011_2_);
    this.hasRails = tagCompound.getBoolean("hr");
    this.hasSpiders = tagCompound.getBoolean("sc");
    this.spawnerPlaced = tagCompound.getBoolean("hps");
    this.sectionCount = tagCompound.getInteger("Num");
}
 
Example #5
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 5 votes vote down vote up
private static void generateUnderSub(TemplateManager templateManager, BlockPos pos, Rotation rotation, List<TofuCastleTemplate> list, Random random) {
    //east
    BlockPos pos1 = new BlockPos(pos.south(4).east(15));
    //west
    BlockPos pos2 = new BlockPos(pos.south(4).east(-7));

    list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos, rotation, "tofucastle_normalroom"));

    //east
    if (random.nextInt(1) == 0) {
        if (random.nextInt(1) == 0) {
            list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos1, rotation, "tofucastle_foodcontainer"));
        } else {
            list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos1, rotation, "tofucastle_foodcontainer2"));
        }
    } else {
        list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos1, rotation, "tofucastle_eastroom"));
    }


    //west
    if (random.nextInt(2) == 0) {
        list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos2, rotation, "tofucastle_westroom"));
    } else {
        list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos2, rotation, "tofucastle_westbedroom"));
    }
}
 
Example #6
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 5 votes vote down vote up
private static void generateUnderGround(TemplateManager templateManager, BlockPos pos, Rotation rotation, List<TofuCastleTemplate> list, Random random) {
    BlockPos pos1 = new BlockPos(pos.down(19));

    BlockPos pos2 = new BlockPos(pos1.south(23).east(4));
    BlockPos pos3 = new BlockPos(pos1.south(-15).east(4));

    BlockPos pos4 = new BlockPos(pos1.south(23 + 15).down(11));

    generateUnderSub(templateManager, pos2, rotation, list, random);
    generateUnderSub(templateManager, pos3, rotation, list, random);

    list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos1, rotation, "tofucastle_undermain"));
    list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos4, rotation, "tofucastle_bossroom"));
}
 
Example #7
Source File: StructureTofuMineshaftPieces.java    From TofuCraftReload with MIT License 5 votes vote down vote up
/**
 * (abstract) Helper method to read subclass data from NBT
 */
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound, p_143011_2_);
    NBTTagList nbttaglist = tagCompound.getTagList("Entrances", 11);

    for (int i = 0; i < nbttaglist.tagCount(); ++i) {
        this.connectedRooms.add(new StructureBoundingBox(nbttaglist.getIntArrayAt(i)));
    }
}
 
Example #8
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #9
Source File: DummySaveHandler.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
@Override
public TemplateManager getStructureTemplateManager() {
	return null;
}
 
Example #10
Source File: DummySaveHandler.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public TemplateManager getStructureTemplateManager() {
    return new TemplateManager("", new DataFixer(0));
}
 
Example #11
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 4 votes vote down vote up
private void loadTemplate(TemplateManager manager) {
    Template template = manager.getTemplate(null, new ResourceLocation(TofuMain.MODID, "tofucastle/" + this.templateName));
    PlacementSettings placementsettings = (new PlacementSettings()).setIgnoreEntities(true).setRotation(this.rotation).setMirror(this.mirror);
    this.setup(template, this.templatePosition, placementsettings);
}
 
Example #12
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public TofuCastleTemplate(TemplateManager manager, BlockPos pos, Rotation rotation, String templateName) {
    this(manager, pos, rotation, Mirror.NONE, templateName);
}
 
Example #13
Source File: TofuCastlePiece.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static void generateCore(TemplateManager templateManager, BlockPos pos, Rotation rotation, List<TofuCastleTemplate> list, Random random) {
    list.add(new TofuCastlePiece.TofuCastleTemplate(templateManager, pos, rotation, "tofucastle_main"));
    generatesub(templateManager, pos, rotation, list, random);
    generateUnderGround(templateManager, pos, rotation, list, random);
}
 
Example #14
Source File: StructureTofuMineshaftPieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
/**
 * (abstract) Helper method to read subclass data from NBT
 */
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    this.mineShaftType = MapGenTofuMineshaft.Type.byId(tagCompound.getInteger("MST"));
}
 
Example #15
Source File: StructureTofuMineshaftPieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
/**
 * (abstract) Helper method to read subclass data from NBT
 */
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound, p_143011_2_);
    this.isMultipleFloors = tagCompound.getBoolean("tf");
    this.corridorDirection = EnumFacing.getHorizontal(tagCompound.getInteger("D"));
}
 
Example #16
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #17
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #18
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #19
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #20
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #21
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    super.readStructureFromNBT(tagCompound);
}
 
Example #22
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_) {
    //
}
 
Example #23
Source File: GuiEntityRender.java    From WearableBackpacks with MIT License votes vote down vote up
public TemplateManager getStructureTemplateManager() { return null; }