Finished all porting
This commit is contained in:
parent
93e5e6cca6
commit
d528bdbbf8
|
@ -107,13 +107,13 @@ public class ModBlocks
|
|||
|
||||
public static void init()
|
||||
{
|
||||
blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar");
|
||||
/* blockAltar = (BlockAltar) registerBlock(new BlockAltar(), "altar");
|
||||
bloodRune = (BlockBloodRune) registerBlock(new BlockBloodRune(), ItemBloodRuneBlock.class, "base_rune");
|
||||
speedRune = (BlockSpeedRune) registerBlock(new BlockSpeedRune(), "speed_rune");
|
||||
efficiencyRune = (BlockEfficiencyRune) registerBlock(new BlockEfficiencyRune(), "efficiency_rune");
|
||||
runeOfSacrifice = (BlockRuneOfSacrifice) registerBlock(new BlockRuneOfSacrifice(), "sacrifice_rune");
|
||||
runeOfSelfSacrifice = (BlockRuneOfSelfSacrifice) registerBlock(new BlockRuneOfSelfSacrifice(), "self_sacrifice_rune");
|
||||
blockTeleposer = registerBlock(new BlockTeleposer(), "teleposer");
|
||||
*/ blockTeleposer = registerBlock(new BlockTeleposer(), "teleposer");
|
||||
spectralBlock = registerBlock(new BlockSpectral(), "spectral_block");
|
||||
ritualStone = registerBlock(new BlockRitualStone(), "ritual_stone");
|
||||
blockMasterStone = registerBlock(new BlockMasterStone(), "master_ritual_stone");
|
||||
|
@ -159,21 +159,22 @@ public class ModBlocks
|
|||
block.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
blocksNotToBeRegistered.clear();
|
||||
for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled)
|
||||
// blocksNotToBeRegistered.clear();
|
||||
// for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled)
|
||||
{
|
||||
if (unlocName.equals(unlocalizedName))
|
||||
// if (unlocName.equals(unlocalizedName))
|
||||
{
|
||||
blocksNotToBeRegistered.add(unlocName);
|
||||
// blocksNotToBeRegistered.add(unlocName);
|
||||
}
|
||||
}
|
||||
if (!blocksNotToBeRegistered.contains(unlocalizedName))
|
||||
// if (!blocksNotToBeRegistered.contains(unlocalizedName))
|
||||
{
|
||||
GameRegistry.registerBlock(block, unlocalizedName);
|
||||
// GameRegistry.registerBlock(block, unlocalizedName);
|
||||
}
|
||||
|
||||
BlockRenderer.registerBlock(block);
|
||||
// BlockRenderer.registerBlock(block);
|
||||
|
||||
GameRegistry.registerBlock(block, unlocalizedName);
|
||||
return block;
|
||||
}
|
||||
|
||||
|
@ -181,20 +182,19 @@ public class ModBlocks
|
|||
{
|
||||
block.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
|
||||
for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled)
|
||||
// for (String unlocName : BloodMagicConfiguration.blocksToBeDisabled)
|
||||
{
|
||||
System.out.println(unlocName);
|
||||
if (unlocName.equals(unlocalizedName))
|
||||
// if (unlocName.equals(unlocalizedName))
|
||||
{
|
||||
blocksNotToBeRegistered.add(unlocName);
|
||||
// blocksNotToBeRegistered.add(unlocName);
|
||||
}
|
||||
}
|
||||
if (!blocksNotToBeRegistered.contains(unlocalizedName))
|
||||
// if (!blocksNotToBeRegistered.contains(unlocalizedName))
|
||||
{
|
||||
GameRegistry.registerBlock(block, itemBlockClass, unlocalizedName);
|
||||
}
|
||||
|
||||
BlockRenderer.registerBlock(block);
|
||||
// BlockRenderer.registerBlock(block);
|
||||
|
||||
return block;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheAssassin;
|
|||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheBridge;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfTheFastMiner;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfWind;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilPackRat;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilCompress;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilSeer;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilVoid;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilWater;
|
||||
|
@ -349,7 +349,7 @@ public class ModItems
|
|||
|
||||
itemBloodPack = registerItem(new ItemBloodLetterPack(), "blood_pack");
|
||||
itemHarvestSigil = registerItem(new SigilHarvest(), "harvest_sigil");
|
||||
itemCompressionSigil = registerItem(new SigilPackRat(), "compression_sigil");
|
||||
itemCompressionSigil = registerItem(new SigilCompress(), "compression_sigil");
|
||||
itemAssassinSigil = registerItem(new SigilOfTheAssassin(), "assassin_sigil");
|
||||
|
||||
boundHelmetWater = registerItem(new OmegaArmourWater(0), "bound_helmet_water");
|
||||
|
@ -384,17 +384,17 @@ public class ModItems
|
|||
{
|
||||
item.setUnlocalizedName(unlocalizedName);
|
||||
item.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
itemsNotToBeRegistered.clear();
|
||||
// itemsNotToBeRegistered.clear();
|
||||
|
||||
for (String unlocName : BloodMagicConfiguration.itemsToBeDisabled)
|
||||
// for (String unlocName : BloodMagicConfiguration.itemsToBeDisabled)
|
||||
{
|
||||
if (unlocName.equals(unlocalizedName))
|
||||
// if (unlocName.equals(unlocalizedName))
|
||||
{
|
||||
itemsNotToBeRegistered.add(unlocName);
|
||||
// itemsNotToBeRegistered.add(unlocName);
|
||||
}
|
||||
}
|
||||
|
||||
if (!itemsNotToBeRegistered.contains(unlocalizedName))
|
||||
// if (!itemsNotToBeRegistered.contains(unlocalizedName))
|
||||
{
|
||||
GameRegistry.registerItem(item, unlocalizedName);
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor;
|
|||
import WayofTime.alchemicalWizardry.common.thread.GAPIChecker;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicalCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
|
@ -160,7 +160,7 @@ public class ClientProxy extends CommonProxy
|
|||
ClientRegistry.bindTileEntitySpecialRenderer(TEReagentConduit.class, new RenderReagentConduit());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEMasterStone.class, new RenderMasterStone());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEAlchemicalCalcinator.class, new RenderAlchemicalCalcinator());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEBellJar.class, new RenderCrystalBelljar());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEBelljar.class, new RenderCrystalBelljar());
|
||||
|
||||
//Item Renderer stuff
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockConduit), new TEConduitItemRenderer());
|
||||
|
|
|
@ -58,14 +58,13 @@ import WayofTime.alchemicalWizardry.common.omega.ReagentRegenConfiguration;
|
|||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
|
||||
|
||||
public class AlchemicalWizardryEventHooks
|
||||
{
|
||||
public static Map<String, Boolean> playerFlightBuff = new HashMap();
|
||||
public static List<String> playersWith1Step = new ArrayList();
|
||||
public static Map<String, Boolean> playerFlightBuff = new HashMap<String, Boolean>();
|
||||
public static List<String> playersWith1Step = new ArrayList<String>();
|
||||
|
||||
public static Map<Integer, List<CoordAndRange>> respawnMap = new HashMap();
|
||||
public static Map<Integer, List<CoordAndRange>> forceSpawnMap = new HashMap();
|
||||
public static Map<Integer, List<CoordAndRange>> respawnMap = new HashMap<Integer, List<CoordAndRange>>();
|
||||
public static Map<Integer, List<CoordAndRange>> forceSpawnMap = new HashMap<Integer, List<CoordAndRange>>();
|
||||
|
||||
public static Random rand = new Random();
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common;
|
|||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.spell.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.BookEntityItem;
|
||||
|
@ -22,8 +21,6 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
|
|||
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ public class BlockBelljar extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ public class BindableItems extends Item implements IBindable
|
|||
public BindableItems()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
protected void setEnergyUsed(int par1int)
|
||||
|
|
|
@ -8,23 +8,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import codechicken.lib.render.TextureUtils.IIconRegister;
|
||||
|
||||
public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
public SigilAir()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
//setMaxDamage(1000);
|
||||
setEnergyUsed(50);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,13 +32,6 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -121,8 +108,7 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player,
|
||||
ItemStack thisItemStack)
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
player.fallDistance = 0;
|
||||
|
|
|
@ -3,113 +3,105 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilBloodLight extends BindableItems implements IHolding, ArmourUpgrade, ISigil
|
||||
{
|
||||
public SigilBloodLight()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(10);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.bloodlightsigil.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
if (!(itemStack.getTagCompound() == null))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + itemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodLightSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if(!BindableItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer) || !BindableItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()))
|
||||
if(!BindableItems.checkAndSetItemOwner(itemStack, player) || !BindableItems.syphonBatteries(itemStack, player, getEnergyUsed()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (par3World.isRemote)
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (par7 == 0 && par3World.isAirBlock(par4, par5 - 1, par6))
|
||||
IBlockState light = ModBlocks.blockBloodLight.getBlockState().getBaseState();
|
||||
|
||||
if (side.getIndex() == 0 && world.isAirBlock(blockPos.add(0, -1, 0)))
|
||||
{
|
||||
par3World.setBlock(par4, par5 - 1, par6, ModBlocks.blockBloodLight);
|
||||
world.setBlockState(blockPos.add(0, -1, 0), light);
|
||||
}
|
||||
|
||||
if (par7 == 1 && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
if (side.getIndex() == 1 && world.isAirBlock(blockPos.add(0, 1, 0)))
|
||||
{
|
||||
par3World.setBlock(par4, par5 + 1, par6, ModBlocks.blockBloodLight);
|
||||
world.setBlockState(blockPos.add(0, 1, 0), light);
|
||||
}
|
||||
|
||||
if (par7 == 2 && par3World.isAirBlock(par4, par5, par6 - 1))
|
||||
if (side.getIndex() == 2 && world.isAirBlock(blockPos.add(0, 0, -1)))
|
||||
{
|
||||
par3World.setBlock(par4, par5, par6 - 1, ModBlocks.blockBloodLight);
|
||||
world.setBlockState(blockPos.add(0, 0, -1), light);
|
||||
}
|
||||
|
||||
if (par7 == 3 && par3World.isAirBlock(par4, par5, par6 + 1))
|
||||
if (side.getIndex() == 3 && world.isAirBlock(blockPos.add(0, 0, 1)))
|
||||
{
|
||||
par3World.setBlock(par4, par5, par6 + 1, ModBlocks.blockBloodLight);
|
||||
world.setBlockState(blockPos.add(0, 0, 1), light);
|
||||
}
|
||||
|
||||
if (par7 == 4 && par3World.isAirBlock(par4 - 1, par5, par6))
|
||||
if (side.getIndex() == 4 && world.isAirBlock(blockPos.add(-1, 0, 0)))
|
||||
{
|
||||
par3World.setBlock(par4 - 1, par5, par6, ModBlocks.blockBloodLight);
|
||||
world.setBlockState(blockPos.add(-1, 0, 0), light);
|
||||
}
|
||||
|
||||
if (par7 == 5 && par3World.isAirBlock(par4 + 1, par5, par6))
|
||||
if (side.getIndex() == 5 && world.isAirBlock(blockPos.add(1, 0, 0)))
|
||||
{
|
||||
par3World.setBlock(par4 + 1, par5, par6, ModBlocks.blockBloodLight);
|
||||
world.setBlockState(blockPos.add(1, 0, 0), light);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!BindableItems.checkAndSetItemOwner(itemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed() * 5))
|
||||
if(!BindableItems.syphonBatteries(itemStack, par3EntityPlayer, getEnergyUsed() * 5))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
|
@ -117,13 +109,13 @@ public class SigilBloodLight extends BindableItems implements IHolding, ArmourUp
|
|||
par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 10));
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true));
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,36 +3,24 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.compress.CompressionRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgrade, ISigil
|
||||
public class SigilCompress extends SigilToggleable implements IHolding, ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilPackRat()
|
||||
public SigilCompress()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(200);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +30,7 @@ public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgra
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -54,47 +42,6 @@ public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgra
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CompressionSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:CompressionSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:CompressionSigil_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)
|
||||
{
|
||||
|
@ -109,9 +56,9 @@ public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgra
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
|
@ -120,7 +67,7 @@ public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgra
|
|||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
tag.setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -146,7 +93,7 @@ public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgra
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
ItemStack stack = CompressionRegistry.compressInventory(par3EntityPlayer.inventory.mainInventory, par2World);
|
||||
if(stack != null)
|
||||
|
@ -155,13 +102,13 @@ public class SigilPackRat extends BindableItems implements IHolding, ArmourUpgra
|
|||
par2World.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
}
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,18 +4,15 @@ import java.util.List;
|
|||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
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.ChatComponentText;
|
||||
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 WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
|
@ -23,23 +20,12 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilDivination extends Item implements ArmourUpgrade, IReagentManipulator, IBindable, ISigil
|
||||
public class SigilDivination extends BindableItems implements ArmourUpgrade, IReagentManipulator, IBindable, ISigil
|
||||
{
|
||||
public SigilDivination()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DivinationSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,11 +75,7 @@ public class SigilDivination extends Item implements ArmourUpgrade, IReagentMani
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = par2World.getTileEntity(x, y, z);
|
||||
TileEntity tile = par2World.getTileEntity(movingobjectposition.func_178782_a());
|
||||
|
||||
if (!(tile instanceof IReagentHandler))
|
||||
{
|
||||
|
@ -104,7 +86,7 @@ public class SigilDivination extends Item implements ArmourUpgrade, IReagentMani
|
|||
|
||||
IReagentHandler relay = (IReagentHandler) tile;
|
||||
|
||||
ReagentContainerInfo[] infoList = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
ReagentContainerInfo[] infoList = relay.getContainerInfo(EnumFacing.DOWN);
|
||||
if (infoList != null)
|
||||
{
|
||||
for (ReagentContainerInfo info : infoList)
|
||||
|
@ -122,10 +104,7 @@ public class SigilDivination extends Item implements ArmourUpgrade, IReagentMani
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
|
|
|
@ -3,28 +3,22 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
||||
public class SigilFluid extends BindableItems implements IFluidContainerItem, ISigil
|
||||
{
|
||||
private int capacity = 128 * 1000;
|
||||
private static final int STATE_SYPHON = 0;
|
||||
|
@ -39,8 +33,6 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
super();
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +78,6 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -196,7 +181,6 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
}
|
||||
int range = 5;
|
||||
|
||||
float f = 1.0F;
|
||||
boolean flag = true;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
|
@ -207,16 +191,12 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a()))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, container))
|
||||
if (!player.func_175151_a(movingobjectposition.func_178782_a(), movingobjectposition.field_178784_b, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
@ -234,7 +214,11 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
List<Int3> positionList = new ArrayList();
|
||||
List<Int3> positionList = new ArrayList<Int3>();
|
||||
|
||||
int x = movingobjectposition.func_178782_a().getX();
|
||||
int y = movingobjectposition.func_178782_a().getY();
|
||||
int z = movingobjectposition.func_178782_a().getZ();
|
||||
|
||||
boolList[range][range][range] = true;
|
||||
positionList.add(new Int3(range, range, range));
|
||||
|
@ -254,7 +238,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (i - 1 >= 0 && !boolList[i - 1][j][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k);
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i - 1, y - range + j, z - range + k)).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -267,7 +251,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
if (j - 1 >= 0 && !boolList[i][j - 1][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k);
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j - 1, z - range + k)).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -280,7 +264,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
if (k - 1 >= 0 && !boolList[i][j][k - 1])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1);
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j, z - range + k - 1)).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -293,7 +277,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
if (i + 1 <= 2 * range && !boolList[i + 1][j][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k);
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i + 1, y - range + j, z - range + k)).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -306,7 +290,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
if (j + 1 <= 2 * range && !boolList[i][j + 1][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k);
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j + 1, z - range + k)).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -319,7 +303,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
if (k + 1 <= 2 * range && !boolList[i][j][k + 1])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1);
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j, z - range + k + 1)).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -345,10 +329,10 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (world.getBlock(x + i - range, y + j - range, z + k - range) != null && world.getBlock(x + i - range, y + j - range, z + k - range).getMaterial() instanceof MaterialLiquid)
|
||||
if (world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock() != null && world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock().getMaterial() instanceof MaterialLiquid)
|
||||
{
|
||||
//world.setBlockToAir(x+i-range, y+j-range, z+k-range);
|
||||
Block block = world.getBlock(x + i - range, y + j - range, z + k - range);
|
||||
Block block = world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock();
|
||||
if (block == null)
|
||||
{
|
||||
continue;
|
||||
|
@ -358,7 +342,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
AlchemicalWizardry.logger.info("x: " + (i - range) + " y: " + (j - range) + " z: " + (k - range));
|
||||
|
||||
|
||||
if (fluid == null || world.getBlockMetadata(x + i - range, y + j - range, z + k - range) != 0)
|
||||
if (fluid == null || world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock().getMetaFromState(world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range))) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -371,8 +355,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
if ((amount > 0 && forceFill) || (amount >= 1000 && !forceFill))
|
||||
{
|
||||
{
|
||||
world.setBlockToAir(x + i - range, y + j - range, z + k - range);
|
||||
|
||||
world.setBlockToAir(new BlockPos(x + i - range, y + j - range, z + k - range));
|
||||
}
|
||||
|
||||
this.fill(container, new FluidStack(fluid, 1000), true);
|
||||
|
@ -387,7 +370,6 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
public ItemStack fillItemFromWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill)
|
||||
{
|
||||
float f = 1.0F;
|
||||
boolean flag = true;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
|
@ -398,23 +380,19 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, i, j, k))
|
||||
if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a()))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, container))
|
||||
if (!player.func_175151_a(movingobjectposition.func_178782_a(), movingobjectposition.field_178784_b, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (world.getBlock(i, j, k) != null && world.getBlock(i, j, k).getMaterial() instanceof MaterialLiquid)
|
||||
if (world.getBlockState(movingobjectposition.func_178782_a()).getBlock() != null && world.getBlockState(movingobjectposition.func_178782_a()).getBlock().getMaterial() instanceof MaterialLiquid)
|
||||
{
|
||||
Block block = world.getBlock(i, j, k);
|
||||
Block block = world.getBlockState(movingobjectposition.func_178782_a()).getBlock();
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid == null)
|
||||
|
@ -430,7 +408,7 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
world.setBlockToAir(i, j, k);
|
||||
world.setBlockToAir(movingobjectposition.func_178782_a());
|
||||
}
|
||||
|
||||
this.fill(container, new FluidStack(fluid, 1000), true);
|
||||
|
@ -455,12 +433,6 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
|
||||
if (simStack != null && simStack.amount >= 1000)
|
||||
{
|
||||
Block fluidBlock = simStack.getFluid().getBlock();
|
||||
|
||||
float f = 1.0F;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||
boolean flag = false;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
|
@ -471,57 +443,56 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, i, j, k))
|
||||
if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a()))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
int i = movingobjectposition.func_178782_a().getX();
|
||||
int j = movingobjectposition.func_178782_a().getY();
|
||||
int k = movingobjectposition.func_178782_a().getZ();
|
||||
|
||||
if (movingobjectposition.sideHit == 0)
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 0)
|
||||
{
|
||||
--j;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 1)
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 1)
|
||||
{
|
||||
++j;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 2)
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 2)
|
||||
{
|
||||
--k;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 3)
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 3)
|
||||
{
|
||||
++k;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 4)
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 4)
|
||||
{
|
||||
--i;
|
||||
}
|
||||
|
||||
if (movingobjectposition.sideHit == 5)
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 5)
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, container))
|
||||
if (!player.func_175151_a(new BlockPos(i, j, k), movingobjectposition.field_178784_b, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (this.tryPlaceContainedLiquid(world, fluidBlock, d0, d1, d2, i, j, k) && !player.capabilities.isCreativeMode)
|
||||
if (this.tryPlaceContainedLiquid(world, new BlockPos(i, j, k)) && !player.capabilities.isCreativeMode)
|
||||
{
|
||||
this.drain(container, 1000, true);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return container;
|
||||
|
@ -531,27 +502,28 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
return container;
|
||||
}
|
||||
|
||||
public boolean tryPlaceContainedLiquid(World par1World, Block block, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean tryPlaceContainedLiquid(World world, BlockPos blockPos)
|
||||
{
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).func_149730_j())
|
||||
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().isSolid()) //TODO Was func_149730_j() so check this!
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlock(par8, par9, par10).getMaterial() instanceof MaterialLiquid && (par1World.getBlockMetadata(par8, par9, par10) == 0)))
|
||||
} else if ((world.getBlockState(blockPos).getBlock().getMaterial() instanceof MaterialLiquid && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0))
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
if ((block == Blocks.water || block == Blocks.flowing_water) && par1World.provider.isHellWorld)
|
||||
Block block = world.getBlockState(blockPos).getBlock();
|
||||
if ((block == Blocks.water || block == Blocks.flowing_water) && world.provider.func_177500_n())
|
||||
{
|
||||
par1World.playSoundEffect(par2 + 0.5D, par4 + 0.5D, par6 + 0.5D, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
|
||||
world.playSoundEffect(blockPos.getX() + 0.5D, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
par1World.spawnParticle("largesmoke", (double) par8 + Math.random(), (double) par9 + Math.random(), (double) par10 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) blockPos.getX() + Math.random(), (double) blockPos.getY() + Math.random(), (double) blockPos.getZ() + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
} else
|
||||
{
|
||||
par1World.setBlock(par8, par9, par10, block, 0, 3);
|
||||
world.setBlockState(blockPos, block.getBlockState().getBaseState());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -578,15 +550,11 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(i, j, k);
|
||||
TileEntity tile = world.getTileEntity(movingobjectposition.func_178782_a());
|
||||
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true);
|
||||
int amount = ((IFluidHandler) tile).fill(movingobjectposition.field_178784_b, fluid, true);
|
||||
|
||||
this.drain(container, amount, true);
|
||||
}
|
||||
|
@ -609,21 +577,17 @@ public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(i, j, k);
|
||||
TileEntity tile = world.getTileEntity(movingobjectposition.func_178782_a());
|
||||
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluidAmount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), false);
|
||||
FluidStack fluidAmount = ((IFluidHandler) tile).drain(movingobjectposition.field_178784_b, this.getCapacity(container), false);
|
||||
|
||||
int amount = this.fill(container, fluidAmount, false);
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), true);
|
||||
((IFluidHandler) tile).drain(movingobjectposition.field_178784_b, this.getCapacity(container), true);
|
||||
|
||||
this.fill(container, fluidAmount, true);
|
||||
}
|
||||
|
|
|
@ -3,35 +3,24 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgrade, ISigil
|
||||
public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilHarvest()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(500);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +30,7 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -53,47 +42,6 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_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)
|
||||
{
|
||||
|
@ -108,9 +56,9 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
|
@ -119,7 +67,7 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
tag.setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -145,7 +93,7 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
int range = 3;
|
||||
int verticalRange = 1;
|
||||
|
@ -159,18 +107,18 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
HarvestRegistry.harvestBlock(par2World, ix, iy, iz);
|
||||
HarvestRegistry.harvestBlock(par2World, new BlockPos(ix, iy, iz));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +143,7 @@ public class SigilHarvest extends BindableItems implements IHolding, ArmourUpgra
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
HarvestRegistry.harvestBlock(world, ix, iy, iz);
|
||||
HarvestRegistry.harvestBlock(world, new BlockPos(ix, iy, iz));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -14,18 +13,16 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.Orb;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
||||
{
|
||||
|
@ -38,16 +35,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
public SigilLava()
|
||||
{
|
||||
super(Blocks.lava);
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,27 +68,27 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
if (!world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000);
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false);
|
||||
int amount = ((IFluidHandler) tile).fill(side, fluid, false);
|
||||
|
||||
if (amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true);
|
||||
((IFluidHandler) tile).fill(side, fluid, true);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -111,74 +99,79 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
{
|
||||
if (side == 0)
|
||||
int x = blockPos.getX();
|
||||
int y = blockPos.getY();
|
||||
int z = blockPos.getZ();
|
||||
|
||||
if (side.getIndex() == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
if (side.getIndex() == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
if (side.getIndex() == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
if (side.getIndex() == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
if (side.getIndex() == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
if (side.getIndex() == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
if (!player.func_175151_a(new BlockPos(x, y, z), side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if(this.canPlaceContainedLiquid(world, new BlockPos(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z);
|
||||
return this.func_180616_a(world, new BlockPos(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Attempts to place the liquid contained inside the bucket.
|
||||
*/
|
||||
public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean func_180616_a(World par1World, BlockPos blockPos)
|
||||
{
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid())
|
||||
if (!par1World.isAirBlock(blockPos) && par1World.getBlockState(blockPos).getBlock().getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0)
|
||||
} else if ((par1World.getBlockState(blockPos).getBlock() == Blocks.lava || par1World.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && par1World.getBlockState(blockPos).getBlock().getMetaFromState(par1World.getBlockState(blockPos)) == 0)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
par1World.setBlock(par8, par9, par10, this.isFull, 0, 3);
|
||||
par1World.setBlockState(blockPos, this.isFull.getBlockState().getBaseState());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean canPlaceContainedLiquid(World par1World, BlockPos blockPos)
|
||||
{
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid())
|
||||
if (!par1World.isAirBlock(blockPos) && par1World.getBlockState(blockPos).getBlock().getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0)
|
||||
} else if ((par1World.getBlockState(blockPos).getBlock() == Blocks.lava || par1World.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && par1World.getBlockState(blockPos).getBlock().getMetaFromState(par1World.getBlockState(blockPos)) == 0)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
|
@ -232,7 +225,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true));
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true, false));
|
||||
player.extinguish();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,36 +1,24 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfElementalAffinity extends BindableItems implements ISigil
|
||||
public class SigilOfElementalAffinity extends SigilToggleable implements ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfElementalAffinity()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(200);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +29,7 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -53,47 +41,6 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfTheFastMiner");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_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)
|
||||
{
|
||||
|
@ -108,14 +55,14 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
|
|||
}
|
||||
|
||||
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) % 200);
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false));
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -139,20 +86,20 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3EntityPlayer.fallDistance = 0;
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,34 +5,23 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfEnderSeverance extends BindableItems implements IHolding, ISigil
|
||||
public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfEnderSeverance()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(200);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +31,7 @@ public class SigilOfEnderSeverance extends BindableItems implements IHolding, IS
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -54,47 +43,6 @@ public class SigilOfEnderSeverance extends BindableItems implements IHolding, IS
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_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)
|
||||
{
|
||||
|
@ -109,9 +57,9 @@ public class SigilOfEnderSeverance extends BindableItems implements IHolding, IS
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
|
@ -120,7 +68,7 @@ public class SigilOfEnderSeverance extends BindableItems implements IHolding, IS
|
|||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
tag.setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -146,7 +94,7 @@ public class SigilOfEnderSeverance extends BindableItems implements IHolding, IS
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
List<Entity> list = SpellHelper.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5);
|
||||
for (Entity entity : list)
|
||||
|
@ -157,17 +105,15 @@ public class SigilOfEnderSeverance extends BindableItems implements IHolding, IS
|
|||
}
|
||||
}
|
||||
}
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -1,43 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
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.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 100;
|
||||
|
||||
public SigilOfGrowth()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(150);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,7 +38,7 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -61,58 +51,17 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
if (BindableItems.checkAndSetItemOwner(stack, playerIn))
|
||||
{
|
||||
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 boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (BindableItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer))
|
||||
{
|
||||
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer))
|
||||
if (applyBonemeal(stack, worldIn, pos, playerIn))
|
||||
{
|
||||
BindableItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
|
||||
BindableItems.syphonBatteries(stack, playerIn, getEnergyUsed());
|
||||
|
||||
if (par3World.isRemote)
|
||||
if (worldIn.isRemote)
|
||||
{
|
||||
par3World.playAuxSFX(2005, par4, par5, par6, 0);
|
||||
worldIn.playAuxSFX(2005, pos, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -168,13 +117,13 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
int range = 3;
|
||||
|
@ -189,14 +138,13 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
Block block = par2World.getBlock(ix, iy, iz);
|
||||
|
||||
IBlockState block = par2World.getBlockState(new BlockPos(ix, iy, iz));
|
||||
|
||||
if (block instanceof IPlantable || block instanceof IGrowable)
|
||||
{
|
||||
if (par2World.rand.nextInt(50) == 0)
|
||||
{
|
||||
block.updateTick(par2World, ix, iy, iz, par2World.rand);
|
||||
block.getBlock().updateTick(par2World, new BlockPos(ix, iy, iz), block, par2World.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -205,17 +153,17 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player)
|
||||
public static boolean applyBonemeal(ItemStack p_179234_0_, World world, BlockPos blockPos, EntityPlayer player)
|
||||
{
|
||||
Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_);
|
||||
IBlockState block = world.getBlockState(blockPos);
|
||||
|
||||
BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_);
|
||||
BonemealEvent event = new BonemealEvent(player, world, blockPos, block);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getResult() == Result.ALLOW)
|
||||
if (event.getResult() == Event.Result.ALLOW)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -224,16 +172,14 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
{
|
||||
IGrowable igrowable = (IGrowable) block;
|
||||
|
||||
if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote))
|
||||
if (igrowable.isStillGrowing(world, blockPos, block, world.isRemote))
|
||||
{
|
||||
if (!p_150919_1_.isRemote)
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_))
|
||||
if (igrowable.canUseBonemeal(world, world.rand, blockPos, block))
|
||||
{
|
||||
igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
|
||||
igrowable.grow(world, world.rand, blockPos, block);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -263,13 +209,13 @@ public class SigilOfGrowth extends BindableItems implements ArmourUpgrade, ISigi
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
Block block = world.getBlock(ix, iy, iz);
|
||||
IBlockState block = world.getBlockState(new BlockPos(ix, iy, iz));
|
||||
|
||||
if (block instanceof IPlantable)
|
||||
{
|
||||
if (world.rand.nextInt(100) == 0)
|
||||
{
|
||||
block.updateTick(world, ix, iy, iz, world.rand);
|
||||
block.getBlock().updateTick(world, new BlockPos(ix, iy, iz), block, world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,33 +4,22 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfHaste extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfHaste()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(250);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,7 +29,7 @@ public class SigilOfHaste extends BindableItems implements ArmourUpgrade, ISigil
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -52,47 +41,6 @@ public class SigilOfHaste extends BindableItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_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)
|
||||
{
|
||||
|
@ -107,9 +55,9 @@ public class SigilOfHaste extends BindableItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
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) % 200);
|
||||
|
@ -137,18 +85,18 @@ public class SigilOfHaste extends BindableItems implements ArmourUpgrade, ISigil
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true, false));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -162,7 +110,7 @@ public class SigilOfHaste extends BindableItems implements ArmourUpgrade, ISigil
|
|||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true));
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
|
@ -11,30 +10,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilOfMagnetism extends BindableItems implements ArmourUpgrade, IHolding, ISigil
|
||||
public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, IHolding, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 300;
|
||||
|
||||
public SigilOfMagnetism()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(50);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,7 +33,7 @@ public class SigilOfMagnetism extends BindableItems implements ArmourUpgrade, IH
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -56,47 +45,6 @@ public class SigilOfMagnetism extends BindableItems implements ArmourUpgrade, IH
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_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)
|
||||
{
|
||||
|
@ -111,9 +59,9 @@ public class SigilOfMagnetism extends BindableItems implements ArmourUpgrade, IH
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -140,13 +88,13 @@ public class SigilOfMagnetism extends BindableItems implements ArmourUpgrade, IH
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,42 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer;
|
||||
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.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfSupression extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int radius = 5;
|
||||
private int refresh = 100;
|
||||
|
||||
public SigilOfSupression()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(400);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +36,7 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -58,47 +48,6 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_deactivated");
|
||||
activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_activated");
|
||||
passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_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 activeIcon;
|
||||
} else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (par1 == 1)
|
||||
{
|
||||
return activeIcon;
|
||||
} else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -120,9 +69,9 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
|
@ -131,7 +80,7 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
tag.setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -162,9 +111,9 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive") && (!par2World.isRemote))
|
||||
if (this.getActivated(par1ItemStack) && (!par2World.isRemote))
|
||||
{
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
Vec3 blockVec = new Vec3((int) Math.round(par3EntityPlayer.posX - 0.5F), par3EntityPlayer.posY, (int) Math.round(par3EntityPlayer.posZ - 0.5F));
|
||||
int x = (int) blockVec.xCoord;
|
||||
int y = (int) blockVec.yCoord;
|
||||
int z = (int) blockVec.zCoord;
|
||||
|
@ -180,18 +129,19 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
continue;
|
||||
}
|
||||
|
||||
Block block = par2World.getBlock(x + i, y + j, z + k);
|
||||
BlockPos blockPos = new BlockPos(x + i, y + j, z + k);
|
||||
IBlockState block = par2World.getBlockState(blockPos);
|
||||
|
||||
if (SpellHelper.isBlockFluid(block))
|
||||
if (SpellHelper.isBlockFluid(block.getBlock()))
|
||||
{
|
||||
if (par2World.getTileEntity(x + i, y + j, z + k) != null)
|
||||
if (par2World.getTileEntity(blockPos) != null)
|
||||
{
|
||||
par2World.setBlockToAir(x + i, y + j, z + k);
|
||||
par2World.setBlockToAir(blockPos);
|
||||
}
|
||||
TESpectralContainer.createSpectralBlockAtLocation(par2World, x + i, y + j, z + k, refresh);
|
||||
TESpectralContainer.createSpectralBlockAtLocation(par2World, blockPos, refresh);
|
||||
} else
|
||||
{
|
||||
TileEntity tile = par2World.getTileEntity(x + i, y + j, z + k);
|
||||
TileEntity tile = par2World.getTileEntity(blockPos);
|
||||
if (tile instanceof TESpectralContainer)
|
||||
{
|
||||
((TESpectralContainer) tile).resetDuration(refresh);
|
||||
|
@ -202,13 +152,13 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
}
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +167,7 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
|
||||
Vec3 blockVec = new Vec3((int) Math.round(player.posX - 0.5F), player.posY, (int) Math.round(player.posZ - 0.5F));
|
||||
int x = (int) blockVec.xCoord;
|
||||
int y = (int) blockVec.yCoord;
|
||||
int z = (int) blockVec.zCoord;
|
||||
|
@ -233,19 +183,19 @@ public class SigilOfSupression extends BindableItems implements ArmourUpgrade, I
|
|||
continue;
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x + i, y + j, z + k);
|
||||
BlockPos blockPos = new BlockPos(x + i, y + j, z + k);
|
||||
IBlockState block = world.getBlockState(blockPos);
|
||||
|
||||
|
||||
if (SpellHelper.isBlockFluid(block))
|
||||
if (SpellHelper.isBlockFluid(block.getBlock()))
|
||||
{
|
||||
if (world.getTileEntity(x + i, y + j, z + k) != null)
|
||||
if (world.getTileEntity(blockPos) != null)
|
||||
{
|
||||
world.setBlockToAir(x + i, y + j, z + k);
|
||||
world.setBlockToAir(blockPos);
|
||||
}
|
||||
TESpectralContainer.createSpectralBlockAtLocation(world, x + i, y + j, z + k, refresh);
|
||||
TESpectralContainer.createSpectralBlockAtLocation(world, blockPos, refresh);
|
||||
} else
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x + i, y + j, z + k);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TESpectralContainer)
|
||||
{
|
||||
((TESpectralContainer) tile).resetDuration(refresh);
|
||||
|
|
|
@ -3,20 +3,15 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
|
@ -25,17 +20,13 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
|||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
public SigilOfTheAssassin()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,13 +38,6 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
|
@ -74,6 +58,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
|
@ -83,8 +68,6 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float f = 10.0F;
|
||||
|
||||
|
@ -108,7 +91,6 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
if(hitEntity instanceof EntityLivingBase)
|
||||
{
|
||||
AlchemicalWizardry.logger.info("It's a living entity!");
|
||||
|
||||
|
||||
teleportTo(par3EntityPlayer, x, y, z, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ);
|
||||
}
|
||||
|
@ -135,17 +117,18 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
int i = MathHelper.floor_double(entityLiving.posX);
|
||||
int j = MathHelper.floor_double(entityLiving.posY);
|
||||
int k = MathHelper.floor_double(entityLiving.posZ);
|
||||
Block l;
|
||||
BlockPos blockPos = new BlockPos(i, j, k);
|
||||
IBlockState l;
|
||||
|
||||
if (entityLiving.worldObj.blockExists(i, j, k))
|
||||
if (!entityLiving.worldObj.isAirBlock(blockPos))
|
||||
{
|
||||
boolean flag1 = false;
|
||||
|
||||
while (!flag1 && j > 0)
|
||||
{
|
||||
l = entityLiving.worldObj.getBlock(i, j - 1, k);
|
||||
l = entityLiving.worldObj.getBlockState(blockPos);
|
||||
|
||||
if (l != null && l.getMaterial().blocksMovement())
|
||||
if (l != null && l.getBlock().getMaterial().blocksMovement())
|
||||
{
|
||||
flag1 = true;
|
||||
} else
|
||||
|
@ -159,7 +142,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
{
|
||||
SpellTeleport.moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ);
|
||||
|
||||
if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox))
|
||||
if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.getBoundingBox()).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.getBoundingBox()))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
@ -183,7 +166,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height;
|
||||
double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2);
|
||||
entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, (double) f, (double) f1, (double) f2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -197,7 +180,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)f;
|
||||
double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)f + (double)(p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences
|
||||
double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)f;
|
||||
Vec3 vec3 = SpellHelper.createVec3(d0, d1, d2);
|
||||
Vec3 vec3 = new Vec3(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
|
@ -205,12 +188,12 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = 500.0D;
|
||||
if (p_77621_2_ instanceof EntityPlayerMP)
|
||||
// if (p_77621_2_ instanceof EntityPlayerMP)
|
||||
{
|
||||
// d3 = ((EntityPlayerMP)p_77621_2_).theItemInWorldManager.getBlockReachDistance();
|
||||
}
|
||||
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
|
||||
return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false);
|
||||
return p_77621_1_.rayTraceBlocks(vec3, vec31, p_77621_3_, !p_77621_3_, false);
|
||||
}
|
||||
|
||||
// public MovingObjectPosition movingObjectPositiongdsa(WOrld worldObj, int posX, int posY, int posZ)
|
||||
|
@ -269,7 +252,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true));
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,37 +1,25 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfTheFastMiner extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfTheFastMiner extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfTheFastMiner()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +29,7 @@ public class SigilOfTheFastMiner extends BindableItems implements ArmourUpgrade,
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -53,47 +41,6 @@ public class SigilOfTheFastMiner extends BindableItems implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_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)
|
||||
{
|
||||
|
@ -108,13 +55,13 @@ public class SigilOfTheFastMiner extends BindableItems implements ArmourUpgrade,
|
|||
}
|
||||
|
||||
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) % 200);
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1));
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -138,18 +85,18 @@ public class SigilOfTheFastMiner extends BindableItems implements ArmourUpgrade,
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true, false));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +110,7 @@ public class SigilOfTheFastMiner extends BindableItems implements ArmourUpgrade,
|
|||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 3, 1, true));
|
||||
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 3, 1, true, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,9 +19,7 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi
|
|||
public SigilOfWind()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(250);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,9 +85,9 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1, true, false));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
|
@ -112,7 +110,7 @@ public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigi
|
|||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 3, 1));
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 3, 1, true, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -22,15 +18,7 @@ public class SigilSeer extends Item implements IHolding, ArmourUpgrade, ISigil
|
|||
public SigilSeer()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SeerSigil");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,10 +51,7 @@ public class SigilSeer extends Item implements IHolding, ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
|
|
|
@ -3,42 +3,28 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil
|
||||
{
|
||||
private int isFull;
|
||||
private int energyUsed;
|
||||
|
||||
public SigilVoid()
|
||||
{
|
||||
super(null);
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(50);
|
||||
isFull = 0;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:VoidSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,72 +63,74 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float f = 1.0F;
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
if (!world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack amount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, false);
|
||||
FluidStack amount = ((IFluidHandler) tile).drain(side, 1000, false);
|
||||
|
||||
if (amount != null && amount.amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(side), 1000, true);
|
||||
((IFluidHandler) tile).drain(side, 1000, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (side == 0)
|
||||
int x = blockPos.getX();
|
||||
int y = blockPos.getY();
|
||||
int z = blockPos.getZ();
|
||||
|
||||
if (side.getIndex() == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
if (side.getIndex() == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
if (side.getIndex() == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
if (side.getIndex() == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
if (side.getIndex() == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
if (side.getIndex() == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
if (!player.func_175151_a(new BlockPos(x, y, z), side, stack)) //was canPlayerEdit
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SpellHelper.isBlockFluid(world.getBlock(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if (SpellHelper.isBlockFluid(world.getBlockState(new BlockPos(x, y, z)).getBlock()) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.setBlockToAir(new BlockPos(x, y, z));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -150,18 +138,17 @@ public class SigilVoid extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Attempts to place the liquid contained inside the bucket.
|
||||
*/
|
||||
public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean func_180616_a(World world, BlockPos blockPos) //was tryPlaceContainedLiquid
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
|
@ -14,17 +14,16 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
||||
{
|
||||
|
@ -34,9 +33,7 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
public SigilWater()
|
||||
{
|
||||
super(Blocks.water);
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,13 +45,6 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
|
@ -72,6 +62,7 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
|
@ -81,27 +72,27 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
if (!world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluid = new FluidStack(FluidRegistry.WATER, 1000);
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false);
|
||||
int amount = ((IFluidHandler) tile).fill(side, fluid, false);
|
||||
|
||||
if (amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true);
|
||||
((IFluidHandler) tile).fill(side, fluid, true);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -111,48 +102,50 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
return false;
|
||||
}
|
||||
|
||||
int x = blockPos.getX();
|
||||
int y = blockPos.getY();
|
||||
int z = blockPos.getZ();
|
||||
{
|
||||
if (side == 0)
|
||||
if (side.getIndex() == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
if (side.getIndex() == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
if (side.getIndex() == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
if (side.getIndex() == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
if (side.getIndex() == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
if (side.getIndex() == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
if (!player.func_175151_a(new BlockPos(x, y, z), side, stack)) // was canPlayerEdit
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if(this.canPlaceContainedLiquid(world, new BlockPos(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z);
|
||||
return this.func_180616_a(world, new BlockPos(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
|
@ -161,40 +154,56 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
/**
|
||||
* Attempts to place the liquid contained inside the bucket.
|
||||
*/
|
||||
public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean func_180616_a(World world, BlockPos blockPos) //was tryPlaceContainedLiquid
|
||||
{
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid())
|
||||
if (this.isFull == Blocks.air)
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlock(par8, par9, par10) == Blocks.water || par1World.getBlock(par8, par9, par10) == Blocks.flowing_water) && par1World.getBlockMetadata(par8, par9, par10) == 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
if (par1World.provider.isHellWorld)
|
||||
{
|
||||
par1World.playSoundEffect(par2 + 0.5D, par4 + 0.5D, par6 + 0.5D, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
|
||||
Material material = world.getBlockState(blockPos).getBlock().getMaterial();
|
||||
boolean flag = !material.isSolid();
|
||||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
par1World.spawnParticle("largesmoke", (double) par8 + Math.random(), (double) par9 + Math.random(), (double) par10 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
} else
|
||||
if (!world.isAirBlock(blockPos) && !flag)
|
||||
{
|
||||
par1World.setBlock(par8, par9, par10, this.isFull, 0, 3);
|
||||
par1World.markBlockForUpdate(par8, par9, par10);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (world.provider.func_177500_n() && this.isFull == Blocks.flowing_water)
|
||||
{
|
||||
int i = blockPos.getX();
|
||||
int j = blockPos.getY();
|
||||
int k = blockPos.getZ();
|
||||
world.playSoundEffect((double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
|
||||
return true;
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random(), 0.0D, 0.0D, 0.0D, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!world.isRemote && flag && !material.isLiquid())
|
||||
{
|
||||
world.destroyBlock(blockPos, true);
|
||||
}
|
||||
|
||||
world.setBlockState(blockPos, this.isFull.getDefaultState(), 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
public boolean canPlaceContainedLiquid(World world, BlockPos blockPos)
|
||||
{
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid())
|
||||
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlock(par8, par9, par10) == Blocks.water || par1World.getBlock(par8, par9, par10) == Blocks.flowing_water) && par1World.getBlockMetadata(par8, par9, par10) == 0)
|
||||
} else if ((world.getBlockState(blockPos).getBlock() == Blocks.water || world.getBlockState(blockPos).getBlock() == Blocks.flowing_water) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
|
@ -216,7 +225,7 @@ public class SigilWater extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true));
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,15 +17,14 @@ import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
|||
|
||||
public class SigilOfHolding extends BindableItems
|
||||
{
|
||||
private static int invSize = 4;
|
||||
private static int invSize = 5;
|
||||
|
||||
private static final String NBT_CURRENT_SIGIL = "CurrentSigil";
|
||||
|
||||
public SigilOfHolding()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +50,7 @@ public class SigilOfHolding extends BindableItems
|
|||
par3List.add(StatCollector.translateToLocal("tooltip.item.currentitem") + " " + item.getDisplayName());
|
||||
}
|
||||
|
||||
for (int i = 0; i <= invSize; i++)
|
||||
for (int i = 0; i < invSize; i++)
|
||||
{
|
||||
if (inv[i] != null)
|
||||
{
|
||||
|
@ -208,7 +207,7 @@ public class SigilOfHolding extends BindableItems
|
|||
NBTTagCompound tag = tagList.getCompoundTagAt(i);
|
||||
int slot = tag.getByte("Slot");
|
||||
|
||||
if (slot >= 0 && slot <= invSize)
|
||||
if (slot >= 0 && slot < invSize)
|
||||
{
|
||||
inv[slot] = ItemStack.loadItemStackFromNBT(tag);
|
||||
}
|
||||
|
@ -228,7 +227,7 @@ public class SigilOfHolding extends BindableItems
|
|||
|
||||
NBTTagList itemList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i <= invSize; i++)
|
||||
for (int i = 0; i < invSize; i++)
|
||||
{
|
||||
if (inventory[i] != null)
|
||||
{
|
||||
|
@ -269,7 +268,7 @@ public class SigilOfHolding extends BindableItems
|
|||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i <= invSize; i++)
|
||||
for (int i = 0; i < invSize; i++)
|
||||
{
|
||||
if (inv[i] == null)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
|||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar;
|
||||
|
||||
public class TEBellJarItemRenderer implements IItemRenderer
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ public class TEBellJarItemRenderer implements IItemRenderer
|
|||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item);
|
||||
ReagentContainerInfo[] info = TEBelljar.getContainerInfoFromItem(item);
|
||||
if (info.length >= 1 && info[0] != null)
|
||||
{
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
|
|
|
@ -14,9 +14,9 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer;
|
|||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
|
||||
public class TEBellJar extends TEReagentConduit
|
||||
public class TEBelljar extends TEReagentConduit
|
||||
{
|
||||
public TEBellJar()
|
||||
public TEBelljar()
|
||||
{
|
||||
super(1, 16000);
|
||||
this.maxConnextions = 1;
|
||||
|
|
Loading…
Reference in a new issue