Skip to content

Commit

Permalink
New connector gui features, translate controller gui, McJtyMods#551 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Emelyanov committed Apr 6, 2024
1 parent d778ba6 commit 472da69
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import mcjty.lib.api.container.DefaultContainerProvider;
import mcjty.lib.bindings.GuiValue;
import mcjty.lib.blockcommands.Command;
import mcjty.lib.blockcommands.ResultCommand;
import mcjty.lib.blockcommands.ServerCommand;
import mcjty.lib.container.GenericContainer;
import mcjty.lib.tileentity.Cap;
import mcjty.lib.tileentity.CapType;
import mcjty.lib.tileentity.GenericTileEntity;
import mcjty.lib.typed.Key;
import mcjty.lib.typed.Type;
import mcjty.lib.typed.TypedMap;
import mcjty.lib.varia.OrientationTools;
import mcjty.rftoolsbase.api.xnet.tiles.IConnectorTile;
import mcjty.xnet.modules.cables.CableModule;
Expand Down Expand Up @@ -303,13 +305,19 @@ public ModelData getModelData() {

public static final Key<Integer> PARAM_FACING = new Key<>(TAG_FACING, Type.INTEGER);
public static final Key<Boolean> PARAM_ENABLED = new Key<>(TAG_ENABLED, Type.BOOLEAN);
public static final Key<String> PARAM_NAME = new Key<>(TAG_NAME, Type.STRING);

@ServerCommand
public static final Command<?> CMD_ENABLE = Command.<ConnectorTileEntity>create("connector.enable",
(te, playerEntity, params) -> {
int f = params.get(PARAM_FACING);
boolean e = params.get(PARAM_ENABLED);
te.setEnabled(OrientationTools.DIRECTION_VALUES[f], e);
});
@ServerCommand
public static final ResultCommand<?> CMD_GET_NAME = ResultCommand.<ConnectorTileEntity>create("xnet.connector.name",
(te, player, params) -> TypedMap.builder().put(PARAM_NAME, te.getConnectorName()).build(),
(te, player, params) -> te.setConnectorName(params.get(PARAM_NAME)));

@Nonnull
@Override
Expand Down

0 comments on commit 472da69

Please sign in to comment.