-
Notifications
You must be signed in to change notification settings - Fork 755
/
ComponentSmeltery.java
139 lines (118 loc) · 5.29 KB
/
ComponentSmeltery.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package tconstruct.worldgen.village;
import java.util.List;
import java.util.Random;
import tconstruct.TConstruct;
import tconstruct.common.TRepo;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraft.world.gen.structure.MapGenVillage;
import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureVillagePieces;
import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
public class ComponentSmeltery extends StructureVillagePieces.House1
{
private int averageGroundLevel = -1;
public ComponentSmeltery()
{
}
public ComponentSmeltery(Start villagePiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5)
{
super();
this.coordBaseMode = par5;
this.boundingBox = par4StructureBoundingBox;
}
public static ComponentSmeltery buildComponent (Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5)
{
StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 9, 3, 7, p4);
return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentSmeltery(villagePiece, p5, random,
structureboundingbox, p4) : null;
}
/**
* second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
* the end, it adds Fences...
*/
public boolean addComponentParts (World world, Random random, StructureBoundingBox sbb)
{
if (this.averageGroundLevel < 0)
{
this.averageGroundLevel = this.getAverageGroundLevel(world, sbb);
if (this.averageGroundLevel < 0)
{
return true;
}
this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + 2, 0);
}
/**
* arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int
* maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
*/
this.func_151549_a(world, sbb, 1, 0, 0, 7, 0, 6, Blocks.stonebrick, Blocks.stonebrick, false); //Base
this.func_151549_a(world, sbb, 0, 0, 1, 0, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
this.func_151549_a(world, sbb, 8, 0, 1, 8, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
this.func_151549_a(world, sbb, 0, 1, 0, 9, 3, 7, Blocks.air, Blocks.air, false);
this.fillWithMetaBlocks(world, sbb, 2, 0, 1, 6, 2, 5, TRepo.smeltery, 2, TRepo.smeltery, 2, false); //Basin
this.func_151549_a(world, sbb, 3, 1, 2, 5, 2, 4, Blocks.air, Blocks.air, false);
this.func_151550_a(world, TRepo.searedBlock, 0, 1, 1, 2, sbb);
this.func_151550_a(world, TRepo.searedBlock, 2, 1, 1, 4, sbb);
this.func_151550_a(world, TRepo.searedBlock, 0, 7, 1, 2, sbb);
this.func_151550_a(world, TRepo.searedBlock, 2, 7, 1, 4, sbb);
for (int l = 1; l < 6; ++l)
{
for (int i1 = 0; i1 < 9; ++i1)
{
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
//TODO fillCurrentPositionBlocksDownwards
this.func_151554_b(world, Blocks.stonebrick, 0, i1, -1, l, sbb);
}
}
for (int l = 0; l < 7; ++l)
{
for (int i1 = 1; i1 < 8; ++i1)
{
this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
this.func_151554_b(world, Blocks.stonebrick, 0, i1, -1, l, sbb);
}
}
return true;
}
int remapDirection (int direction)
{
TConstruct.logger.info("Direction: " + direction);
switch (direction)
{
case 0:
return 2;
case 1:
return 3;
case 2:
return 1;
case 3:
return 0;
}
TConstruct.logger.error("This shouldn't happen (remapDirection in tconstruct.worldgen.village.ComponentSmeltery)");
return -1;
}
protected void fillWithMetaBlocks (World par1World, StructureBoundingBox par2StructureBoundingBox, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block placeBlockID,
int placeBlockMeta, Block replaceBlockID, int replaceBlockMeta, boolean alwaysReplace)
{
Block i2 = this.func_151558_b(placeBlockID, placeBlockMeta);
int j2 = this.func_151557_c(placeBlockID, placeBlockMeta);
Block k2 = this.func_151558_b(replaceBlockID, replaceBlockMeta);
int l2 = this.func_151557_c(replaceBlockID, replaceBlockMeta);
super.func_151556_a(par1World, par2StructureBoundingBox, minX, minY, minZ, maxX, maxY, maxZ, i2, j2, k2, l2, alwaysReplace);
}
@Override
protected void func_143012_a (NBTTagCompound var1)
{
// TODO Auto-generated method stub
}
@Override
protected void func_143011_b (NBTTagCompound var1)
{
// TODO Auto-generated method stub
}
}