Skip to content

Remove unused contents#23

Merged
serenibyss merged 2 commits intoGTNewHorizons:masterfrom
zyf051520:master
May 25, 2025
Merged

Remove unused contents#23
serenibyss merged 2 commits intoGTNewHorizons:masterfrom
zyf051520:master

Conversation

@zyf051520
Copy link

@zyf051520 zyf051520 commented May 21, 2025

ChannelRegistry is only used by TileTransceiver and ItemWirelessLocationChip.
The original author commented out Transceiver&WirelessLocationChip registration code before GTNH fork.
see:
097a30f#diff-86d17ec053e224d336db41fed952c4d702b993909b8126710704a3f020a98939

// interactionInhibitor = new ItemInteractionInhibitor().setUnlocalizedName("interaction_inhibitor");
// register(interactionInhibitor);
// wirelessLocationChip = new ItemWirelessLocationChip().setUnlocalizedName("wireless_chip.location");
// register(wirelessLocationChip);
}

// transceiver = new BlockTransceiver().setBlockName("transceiver");
// GameRegistry.registerBlock(transceiver, ItemBlockTransceiver.class, "transceiver");
// GameRegistry.registerTileEntity(TileTransceiver.class, "remoteio:transceiver");


Now it's still commented out.

Comment in ModItems is removed in current fork.

/*
* transceiver = new BlockTransceiver().setBlockName("transceiver"); GameRegistry.registerBlock(transceiver,
* ItemBlockTransceiver.class, "transceiver"); GameRegistry.registerTileEntity(TileTransceiver.class,
* "remoteio:transceiver");
*/

So I assume that TileTransceiver and ItemWirelessLocationChip are not used.

However ChannelRegistry subscribes events, and try to read/write file, even if there's nothing to save/load.

So this PR remove the subscription
So this PR remove all unused contents related to TileTransceiver & WirelessLocationChip.

I created this PR because I got a crash:
crash-2025-05-21_00.56.09-server.txt
Not sure how to reproduct it, but this PR can prevent some potentioal crash.

@zyf051520 zyf051520 marked this pull request as ready for review May 21, 2025 06:35
Copy link
Member

@boubou19 boubou19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall if the classes are never used elsewhere, it's more than fine to yeet them, so we reduce cluttering on the codebase

@zyf051520 zyf051520 changed the title Disable ChannelRegistry since it is never used Remove unused contents May 24, 2025
@Dream-Master Dream-Master requested review from a team and boubou19 May 24, 2025 20:05
@serenibyss serenibyss merged commit 01b7571 into GTNewHorizons:master May 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants