mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Fix lexicon share crashing if you don't have the lexicon in main hand
This commit is contained in:
1 parent
6666cf1e23
commit
346581e23d
1 file changed
+7
-3
@@ -192,12 +192,16 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int idk, boolean something) {
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
||||
int ticks = getQueueTicks(stack);
|
||||
if(ticks > 0 && entity instanceof EntityPlayer) {
|
||||
skipSound = ticks < 5;
|
||||
if(ticks == 1)
|
||||
onItemRightClick(world, (EntityPlayer) entity, EnumHand.MAIN_HAND);
|
||||
if(ticks == 1) {
|
||||
if(selected)
|
||||
onItemRightClick(world, (EntityPlayer) entity, EnumHand.MAIN_HAND);
|
||||
else if(stack == ((EntityPlayer) entity).getHeldItemOffhand())
|
||||
onItemRightClick(world, (EntityPlayer) entity, EnumHand.OFF_HAND);
|
||||
}
|
||||
|
||||
setQueueTicks(stack, ticks - 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user