Initial commit of BM 1.8
This commit is contained in:
parent
d99eadbea7
commit
c5681dc831
713 changed files with 6502 additions and 27334 deletions
|
@ -117,7 +117,7 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
|
@ -128,11 +128,6 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.disableBoundToolsRightClick)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return par1ItemStack;
|
||||
|
|
|
@ -131,11 +131,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.disableBoundToolsRightClick)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return par1ItemStack;
|
||||
|
|
|
@ -132,11 +132,6 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.disableBoundToolsRightClick)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return par1ItemStack;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class CheatyItem extends Item implements IBindable
|
|||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.worldObj.isRemote)
|
||||
|
|
|
@ -95,7 +95,7 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 1, posX, posY, posZ);
|
||||
}
|
||||
|
||||
par2EntityLivingBase.setHealth(-1);
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -20,11 +22,8 @@ import net.minecraft.util.MathHelper;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DemonPlacer extends Item
|
||||
{
|
||||
|
@ -75,8 +74,6 @@ public class DemonPlacer extends Item
|
|||
((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
--par1ItemStack.stackSize;
|
||||
|
@ -165,16 +162,12 @@ public class DemonPlacer extends Item
|
|||
entityliving.renderYawOffset = entityliving.rotationYaw;
|
||||
if (entityliving instanceof EntityDemon)
|
||||
{
|
||||
Entity owner = SpellHelper.getPlayerForUsername(DemonPlacer.getOwnerName(itemStack));
|
||||
if(owner != null)
|
||||
{
|
||||
((EntityDemon) entityliving).func_152115_b(owner.getPersistentID().toString());
|
||||
((EntityDemon) entityliving).func_152115_b(DemonPlacer.getOwnerName(itemStack));
|
||||
|
||||
if (!DemonPlacer.getOwnerName(itemStack).equals(""))
|
||||
{
|
||||
((EntityDemon) entityliving).setTamed(true);
|
||||
}
|
||||
}
|
||||
if (!DemonPlacer.getOwnerName(itemStack).equals(""))
|
||||
{
|
||||
((EntityDemon) entityliving).setTamed(true);
|
||||
}
|
||||
}
|
||||
|
||||
par0World.spawnEntityInWorld(entity);
|
||||
|
|
|
@ -66,7 +66,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
|
|||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
}
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class EnergyItems extends Item implements IBindable
|
|||
double posY = player.posY;
|
||||
double posZ = player.posZ;
|
||||
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,6 @@ public class EnergySword extends ItemSword
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ItemDiabloKey extends EnergyItems
|
|||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.worldObj.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class)))
|
||||
|
|
|
@ -9,7 +9,6 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -50,41 +49,52 @@ public class ItemRitualDismantler extends EnergyItems
|
|||
|
||||
public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
ItemStack[] playerInventory = player.inventory.mainInventory;
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
TEMasterStone masterStone = (TEMasterStone) tileEntity;
|
||||
int direction = masterStone.getDirection();
|
||||
int freeSpace = -1;
|
||||
|
||||
String ritualName = Rituals.checkValidRitual(world, x, y, z);
|
||||
List<RitualComponent> ritualList = Rituals.getRitualList(ritualName);
|
||||
List<RitualComponent> ritualList = Rituals.getRitualList(masterStone.getCurrentRitual());
|
||||
if (ritualList == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < playerInventory.length; i++)
|
||||
{
|
||||
if (playerInventory[i] == null)
|
||||
{
|
||||
freeSpace = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (RitualComponent rc : ritualList)
|
||||
{
|
||||
if (!world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) && world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) instanceof RitualStone)
|
||||
{
|
||||
if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode)
|
||||
if (freeSpace >= 0)
|
||||
{
|
||||
world.setBlockToAir(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(ModBlocks.ritualStone));
|
||||
if (world.isRemote)
|
||||
if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode)
|
||||
{
|
||||
world.playAuxSFX(2005, x, y + 1, z, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
world.setBlockToAir(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.ritualStone));
|
||||
if (world.isRemote)
|
||||
{
|
||||
world.playAuxSFX(2005, x, y + 1, z, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TelepositionFocus extends EnergyItems
|
||||
{
|
||||
|
@ -111,6 +112,11 @@ public class TelepositionFocus extends EnergyItems
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockPos getBlockPos(ItemStack stack)
|
||||
{
|
||||
return new BlockPos(xCoord(stack), yCoord(stack), zCoord(stack));
|
||||
}
|
||||
|
||||
public int getFocusLevel()
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -57,12 +58,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
setMaxDamage(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemTool(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ModelBiped model1 = null;
|
||||
ModelBiped model2 = null;
|
||||
|
|
|
@ -102,7 +102,7 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
|
||||
if(this.storeDimensionID())
|
||||
{
|
||||
this.setDimensionIDStored(itemStack, world.provider.dimensionId);
|
||||
this.setDimensionIDStored(itemStack, world.provider.getDimensionId());
|
||||
}
|
||||
|
||||
if(this.storeYLevel())
|
||||
|
|
|
@ -223,7 +223,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
return itemStack;
|
||||
}
|
||||
|
||||
if (dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance)
|
||||
if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance)
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
||||
return itemStack;
|
||||
|
@ -261,7 +261,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
} else
|
||||
{
|
||||
int dimension = world.provider.dimensionId;
|
||||
int dimension = world.provider.getDimensionId();
|
||||
|
||||
this.setDimension(itemStack, dimension);
|
||||
this.setCoordinates(itemStack, new Int3(x, y, z));
|
||||
|
|
|
@ -155,8 +155,8 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||
float posX = Math.round(par3Entity.posX);
|
||||
float posY = (float) (par3Entity.posY - par3Entity.getEyeHeight());
|
||||
float posZ = Math.round(par3Entity.posZ);
|
||||
List<EntityItem> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityItem> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
|
||||
for (EntityItem entity : entities)
|
||||
{
|
||||
|
@ -184,8 +184,8 @@ public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHol
|
|||
float posX = Math.round(player.posX);
|
||||
float posY = (float) (player.posY - player.getEyeHeight());
|
||||
float posZ = Math.round(player.posZ);
|
||||
List<EntityItem> entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityItem> entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
|
||||
for (EntityItem entity : entities)
|
||||
{
|
||||
|
|
|
@ -252,7 +252,7 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISig
|
|||
}
|
||||
|
||||
int range = 2;
|
||||
int verticalOffset = -2;
|
||||
int verticalOffset = -1;
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.inventory.IInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -136,13 +137,13 @@ public class InventoryHolding implements IInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
public String getName()
|
||||
{
|
||||
return "SigilOfHolding";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -166,13 +167,13 @@ public class InventoryHolding implements IInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory(EntityPlayer player)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
public void closeInventory(EntityPlayer player)
|
||||
{
|
||||
// NOOP
|
||||
}
|
||||
|
@ -224,7 +225,7 @@ public class InventoryHolding implements IInventory
|
|||
|
||||
public static boolean hasTag(ItemStack itemStack, String keyName)
|
||||
{
|
||||
return itemStack != null && itemStack.stackTagCompound != null && itemStack.stackTagCompound.hasKey(keyName);
|
||||
return itemStack != null && itemStack.getTagCompound() != null && itemStack.getTagCompound().hasKey(keyName);
|
||||
}
|
||||
|
||||
public static boolean hasUUID(ItemStack itemStack)
|
||||
|
@ -246,7 +247,7 @@ public class InventoryHolding implements IInventory
|
|||
|
||||
private static void initNBTTagCompound(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack.stackTagCompound == null)
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
@ -256,6 +257,36 @@ public class InventoryHolding implements IInventory
|
|||
{
|
||||
initNBTTagCompound(itemStack);
|
||||
|
||||
itemStack.stackTagCompound.setLong(keyName, keyValue);
|
||||
itemStack.getTagCompound().setLong(keyName, keyValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField(int id) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil.holding;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ScrollHelper
|
||||
|
@ -16,7 +16,7 @@ public class ScrollHelper
|
|||
@SubscribeEvent
|
||||
public void onMouseEvent(MouseEvent event)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (event.dwheel != 0 && player != null && player.isSneaking())
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class SigilOfHolding extends EnergyItems
|
||||
{
|
||||
private static int invSize = 5;
|
||||
private static int invSize = 4;
|
||||
|
||||
private static final String NBT_CURRENT_SIGIL = "CurrentSigil";
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
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)
|
||||
{
|
||||
|
@ -156,41 +156,11 @@ public class SigilOfHolding extends EnergyItems
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (checkAndSetItemOwner(stack, player))
|
||||
{
|
||||
int currentSlot = getCurrentItem(stack);
|
||||
ItemStack[] inv = getInternalInventory(stack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemUsed = inv[currentSlot];
|
||||
|
||||
if (itemUsed == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean bool = itemUsed.getItem().onItemUseFirst(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
|
||||
saveInventory(stack, inv);
|
||||
|
||||
return bool;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int next(int mode)
|
||||
{
|
||||
int index = mode + 1;
|
||||
|
||||
if (index >= invSize)
|
||||
if (index >= invSize + 1)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
|
@ -212,10 +182,10 @@ public class SigilOfHolding extends EnergyItems
|
|||
|
||||
private static void initModeTag(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack.stackTagCompound == null)
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.stackTagCompound = new NBTTagCompound();
|
||||
itemStack.stackTagCompound.setInteger(NBT_CURRENT_SIGIL, invSize);
|
||||
itemStack.getTagCompound() = new NBTTagCompound();
|
||||
itemStack.getTagCompound().setInteger(NBT_CURRENT_SIGIL, invSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,7 +209,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
if (itemStack != null && itemStack.getItem() instanceof SigilOfHolding)
|
||||
{
|
||||
initModeTag(itemStack);
|
||||
int currentSigil = itemStack.stackTagCompound.getInteger(NBT_CURRENT_SIGIL);
|
||||
int currentSigil = itemStack.getTagCompound().getInteger(NBT_CURRENT_SIGIL);
|
||||
currentSigil = MathHelper.clamp_int(currentSigil, 0, invSize);
|
||||
return currentSigil;
|
||||
}
|
||||
|
@ -270,7 +240,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
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);
|
||||
}
|
||||
|
@ -290,7 +260,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
|
||||
NBTTagList itemList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < invSize; i++)
|
||||
for (int i = 0; i <= invSize; i++)
|
||||
{
|
||||
if (inventory[i] != null)
|
||||
{
|
||||
|
@ -309,7 +279,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
if (itemStack != null && itemStack.getItem() instanceof SigilOfHolding)
|
||||
{
|
||||
initModeTag(itemStack);
|
||||
itemStack.stackTagCompound.setInteger(NBT_CURRENT_SIGIL, mode);
|
||||
itemStack.getTagCompound().setInteger(NBT_CURRENT_SIGIL, mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,7 +301,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < invSize; i++)
|
||||
for (int i = 0; i <= invSize; i++)
|
||||
{
|
||||
if (inv[i] == null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue