Fixed performance of the compression handler, and made the ritual checking a lot more streamlined. Allowed hoppers, etc, to interact with the chemistry set.

This commit is contained in:
WayofTime 2014-11-22 10:15:29 -05:00
parent ce08afaf9f
commit 4db4b458da
6 changed files with 26 additions and 80 deletions

View file

@ -6,7 +6,7 @@ ccc_version=1.0.4.29
nei_version=1.0.3.64 nei_version=1.0.3.64
//=Dependency Information //=Dependency Information
package_group=com.wayoftime.bloodmagic package_group=com.wayoftime.bloodmagic
mod_version=1.2.1 mod_version=1.2.1a
minetweaker_version=Dev-1.7.10-3.0.9B minetweaker_version=Dev-1.7.10-3.0.9B
build_number=2 build_number=1
mc_version=1.7.10 mc_version=1.7.10

View file

@ -248,7 +248,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.1", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") @Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.1a", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory")
public class AlchemicalWizardry public class AlchemicalWizardry
{ {

View file

@ -4,5 +4,15 @@ import net.minecraft.world.World;
public interface IRitualStone public interface IRitualStone
{ {
/**
* x, y, and z give the position of the Ritual Stone
* @param world
* @param x
* @param y
* @param z
* @param meta
* @param runeType
* @return
*/
public boolean isRuneType(World world, int x, int y, int z, int meta, int runeType); public boolean isRuneType(World world, int x, int y, int z, int meta, int runeType);
} }

View file

@ -152,70 +152,19 @@ public class Rituals
Block test = null; Block test = null;
TileEntity te = null; TileEntity te = null;
switch (direction) for (RitualComponent rc : ritual)
{ {
case 1: test = world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
for (RitualComponent rc : ritual) te = world.getTileEntity(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
{
test = world.getBlock(x + rc.getX(), y + rc.getY(), z + rc.getZ());
te = world.getTileEntity(x + rc.getX(), y + rc.getY(), z + rc.getZ());
if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x, y, z, world.getBlockMetadata(x + rc.getX(), y + rc.getY(), z + rc.getZ()), rc.getStoneType())) if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x + rc.getX(direction), y, z+ rc.getZ(direction), world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)), rc.getStoneType()))
&& !(test instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType()))) && !(test instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType())))
{ {
return false; return false;
} }
}
return true;
case 2:
for (RitualComponent rc : ritual)
{
test = world.getBlock(x - rc.getZ(), y + rc.getY(), z + rc.getX());
te = world.getTileEntity(x - rc.getZ(), y + rc.getY(), z + rc.getX());
if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x, y, z, world.getBlockMetadata(x - rc.getZ(), y + rc.getY(), z + rc.getX()), rc.getStoneType()))
&& !(test instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType())))
{
return false;
}
}
return true;
case 3:
for (RitualComponent rc : ritual)
{
test = world.getBlock(x - rc.getX(), y + rc.getY(), z - rc.getZ());
te = world.getTileEntity(x - rc.getX(), y + rc.getY(), z - rc.getZ());
if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x, y, z, world.getBlockMetadata(x - rc.getX(), y + rc.getY(), z - rc.getZ()), rc.getStoneType()))
&& !(test instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType())))
{
return false;
}
}
return true;
case 4:
for (RitualComponent rc : ritual)
{
test = world.getBlock(x + rc.getZ(), y + rc.getY(), z - rc.getX());
te = world.getTileEntity(x + rc.getZ(), y + rc.getY(), z - rc.getX());
if (!(test instanceof IRitualStone && ((IRitualStone)test).isRuneType(world, x, y, z, world.getBlockMetadata(x + rc.getZ(), y + rc.getY(), z - rc.getX()), rc.getStoneType()))
&& !(test instanceof ITileRitualStone && ((ITileRitualStone)te).isRuneType(rc.getStoneType())))
{
return false;
}
}
return true;
} }
return false; return true;
} }
public static int getDirectionOfRitual(World world, int x, int y, int z, String ritualID) public static int getDirectionOfRitual(World world, int x, int y, int z, String ritualID)

View file

@ -100,6 +100,10 @@ public class AdvancedCompressionHandler extends CompressionHandler
public boolean isResultStackReversible(ItemStack stack, int gridSize, World world) public boolean isResultStackReversible(ItemStack stack, int gridSize, World world)
{ {
if(stack == null)
{
return false;
}
InventoryCrafting inventory = new InventoryCrafting(new Container() InventoryCrafting inventory = new InventoryCrafting(new Container()
{ {
public boolean canInteractWith(EntityPlayer player) public boolean canInteractWith(EntityPlayer player)

View file

@ -1,17 +0,0 @@
package WayofTime.alchemicalWizardry.common.compress;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
public class DumbyInventoryCrafting extends InventoryCrafting
{
public DumbyInventoryCrafting(int x, int y)
{
super(null, x, y);
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack)
{
}
}