2015-12-28 00:38:12 +00:00
|
|
|
package WayofTime.bloodmagic.item.sigil;
|
|
|
|
|
2016-03-17 20:00:44 +00:00
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.api.compress.CompressionRegistry;
|
2015-12-29 00:09:51 +00:00
|
|
|
import net.minecraft.entity.item.EntityItem;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2016-03-23 01:10:05 +00:00
|
|
|
public class ItemSigilCompression extends ItemSigilToggleableBase
|
2015-12-30 20:34:40 +00:00
|
|
|
{
|
|
|
|
public ItemSigilCompression()
|
|
|
|
{
|
2015-12-29 00:09:51 +00:00
|
|
|
super("compression", 200);
|
2016-01-19 06:34:12 +00:00
|
|
|
setRegistryName(Constants.BloodMagicItem.SIGIL_COMPRESSION.getRegName());
|
2015-12-29 00:09:51 +00:00
|
|
|
}
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
// TODO REWRITE all compression stuff if someone has time
|
|
|
|
// TODO for now, there is a semi-working system in place
|
2015-12-29 00:09:51 +00:00
|
|
|
|
|
|
|
@Override
|
2015-12-30 20:34:40 +00:00
|
|
|
public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected)
|
|
|
|
{
|
2015-12-29 00:09:51 +00:00
|
|
|
ItemStack compressedStack = CompressionRegistry.compressInventory(player.inventory.mainInventory, world);
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
if (compressedStack != null)
|
|
|
|
{
|
2015-12-29 00:09:51 +00:00
|
|
|
EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, compressedStack);
|
|
|
|
world.spawnEntityInWorld(entityItem);
|
|
|
|
}
|
|
|
|
}
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|