void trading delay
This commit is contained in:
@@ -7,7 +7,7 @@ mod_name = AutoTrade
|
|||||||
author = sebseb7
|
author = sebseb7
|
||||||
mod_file_name = autotrade-fabric
|
mod_file_name = autotrade-fabric
|
||||||
|
|
||||||
mod_version = 0.0.2
|
mod_version = 0.0.3
|
||||||
|
|
||||||
malilib_version = 0.16.0
|
malilib_version = 0.16.0
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,12 @@ public class Configs implements IConfigHandler {
|
|||||||
"Output container Y (not used when buy disabled)");
|
"Output container Y (not used when buy disabled)");
|
||||||
public static final ConfigInteger OUTPUT_CONTAINER_Z = new ConfigInteger("outputContainerZ", 0, -30000000,
|
public static final ConfigInteger OUTPUT_CONTAINER_Z = new ConfigInteger("outputContainerZ", 0, -30000000,
|
||||||
30000000, "Output container Z (not used when buy disabled)");
|
30000000, "Output container Z (not used when buy disabled)");
|
||||||
|
public static final ConfigInteger VOID_TRADING_DELAY = new ConfigInteger("voidTradingDelay", 0, 0, 30000000,
|
||||||
|
"delay in ticks for void trading");
|
||||||
|
|
||||||
public static final ImmutableList<IConfigValue> OPTIONS = ImmutableList.of(ENABLED, ENABLE_SELL, SELL_ITEM,
|
public static final ImmutableList<IConfigValue> OPTIONS = ImmutableList.of(ENABLED, ENABLE_SELL, SELL_ITEM,
|
||||||
ENABLE_BUY, BUY_ITEM, MAX_INPUT_ITEMS, INPUT_CONTAINER_X, INPUT_CONTAINER_Y, INPUT_CONTAINER_Z,
|
ENABLE_BUY, BUY_ITEM, MAX_INPUT_ITEMS, INPUT_CONTAINER_X, INPUT_CONTAINER_Y, INPUT_CONTAINER_Z,
|
||||||
OUTPUT_CONTAINER_X, OUTPUT_CONTAINER_Y, OUTPUT_CONTAINER_Z);
|
OUTPUT_CONTAINER_X, OUTPUT_CONTAINER_Y, OUTPUT_CONTAINER_Z, VOID_TRADING_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadFromFile() {
|
public static void loadFromFile() {
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
|
|||||||
private boolean outputInRange = false;
|
private boolean outputInRange = false;
|
||||||
private boolean outputOpened = false;
|
private boolean outputOpened = false;
|
||||||
private int tickCount = 0;
|
private int tickCount = 0;
|
||||||
|
private int voidDelay = 0;
|
||||||
|
|
||||||
public static KeybindCallbacks getInstance() {
|
public static KeybindCallbacks getInstance() {
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
@@ -192,6 +193,12 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClientTick(MinecraftClient mc) {
|
public void onClientTick(MinecraftClient mc) {
|
||||||
|
|
||||||
|
if (voidDelay > 0) {
|
||||||
|
voidDelay--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.functionalityEnabled() == false || mc.player == null) {
|
if (this.functionalityEnabled() == false || mc.player == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -282,6 +289,7 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
|
|||||||
found = true;
|
found = true;
|
||||||
newVillagersInRange.add(entity);
|
newVillagersInRange.add(entity);
|
||||||
mc.interactionManager.interactEntity(mc.player, entity, Hand.MAIN_HAND);
|
mc.interactionManager.interactEntity(mc.player, entity, Hand.MAIN_HAND);
|
||||||
|
voidDelay = Configs.Generic.VOID_TRADING_DELAY.getIntegerValue();
|
||||||
state = false;
|
state = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user