Initial commit of BM 1.8
This commit is contained in:
parent
d99eadbea7
commit
c5681dc831
713 changed files with 6502 additions and 27334 deletions
|
@ -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