disable ItemPanel Animation

This commit is contained in:
くぁーりぃ committed 2022-09-13 23:13:38 +09:00
1 parent 03709d8efa
commit b8b2b1f4f5
2 files changed
+20 -17

No files matched your search

@@ -14,13 +14,13 @@ public class AnimatedItemStack {
private int lastPosX = -1;
private int lastPosY = -1;
private float currentScale = 0;
private boolean doPopAnim;
private boolean doAnim;
public ItemStack itemStack;
public AnimatedItemStack(ItemStack itemStack, boolean doPopAnim) {
public AnimatedItemStack(ItemStack itemStack, boolean doAnim) {
this.itemStack = itemStack;
this.doPopAnim = doPopAnim;
this.doAnim = doAnim;
}
public void drawItem(int x, int y) {
@@ -28,13 +28,16 @@ public class AnimatedItemStack {
}
public void drawItem(int x, int y, boolean smallAmount, String stackSize) {
if (doPopAnim && currentScale < 1) {
drawPoppingItem(x, y, smallAmount, stackSize);
} else if (lastPosX != x || lastPosY != y) {
drawMovingItem(x, y, smallAmount, stackSize);
} else {
GuiContainerManager.drawItem(x, y, itemStack, smallAmount, stackSize);
if (doAnim) {
if (currentScale < 1) {
drawPoppingItem(x, y, smallAmount, stackSize);
return;
} else if (lastPosX != x || lastPosY != y) {
drawMovingItem(x, y, smallAmount, stackSize);
return;
}
}
GuiContainerManager.drawItem(x, y, itemStack, smallAmount, stackSize);
}
private void drawPoppingItem(int x, int y, boolean smallAmount, String stackSize) {
+8 -8
View File
@@ -58,20 +58,20 @@ public class ItemsGrid {
return realItems.get(idx).itemStack;
}
protected void addRealItems(Collection<ItemStack> itemStack, boolean doPopAnim) {
itemStack.forEach(e -> addRealItem(e, doPopAnim));
protected void addRealItems(Collection<ItemStack> itemStack, boolean doAnim) {
itemStack.forEach(e -> addRealItem(e, doAnim));
}
protected void addRealItem(ItemStack itemStack, boolean doPopAnim) {
realItems.add(new AnimatedItemStack(itemStack, doPopAnim));
protected void addRealItem(ItemStack itemStack, boolean doAnim) {
realItems.add(new AnimatedItemStack(itemStack, doAnim));
}
protected void addRealItem(int index, ItemStack itemStack, boolean doPopAnim) {
realItems.add(index, new AnimatedItemStack(itemStack, doPopAnim));
protected void addRealItem(int index, ItemStack itemStack, boolean doAnim) {
realItems.add(index, new AnimatedItemStack(itemStack, doAnim));
}
protected void setRealItem(int index, ItemStack itemStack, boolean doPopAnim) {
realItems.set(index, new AnimatedItemStack(itemStack, doPopAnim));
protected void setRealItem(int index, ItemStack itemStack, boolean doAnim) {
realItems.set(index, new AnimatedItemStack(itemStack, doAnim));
}
public int size() {