delay after teleport option
This commit is contained in:
@@ -47,10 +47,13 @@ public class Configs implements IConfigHandler {
|
|||||||
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,
|
public static final ConfigInteger VOID_TRADING_DELAY = new ConfigInteger("voidTradingDelay", 0, 0, 30000000,
|
||||||
"delay in ticks for void trading");
|
"delay in ticks for void trading");
|
||||||
|
public static final ConfigBoolean VOID_TRADING_DELAY_AFTER_TELEPORT = new ConfigBoolean("delayAfterTelport",
|
||||||
|
false, "Start the delay after th villager is gone");
|
||||||
|
|
||||||
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,
|
||||||
SELL_LIMIT, ENABLE_BUY, BUY_ITEM, BUY_LIMIT, MAX_INPUT_ITEMS, INPUT_CONTAINER_X, INPUT_CONTAINER_Y,
|
SELL_LIMIT, ENABLE_BUY, BUY_ITEM, BUY_LIMIT, MAX_INPUT_ITEMS, INPUT_CONTAINER_X, INPUT_CONTAINER_Y,
|
||||||
INPUT_CONTAINER_Z, OUTPUT_CONTAINER_X, OUTPUT_CONTAINER_Y, OUTPUT_CONTAINER_Z, VOID_TRADING_DELAY);
|
INPUT_CONTAINER_Z, OUTPUT_CONTAINER_X, OUTPUT_CONTAINER_Y, OUTPUT_CONTAINER_Z, VOID_TRADING_DELAY,
|
||||||
|
VOID_TRADING_DELAY_AFTER_TELEPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadFromFile() {
|
public static void loadFromFile() {
|
||||||
|
|||||||
@@ -202,7 +202,22 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
|
|||||||
public void onClientTick(MinecraftClient mc) {
|
public void onClientTick(MinecraftClient mc) {
|
||||||
|
|
||||||
if (voidDelay > 0) {
|
if (voidDelay > 0) {
|
||||||
voidDelay--;
|
|
||||||
|
if (Configs.Generic.VOID_TRADING_DELAY_AFTER_TELEPORT.getBooleanValue()) {
|
||||||
|
boolean found = false;
|
||||||
|
for (Entity entity : mc.player.clientWorld.getEntities()) {
|
||||||
|
if (entity instanceof VillagerEntity || entity instanceof WanderingTraderEntity) {
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
voidDelay--;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
voidDelay--;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user