-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36602d7
commit 04e3131
Showing
56 changed files
with
836 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Updated to 1.20.2 | ||
- Updated nodeflow | ||
- Nodes are now grouped with tags, allowing easier customization | ||
- Now uses split client sources | ||
- Textures are now sprite based | ||
- Lots of API changes for anyone building an addon or integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
org.gradle.jvmargs=-Xmx1G | ||
|
||
minecraft_version=1.20.1 | ||
yarn_mappings=1.20.1+build.9 | ||
loader_version=0.14.21 | ||
minecraft_version=1.20.2 | ||
yarn_mappings=1.20.2+build.2 | ||
loader_version=0.14.22 | ||
|
||
mod_version=2.0.3 | ||
mod_version=3.0.0 | ||
maven_group=io.github.mattidragon | ||
archives_base_name=advanced-networking | ||
|
||
fabric_version=0.85.0+1.20.1 | ||
nodeflow_version=0.2.2-mc.1.20 | ||
graphlib_version=1.1.1+1.20 | ||
fabric_version=0.89.3+1.20.2 | ||
nodeflow_version=1.0.0-beta.3+mc.1.20.2 | ||
graphlib_version=1.4.0+1.20.2 | ||
energy_version=3.0.0 | ||
yacl_version=3.0.3+1.20 | ||
modmenu_version=7.1.0 | ||
yacl_version=3.2.1+1.20.2 | ||
modmenu_version=8.0.0 | ||
configtoolkit_version=1.0.0 | ||
noindium_version=1.1.0+1.20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
72 changes: 72 additions & 0 deletions
72
...client/java/io/github/mattidragon/advancednetworking/client/AdvancedNetworkingClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package io.github.mattidragon.advancednetworking.client; | ||
|
||
import io.github.mattidragon.advancednetworking.AdvancedNetworking; | ||
import io.github.mattidragon.advancednetworking.client.screen.ControllerScreen; | ||
import io.github.mattidragon.advancednetworking.client.screen.ResourceFilterConfigScreen; | ||
import io.github.mattidragon.advancednetworking.client.screen.node.CountNodeConfigScreen; | ||
import io.github.mattidragon.advancednetworking.client.screen.node.InterfaceNodeConfigScreen; | ||
import io.github.mattidragon.advancednetworking.client.screen.node.SliderNodeConfigScreen; | ||
import io.github.mattidragon.advancednetworking.graph.ModNodeTypes; | ||
import io.github.mattidragon.advancednetworking.misc.RequestInterfacesPacket; | ||
import io.github.mattidragon.advancednetworking.screen.ControllerScreenHandler; | ||
import io.github.mattidragon.nodeflow.client.compat.controlify.ControlifyProxy; | ||
import io.github.mattidragon.nodeflow.client.ui.NodeConfigScreenRegistry; | ||
import io.github.mattidragon.nodeflow.client.ui.screen.HandledEditorScreen; | ||
import io.github.mattidragon.nodeflow.screen.EditorScreenHandler; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; | ||
import net.minecraft.client.gui.screen.ingame.HandledScreens; | ||
import net.minecraft.network.PacketByteBuf; | ||
|
||
public class AdvancedNetworkingClient implements ClientModInitializer { | ||
@Override | ||
public void onInitializeClient() { | ||
HandledScreens.<EditorScreenHandler, HandledEditorScreen>register(AdvancedNetworking.CONTROLLER_SCREEN, (handler, inventory, title) -> new ControllerScreen((ControllerScreenHandler) handler, inventory, title)); | ||
ControlifyProxy.INSTANCE.registerScreenType(ControllerScreen.class); | ||
|
||
NodeConfigScreenRegistry.register(InterfaceNodeConfigScreen::new, | ||
ModNodeTypes.READ_REDSTONE, | ||
ModNodeTypes.SET_REDSTONE, | ||
ModNodeTypes.WRITE_REDSTONE, | ||
ModNodeTypes.ITEM_SOURCE, | ||
ModNodeTypes.ITEM_TARGET, | ||
ModNodeTypes.ITEM_CAPACITY, | ||
ModNodeTypes.ENERGY_SOURCE, | ||
ModNodeTypes.ENERGY_TARGET, | ||
ModNodeTypes.ENERGY_CAPACITY, | ||
ModNodeTypes.ENERGY_AMOUNT, | ||
ModNodeTypes.FLUID_SOURCE, | ||
ModNodeTypes.FLUID_TARGET, | ||
ModNodeTypes.FLUID_CAPACITY | ||
); | ||
NodeConfigScreenRegistry.register(CountNodeConfigScreen::new, ModNodeTypes.ITEM_COUNT, ModNodeTypes.FLUID_COUNT); | ||
|
||
NodeConfigScreenRegistry.register(SliderNodeConfigScreen::new, | ||
ModNodeTypes.LIMIT_ITEMS, | ||
ModNodeTypes.LIMIT_FLUID, | ||
ModNodeTypes.LIMIT_ENERGY, | ||
ModNodeTypes.SPLIT_ITEMS, | ||
ModNodeTypes.SPLIT_FLUID, | ||
ModNodeTypes.SPLIT_ENERGY, | ||
ModNodeTypes.MERGE_ITEMS, | ||
ModNodeTypes.MERGE_FLUID, | ||
ModNodeTypes.MERGE_ENERGY | ||
); | ||
NodeConfigScreenRegistry.register((node, editorScreen) -> new ResourceFilterConfigScreen<>(node, editorScreen, node.getFilter()), | ||
ModNodeTypes.FILTER_FLUID, ModNodeTypes.FILTER_ITEMS); | ||
NodeConfigScreenRegistry.register(CountNodeConfigScreen::new, | ||
ModNodeTypes.ITEM_COUNT, | ||
ModNodeTypes.FLUID_COUNT); | ||
|
||
ClientPlayNetworking.registerGlobalReceiver(RequestInterfacesPacket.RESPONSE_ID, (client, handler, buf, responseSender) -> { | ||
var syncId = buf.readByte(); | ||
var interfaces = buf.readMap(PacketByteBuf::readString, PacketByteBuf::readString); | ||
|
||
client.execute(() -> { | ||
if (client.player != null && client.player.currentScreenHandler.syncId == syncId && client.currentScreen instanceof InterfaceNodeConfigScreen<?> configScreen) { | ||
configScreen.setInterfaces(interfaces); | ||
} | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...networking/config/ModmenuIntegration.java → ...ing/client/config/ModmenuIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...etworking/mixin/CheckboxWidgetAccess.java → ...ng/client/mixin/CheckboxWidgetAccess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...t/java/io/github/mattidragon/advancednetworking/client/mixin/ClientPlayerEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.github.mattidragon.advancednetworking.client.mixin; | ||
|
||
import io.github.mattidragon.advancednetworking.client.screen.CableConfigScreen; | ||
import io.github.mattidragon.advancednetworking.misc.InterfaceType; | ||
import io.github.mattidragon.advancednetworking.mixin.PlayerEntityMixin; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.network.ClientPlayerEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.function.Function; | ||
|
||
@Mixin(ClientPlayerEntity.class) | ||
public class ClientPlayerEntityMixin extends PlayerEntityMixin { | ||
@Shadow @Final protected MinecraftClient client; | ||
|
||
@Override | ||
public void advancednetworking$openCableConfigScreen(BlockPos pos, Direction direction, Function<Direction, InterfaceType> typeSupplier, Function<Direction, String> nameSupplier, boolean allowAdventureModeAccess) { | ||
client.setScreen(new CableConfigScreen(pos, direction, typeSupplier, nameSupplier, allowAdventureModeAccess)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...va/io/github/mattidragon/advancednetworking/client/screen/ResourceFilterConfigScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.github.mattidragon.advancednetworking.client.screen; | ||
|
||
import io.github.mattidragon.advancednetworking.AdvancedNetworking; | ||
import io.github.mattidragon.advancednetworking.misc.ResourceFilter; | ||
import io.github.mattidragon.nodeflow.client.ui.screen.EditorScreen; | ||
import io.github.mattidragon.nodeflow.client.ui.screen.NodeConfigScreen; | ||
import io.github.mattidragon.nodeflow.graph.node.Node; | ||
import net.minecraft.client.gui.tooltip.Tooltip; | ||
import net.minecraft.client.gui.widget.CyclingButtonWidget; | ||
import net.minecraft.client.gui.widget.TextFieldWidget; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Formatting; | ||
|
||
public class ResourceFilterConfigScreen<N extends Node> extends NodeConfigScreen<N> { | ||
private final ResourceFilter<?, ?> filter; | ||
|
||
public ResourceFilterConfigScreen(N owner, EditorScreen parent, ResourceFilter<?, ?> filter) { | ||
super(owner, parent); | ||
this.filter = filter; | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
var x = ((width - 200) / 2) - 50; | ||
|
||
var regexButton = CyclingButtonWidget.onOffBuilder() | ||
.initially(filter.shouldUseRegex()) | ||
.build(x, 45, 100, 20, Text.translatable("node.advanced_networking.filter.use_regex"), (button1, value) -> filter.setUseRegex(value)); | ||
if (AdvancedNetworking.CONFIG.get().disableRegexFilter()) { | ||
regexButton.active = false; | ||
regexButton.setTooltip(Tooltip.of(Text.translatable("node.advanced_networking.filter.use_regex.disabled"))); | ||
} | ||
addDrawableChild(regexButton); | ||
|
||
var whitelistButton = CyclingButtonWidget.onOffBuilder(Text.translatable("node.advanced_networking.filter.mode.whitelist"), Text.translatable("node.advanced_networking.filter.mode.blacklist")) | ||
.initially(filter.isWhitelist()) | ||
.omitKeyText() | ||
.build(x, 70, 100, 20, Text.empty(), (button1, value) -> filter.setWhitelist(value)); | ||
addDrawableChild(whitelistButton); | ||
|
||
var button = CyclingButtonWidget.<ResourceFilter.Mode>builder(mode -> mode == ResourceFilter.Mode.RESOURCE ? Text.translatable("node.advanced_networking.filter.mode.resource") : Text.translatable("node.advanced_networking.filter.mode.tag")) | ||
.values(ResourceFilter.Mode.values()) | ||
.initially(filter.getMode()) | ||
.build(x, 95, 100, 20, Text.translatable("node.advanced_networking.filter.mode"), (button1, value) -> filter.setMode(value)); | ||
addDrawableChild(button); | ||
|
||
var idField = new TextFieldWidget(textRenderer, x, 120, 100, 20, Text.empty()); | ||
idField.setMaxLength(100); | ||
idField.setPlaceholder(Text.literal("id").formatted(Formatting.GRAY)); | ||
idField.setText(filter.getIdFilter()); | ||
idField.setChangedListener(filter::setIdFilter); | ||
addDrawableChild(idField); | ||
|
||
var nbtField = new TextFieldWidget(textRenderer, x, 145, 100, 20, Text.empty()); | ||
nbtField.setMaxLength(200); | ||
nbtField.setPlaceholder(Text.literal("nbt").formatted(Formatting.GRAY)); | ||
nbtField.setText(filter.getNbtFilter()); | ||
nbtField.setChangedListener(filter::setNbtFilter); | ||
addDrawableChild(nbtField); | ||
} | ||
} |
Oops, something went wrong.