Skip to content

Commit

Permalink
Use gtnhlib config sync (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts authored Jan 20, 2025
1 parent 2055c0e commit 158f2f4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 39 deletions.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.6.2:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.3:dev")
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.13.4-GTNH:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.18-GTNH:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.23-GTNH:dev")
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.0:dev")
compileOnly(rfg.deobf('maven.modrinth:etfuturum:2.6.2'))
}
2 changes: 1 addition & 1 deletion src/main/java/xonin/backhand/Backhand.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
modid = Backhand.MODID,
name = "Backhand",
version = Tags.VERSION,
dependencies = "required-after:gtnhlib@[0.5.16,)")
dependencies = "required-after:gtnhlib@[0.6.3,)")
public class Backhand {

public static final String MODID = "backhand";
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/xonin/backhand/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import xonin.backhand.api.core.BackhandUtils;
import xonin.backhand.packet.OffhandConfigSyncPacket;
import xonin.backhand.packet.OffhandSyncItemPacket;

@EventBusSubscriber
Expand All @@ -26,7 +25,6 @@ public static void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent event) {
if (!(event.player instanceof EntityPlayerMP playerMP)) {
return;
}
Backhand.packetHandler.sendPacketToPlayer(new OffhandConfigSyncPacket().generatePacket(), playerMP);
ItemStack offhandItem = BackhandUtils.getOffhandItem(playerMP);
if (Backhand.isOffhandBlacklisted(offhandItem)) {
BackhandUtils.setPlayerOffhandItem(playerMP, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public BackhandPacketHandler() {
map.put(OffhandSyncItemPacket.packetName, new OffhandSyncItemPacket());
map.put(OffhandSwapPacket.packetName, new OffhandSwapPacket());
map.put(OffhandSwapClientPacket.packetName, new OffhandSwapClientPacket());
map.put(OffhandConfigSyncPacket.packetName, new OffhandConfigSyncPacket());
map.put(OffhandSyncOffhandUse.packetName, new OffhandSyncOffhandUse());
}

Expand Down
33 changes: 0 additions & 33 deletions src/main/java/xonin/backhand/packet/OffhandConfigSyncPacket.java

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/xonin/backhand/utils/BackhandConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
@Config.Comment("Configs that will be synced with the server's config if playing in multiplayer")
public class BackhandConfig {

@Config.Sync
@Config.Comment("If set to false, an empty offhand will only be rendered when the player is punching with the offhand. False in vanilla.")
@Config.DefaultBoolean(false)
public static boolean OffhandAttack;

@Config.Sync
@Config.Comment("If set to false, disables offhand actions and rendering if there is no offhand item. False in vanilla.")
@Config.DefaultBoolean(false)
public static boolean EmptyOffhand;

@Config.Sync
@Config.Comment("Determines whether you can break blocks with the offhand or not. False in vanilla.")
@Config.DefaultBoolean(false)
public static boolean OffhandBreakBlocks;
Expand Down

0 comments on commit 158f2f4

Please sign in to comment.