Skip to content

Conversation

@TheBuilderBoy76
Copy link
Contributor

Adds floodlights, halogen bulbs, and horizontal GUI trackbars; implements a custom block rotation system; and fixes some minor bugs.

Additions:

  • Added fully functional Basic and Motorized floodlights to the game.
    • Floodlights can be placed on any solid surface (floor, wall, and ceiling) and the base can be rotated in any direction by using the wrench (tool or key).
    • The lamp socket ("head") of the floodlights can be rotated 360° horizontally and 180° vertically, allowing light to be projected in any direction.
    • Basic floodlights use trackbars in the GUI to control light beam projection, while Motorized floodlights use signal inputs around the base.
      • Motorized floodlight signal and power connection scheme
    • Light is projected in a "cone" up to 32 blocks long, depending on the number of bulbs inserted (1 or 2) and their voltages. The width of this light cone can be adjusted from 0° to 45° using the GUI trackbar or signal input, depending on the floodlight type.
      • See this graphic for a demo of the math behind the beam projection.
  • Added a new halogen bulb type that can only be used in floodlights. Comes in 50V and 200V variants.
    • The 50V halogen bulbs draw 250 watts and have a throw distance of 8 blocks, while the 200V halogen bulbs draw 500 watts and have a throw distance of 16 blocks.
    • Halogen bulb aging and nominal lifetime can be adjusted in the config file.
  • Added crafting recipes for each floodlight and halogen bulb type.
Basic floodlight crafting recipe Motorized floodlight crafting recipe 50V halogen bulb crafting recipe 200V halogen bulb crafting recipe

Technical Features:

  • Added new HybridNodeDirection and HybridNodeLRDU classes to support multi-directional rotation and connectivity of TransparentNode blocks. These classes introduce the concepts of a rotational axis and a facing direction for a block, both defined by how the block is placed by a player. These characteristics, in turn, allow for easily defining different rotations of the block while maintaining the proper arrangement of SixNode electrical connections.
  • Added new GuiHorizontalTrackBar class. This allows for the use of horizontal trackbars in GUIs with the same set of features as vertical trackbars.

Bugfixes:

  • transparentNodedescriptor renamed to transparentNodeDescriptor in all places it appears.
  • Lamp supply now uses LinkedHashMap instead of HashMap to list channels in WAILA. This fixes the channels always being listed out of order.
  • Unnecessary colon removed from "Life Left" WAILA string in lamp sockets.
  • Lamp sockets now only accept bulbs that have a matching LampSocketType. This primarily prevents floodlight bulbs from being used in regular lamp sockets, and vice-versa.

Notes:

  • Due to issues with the existing ELN and Minecraft lighting engines, floodlights with high throw distances and cone widths are prone to induce "ghost lights" when the light beam is rotated while the floodlight is on. Additionally, ghost lights can be left behind when turning the floodlight off from full brightness. These ghost lights can be removed by closing and reopening the world. The best way to prevent lighting bugs is to only rotate floodlights when they are off and gradually reduce the voltage instead of cutting it off sharply.

TheBuilderBoy76 and others added 30 commits July 21, 2024 21:03
…h when placing motorized floodlight, add English translations for floodlight names, implement temporary item textures (slightly modified versions of existing texture in model folder), adjust animations (remove sharp jump back to 0 in X)
…h when placing motorized floodlight, add English translations for floodlight names, implement temporary item textures (slightly modified versions of existing texture in model folder), adjust animations (remove sharp jump back to 0 in X)
@TheBuilderBoy76 TheBuilderBoy76 marked this pull request as ready for review January 10, 2026 21:15
super.addInformation(itemStack, entityPlayer, list, par4)
list.add(tr("Technology: %1$", type))
list.add(tr("Range: %1$ blocks", (nominalLight * 15).toInt()))
// TODO: Convert all lamp ranges (instead of brightnesses) to be dependent upon bulb type (future lighting code overhaul)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably should make an issue for this one

}

/**
* DO NOT TOUCH THIS FUNCTION!!!!!
Copy link
Collaborator

Choose a reason for hiding this comment

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

lol

@jrddunbr
Copy link
Collaborator

I didn't finish. Not sure why you needed to make the hybrid transparent node but I suspect rotating the connection hitbox is hard without it.

@TheBuilderBoy76
Copy link
Contributor Author

Yeah, without some sort of concrete reference direction I really had no idea how to keep the block connections lined up properly. The existing Direction and LRDU code didn’t really allow for what I was looking for, and I didn’t want to break everything that depended on those, so I just rewrote them specifically for the floodlights. Maybe one day someone can go through and update the rest of the codebase to use the new hybrid node stuff.

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.

2 participants