Finished all errors except for the sigils.
This commit is contained in:
parent
9e2c0e6e74
commit
230b44fe88
44 changed files with 431 additions and 1148 deletions
|
@ -1,36 +1,34 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.*;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
|
||||
public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
||||
{
|
||||
public static final int maxDistance = 6;
|
||||
|
||||
public IIcon crystalBody;
|
||||
public IIcon crystalLabel;
|
||||
|
||||
|
||||
public ItemAttunedCrystal()
|
||||
{
|
||||
super();
|
||||
|
@ -78,62 +76,6 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal1");
|
||||
this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
case 1:
|
||||
Reagent reagent = this.getReagent(stack);
|
||||
if (reagent != null)
|
||||
{
|
||||
return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(int meta)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return this.crystalBody;
|
||||
case 1:
|
||||
return this.crystalLabel;
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -157,11 +99,9 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (!(tile instanceof IReagentHandler))
|
||||
{
|
||||
|
@ -172,7 +112,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(EnumFacing.UP);
|
||||
if (infos != null)
|
||||
{
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
|
@ -223,13 +163,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
return itemStack;
|
||||
}
|
||||
|
||||
if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance)
|
||||
if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - pos.getX()) > maxDistance || Math.abs(coords.yCoord - pos.getY()) > maxDistance || Math.abs(coords.zCoord - pos.getZ()) > maxDistance)
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
TileEntity pastTile = world.getTileEntity(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
|
||||
if (!(pastTile instanceof TEReagentConduit))
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
||||
|
@ -247,10 +187,10 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, x, y, z);
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, pos);
|
||||
} else
|
||||
{
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z))
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, pos))
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name));
|
||||
} else
|
||||
|
@ -258,13 +198,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
world.markBlockForUpdate(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
|
||||
} else
|
||||
{
|
||||
int dimension = world.provider.getDimensionId();
|
||||
|
||||
this.setDimension(itemStack, dimension);
|
||||
this.setCoordinates(itemStack, new Int3(x, y, z));
|
||||
this.setCoordinates(itemStack, new Int3(pos));
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking"));
|
||||
}
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
|
||||
public class ItemDestinationClearer extends Item implements IReagentManipulator
|
||||
{
|
||||
|
@ -26,13 +24,6 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
|
|||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -57,11 +48,9 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (!(tile instanceof TEReagentConduit))
|
||||
{
|
||||
|
|
|
@ -1,33 +1,29 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.*;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
|
||||
public class ItemTankSegmenter extends Item implements IReagentManipulator
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon crystalBody;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon crystalLabel;
|
||||
|
||||
public ItemTankSegmenter()
|
||||
{
|
||||
super();
|
||||
|
@ -64,62 +60,6 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter1");
|
||||
this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
case 1:
|
||||
Reagent reagent = this.getReagent(stack);
|
||||
if (reagent != null)
|
||||
{
|
||||
return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(int meta)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return this.crystalBody;
|
||||
case 1:
|
||||
return this.crystalLabel;
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -136,10 +76,8 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (!(tile instanceof ISegmentedReagentHandler))
|
||||
{
|
||||
return itemStack;
|
||||
|
@ -148,7 +86,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(EnumFacing.UP);
|
||||
if (infos != null)
|
||||
{
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue