Skip to content

Commit

Permalink
Fix #5834: chargeable items bobbing up and down while being used
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Dec 20, 2021
1 parent d8f83e6 commit 62c907d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
10 changes: 0 additions & 10 deletions src/main/java/appeng/hooks/ICustomReequipAnimation.java

This file was deleted.

3 changes: 2 additions & 1 deletion src/main/java/appeng/items/AEBaseItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

import javax.annotation.Nullable;

import net.fabricmc.fabric.api.item.v1.FabricItem;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;

public abstract class AEBaseItem extends Item {
public abstract class AEBaseItem extends Item implements FabricItem {

public AEBaseItem(Item.Properties properties) {
super(properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import appeng.api.storage.StorageHelper;
import appeng.api.storage.cells.IBasicCellItem;
import appeng.core.AEConfig;
import appeng.hooks.ICustomReequipAnimation;
import appeng.items.contents.CellConfig;
import appeng.items.contents.CellUpgrades;
import appeng.items.contents.PortableCellMenuHost;
Expand All @@ -53,7 +52,7 @@
import appeng.util.ConfigInventory;

public class PortableCellItem extends AEBasePoweredItem
implements IBasicCellItem, IMenuItem, ICustomReequipAnimation {
implements IBasicCellItem, IMenuItem {

public static final StorageTier SIZE_1K = new StorageTier(512, 54, 8);
public static final StorageTier SIZE_4K = new StorageTier(2048, 45, 32);
Expand Down Expand Up @@ -164,8 +163,9 @@ public PortableCellMenuHost getMenuHost(Player player, int inventorySlot, ItemSt
}

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
return slotChanged;
public boolean allowNbtUpdateAnimation(Player player, InteractionHand hand, ItemStack oldStack,
ItemStack newStack) {
return false;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@
import appeng.core.localization.GuiText;
import appeng.core.localization.PlayerMessages;
import appeng.helpers.WirelessTerminalMenuHost;
import appeng.hooks.ICustomReequipAnimation;
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
import appeng.menu.MenuLocator;
import appeng.menu.MenuOpener;
import appeng.menu.me.common.MEStorageMenu;
import appeng.util.ConfigManager;

public class WirelessTerminalItem extends AEBasePoweredItem implements ICustomReequipAnimation, IMenuItem {
public class WirelessTerminalItem extends AEBasePoweredItem implements IMenuItem {

public static final IGridLinkableHandler LINKABLE_HANDLER = new LinkableHandler();

Expand Down Expand Up @@ -138,8 +137,9 @@ public MenuType<?> getMenuType() {
}

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
return slotChanged;
public boolean allowNbtUpdateAnimation(Player player, InteractionHand hand, ItemStack oldStack,
ItemStack newStack) {
return false;
}

@Nullable
Expand Down

0 comments on commit 62c907d

Please sign in to comment.