Testing the creation of hell

This commit is contained in:
WayofTime 2014-10-31 17:35:30 -04:00
parent 796e75b1f9
commit a2b006105e
2587 changed files with 0 additions and 129617 deletions

View file

@ -0,0 +1,60 @@
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
import net.minecraft.block.Block;
public class AltarComponent
{
private int x;
private int y;
private int z;
private Block block;
private int metadata;
private boolean isBloodRune;
private boolean isUpgradeSlot;
public AltarComponent(int x, int y, int z, Block block, int metadata, boolean isBloodRune, boolean isUpgradeSlot)
{
this.x = x;
this.y = y;
this.z = z;
this.block = block;
this.metadata = metadata;
this.isBloodRune = isBloodRune;
this.isUpgradeSlot = isUpgradeSlot;
}
public int getX()
{
return x;
}
public int getY()
{
return y;
}
public int getZ()
{
return z;
}
public Block getBlock()
{
return block;
}
public int getMetadata()
{
return metadata;
}
public boolean isBloodRune()
{
return isBloodRune;
}
public boolean isUpgradeSlot()
{
return isUpgradeSlot;
}
}

View file

@ -0,0 +1,105 @@
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
public class AltarUpgradeComponent
{
private int speedUpgrades;
private int efficiencyUpgrades;
private int sacrificeUpgrades;
private int selfSacrificeUpgrades;
private int displacementUpgrades;
private int altarCapacitiveUpgrades;
private int orbCapacitiveUpgrades;
private int betterCapacitiveUpgrades;
public AltarUpgradeComponent()
{
speedUpgrades = 0;
efficiencyUpgrades = 0;
sacrificeUpgrades = 0;
selfSacrificeUpgrades = 0;
displacementUpgrades = 0;
altarCapacitiveUpgrades = 0;
orbCapacitiveUpgrades = 0;
betterCapacitiveUpgrades = 0;
}
public void addSpeedUpgrade()
{
speedUpgrades++;
}
public void addEfficiencyUpgrade()
{
efficiencyUpgrades++;
}
public void addSacrificeUpgrade()
{
sacrificeUpgrades++;
}
public void addSelfSacrificeUpgrade()
{
selfSacrificeUpgrades++;
}
public void addDisplacementUpgrade()
{
displacementUpgrades++;
}
public void addaltarCapacitiveUpgrade()
{
altarCapacitiveUpgrades++;
}
public void addorbCapacitiveUpgrade()
{
orbCapacitiveUpgrades++;
}
public void addBetterCapacitiveUpgrade()
{
betterCapacitiveUpgrades++;
}
public int getSpeedUpgrades()
{
return speedUpgrades;
}
public int getEfficiencyUpgrades()
{
return efficiencyUpgrades;
}
public int getSacrificeUpgrades()
{
return sacrificeUpgrades;
}
public int getSelfSacrificeUpgrades()
{
return selfSacrificeUpgrades;
}
public int getDisplacementUpgrades()
{
return displacementUpgrades;
}
public int getAltarCapacitiveUpgrades()
{
return this.altarCapacitiveUpgrades;
}
public int getOrbCapacitiveUpgrades()
{
return this.orbCapacitiveUpgrades;
}
public int getBetterCapacitiveUpgrades()
{
return this.betterCapacitiveUpgrades;
}
}

View file

@ -0,0 +1,299 @@
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.common.block.BloodRune;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class UpgradedAltars
{
public static List<AltarComponent> secondTierAltar = new ArrayList();
public static List<AltarComponent> thirdTierAltar = new ArrayList();
public static List<AltarComponent> fourthTierAltar = new ArrayList();
public static List<AltarComponent> fifthTierAltar = new ArrayList();
public static int highestAltar = 5;
public static int isAltarValid(World world, int x, int y, int z)
{
for (int i = highestAltar; i >= 2; i--)
{
if (checkAltarIsValid(world, x, y, z, i))
{
return i;
}
}
return 1;
}
public static boolean checkAltarIsValid(World world, int x, int y, int z, int altarTier)
{
switch (altarTier)
{
case 1:
return true;
case 2:
for (AltarComponent ac : secondTierAltar)
{
if (ac.isBloodRune())
{
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (!(testBlock instanceof BloodRune))
{
return false;
}
} else
{
Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
{
return false;
}
}
}
return true;
case 3:
for (AltarComponent ac : thirdTierAltar)
{
if (ac.isBloodRune())
{
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (!(testBlock instanceof BloodRune))
{
return false;
}
} else
{
Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
{
return false;
}
}
}
return true;
case 4:
for (AltarComponent ac : fourthTierAltar)
{
if (ac.isBloodRune())
{
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (!(testBlock instanceof BloodRune))
{
return false;
}
} else
{
Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
{
return false;
}
}
}
return true;
case 5:
for (AltarComponent ac : fifthTierAltar)
{
if (ac.isBloodRune())
{
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (!(testBlock instanceof BloodRune))
{
return false;
}
} else
{
Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
int metadata = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
{
return false;
}
}
}
return true;
default:
return false;
}
}
public static AltarUpgradeComponent getUpgrades(World world, int x, int y, int z, int altarTier)
{
AltarUpgradeComponent upgrades = new AltarUpgradeComponent();
List<AltarComponent> list = UpgradedAltars.getAltarUpgradeListForTier(altarTier);
for (AltarComponent ac : list)
{
if (ac.isUpgradeSlot())
{
//Currently checks the getRuneEffect.
//TODO Change so that it uses the metadata instead, with the BlockID.
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
if (testBlock instanceof BloodRune)
{
if (!world.isRemote)
{
switch (((BloodRune) testBlock).getRuneEffect(world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
{
case 1:
upgrades.addSpeedUpgrade();
break;
case 2:
upgrades.addEfficiencyUpgrade();
break;
case 3:
upgrades.addSacrificeUpgrade();
break;
case 4:
upgrades.addSelfSacrificeUpgrade();
break;
case 5:
upgrades.addaltarCapacitiveUpgrade();
break;
case 6:
upgrades.addDisplacementUpgrade();
break;
case 7:
upgrades.addorbCapacitiveUpgrade();
break;
case 8:
upgrades.addBetterCapacitiveUpgrade();
break;
}
}
}
}
}
return upgrades;
}
public static void loadAltars()
{
secondTierAltar.add(new AltarComponent(-1, -1, -1, ModBlocks.bloodRune, 0, true, false));
secondTierAltar.add(new AltarComponent(0, -1, -1, ModBlocks.bloodRune, 0, true, true));
secondTierAltar.add(new AltarComponent(1, -1, -1, ModBlocks.bloodRune, 0, true, false));
secondTierAltar.add(new AltarComponent(-1, -1, 0, ModBlocks.bloodRune, 0, true, true));
secondTierAltar.add(new AltarComponent(1, -1, 0, ModBlocks.bloodRune, 0, true, true));
secondTierAltar.add(new AltarComponent(-1, -1, 1, ModBlocks.bloodRune, 0, true, false));
secondTierAltar.add(new AltarComponent(0, -1, 1, ModBlocks.bloodRune, 0, true, true));
secondTierAltar.add(new AltarComponent(1, -1, 1, ModBlocks.bloodRune, 0, true, false));
thirdTierAltar.add(new AltarComponent(-1, -1, -1, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(0, -1, -1, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(1, -1, -1, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(-1, -1, 0, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(1, -1, 0, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(-1, -1, 1, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(0, -1, 1, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(1, -1, 1, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(-3, -1, -3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(-3, 0, -3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(3, -1, -3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(3, 0, -3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(-3, -1, 3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(-3, 0, 3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(3, -1, 3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(3, 0, 3, Blocks.stonebrick, 0, false, false));
thirdTierAltar.add(new AltarComponent(-3, 1, -3, Blocks.glowstone, 0, false, false));
thirdTierAltar.add(new AltarComponent(3, 1, -3, Blocks.glowstone, 0, false, false));
thirdTierAltar.add(new AltarComponent(-3, 1, 3, Blocks.glowstone, 0, false, false));
thirdTierAltar.add(new AltarComponent(3, 1, 3, Blocks.glowstone, 0, false, false));
for (int i = -2; i <= 2; i++)
{
thirdTierAltar.add(new AltarComponent(3, -2, i, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(-3, -2, i, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(i, -2, 3, ModBlocks.bloodRune, 0, true, true));
thirdTierAltar.add(new AltarComponent(i, -2, -3, ModBlocks.bloodRune, 0, true, true));
}
fourthTierAltar.addAll(thirdTierAltar);
for (int i = -3; i <= 3; i++)
{
fourthTierAltar.add(new AltarComponent(5, -3, i, ModBlocks.bloodRune, 0, true, true));
fourthTierAltar.add(new AltarComponent(-5, -3, i, ModBlocks.bloodRune, 0, true, true));
fourthTierAltar.add(new AltarComponent(i, -3, 5, ModBlocks.bloodRune, 0, true, true));
fourthTierAltar.add(new AltarComponent(i, -3, -5, ModBlocks.bloodRune, 0, true, true));
}
for (int i = -2; i <= 1; i++)
{
fourthTierAltar.add(new AltarComponent(5, i, 5, Blocks.stonebrick, 0, false, false));
fourthTierAltar.add(new AltarComponent(5, i, -5, Blocks.stonebrick, 0, false, false));
fourthTierAltar.add(new AltarComponent(-5, i, -5, Blocks.stonebrick, 0, false, false));
fourthTierAltar.add(new AltarComponent(-5, i, 5, Blocks.stonebrick, 0, false, false));
}
fourthTierAltar.add(new AltarComponent(5, 2, 5, ModBlocks.largeBloodStoneBrick, 0, false, false));
fourthTierAltar.add(new AltarComponent(5, 2, -5, ModBlocks.largeBloodStoneBrick, 0, false, false));
fourthTierAltar.add(new AltarComponent(-5, 2, -5, ModBlocks.largeBloodStoneBrick, 0, false, false));
fourthTierAltar.add(new AltarComponent(-5, 2, 5, ModBlocks.largeBloodStoneBrick, 0, false, false));
fifthTierAltar.addAll(fourthTierAltar);
fifthTierAltar.add(new AltarComponent(-8, -3, 8, Blocks.beacon, 0, false, false));
fifthTierAltar.add(new AltarComponent(-8, -3, -8, Blocks.beacon, 0, false, false));
fifthTierAltar.add(new AltarComponent(8, -3, 8, Blocks.beacon, 0, false, false));
fifthTierAltar.add(new AltarComponent(8, -3, 8, Blocks.beacon, 0, false, false));
for (int i = -6; i <= 6; i++)
{
fifthTierAltar.add(new AltarComponent(8, -4, i, ModBlocks.bloodRune, 0, true, true));
fifthTierAltar.add(new AltarComponent(-8, -4, i, ModBlocks.bloodRune, 0, true, true));
fifthTierAltar.add(new AltarComponent(i, -4, 8, ModBlocks.bloodRune, 0, true, true));
fifthTierAltar.add(new AltarComponent(i, -4, -8, ModBlocks.bloodRune, 0, true, true));
}
}
public static List<AltarComponent> getAltarUpgradeListForTier(int tier)
{
switch (tier)
{
case 2:
return secondTierAltar;
case 3:
return thirdTierAltar;
case 4:
return fourthTierAltar;
case 5:
return fifthTierAltar;
}
return null;
}
}