Skip to content

Commit a8cb2cf

Browse files
committed
sync 1.21.4-0.23.3, update mafglib, update NeoForge version to 21.4.136
1 parent a6d4a6d commit a8cb2cf

55 files changed

Lines changed: 1217 additions & 2831 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
minecraft_version="1.21.4"
44
yarn_mappings="1.21.4+build.8"
55
mappings_patch="1.21+build.4"
6-
neoforge="21.4.124"
6+
neoforge="21.4.136"
77

88
# Mod properties
9-
version="0.3.1"
9+
version="0.3.2"
1010
maven-group="org.thinkingstudio.tweakerge"
1111
archives-name="Tweakerge"
1212

@@ -15,7 +15,7 @@ id-modrinth="yke6wdGF"
1515
id-curseforge="915857"
1616

1717
# Mod dependencies
18-
mafglib="0.3.2-mc1.21.4"
18+
mafglib="0.3.3-mc1.21.4"
1919

2020
# Libraries
2121
jsr305="3.0.2"

src/main/java/fi/dy/masa/tweakeroo/Reference.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public class Reference
1111
public static final String MOD_NAME = "Tweakerge";
1212
public static final String MOD_VERSION = StringUtils.getModVersionString(MOD_ID);
1313
public static final String MC_VERSION = MinecraftVersion.CURRENT.getName();
14-
public static final String MOD_TYPE = "neoforge";
15-
public static final String MOD_STRING = MOD_ID + "-" + MOD_TYPE + "-" + MC_VERSION + "-" + MOD_VERSION;
14+
public static final String MOD_TYPE = "fabric";
15+
public static final String MOD_STRING = MOD_ID+"-"+MOD_TYPE+"-"+MC_VERSION+"-"+MOD_VERSION;
1616
}

src/main/java/fi/dy/masa/tweakeroo/config/Callbacks.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fi.dy.masa.tweakeroo.config;
22

3+
import fi.dy.masa.malilib.config.options.ConfigDouble;
34
import net.minecraft.block.Blocks;
45
import net.minecraft.block.entity.BlockEntity;
56
import net.minecraft.block.entity.SignBlockEntity;
@@ -61,6 +62,8 @@ public static void init(MinecraftClient mc)
6162
Hotkeys.FLY_PRESET_2.getKeybind().setCallback(callbackGeneric);
6263
Hotkeys.FLY_PRESET_3.getKeybind().setCallback(callbackGeneric);
6364
Hotkeys.FLY_PRESET_4.getKeybind().setCallback(callbackGeneric);
65+
Hotkeys.FLY_INCREMENT_1.getKeybind().setCallback(callbackGeneric);
66+
Hotkeys.FLY_INCREMENT_2.getKeybind().setCallback(callbackGeneric);
6467
Hotkeys.FREE_CAMERA_PLAYER_INPUTS.getKeybind().setCallback((action, key) ->
6568
{
6669
IConfigBoolean config = Configs.Generic.FREE_CAMERA_PLAYER_INPUTS;
@@ -352,6 +355,28 @@ else if (key == Hotkeys.FLY_PRESET_4.getKeybind())
352355
this.setFlySpeedPreset(3);
353356
return true;
354357
}
358+
else if (key == Hotkeys.FLY_INCREMENT_1.getKeybind())
359+
{
360+
ConfigDouble config = Configs.getActiveFlySpeedConfig();
361+
double newValue = config.getDoubleValue() + (Configs.Generic.FLY_SPEED_INCREMENT_1.getDoubleValue());
362+
config.setDoubleValue(newValue);
363+
364+
String strIndex = GuiBase.TXT_GREEN + (Configs.Internal.FLY_SPEED_PRESET.getIntegerValue() + 1) + GuiBase.TXT_RST;
365+
String strValue = GuiBase.TXT_GREEN + String.format("%.3f", config.getDoubleValue()) + GuiBase.TXT_RST;
366+
InfoUtils.printActionbarMessage("tweakeroo.message.set_fly_speed_to", strIndex, strValue);
367+
return true;
368+
}
369+
else if (key == Hotkeys.FLY_INCREMENT_2.getKeybind())
370+
{
371+
ConfigDouble config = Configs.getActiveFlySpeedConfig();
372+
double newValue = config.getDoubleValue() + (Configs.Generic.FLY_SPEED_INCREMENT_2.getDoubleValue());
373+
config.setDoubleValue(newValue);
374+
375+
String strIndex = GuiBase.TXT_GREEN + (Configs.Internal.FLY_SPEED_PRESET.getIntegerValue() + 1) + GuiBase.TXT_RST;
376+
String strValue = GuiBase.TXT_GREEN + String.format("%.3f", config.getDoubleValue()) + GuiBase.TXT_RST;
377+
InfoUtils.printActionbarMessage("tweakeroo.message.set_fly_speed_to", strIndex, strValue);
378+
return true;
379+
}
355380
else if (key == Hotkeys.HOTBAR_SCROLL.getKeybind())
356381
{
357382
if (FeatureToggle.TWEAK_HOTBAR_SCROLL.getBooleanValue())

src/main/java/fi/dy/masa/tweakeroo/config/Configs.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import fi.dy.masa.malilib.config.*;
1212
import fi.dy.masa.malilib.config.options.*;
13+
import fi.dy.masa.malilib.hotkeys.IHotkey;
1314
import fi.dy.masa.malilib.util.ActiveMode;
1415
import fi.dy.masa.malilib.util.FileUtils;
1516
import fi.dy.masa.malilib.util.JsonUtils;
@@ -70,6 +71,8 @@ public static class Generic
7071
public static final ConfigDouble FLY_SPEED_PRESET_2 = new ConfigDouble ("flySpeedPreset2", 0.064, 0, 4).apply(GENERIC_KEY);
7172
public static final ConfigDouble FLY_SPEED_PRESET_3 = new ConfigDouble ("flySpeedPreset3", 0.128, 0, 4).apply(GENERIC_KEY);
7273
public static final ConfigDouble FLY_SPEED_PRESET_4 = new ConfigDouble ("flySpeedPreset4", 0.32, 0, 4).apply(GENERIC_KEY);
74+
public static final ConfigDouble FLY_SPEED_INCREMENT_1 = new ConfigDouble ("flySpeedIncrement1", 0.128, -4, 4).apply(GENERIC_KEY);
75+
public static final ConfigDouble FLY_SPEED_INCREMENT_2 = new ConfigDouble ("flySpeedIncrement2", -0.128, -4, 4).apply(GENERIC_KEY);
7376
public static final ConfigBoolean FREE_CAMERA_PLAYER_INPUTS = new ConfigBoolean ("freeCameraPlayerInputs", false).apply(GENERIC_KEY);
7477
public static final ConfigBoolean FREE_CAMERA_PLAYER_MOVEMENT = new ConfigBoolean ("freeCameraPlayerMovement", false).apply(GENERIC_KEY);
7578
public static final ConfigDouble GAMMA_OVERRIDE_VALUE = new ConfigDouble ("gammaOverrideValue", 16, 0, 32).apply(GENERIC_KEY);
@@ -131,9 +134,10 @@ public static class Generic
131134
public static final ConfigInteger STRUCTURE_BLOCK_MAX_SIZE = new ConfigInteger ("structureBlockMaxSize", 128, 1, 256).apply(GENERIC_KEY);
132135
public static final ConfigString TOOL_SWITCHABLE_SLOTS = new ConfigString ("toolSwitchableSlots", "1-9").apply(GENERIC_KEY);
133136
public static final ConfigString TOOL_SWITCH_IGNORED_SLOTS = new ConfigString ("toolSwitchIgnoredSlots", "").apply(GENERIC_KEY);
134-
public static final ConfigBoolean TOOL_SWAP_BETTER_ENCHANTS = new ConfigBoolean ("toolSwapBetterEnchants", false).apply(GENERIC_KEY);
135-
public static final ConfigBoolean TOOL_SWAP_SILK_TOUCH_FIRST = new ConfigBoolean ("toolSwapSilkTouchFirst", true).apply(GENERIC_KEY);
136-
public static final ConfigBoolean WEAPON_SWAP_BETTER_ENCHANTS = new ConfigBoolean ("weaponSwapBetterEnchants", false).apply(GENERIC_KEY);
137+
public static final ConfigBooleanHotkeyed TOOL_SWAP_BETTER_ENCHANTS = new ConfigBooleanHotkeyed ("toolSwapBetterEnchants", false, "").apply(GENERIC_KEY);
138+
public static final ConfigBooleanHotkeyed TOOL_SWAP_SILK_TOUCH_FIRST = new ConfigBooleanHotkeyed ("toolSwapSilkTouchFirst", true, "").apply(GENERIC_KEY);
139+
public static final ConfigBooleanHotkeyed TOOL_SWAP_SILK_TOUCH_ORES = new ConfigBooleanHotkeyed ("toolSwapSilkTouchOres", false, "").apply(GENERIC_KEY);
140+
public static final ConfigBooleanHotkeyed WEAPON_SWAP_BETTER_ENCHANTS = new ConfigBooleanHotkeyed ("weaponSwapBetterEnchants", false, "").apply(GENERIC_KEY);
137141
public static final ConfigBoolean ZOOM_ADJUST_MOUSE_SENSITIVITY = new ConfigBoolean ("zoomAdjustMouseSensitivity", true).apply(GENERIC_KEY);
138142
public static final ConfigDouble ZOOM_FOV = new ConfigDouble ("zoomFov", 30, 0.01, 359.99).apply(GENERIC_KEY);
139143
public static final ConfigBoolean ZOOM_RESET_FOV_ON_ACTIVATE = new ConfigBoolean ("zoomResetFovOnActivate", true).apply(GENERIC_KEY);
@@ -203,6 +207,8 @@ public static class Generic
203207
FLY_SPEED_PRESET_2,
204208
FLY_SPEED_PRESET_3,
205209
FLY_SPEED_PRESET_4,
210+
FLY_SPEED_INCREMENT_1,
211+
FLY_SPEED_INCREMENT_2,
206212
GAMMA_OVERRIDE_VALUE,
207213
HAND_RESTOCK_PRE_THRESHOLD,
208214
HOTBAR_SLOT_CYCLE_MAX,
@@ -239,10 +245,18 @@ public static class Generic
239245
TOOL_SWITCH_IGNORED_SLOTS,
240246
TOOL_SWAP_BETTER_ENCHANTS,
241247
TOOL_SWAP_SILK_TOUCH_FIRST,
248+
TOOL_SWAP_SILK_TOUCH_ORES,
242249
WEAPON_SWAP_BETTER_ENCHANTS,
243250
ZOOM_FOV,
244251
ZOOM_RESET_FOV_ON_ACTIVATE
245252
);
253+
254+
public static final ImmutableList<IHotkey> HOTKEYS = ImmutableList.of(
255+
TOOL_SWAP_BETTER_ENCHANTS,
256+
TOOL_SWAP_SILK_TOUCH_FIRST,
257+
TOOL_SWAP_SILK_TOUCH_ORES,
258+
WEAPON_SWAP_BETTER_ENCHANTS
259+
);
246260
}
247261

248262
public static class Fixes

src/main/java/fi/dy/masa/tweakeroo/config/Hotkeys.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public class Hotkeys
3232
public static final ConfigHotkey FLY_PRESET_2 = new ConfigHotkey("flyPreset2", "").apply(HOTKEY_KEY);
3333
public static final ConfigHotkey FLY_PRESET_3 = new ConfigHotkey("flyPreset3", "").apply(HOTKEY_KEY);
3434
public static final ConfigHotkey FLY_PRESET_4 = new ConfigHotkey("flyPreset4", "").apply(HOTKEY_KEY);
35+
public static final ConfigHotkey FLY_INCREMENT_1 = new ConfigHotkey("flyIncrement1", "").apply(HOTKEY_KEY);
36+
public static final ConfigHotkey FLY_INCREMENT_2 = new ConfigHotkey("flyIncrement2", "").apply(HOTKEY_KEY);
3537
public static final ConfigHotkey FREE_CAMERA_PLAYER_INPUTS = new ConfigHotkey("freeCameraPlayerInputs", "").apply(HOTKEY_KEY);
3638
public static final ConfigHotkey FREE_CAMERA_PLAYER_MOVEMENT = new ConfigHotkey("freeCameraPlayerMovement", "").apply(HOTKEY_KEY);
3739
public static final ConfigHotkey HOTBAR_SCROLL = new ConfigHotkey("hotbarScroll", "", KeybindSettings.RELEASE_ALLOW_EXTRA).apply(HOTKEY_KEY);
@@ -79,6 +81,8 @@ public class Hotkeys
7981
FLY_PRESET_2,
8082
FLY_PRESET_3,
8183
FLY_PRESET_4,
84+
FLY_INCREMENT_1,
85+
FLY_INCREMENT_2,
8286
FREE_CAMERA_PLAYER_INPUTS,
8387
FREE_CAMERA_PLAYER_MOVEMENT,
8488
HOTBAR_SCROLL,

src/main/java/fi/dy/masa/tweakeroo/data/ServerDataSyncer.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
import fi.dy.masa.malilib.interfaces.IClientTickHandler;
3838
import fi.dy.masa.malilib.interfaces.IDataSyncer;
3939
import fi.dy.masa.malilib.mixin.entity.IMixinAbstractHorseEntity;
40-
import fi.dy.masa.malilib.mixin.entity.IMixinDataQueryHandler;
4140
import fi.dy.masa.malilib.mixin.entity.IMixinPiglinEntity;
41+
import fi.dy.masa.malilib.mixin.network.IMixinDataQueryHandler;
4242
import fi.dy.masa.malilib.network.ClientPlayHandler;
4343
import fi.dy.masa.malilib.network.IPluginClientPlayHandler;
4444
import fi.dy.masa.malilib.util.InventoryUtils;
@@ -119,7 +119,11 @@ public void onClientTick(MinecraftClient mc)
119119
this.servuxServer = false;
120120
HANDLER.unregisterPlayReceiver();
121121
}
122-
return;
122+
123+
if (!FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue())
124+
{
125+
return;
126+
}
123127
}
124128
else if (!DataManager.getInstance().hasIntegratedServer() &&
125129
!this.hasServuxServer() &&
@@ -458,7 +462,7 @@ public void onPacketFailure()
458462
{
459463
// Refresh at 25%
460464
if (!DataManager.getInstance().hasIntegratedServer() &&
461-
FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue())
465+
(FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue() || FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue()))
462466
{
463467
if (System.currentTimeMillis() - this.blockEntityCache.get(pos).getLeft() > this.getCacheRefresh())
464468
{
@@ -472,7 +476,7 @@ public void onPacketFailure()
472476
else if (world.getBlockState(pos).getBlock() instanceof BlockEntityProvider)
473477
{
474478
if (!DataManager.getInstance().hasIntegratedServer() &&
475-
FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue())
479+
(FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue() || FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue()))
476480
{
477481
this.pendingBlockEntitiesQueue.add(pos);
478482
}
@@ -503,7 +507,7 @@ else if (world.getBlockState(pos).getBlock() instanceof BlockEntityProvider)
503507
{
504508
// Refresh at 25%
505509
if (!DataManager.getInstance().hasIntegratedServer() &&
506-
FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue())
510+
(FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue() || FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue()))
507511
{
508512
if (System.currentTimeMillis() - this.entityCache.get(entityId).getLeft() > this.getCacheRefresh())
509513
{
@@ -515,7 +519,7 @@ else if (world.getBlockState(pos).getBlock() instanceof BlockEntityProvider)
515519
return this.entityCache.get(entityId).getRight();
516520
}
517521
if (!DataManager.getInstance().hasIntegratedServer() &&
518-
FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue())
522+
(FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue() || FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue()))
519523
{
520524
this.pendingEntitiesQueue.add(entityId);
521525
}
@@ -606,7 +610,7 @@ public Inventory getBlockInventory(World world, BlockPos pos, boolean useNbt)
606610
}
607611
}
608612

609-
if (FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue())
613+
if (FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue() || FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue())
610614
{
611615
this.requestBlockEntity(world, pos);
612616
}
@@ -658,7 +662,7 @@ else if (entity instanceof PiglinEntity)
658662
}
659663
}
660664

661-
if (FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue())
665+
if (FeatureToggle.TWEAK_SERVER_DATA_SYNC.getBooleanValue() || FeatureToggle.TWEAK_SERVER_DATA_SYNC_BACKUP.getBooleanValue())
662666
{
663667
this.requestEntity(world, entityId);
664668
}

src/main/java/fi/dy/masa/tweakeroo/event/InputHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ public void addKeysToMap(IKeybindManager manager)
5555
manager.addKeybindToMap(hotkey.getKeybind());
5656
}
5757

58+
for (IHotkey hotkey : Configs.Generic.HOTKEYS)
59+
{
60+
manager.addKeybindToMap(hotkey.getKeybind());
61+
}
62+
5863
for (IHotkey hotkey : Configs.Disable.OPTIONS)
5964
{
6065
manager.addKeybindToMap(hotkey.getKeybind());
@@ -66,6 +71,7 @@ public void addHotkeys(IKeybindManager manager)
6671
{
6772
manager.addHotkeysForCategory(Reference.MOD_NAME, "tweakeroo.hotkeys.category.disable_toggle_hotkeys", Configs.Disable.OPTIONS);
6873
manager.addHotkeysForCategory(Reference.MOD_NAME, "tweakeroo.hotkeys.category.generic_hotkeys", Hotkeys.HOTKEY_LIST);
74+
manager.addHotkeysForCategory(Reference.MOD_NAME, "tweakeroo.hotkeys.category.generic_config_hotkeys", Configs.Generic.HOTKEYS);
6975
manager.addHotkeysForCategory(Reference.MOD_NAME, "tweakeroo.hotkeys.category.tweak_toggle_hotkeys", ImmutableList.copyOf(FeatureToggle.values()));
7076
}
7177

src/main/java/fi/dy/masa/tweakeroo/gui/GuiConfigs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class GuiConfigs extends GuiConfigsBase
2828

2929
public GuiConfigs()
3030
{
31-
super(10, 50, Reference.MOD_ID, null, "tweakeroo.gui.title.configs", Reference.MOD_NAME, Reference.MOD_VERSION);
31+
super(10, 50, Reference.MOD_ID, null, "tweakeroo.gui.title.configs", String.format("%s", Reference.MOD_VERSION));
3232
}
3333

3434
@Override

src/main/java/fi/dy/masa/tweakeroo/mixin/IMixinChunkLightProvider.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/main/java/fi/dy/masa/tweakeroo/mixin/IMixinClientWorld.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)