Skip to content

Commit

Permalink
Remove packet limit and add masscraftmultiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed Aug 18, 2021
1 parent 230e8a7 commit 26d5e0f
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 303 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ author = masa
mod_file_name = itemscroller-fabric

# Current mod version
mod_version = craftfix-1.2.5
mod_version = craftfix-1.2.6

# Required malilib version
malilib_version = 0.10.0-dev.23
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/fi/dy/masa/itemscroller/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ public static class Generic
public static final ConfigBoolean CRAFTING_RENDER_RECIPE_ITEMS = new ConfigBoolean("craftingRenderRecipeItems", true, "If enabled, then the recipe items are also rendered\nin the crafting recipe view.");
public static final ConfigBoolean DROP_RECIPE_REMAINDER = new ConfigBoolean("dropRecipeRemainder", true, "If enabled, recipe remainders are dropped.");
public static final ConfigBoolean DROP_NON_RECIPE_ITEMS = new ConfigBoolean("dropNonRecipeItems", false, "If enabled, non recipe items in crafting grid are dropped.");
public static final ConfigInteger PACKET_RATE_LIMIT = new ConfigInteger("packetRateLimit", 4, 1, 1024, "The limit of sent emulated slot click packets per game tick,\nif 'rateLimitClickPackets' is enabled");
public static final ConfigInteger MASS_CRAFT_MULTIPLIER = new ConfigInteger("massCraftMultiplier", 1, 1, 50, "Specifies Masscraft operations per tick");
public static final ConfigBoolean SCROLL_CRAFT_STORE_RECIPES_TO_FILE = new ConfigBoolean("craftingRecipesSaveToFile", true, "If enabled, then the crafting features recipes are saved to a file\ninside minecraft/itemscroller/recipes_worldorservername.nbt.\nThis makes the recipes persistent across game restarts.");
public static final ConfigBoolean SCROLL_CRAFT_RECIPE_FILE_GLOBAL = new ConfigBoolean("craftingRecipesSaveFileIsGlobal", false, "If true, then the recipe file is global, instead\n of being saved per-world or server");
public static final ConfigBoolean RATE_LIMIT_CLICK_PACKETS = new ConfigBoolean("rateLimitClickPackets", false, "This is meant for compatibility with Spigot servers and similar,\nwhich apply rate limits to packets from the client.\nThis queues up the emulated slot click packets and sends\nthem rate limited over time. The limit per game tick can be set in 'packetRateLimit´.");
public static final ConfigBoolean REVERSE_SCROLL_DIRECTION_SINGLE = new ConfigBoolean("reverseScrollDirectionSingle", false, "Reverse the scrolling direction for single item mode.");
public static final ConfigBoolean REVERSE_SCROLL_DIRECTION_STACKS = new ConfigBoolean("reverseScrollDirectionStacks", false, "Reverse the scrolling direction for full stacks mode.");
public static final ConfigBoolean SLOT_POSITION_AWARE_SCROLL_DIRECTION = new ConfigBoolean("useSlotPositionAwareScrollDirection", false, "When enabled, the item movement direction depends\non the slots' y-position on screen. Might be derpy with more\ncomplex inventories, use with caution!");
Expand All @@ -46,8 +45,7 @@ public static class Generic
CRAFTING_RENDER_RECIPE_ITEMS,
DROP_RECIPE_REMAINDER,
DROP_NON_RECIPE_ITEMS,
PACKET_RATE_LIMIT,
RATE_LIMIT_CLICK_PACKETS,
MASS_CRAFT_MULTIPLIER,
SCROLL_CRAFT_STORE_RECIPES_TO_FILE,
SCROLL_CRAFT_RECIPE_FILE_GLOBAL,
REVERSE_SCROLL_DIRECTION_SINGLE,
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/fi/dy/masa/itemscroller/event/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import fi.dy.masa.itemscroller.config.Hotkeys;
import fi.dy.masa.itemscroller.recipes.RecipeStorage;
import fi.dy.masa.itemscroller.util.AccessorUtils;
import fi.dy.masa.itemscroller.util.ClickPacketBuffer;
import fi.dy.masa.itemscroller.util.InputUtils;
import fi.dy.masa.itemscroller.util.InventoryUtils;
import fi.dy.masa.itemscroller.util.MoveAction;
Expand Down Expand Up @@ -108,15 +107,8 @@ public boolean onMouseClick(int mouseX, int mouseY, int eventButton, boolean eve

private boolean handleInput(int keyCode, boolean keyState, double dWheel)
{
if (Configs.Generic.RATE_LIMIT_CLICK_PACKETS.getBooleanValue())
{
ClickPacketBuffer.setShouldBufferClickPackets(true);
}

boolean cancel = this.handleInputImpl(keyCode, keyState, dWheel);

ClickPacketBuffer.setShouldBufferClickPackets(false);

return cancel;
}

Expand Down Expand Up @@ -247,11 +239,6 @@ private boolean handleDragging(HandledScreen<?> gui, MinecraftClient mc, int mou
boolean cancel = false;
MoveAction action = InventoryUtils.getActiveMoveAction();

if (Configs.Generic.RATE_LIMIT_CLICK_PACKETS.getBooleanValue())
{
ClickPacketBuffer.setShouldBufferClickPackets(true);
}

if (InputUtils.isActionKeyActive(action))
{
cancel = InventoryUtils.dragMoveItems(gui, mc, action, mouseX, mouseY, false);
Expand All @@ -261,8 +248,6 @@ else if (action != MoveAction.NONE)
InventoryUtils.stopDragging();
}

ClickPacketBuffer.setShouldBufferClickPackets(false);

return cancel;
}
}
Loading

0 comments on commit 26d5e0f

Please sign in to comment.