X Tutup
Skip to content

BuildCraft for 1.18.2 Forge#4714

Open
CalenXwX wants to merge 65 commits intoBuildCraft:8.0.x-1.18.2from
CalenXwX:8.0.x-1.18.2
Open

BuildCraft for 1.18.2 Forge#4714
CalenXwX wants to merge 65 commits intoBuildCraft:8.0.x-1.18.2from
CalenXwX:8.0.x-1.18.2

Conversation

@CalenXwX
Copy link

@CalenXwX CalenXwX commented Apr 10, 2024

Here is BC for 1.18.2 Forge!
Now most things work well in the new mc version~awa
(But not completed yet...)

Fixed:
Ledger in some GUIs (ArchitectTable & Replacer) does not update animation after clicked
When world loading, builder tileentity will not load the blueprint correctly and some items will disappear
Builder cannot destroy blocks with no strength, such as grass and dead_bush
Issue#4694: In ElectronitLibrary GUI, the white arrow overlay of blueprint saving does not appear
Issue#4685: en_us I18n value of advancements.buildcrafttransport.sealing_fluids.description
BuildCraft-Localization Issue#305: updated some zh_cn I18n values

Not impl:
ZonePlanner GUI and rendering
Oil biomes (It seems hard to add biomes to an existing dimension in 1.18.2...)
Frozen fluid sprite (Using still texture instead now)
Quarry collision boxes of moving parts
RecipeBook of GUI(AutoCraft & AdvancedCrafting)
Config (I just copied the config classes of forge 1.12.2 to use them in 1.18.2)
Tooltip rendering of blocks in blueprint

I retained some of the old code of 1.12.2 in comments, then we can know the meaning of the code with new deobf mappings easier. For this, I changed the code style from

xxxxxxx {
}

to

xxxxxxx
{
}

In the future, we can remove the messy comments and recover the code style.

To differ from the code from BC 1.12.2, some methods I created additionally are under the comment // Calen.
When we ensure the additional code is necessary and works well, we can remove the comments.
Also, new TODOs looks like // TODO Calen

It's hard for me to configure build.gradle correctly, so... I combined BuildCraft API, BuildCraft Localization and BuildCraft Compat with BC main modules in this whole branch. Maybe it's better to devide them as 1.12.2...
Vecmath and Trove4j are jar in jar dependencies, and they works well in normal mc client and server. However, I should add the jar file paths to the txt files in /build/classpath/, or the dev environment cannot find them when running mc. I haven't found why...

XwX

@AlexIIL AlexIIL changed the base branch from 8.0.x-1.12.2 to 8.0.x-1.18.2 April 10, 2024 22:11
@AlexIIL
Copy link
Member

AlexIIL commented Apr 10, 2024

This is quite impressive! Well done for bringing BuildCraft to 1.18.2!

I'm a bit miffed that you beat me to it (I'm still working on a BuildCraft 9 on minecraft 1.19.4 at the moment, with a lot of new features), but that doesn't stop us from releasing this!

There are a few minor technical problems I have with this port, and one major one, as it stands.

Forge's configuration system is licensed under the LGPL, which we can't redistribute as-is with buildcraft itself. I'm not sure of a great solution to this honestly - it might mean pulling those files out into a separate project (there are already a few like this, but I can't see one for 1.18.2 so we might have to make our own or ask them to backport it to 1.18.2)

The other minor problems are:

  • You've moved all source code and resources from common/buildcraft_resources to src/main/java/src/main/resources - please revert this so we don't lose file history. You can fix this by uncommenting these lines from the build.gradle file. If you have trouble with it (or if forgegradle turns out to be more complicated than I thought) then I can have a go instead, and PR you a fix?
  • You've deleted a lot of files and directories from the root folder that should be retained:
    • .github contains our issue templates
    • guidelines contains our checkstyle, license header, and a few other minor things.
    • misc contains old textures and other misc files which I'd like to keep.
    • src/test/java probably shouldn't be deleted? I can understand if you don't want to port these though, or if they aren't easy to run.
    • sub_projects contained the expression sub-library, which I used for CustomLoadingScreen, and probably nothing else. I don't mind if you don't end up keeping it though, since I'll use my own BC9 version in the future.
  • You've deleted a few files with were old and useless and don't need to be retained (so not a mistake, just something I'm pointing out :p) :
    • common_old_license
    • license_checker is probably not useful anymore
    • tests/buildcraft/tests wasn't used in 1.12.
    • testsuite wasn't either.
    • .travis.yml was used for building a while ago, but not anymore.
    • Jenkinsfile was possibly used for building too, but not anymore.
    • private.properties.example was used for building, but not anymore.
    • test.py was an old tester, which isn't used anymore.
      -The BuildCraft-Localization and BuildCraftGuide linked folders should be kept, as that way we can keep all localization PRs to that repository (and guide book PRs, although they are few and far between).

All the code style changes and //TODO Calen comments are fine!

I've also given up on Oil Biomes for BC9, since the worldgen changes in newer versions of minecraft are just painful :p.

All of the missing code is okay, and doesn't stop us from releasing a test build, if you ware okay with that?

@AlexIIL
Copy link
Member

AlexIIL commented Apr 10, 2024

I'm trying to run this in eclipse and getting a few problems:

[00:15:10] [modloading-worker-0/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: buildcraftlib, class buildcraft.lib.BCLib
java.lang.ExceptionInInitializerError: null
	at buildcraft.lib.recipe.RefineryRecipeRegistry.<init>(RefineryRecipeRegistry.java:33) ~[%2385!/:?] {re:classloading}
	at buildcraft.lib.recipe.RefineryRecipeRegistry.<clinit>(RefineryRecipeRegistry.java:30) ~[%2385!/:?] {re:classloading}
	at buildcraft.lib.BCLibRegistries.fmlPreInit(BCLibRegistries.java:31) ~[%2385!/:?] {re:classloading}
	at buildcraft.lib.BCLib.<clinit>(BCLib.java:63) ~[%2385!/:?] {re:classloading}
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:67) ~[javafmllanguage-1.18.2-40.2.14.jar%2381!/:?] {}
	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.18.2-40.2.14.jar%2384!/:?] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) [?:?] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?] {}
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?] {}
Caused by: java.lang.IllegalStateException: Registry is already frozen (trying to add key ResourceKey[minecraft:recipe_type / buildcraftfactory:distillation])
	at net.minecraft.core.MappedRegistry.validateWrite(MappedRegistry.java:78) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:87) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:83) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.MappedRegistry.register(MappedRegistry.java:129) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.Registry.register(Registry.java:564) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.Registry.register(Registry.java:560) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.world.item.crafting.RecipeType.register(RecipeType.java:19) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at buildcraft.api.recipes.IRefineryRecipeManager$IDistillationRecipe.<clinit>(IRefineryRecipeManager.java:138) ~[%2385!/:?] {re:classloading}
	... 18 more

Is this normal, or am I running this incorrectly?

@CalenXwX
Copy link
Author

CalenXwX commented Apr 11, 2024

This is quite impressive! Well done for bringing BuildCraft to 1.18.2!

I'm a bit miffed that you beat me to it (I'm still working on a BuildCraft 9 on minecraft 1.19.4 at the moment, with a lot of new features), but that doesn't stop us from releasing this!

There are a few minor technical problems I have with this port, and one major one, as it stands.

Forge's configuration system is licensed under the LGPL, which we can't redistribute as-is with buildcraft itself. I'm not sure of a great solution to this honestly - it might mean pulling those files out into a separate project (there are already a few like this, but I can't see one for 1.18.2 so we might have to make our own or ask them to backport it to 1.18.2)

The other minor problems are:

  • You've moved all source code and resources from common/buildcraft_resources to src/main/java/src/main/resources - please revert this so we don't lose file history. You can fix this by uncommenting these lines from the build.gradle file. If you have trouble with it (or if forgegradle turns out to be more complicated than I thought) then I can have a go instead, and PR you a fix?

  • You've deleted a lot of files and directories from the root folder that should be retained:

    • .github contains our issue templates
    • guidelines contains our checkstyle, license header, and a few other minor things.
    • misc contains old textures and other misc files which I'd like to keep.
    • src/test/java probably shouldn't be deleted? I can understand if you don't want to port these though, or if they aren't easy to run.
    • sub_projects contained the expression sub-library, which I used for CustomLoadingScreen, and probably nothing else. I don't mind if you don't end up keeping it though, since I'll use my own BC9 version in the future.
  • You've deleted a few files with were old and useless and don't need to be retained (so not a mistake, just something I'm pointing out :p) :

    • common_old_license
    • license_checker is probably not useful anymore
    • tests/buildcraft/tests wasn't used in 1.12.
    • testsuite wasn't either.
    • .travis.yml was used for building a while ago, but not anymore.
    • Jenkinsfile was possibly used for building too, but not anymore.
    • private.properties.example was used for building, but not anymore.
    • test.py was an old tester, which isn't used anymore.
      -The BuildCraft-Localization and BuildCraftGuide linked folders should be kept, as that way we can keep all localization PRs to that repository (and guide book PRs, although they are few and far between).

All the code style changes and //TODO Calen comments are fine!

I've also given up on Oil Biomes for BC9, since the worldgen changes in newer versions of minecraft are just painful :p.

All of the missing code is okay, and doesn't stop us from releasing a test build, if you ware okay with that?

Oh... I'm sorry for disrupting your plan... QwQ
I'm also looking forward to the new BC for 1.19 :)
Maybe this version for 1.18.2 could be a gift for you :)

Months ago, I set up a mc server, using CatServer as the core, which can run both forge mods and spigot plugins. 1.18.2 is the latest version of CatServer, but many classic mods are absent for this version, such as IC2E, Custom NPCs and BC. Known that BC skipped 1.18.2, I'd like to create it by myself, and it will not duplicate what you do for a newer mc version than 1.18.2.

Thanks for your suggestions. owo
I did have some difficulty with the license and the project structure. This time I just make the game run like that in 1.12.2, but there are still a lot of unsolved problems... I'd like to try to fix them soon, and I'm looking forward to your help if possible XwX

Thanks for your tips, and now I know how to use files in other directories instead of src/main >w<

Access permissions to my fork have been given to you, and please feel free to edit it :)
I'll be honored if this PR could be merged. awa

@CalenXwX
Copy link
Author

CalenXwX commented Apr 11, 2024

I'm trying to run this in eclipse and getting a few problems:

[00:15:10] [modloading-worker-0/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: buildcraftlib, class buildcraft.lib.BCLib
java.lang.ExceptionInInitializerError: null
	at buildcraft.lib.recipe.RefineryRecipeRegistry.<init>(RefineryRecipeRegistry.java:33) ~[%2385!/:?] {re:classloading}
	at buildcraft.lib.recipe.RefineryRecipeRegistry.<clinit>(RefineryRecipeRegistry.java:30) ~[%2385!/:?] {re:classloading}
	at buildcraft.lib.BCLibRegistries.fmlPreInit(BCLibRegistries.java:31) ~[%2385!/:?] {re:classloading}
	at buildcraft.lib.BCLib.<clinit>(BCLib.java:63) ~[%2385!/:?] {re:classloading}
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:67) ~[javafmllanguage-1.18.2-40.2.14.jar%2381!/:?] {}
	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.18.2-40.2.14.jar%2384!/:?] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) [?:?] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?] {}
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?] {}
Caused by: java.lang.IllegalStateException: Registry is already frozen (trying to add key ResourceKey[minecraft:recipe_type / buildcraftfactory:distillation])
	at net.minecraft.core.MappedRegistry.validateWrite(MappedRegistry.java:78) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:87) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:83) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.MappedRegistry.register(MappedRegistry.java:129) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.Registry.register(Registry.java:564) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.core.Registry.register(Registry.java:560) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at net.minecraft.world.item.crafting.RecipeType.register(RecipeType.java:19) ~[forge-1.18.2-40.2.14_mapped_official_1.18.2-recomp.jar%2380!/:?] {re:classloading}
	at buildcraft.api.recipes.IRefineryRecipeManager$IDistillationRecipe.<clinit>(IRefineryRecipeManager.java:138) ~[%2385!/:?] {re:classloading}
	... 18 more

Is this normal, or am I running this incorrectly?

It seems that this is caused by duplicated (I fogot to remove the earlier) call of recipe registry initialization in BCLibRegistries.
Does it work well now? (This crash didn't appear when I ran in IDEA... So I'm not sure...)

@timmbobb
Copy link

Stupid question, how hard would this be to port to 1.20 from here?

CalenXwX added 3 commits May 25, 2024 17:27
Fixed:
1. Lava was not able to be used as coolable fluid.
2. Fluid in [Start] section will not be stored to save data. (a bug from 1.12.2)
@Leclowndu93150
Copy link

this guy doig god's work

@furtabs
Copy link

furtabs commented Jun 5, 2024

This is really impressive. The only question i have now is BC going to Neo(forge) or Fabric.

@furtabs
Copy link

furtabs commented Jun 5, 2024

@LRW-Calen I was wondering if I could add you on discord and talk about this, I'm looking to help contribute, thanks!!

Emmmmm... It's ok to add me on discord :) I'm in the server of bc. I've not figured out how to reply to you... XwX Maybe we'd better wait for the good news from AlexIIL? But I'm also not sure how long it will be until that comes out... If we update bc for a newer mc version, what we do might duplicate AlexIIL's and become a community version. The item/block ids and nbt tags will be different between the versions... That will cause players trouble. Perhaps it's a better choice to port bc to 1.16.5? I'm not sure... QwQ

No Mod has made the 1.12 to 1.13 conversion easy, and BC is no exception.

@CalenXwX
Copy link
Author

CalenXwX commented Jun 16, 2024

Oh...... I'v not found I can upload a local file as a release until several hours ago...... I thought releases could only be created from other websites like jenkins... A stupid mistake! QwQ

here are the test release links ↓
https://github.com/CalenXwX/BuildCraft/releases/tag/7.99.24.9-1.18.2
https://github.com/CalenXwX/BuildCraft/releases/tag/7.99.24.9-1.16.5
we can download them instead of building locally with the code

Warn: Please don't run it in precious saves, and please often backup. Although I'v tested in my own mc server many times and it worked fine, I'm still not able to ensure that there are no bugs which break the save data.

@Leclowndu93150
Copy link

links are broken for people that aren't you

@lm000108
Copy link

Hello Energy incompatibility Mek's MJ is Milion Joule, which is a million joules, while [BC] Architecture uses M) which is Minecraft Joule (Minecraft Joule)

CalenXwX added 2 commits July 21, 2024 14:45
1. fixed rendering position of builder's path
2. plugs on pipes now can rotate with the rotation of builder block (a bug from 1.12.2)
@Leclowndu93150
Copy link

when 1.21

CalenXwX added 17 commits July 21, 2024 18:53
…S FrozenSprite Distiller

1.enabled renderLaserStatic
2.Wrench now is able to switch creative engine output
3.FloodGate and MineingWell now are able to tick
4.fixed a bug from 1.12.2: Quarry and Chute changes the order of values in Direction.VALUES
5.enabled FrozenSprite
6.Distiller fluid capability
…ith FE engine

Fixed config double value reading
Fixed laser rendering (laser looks covered with fog when distance between player and (x=0, z=0) is longer than render distance)
Fixed NPE when BC modules using BCLibRegistries inisialize earlier than BCLib.
Fixed GuiArchitectTable closes when user type <E> in the edit box.
Fixed the edit box of GuiReplacer was not clickable. (but the edit box is still useless)
Fixed the edit box in GuiList was not editable.
Fixed Create mod's HosePulley could not enter and drain oil blocks.
Fixed "\u" in config jsons.
Changed pipe's map colours.
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.

7 participants

X Tutup