mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 23:33:15 +00:00
Finished all porting
This commit is contained in:
1 parent
93e5e6cca6
commit
d528bdbbf8
30 files changed
+393
-1045
No files matched your search
+18
-69
@@ -1,40 +1,30 @@
|
||||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 200;
|
||||
|
||||
public SigilOfTheBridge()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +35,7 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
@@ -57,47 +47,6 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (par1 == 1)
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
@@ -112,9 +61,9 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
|
||||
if (tag.getBoolean("isActive") && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
@@ -141,7 +90,7 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
@@ -150,7 +99,7 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
this.setLPUsed(par1ItemStack, 0);
|
||||
}else
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking())
|
||||
@@ -181,13 +130,13 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
for (int iz = posZ - range; iz <= posZ + range; iz++)
|
||||
{
|
||||
{
|
||||
Block block = par2World.getBlock(ix, posY + verticalOffset, iz);
|
||||
IBlockState block = par2World.getBlockState(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
|
||||
if (par2World.isAirBlock(ix, posY + verticalOffset, iz))
|
||||
if (par2World.isAirBlock(new BlockPos(ix, posY + verticalOffset, iz)))
|
||||
{
|
||||
par2World.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3);
|
||||
par2World.setBlockState(new BlockPos(ix, posY + verticalOffset, iz), ModBlocks.spectralBlock.getDefaultState(), 3);
|
||||
|
||||
TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
TileEntity tile = par2World.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
@@ -199,7 +148,7 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
}
|
||||
} else if (block == ModBlocks.spectralBlock)
|
||||
{
|
||||
TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
TileEntity tile = par2World.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
@@ -266,20 +215,20 @@ public class SigilOfTheBridge extends BindableItems implements ArmourUpgrade, IS
|
||||
{
|
||||
for (int iz = posZ - range; iz <= posZ + range; iz++)
|
||||
{
|
||||
Block block = world.getBlock(ix, posY + verticalOffset, iz);
|
||||
IBlockState block = world.getBlockState(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
|
||||
if (world.isAirBlock(ix, posY + verticalOffset, iz))
|
||||
if (world.isAirBlock(new BlockPos(ix, posY + verticalOffset, iz)))
|
||||
{
|
||||
world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3);
|
||||
world.setBlockState(new BlockPos(ix, posY + verticalOffset, iz), ModBlocks.spectralBlock.getDefaultState(), 3);
|
||||
|
||||
TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
TileEntity tile = world.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
}
|
||||
} else if (block == ModBlocks.spectralBlock)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
TileEntity tile = world.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
|
||||
Reference in new issue
Block a user