File creation and first crack at default .zip folder

This commit is contained in:
WayofTime 2014-06-24 21:08:29 -04:00
parent 74206f1dd9
commit cce90ce8fd
8 changed files with 310 additions and 65 deletions

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.demonVillage;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.Int3;
public class DemonBuilding
{
@ -9,6 +10,7 @@ public class DemonBuilding
public GridSpaceHolder area;
public int buildingTier;
public int type;
public Int3 doorGridSpace;
public DemonBuilding(BuildingSchematic schematic)
{
@ -16,6 +18,7 @@ public class DemonBuilding
this.type = 0;
this.buildingTier = 0;
this.area = this.createGSHForSchematic(schematic);
this.doorGridSpace = schematic.getGridSpotOfDoor();
}
public String getName()
@ -42,4 +45,56 @@ public class DemonBuilding
{
return scheme.createGSH();
}
public Int3 getDoorSpace(ForgeDirection dir)
{
int x = 0;
int z = 0;
switch(dir)
{
case SOUTH:
x = -doorGridSpace.xCoord;
z = -doorGridSpace.zCoord;
break;
case WEST:
x = doorGridSpace.zCoord;
z = -doorGridSpace.xCoord;
break;
case EAST:
x = -doorGridSpace.zCoord;
z = doorGridSpace.xCoord;
break;
default:
x = doorGridSpace.xCoord;
z = doorGridSpace.zCoord;
break;
}
return new Int3(x, 0, z);
}
public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel)
{
Int3 doorSpace = this.getDoorSpace(sideOfRoad);
int x = doorSpace.xCoord;
int z = doorSpace.zCoord;
switch(sideOfRoad)
{
case SOUTH:
z++;
break;
case EAST:
x++;
break;
case WEST:
x--;
break;
default:
z--;
break;
}
return new Int3(x, yLevel, z);
}
}