Skip to content
Open
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
d3211c7
ref: first try for a new signal controller UI
Uhutown Mar 6, 2026
96df363
ref: redone networking in signal controller
Uhutown Mar 6, 2026
7f2e0b1
ref: better UI structure, feat: added back button in node settings
Uhutown Mar 6, 2026
429e7ad
ref: better handling of missing pre signal data
Uhutown Mar 6, 2026
82a5069
ref: redone int entries in signalbox UI
Uhutown Mar 9, 2026
316a246
ref: redone all boolean entries in signalbox UI
Uhutown Mar 9, 2026
37b31ba
feat: added base for customizable signalbox UIs
Uhutown Mar 9, 2026
7e3624c
ref: better code performance
Uhutown Mar 11, 2026
8aa4281
fix: issue with signalBoxUIProfile
Uhutown Mar 24, 2026
fe9eb00
ref: better SignalBox UI structure
Uhutown Mar 24, 2026
3bd98a5
feat: added option for delayed reset for signalbox
Uhutown Mar 24, 2026
aa866b8
fix: issue with InterSignalBox, when Start PW doesn't reset the signa…
Uhutown Mar 24, 2026
cebe7ce
fix: issue with saveing input delay
Uhutown Mar 24, 2026
cfbd10f
feat: added possibility to user "ENTER" for saveing the name in Namea…
Uhutown Mar 24, 2026
47367b8
feat: setting of presignals is now not linked to pos
Uhutown Mar 25, 2026
0613e03
ref: better hashing for name
Uhutown Apr 14, 2026
3c7b045
ref: update lang keys
Jeronimo97 Apr 14, 2026
957d38c
ref: new signalbox ui texture files
Jeronimo97 Apr 14, 2026
9edea17
ref: tried to fix hash Method
Uhutown Apr 14, 2026
63d3730
feat: added basic monitor block
Jeronimo97 Apr 15, 2026
73fd6b8
feat: added CP option for ResourceLocations for UI Profiles
Uhutown Apr 19, 2026
6b7202e
feat: added item for monitor placement
Uhutown Apr 19, 2026
6acda02
feat: added basic system for monitor
Uhutown Apr 27, 2026
09c8adb
ref: added rotation and fixed Shapes
Uhutown Apr 27, 2026
d742483
fix: rotation and placement of Monitor
Uhutown Apr 27, 2026
b451913
ref: better Settings UI for monitors
Uhutown Apr 27, 2026
f39971e
ref: readded break point
Uhutown May 4, 2026
8389496
ref: redone to working hashing
Uhutown May 4, 2026
12eb42e
updated current dev state
Uhutown May 19, 2026
dbc5464
fix: monitor for signalbox
Uhutown May 20, 2026
c5848ff
Merge branch '1.18-master' into 1.18-ref/UI_update
Uhutown May 20, 2026
6f6484e
feat: added signal reader block
Uhutown May 21, 2026
3223a62
feat: added blocking delay for signalbox input
Uhutown May 21, 2026
e92d688
ref: added networking for UI Profile
Uhutown May 21, 2026
75d7987
fix: UI issues with SignalBox
Uhutown May 22, 2026
c2a7de2
feat: added new method for area selection in Monitor
Uhutown May 22, 2026
4cf435e
feat: added changeing ratio for point -> point selection in MonitorGUI
Uhutown May 22, 2026
a299a0d
fix: issue with setting blocking delay for normal input
Uhutown May 23, 2026
cc98ceb
feat: added option, that entries get removed when connected block get…
Uhutown May 23, 2026
25a3729
fix: issues with packet delay on monitors
Uhutown May 23, 2026
3880996
fix: issues with colors in Editor Mode
Uhutown May 25, 2026
c253fc7
ref: removed unused
Uhutown May 25, 2026
c180bff
fix: issues with colors in grid UIs
Uhutown May 25, 2026
7a9b266
fix: issues with ratio and size selction
Uhutown May 25, 2026
2cd0afa
fix: issues with profiles in Controller UI
Uhutown May 25, 2026
fe115d9
fix: issues with wrong RS profiles; ref: changed button enable for RS…
Uhutown May 25, 2026
82d1eda
fix: issues with side side selection of RS profiles in SignalController
Uhutown May 25, 2026
8f90ebb
ref: redone rendering of monitor
Uhutown May 25, 2026
77249f8
fix: update of grid when changeing points
Uhutown May 25, 2026
d4ff121
feat: added HexConverter
Jeronimo97 May 25, 2026
8cce936
ref: lang keys + default monitor + item model
Jeronimo97 May 25, 2026
21e763f
Merge branch '1.18-ref/UI_update' of https://github.com/MrTroble/Open…
Jeronimo97 May 25, 2026
39e5e6a
ref: redone logic of signal reader
Uhutown May 25, 2026
d561e4f
ref: added max size for entries in signal reader
Uhutown May 25, 2026
2598a1c
ref: better code performance
Uhutown May 25, 2026
da303ac
feat: HexConverter for signal colors
Jeronimo97 May 25, 2026
4a9e03d
fix: issues with client monitor
Uhutown May 25, 2026
97974c6
Merge branch '1.18-ref/UI_update' of https://github.com/MrTroble/Open…
Uhutown May 25, 2026
c702cac
ref: better code performance; fix: issues with missing updates on mon…
Uhutown May 26, 2026
c72f824
ref: better signal reader UI
Uhutown May 26, 2026
6dbfba4
fix: NPE in GuiMonitor
Uhutown May 26, 2026
e425dde
fix: setting pathway over blocked crossing element
Uhutown May 27, 2026
9129378
fix: Redstone Output haveing option for delay
Uhutown May 28, 2026
7455430
ref: removed time unit from input
Uhutown May 28, 2026
09b6d6b
fix: closing Info & Help page at beginnging
Uhutown May 28, 2026
f2e9454
ref: better UI performance and lag keys
Uhutown May 28, 2026
816e033
ref: first changes for version
Uhutown May 28, 2026
231d644
ref: syntax and version fixes
Uhutown May 28, 2026
16a378d
fix: startup issues
Uhutown May 28, 2026
8786151
fix: UI opening Monitor Selection
Uhutown May 28, 2026
8a6ffb9
fix: UI and UI Signal Box issues
Uhutown May 29, 2026
3b1a91f
ref: restructed creation of TE; fixed: TE problems with Monitor
Uhutown Jun 1, 2026
e30978e
ref: first fixes for Monitor
Uhutown Jun 1, 2026
5517886
fix: problems with rendering and missing client data
Uhutown Jun 4, 2026
435eefd
fix: missing event register
Uhutown Jun 4, 2026
7519c95
fix: issue with not updateing RS in signal reader
Uhutown Jun 4, 2026
5b163fb
ref: fixed issues with monitors
Uhutown Jun 8, 2026
843e945
ref: better code performance
Uhutown Jun 8, 2026
031f0ba
ref: beter code performance
Uhutown Jun 8, 2026
28e6fe4
ref: fit assets to 1.12.2
Jeronimo97 Jun 9, 2026
178ded5
fix: wrong disabled IDs in signal controller
Uhutown Jun 9, 2026
c94e6e4
fix: insets of monitorblock
Uhutown Jun 9, 2026
3e60c5e
fix: scale
Uhutown Jun 9, 2026
78c6520
ref: better code performance; fix: Server issues
Uhutown Jun 9, 2026
4662a8a
ref: fix alpha issue
Uhutown Jun 11, 2026
85c3f97
fix: issues with rendering box
Uhutown Jun 11, 2026
1ebdd15
ref: checkstyle
Uhutown Jun 11, 2026
7056b62
ref: added info for selection type
Uhutown Jun 11, 2026
874a8dd
fix: nameing
Uhutown Jun 11, 2026
10839b7
ref: fixed tests
Uhutown Jun 11, 2026
5600bde
Update guilib
Uhutown Jun 11, 2026
6b2be2a
fix: issue with Block faceing
Uhutown Jun 11, 2026
45affbb
ref: removed option for signal falling into stop, when useing Emergen…
Uhutown Jun 11, 2026
5432d02
fix: missing properties in RS Mode
Uhutown Jul 6, 2026
e3c41ed
Merge branch '1.12-master' into 1.12-ref/UI_update
Uhutown Jul 8, 2026
cbf9192
fix: trainNumberBackgroundColor spelling error
Jeronimo97 Jul 8, 2026
b533a14
fix: issue in KS -> HL Config with speeds
Uhutown Jul 9, 2026
95a3894
Merge branch '1.12-ref/UI_update' of https://github.com/MrTroble/Open…
Uhutown Jul 9, 2026
9fa323c
feat: added method to filter at current signal; feat: added function,…
Uhutown Jul 9, 2026
1928ef2
ref: SignalBoxHandler threaded onWorldSave()
Jeronimo97 Jul 13, 2026
4ed6f12
chore: checkstyle
Jeronimo97 Jul 13, 2026
596aa1b
fix: threaded signalboxhandler
Jeronimo97 Jul 15, 2026
9521a0b
perf: text render cache
Jeronimo97 Jul 15, 2026
4862e67
chore: checkstyle
Jeronimo97 Jul 15, 2026
2221cb9
ref: update build setup
Jeronimo97 Jul 20, 2026
d99f284
chore: relocate libs
Jeronimo97 Jul 26, 2026
6edc9cd
chore: fix upload files
Jeronimo97 Aug 1, 2026
c6d1b89
ref: better code performance
Uhutown Aug 4, 2026
0048d2b
Update guilib
Uhutown Aug 4, 2026
74977e1
fix: spelling issue
Uhutown Aug 4, 2026
faebf56
fix: issue with depth
Uhutown Aug 4, 2026
a222034
fix: potential bug in signalboxhandler file-saving
Jeronimo97 Aug 10, 2026
96f02d0
ref: checkstyle
Jeronimo97 Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions src/main/java/com/troblecodings/signals/OpenSignalsMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.troblecodings.contentpacklib.ContentPackHandler;
import com.troblecodings.core.net.NetworkHandler;
import com.troblecodings.guilib.ecs.GuiHandler;
import com.troblecodings.signals.handler.MonitorNetworkHandler;
import com.troblecodings.signals.handler.NameHandler;
import com.troblecodings.signals.handler.SignalBoxHandler;
import com.troblecodings.signals.handler.SignalStateHandler;
Expand Down Expand Up @@ -57,6 +58,7 @@ public OpenSignalsMain() {
MinecraftForge.EVENT_BUS.register(NameHandler.class);
MinecraftForge.EVENT_BUS.register(SignalStateHandler.class);
MinecraftForge.EVENT_BUS.register(SignalBoxHandler.class);
MinecraftForge.EVENT_BUS.register(MonitorNetworkHandler.class);
debug = true;
log = LoggerContext.getContext().getLogger(MODID);

Expand Down Expand Up @@ -87,6 +89,7 @@ public static boolean isDebug() {
@EventHandler
public void onServerStop(final FMLServerStoppingEvent event) {
SignalStateHandler.onServerStop(event);
SignalBoxHandler.onServerStop(event);
NameHandler.onServerStop(event);
}

Expand All @@ -104,8 +107,9 @@ public void init(final FMLInitializationEvent event) {
}

public static Logger getLogger() {
if (log == null)
if (log == null) {
log = LogManager.getLogger(MODID);
}
return log;
}

Expand All @@ -123,21 +127,20 @@ private static Optional<Path> getRessourceLocation(final String location) {
if (url != null) {
final URI uri = url.toURI();
if ("file".equals(uri.getScheme())) {
if (!location.startsWith("/"))
if (!location.startsWith("/")) {
filelocation = "/" + filelocation;
}
final URL resource = OSBlocks.class.getResource(filelocation);
if (resource == null)
return Optional.empty();
return Optional.of(Paths.get(resource.toURI()));
} else {
if (!"jar".equals(uri.getScheme())) {
return Optional.empty();
}
if (fileSystemCache == null) {
fileSystemCache = FileSystems.newFileSystem(uri, Collections.emptyMap());
}
return Optional.of(fileSystemCache.getPath(filelocation));
}
if (!"jar".equals(uri.getScheme()))
return Optional.empty();
if (fileSystemCache == null) {
fileSystemCache = FileSystems.newFileSystem(uri, Collections.emptyMap());
}
return Optional.of(fileSystemCache.getPath(filelocation));
}
} catch (final IOException | URISyntaxException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public boolean hasTileEntity(final IBlockState state) {

@Override
public TileEntity createNewTileEntity(final World worldIn, final int meta) {
return null;
return getSupplierWrapper().map(type -> type.supply()).orElse(null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public void neighborChanged(final IBlockState state, final World worldIn, final
final RedstoneIOTileEntity tile = (RedstoneIOTileEntity) worldIn.getTileEntity(pos);
if (currentState && !hasNeighborSignal) {
worldIn.setBlockState(pos, state.withProperty(POWER, false));
tile.sendToAll();
tile.sendInputOff();
} else if (hasNeighborSignal && !currentState) {
worldIn.setBlockState(pos, state.withProperty(POWER, true));
tile.sendToAll();
tile.sendInputOn();
} else if (!hasNeighborSignal) {
worldIn.setBlockState(pos, state.withProperty(POWER, false));
}
Expand Down
215 changes: 215 additions & 0 deletions src/main/java/com/troblecodings/signals/blocks/Monitor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
package com.troblecodings.signals.blocks;

import java.util.ArrayList;
import java.util.List;

import com.troblecodings.signals.core.DestroyHelper;
import com.troblecodings.signals.core.MonitorBlockProperties;

import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class Monitor extends BasicBlock {

public static final List<Monitor> MONITORS = new ArrayList<>();

public static final PropertyDirection FACING = BlockHorizontal.FACING;
public static final PropertyBool LEFT = PropertyBool.create("left");
public static final PropertyBool RIGHT = PropertyBool.create("right");
public static final PropertyBool UP = PropertyBool.create("up");
public static final PropertyBool DOWN = PropertyBool.create("down");

private final MonitorBlockProperties prop;
private final MonitorTEBlock teMonitor;
private int id = -1;

public Monitor(final MonitorBlockProperties prop, final MonitorTEBlock teMonitor) {
super(Material.ROCK);
this.setDefaultState(getDefaultState().withProperty(FACING, EnumFacing.NORTH)
.withProperty(LEFT, Boolean.valueOf(false))
.withProperty(RIGHT, Boolean.valueOf(false))
.withProperty(UP, Boolean.valueOf(false))
.withProperty(DOWN, Boolean.valueOf(false)));
this.prop = prop;
this.teMonitor = teMonitor;
if (this instanceof MonitorTEBlock)
return;
this.id = MONITORS.size();
MONITORS.add(this);
}

@Override
public IBlockState getStateForPlacement(final World world, final BlockPos pos,
final EnumFacing face, final float hitX, final float hitY, final float hitZ,
final int meta, final EntityLivingBase placer, final EnumHand hand) {
IBlockState state = getDefaultState();
switch (face) {
case EAST:
state = state.withProperty(FACING, EnumFacing.EAST);
break;
case SOUTH:
state = state.withProperty(FACING, EnumFacing.SOUTH);
break;
case WEST:
state = state.withProperty(FACING, EnumFacing.WEST);
break;
case NORTH:
default:
state = state.withProperty(FACING, EnumFacing.NORTH);
break;
}
return state;
}

@Override
public IBlockState getActualState(final IBlockState state, final IBlockAccess world,
final BlockPos pos) {
IBlockState newState = state;
EnumFacing dir = newState.getValue(FACING);
switch (dir) {
case EAST:
newState = newState.withProperty(LEFT, connectsTo(world, pos.south(), newState))
.withProperty(RIGHT, connectsTo(world, pos.north(), newState))
.withProperty(UP, connectsTo(world, pos.up(), newState))
.withProperty(DOWN, connectsTo(world, pos.down(), newState));
break;
case SOUTH:
newState = newState.withProperty(LEFT, connectsTo(world, pos.west(), newState))
.withProperty(RIGHT, connectsTo(world, pos.east(), newState))
.withProperty(UP, connectsTo(world, pos.up(), newState))
.withProperty(DOWN, connectsTo(world, pos.down(), newState));
break;
case WEST:
newState = newState.withProperty(LEFT, connectsTo(world, pos.north(), newState))
.withProperty(RIGHT, connectsTo(world, pos.south(), newState))
.withProperty(UP, connectsTo(world, pos.up(), newState))
.withProperty(DOWN, connectsTo(world, pos.down(), newState));
break;
case NORTH:
default:
newState = newState.withProperty(LEFT, connectsTo(world, pos.east(), newState))
.withProperty(RIGHT, connectsTo(world, pos.west(), newState))
.withProperty(UP, connectsTo(world, pos.up(), newState))
.withProperty(DOWN, connectsTo(world, pos.down(), newState));
break;
}
return newState;
}

private boolean connectsTo(final IBlockAccess level, final BlockPos pos,
final IBlockState thisState) {
IBlockState otherState = level.getBlockState(pos);
return otherState.getBlock() instanceof Monitor
&& thisState.getValue(FACING).equals(otherState.getValue(FACING));
}

@Override
public IBlockState withRotation(final IBlockState state, final Rotation rot) {
return state.withProperty(FACING, rot.rotate(state.getValue(FACING)));
}

@Override
public IBlockState withMirror(final IBlockState state, final Mirror mirrorIn) {
return state.withRotation(mirrorIn.toRotation(state.getValue(FACING)));
}

@Override
public int getMetaFromState(final IBlockState state) {
return state.getValue(FACING).ordinal();
}

@Override
public IBlockState getStateFromMeta(final int meta) {
return getDefaultState().withProperty(FACING, EnumFacing.values()[meta]);
}

@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {
FACING, LEFT, RIGHT, UP, DOWN
});
}

@Override
public void breakBlock(final World worldIn, final BlockPos pos, final IBlockState state) {
super.breakBlock(worldIn, pos, state);
DestroyHelper.checkAndDestroyOtherBlocks(worldIn, pos, state,
block -> block instanceof Monitor);
}

@SuppressWarnings("deprecation")
@Override
public AxisAlignedBB getBoundingBox(final IBlockState state, final IBlockAccess source,
final BlockPos pos) {
final BlockPos downPos = pos.down();
final IBlockState downState = source.getBlockState(downPos);
final Block downBlock = downState.getBlock();
if (downBlock instanceof Monitor)
return downBlock.getBoundingBox(downState, source, downPos).offset(0, -1, 0);
final BlockPos nextPos = getLeftPos(getActualState(state, source, pos), pos);
final Vec3i relative = nextPos.subtract(pos);
final IBlockState nextState = source.getBlockState(nextPos);
final Block nextBlock = nextState.getBlock();
if (!relative.equals(BlockPos.ORIGIN) && nextBlock instanceof Monitor)
return nextBlock.getBoundingBox(nextState, source, nextPos).offset(relative.getX(),
relative.getY(), relative.getZ());
return FULL_BLOCK_AABB;
}

private static BlockPos getLeftPos(final IBlockState state, final BlockPos pos) {
if (!(state.getBlock() instanceof Monitor) || !state.getValue(LEFT))
return pos;
EnumFacing dir = state.getValue(FACING);
switch (dir) {
case EAST:
return pos.south();
case SOUTH:
return pos.west();
case WEST:
return pos.north();
case NORTH:
default:
return pos.east();
}
}

@Override
public AxisAlignedBB getCollisionBoundingBox(final IBlockState blockState,
final IBlockAccess worldIn, final BlockPos pos) {
return getBoundingBox(blockState, worldIn, pos);
}

@Override
public boolean shouldHaveItem() {
return false;
}

public MonitorTEBlock getTileEntityMonitorBlock() {
return teMonitor;
}

public MonitorBlockProperties getMonitorProperties() {
return prop;
}

public int getID() {
return id;
}

}
Loading
Loading