Abdiel Kavash 3b3bc4b9ad Add preset IAlignmentLimits constants. (#43)
Many multiblocks can only be placed or rotated in certain orientations.
This has been always done ad-hoc, with individual checks for each
controller. This is inconsistent and sometimes it results in bugs where
certain orientations are not allowed for no discernible reason; for
example
https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/14206.

This PR introduces a short list of named constants to
`IAlignmentLimits`, which describe common multiplboc orientations. These
are currently:

* `UNLIMITED`: Any orientation is allowed. Most multiblocks.
* `UPRIGHT`: The multiblock must be in an upright position, with the top
side facing up. Example: Distillation Tower, Ore Washing Plant.
* `NOT_UPSIDE_DOWN`: The multiblock can be in any orientation, except
for the top side facing directly downwards. This is currently only the
Large Heat Exchanger and Integrated Ore Factory.
* `FACING_UP`: The front of the controller must face up. Example:
Flotation Cell, XL Turbines.

Currently, these constants describe the allowed facings of *all* GT5U
multiblocks.

A multiblock can then simply return one of these constants from
`getInitialAlignmentLimits()` to describe its valid orientations,
instead of implementing the logic itself. This concentrates the code to
one place, improves readability, and fixes any bugs connected with these
checks being done wrong.

Of course, even though the list is currently complete, if any future
multiblock wants to implement its own strange restrictions on
orientation, it can still implement its own check instead of returning
one of the constants.

A follow-up PR to GT5U implements this for all multiblocks which
restrict valid orientations:
https://github.com/GTNewHorizons/GT5-Unofficial/pull/4595
2025-08-01 10:54:59 +07:00
2024-01-09 22:52:41 +01:00
2025-03-10 16:27:58 -05:00
2022-03-02 00:32:50 +08:00
2025-03-10 16:27:58 -05:00
2023-02-28 01:30:57 +08:00
2024-02-04 20:01:59 +00:00
2022-01-17 23:58:46 -08:00
2025-03-10 16:27:58 -05:00
2024-08-07 15:42:01 +07:00
2023-07-13 22:05:35 +02:00
2024-01-09 11:42:10 +08:00

StructureLib

A standalone version of TecTech structure api.

Originally created by TecTech authors, taken with permission. It's under MIT license anyway.

permission

Using

  1. Add this to your build.gradle
    dependencies {
      compile "com.github.GTNewHorizons:StructureLib:master-SNAPSHOT:deobf"
    }
    repositories {
        maven {
            name = "jitpack.io"
            url = "https://jitpack.io"
        }
    }
    
    Replace master-SNAPSHOT with a commit hash or a tag name (if any) of your choice to prevent unexpected upstream changes.
  2. Add required-after:structurelib; to your @Mod(dependencies = "..") tring.
  3. Add structurelib to your mcmod.info.

Contribution

The project is developed using IDEA. Please manually configure the build to not delegate to gradle for textures to show up in dev.

Current license

Due to me adding in ItemStackMap, which was derived from code from CodeChicken's LGPL mod NEI. This mod is effectively considered licensed under LGPL in its entirety since commit ebef584b8c or any squash commit containing it, e.g. 609e50428e.

Note while the LICENSE.txt is added by a much later commit, all code on previous commits are covered by this as well.

S
Description
No description provided
Readme GPL-3.0
16 MiB
0 Stars 1 Watchers 0 Forks
Languages
Java 99.8%
Shell 0.2%