Added the Dawn Scribing Tool + Dawn Ritual Stone

Fixed the ISidedInventory nature of the chemistry set
Added the Omega Reaction Chamber for initiating the Omega state
Experimented with enchantments
This commit is contained in:
WayofTime 2015-04-04 16:35:42 -04:00
parent 60ae47c499
commit ab8d25db76
23 changed files with 554 additions and 57 deletions

View file

@ -0,0 +1,9 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.world.World;
public interface IEnchantmentGlyph
{
public int getSubtractedStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount);
public int getEnchantability(World world, int x, int y, int z, int meta);
}

View file

@ -1,5 +1,7 @@
package WayofTime.alchemicalWizardry.common.omega;
import java.util.Random;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -36,7 +38,7 @@ public class OmegaParadigm
this.config = new ReagentRegenConfiguration(20, 10, 1);
}
public void convertPlayerArmour(EntityPlayer player)
public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity)
{
ItemStack[] armours = player.inventory.armorInventory;
@ -47,16 +49,22 @@ public class OmegaParadigm
if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots)
{
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack);
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack);
long worldSeed = player.worldObj.getSeed();
Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z);
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, rand);
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, rand);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, rand);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, rand);
armours[3] = omegaHelmetStack;
armours[2] = omegaChestStack;
armours[1] = omegaLeggingsStack;
armours[0] = omegaBootsStack;
return true;
}
return false;
}
public ReagentRegenConfiguration getRegenConfig(EntityPlayer player)

View file

@ -17,13 +17,7 @@ public class OmegaParadigmFire extends OmegaParadigm
@Override
public float getCostPerTickOfUse(EntityPlayer player)
{
if(player.isAirBorne)
{
return 0.5f;
}else
{
return 1;
}
return 1;
}
@Override

View file

@ -0,0 +1,225 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.ModBlocks;
public class OmegaStructureHandler
{
public static final OmegaStructureParameters emptyParam = new OmegaStructureParameters(0, 0);
public static boolean isStructureIntact(World world, int x, int y, int z)
{
return true;
}
public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim)
{
int range = expLim;
int[][][] boolList = new int[range * 2 + 1][range * 2 + 1][range * 2 + 1]; //0 indicates unchecked, 1 indicates checked and is air, -1 indicates checked to be right next to air blocks in question but is NOT air
for (int i = 0; i < 2 * range + 1; i++)
{
for (int j = 0; j < 2 * range + 1; j++)
{
for (int k = 0; k < 2 * range + 1; k++)
{
boolList[i][j][k] = 0;
}
}
}
boolList[range][range][range] = 1;
boolean isReady = false;
while (!isReady)
{
isReady = true;
for (int i = 0; i < 2 * range + 1; i++)
{
for (int j = 0; j < 2 * range + 1; j++)
{
for (int k = 0; k < 2 * range + 1; k++)
{
if (boolList[i][j][k] == 1)
{
if (i - 1 >= 0 && !(boolList[i - 1][j][k] == 1 || boolList[i - 1][j][k] == -1))
{
Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k);
if (world.isAirBlock(x - range + i - 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(i - 1 == 0) //One of the found air blocks is at the range boundary, and thus the container is incomplete
{
return emptyParam;
}
boolList[i - 1][j][k] = 1;
isReady = false;
}else
{
boolList[i - 1][j][k] = -1;
}
}
if (j - 1 >= 0 && !(boolList[i][j - 1][k] == 1 || boolList[i][j - 1][k] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k);
if (world.isAirBlock(x - range + i, y - range + j - 1, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(j - 1 == 0)
{
return emptyParam;
}
boolList[i][j - 1][k] = 1;
isReady = false;
}else
{
boolList[i][j - 1][k] = -1;
}
}
if (k - 1 >= 0 && !(boolList[i][j][k - 1] == 1 || boolList[i][j][k - 1] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1);
if (world.isAirBlock(x - range + i, y - range + j, z - range + k - 1) || block == ModBlocks.blockSpectralContainer)
{
if(k - 1 == 0)
{
return emptyParam;
}
boolList[i][j][k - 1] = 1;
isReady = false;
}else
{
boolList[i][j][k - 1] = -1;
}
}
if (i + 1 <= 2 * range && !(boolList[i + 1][j][k] == 1 || boolList[i + 1][j][k] == -1))
{
Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k);
if (world.isAirBlock(x - range + i + 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(i + 1 == range * 2)
{
return emptyParam;
}
boolList[i + 1][j][k] = 1;
isReady = false;
}else
{
boolList[i + 1][j][k] = -1;
}
}
if (j + 1 <= 2 * range && !(boolList[i][j + 1][k] == 1 || boolList[i][j + 1][k] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k);
if (world.isAirBlock(x - range + i, y - range + j + 1, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(j + 1 == range * 2)
{
return emptyParam;
}
boolList[i][j + 1][k] = 1;
isReady = false;
}else
{
boolList[i][j + 1][k] = -1;
}
}
if (k + 1 <= 2 * range && !(boolList[i][j][k + 1] == 1 || boolList[i][j][k + 1] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1);
if (world.isAirBlock(x - range + i, y - range + j, z - range + k + 1) || block == ModBlocks.blockSpectralContainer)
{
if(k + 1 == range * 2)
{
return emptyParam;
}
boolList[i][j][k + 1] = 1;
isReady = false;
}else
{
boolList[i][j][k + 1] = -1;
}
}
}
}
}
}
}
int tally = 0;
int enchantability = 0;
for (int i = 0; i < 2 * range + 1; i++)
{
for (int j = 0; j < 2 * range + 1; j++)
{
for (int k = 0; k < 2 * range + 1; k++)
{
if (boolList[i][j][k] != -1)
{
continue;
}
int indTally = 0;
if (i - 1 >= 0 && boolList[i - 1][j][k] == 1)
{
indTally++;
}
if (j - 1 >= 0 && boolList[i][j - 1][k] == 1)
{
indTally++;
}
if (k - 1 >= 0 && boolList[i][j][k - 1] == 1)
{
indTally++;
}
if (i + 1 <= 2 * range && boolList[i + 1][j][k] == 1)
{
indTally++;
}
if (j + 1 <= 2 * range && boolList[i][j + 1][k] == 1)
{
indTally++;
}
if (k + 1 <= 2 * range && boolList[i][j][k + 1] == 1)
{
indTally++;
}
Block block = world.getBlock(x - range + i, y - range + j, z - range + k);
int meta = 0;
if(block instanceof IEnchantmentGlyph)
{
tally -= ((IEnchantmentGlyph)block).getSubtractedStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally);
enchantability += ((IEnchantmentGlyph)block).getEnchantability(world, x-range+i, y-range+j, z-range+k, meta);
}else
{
tally += indTally;
}
// Block block = world.getBlock(x + i - range, y + j - range, z + k - range);
//
// if (block == ModBlocks.blockSpectralContainer)
// {
// world.setBlockToAir(x + i - range, y + j - range, z + k - range);
// }
}
}
}
return new OmegaStructureParameters(tally, enchantability);
}
}

View file

@ -0,0 +1,13 @@
package WayofTime.alchemicalWizardry.common.omega;
public class OmegaStructureParameters
{
public final int stability;
public final int enchantability;
public OmegaStructureParameters(int stability, int enchantability)
{
this.stability = stability;
this.enchantability = enchantability;
}
}