0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 01:12:13 +02:00

Make slow mode a bit less slow

This commit is contained in:
Alexander01998 2019-09-08 22:59:53 +02:00
parent 0d92166b31
commit cfdce078b1

View File

@ -45,6 +45,12 @@ public final class DropCmd extends Command implements UpdateListener
WURST.getEventManager().add(UpdateListener.class, this); WURST.getEventManager().add(UpdateListener.class, this);
} }
private void dropAllItems()
{
for(int i = 9; i < 45; i++)
IMC.getInteractionManager().windowClick_THROW(i);
}
@Override @Override
public void onUpdate() public void onUpdate()
{ {
@ -52,7 +58,9 @@ public final class DropCmd extends Command implements UpdateListener
if(slowModeTimer > 0) if(slowModeTimer > 0)
return; return;
skipEmptySlots();
IMC.getInteractionManager().windowClick_THROW(slowModeSlotCounter); IMC.getInteractionManager().windowClick_THROW(slowModeSlotCounter);
slowModeSlotCounter++; slowModeSlotCounter++;
slowModeTimer = 5; slowModeTimer = 5;
@ -60,9 +68,18 @@ public final class DropCmd extends Command implements UpdateListener
WURST.getEventManager().remove(UpdateListener.class, this); WURST.getEventManager().remove(UpdateListener.class, this);
} }
private void dropAllItems() private void skipEmptySlots()
{ {
for(int i = 9; i < 45; i++) while(slowModeSlotCounter < 45)
IMC.getInteractionManager().windowClick_THROW(i); {
int adjustedSlot = slowModeSlotCounter;
if(adjustedSlot >= 36)
adjustedSlot -= 36;
if(!MC.player.inventory.getInvStack(adjustedSlot).isEmpty())
break;
slowModeSlotCounter++;
}
} }
} }