use of WayofTime.alchemicalWizardry.common.demonVillage.DemonCrosspath in project BloodMagic by WayofTime.
the class TEDemonPortal method createGriddedRoad.
public // Total grid length
int createGriddedRoad(// Total grid length
int gridXi, // Total grid length
int yi, // Total grid length
int gridZi, // Total grid length
ForgeDirection dir, // Total grid length
int gridLength, // Total grid length
boolean convertStarter) {
if (gridLength == 0 || gridLength == 1) {
return 0;
}
int initGridX = gridXi;
int initGridZ = gridZi;
int initY = yi;
if (convertStarter) {
this.setGridSpace(initGridX, initGridZ, new GridSpace(GridSpace.CROSSROAD, initY));
DemonCrosspath crosspath = new DemonCrosspath(xCoord + initGridX * 5, initY, zCoord + initGridZ * 5);
crosspath.createCrosspath(worldObj);
}
for (int index = 0; index < gridLength - 1; index++) {
DemonVillagePath path = new DemonVillagePath(xCoord + initGridX * 5, initY, zCoord + initGridZ * 5, dir, 6);
Int3AndBool temp = path.constructFullPath(this, worldObj, this.getRoadStepClearance());
Int3 next = temp.coords;
if (next != null) {
initY = next.yCoord;
if (printDebug)
AlchemicalWizardry.logger.info("" + initY);
}
if (!temp.bool) {
return index;
}
initGridX += dir.offsetX;
initGridZ += dir.offsetZ;
if (!this.getGridSpace(initGridX, initGridZ).isRoadSegment()) {
this.setGridSpace(initGridX, initGridZ, new GridSpace(GridSpace.ROAD, initY));
}
}
return gridLength - 1;
}
Aggregations