-
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.
Nodeflow update and misc changes for 3.1.0
- Loading branch information
1 parent
5003769
commit 48b4988
Showing
9 changed files
with
118 additions
and
13 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
* Make interfaces use names from attached containers as fallback | ||
* Add interface groups | ||
* They allow you to interact with multiple interfaces as one | ||
* They allow you to interact with multiple interfaces as one | ||
* Added support for color tagging nodes | ||
* Added support for setting a custom name for a node | ||
* Made tooltips only show on the config/error button | ||
* Fixed context menu sometimes going outside the screen | ||
* Generally improved the UI | ||
* Missing containers no longer cause an error. | ||
* This was required to get groups working properly | ||
* This is useful if you have containers that might sometimes be missing | ||
* Connection in the editor are now textured |
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
68 changes: 68 additions & 0 deletions
68
src/testmod/java/io/github/mattidragon/advancednetworking/test/GroupMoveTests.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,68 @@ | ||
package io.github.mattidragon.advancednetworking.test; | ||
|
||
import io.github.mattidragon.advancednetworking.AdvancedNetworking; | ||
import io.github.mattidragon.advancednetworking.block.CableBlock; | ||
import io.github.mattidragon.advancednetworking.graph.node.item.storage.ItemSourceNode; | ||
import io.github.mattidragon.advancednetworking.graph.node.item.storage.ItemTargetNode; | ||
import io.github.mattidragon.advancednetworking.test.util.AdvancedNetworkingGameTest; | ||
import io.github.mattidragon.advancednetworking.test.util.AdvancedNetworkingTestContext; | ||
import io.github.mattidragon.nodeflow.graph.Graph; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.block.LeverBlock; | ||
import net.minecraft.block.entity.DecoratedPotBlockEntity; | ||
import net.minecraft.block.enums.BlockFace; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.test.GameTest; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
|
||
public class GroupMoveTests implements AdvancedNetworkingGameTest { | ||
@GameTest(templateName = AdvancedNetworkingGameTest.EMPTY_4x4x4) | ||
public void moveItemsWithGroup(AdvancedNetworkingTestContext context) { | ||
var controllerPos = new BlockPos(1, 1, 1); | ||
var controller = context.controller(controllerPos); | ||
var cable1 = context.cable(controllerPos.east(), CableBlock.SOUTH, CableBlock.NORTH); | ||
var cable2 = context.cable(controllerPos.east(2), CableBlock.SOUTH, CableBlock.NORTH); | ||
|
||
cable1.setGroup(Direction.NORTH, "IN"); | ||
cable2.setGroup(Direction.NORTH, "IN"); | ||
cable1.setGroup(Direction.SOUTH, "OUT"); | ||
cable2.setGroup(Direction.SOUTH, "OUT"); | ||
|
||
context.setBlockState(controllerPos.up(), Blocks.LEVER.getDefaultState().with(LeverBlock.FACE, BlockFace.FLOOR)); | ||
|
||
context.setBlockState(controllerPos.east().south(), Blocks.DECORATED_POT); | ||
context.setBlockState(controllerPos.east().north(), Blocks.DECORATED_POT); | ||
context.setBlockState(controllerPos.east(2).south(), Blocks.DECORATED_POT); | ||
context.setBlockState(controllerPos.east(2).north(), Blocks.DECORATED_POT); | ||
|
||
context.getBlockEntity(controllerPos.east().north(), DecoratedPotBlockEntity.class) | ||
.setStack(0, new ItemStack(Items.DIRT, 64)); | ||
context.getBlockEntity(controllerPos.east(2).north(), DecoratedPotBlockEntity.class) | ||
.setStack(0, new ItemStack(Items.DIRT, 64)); | ||
|
||
var graph = new Graph(AdvancedNetworking.ENVIRONMENT); | ||
|
||
var sourceNode = new ItemSourceNode(graph); | ||
sourceNode.interfaceId = "IN"; | ||
sourceNode.isGroup = true; | ||
graph.addNode(sourceNode); | ||
var targetNode = new ItemTargetNode(graph); | ||
targetNode.interfaceId = "OUT"; | ||
targetNode.isGroup = true; | ||
graph.addNode(targetNode); | ||
|
||
graph.addConnection(targetNode.getInputs()[0], sourceNode.getOutputs()[0]); | ||
controller.setGraph(graph, null, null); | ||
|
||
context.toggleLever(controllerPos.up()); | ||
context.waitAndRun(20, () -> { | ||
context.expectPotWith(controllerPos.east().south(), Items.DIRT, 64); | ||
context.expectPotWith(controllerPos.east(2).south(), Items.DIRT, 64); | ||
context.expectEmptyPot(controllerPos.east().north()); | ||
context.expectEmptyPot(controllerPos.east(2).north()); | ||
context.complete(); | ||
}); | ||
} | ||
} |
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