Skip to content

Commit 23d5509

Browse files
committed
wip 1.21.1
1 parent b716a4e commit 23d5509

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+600
-546
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
fetch-tags: true
14+
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
24+
- name: Build with Gradle
25+
run: ./gradlew build

build.gradle

Lines changed: 172 additions & 210 deletions
Large diffs are not rendered by default.

gradle.properties

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,57 @@
11
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
22
# This is required to provide enough memory for the Minecraft decompilation process.
33
org.gradle.jvmargs=-Xmx3G
4-
org.gradle.daemon=false
4+
org.gradle.daemon=true
5+
org.gradle.parallel=true
6+
org.gradle.caching=true
7+
org.gradle.configuration-cache=true
58

6-
minecraft_version = 1.20.1
7-
forge_version = 47.3.0
9+
minecraft_version=1.21.1
810

911
mod_version = 1.3.1
1012

11-
jei_minecraft_version = 1.20.1
12-
jei_version = 15.20.0.106
13+
jei_version=19.9.1.125
1314

14-
create_version = 6.0.3-71
15-
ponder_version = 1.0.51
15+
create_version = 6.0.3-46
16+
ponder_version = 1.0.45
1617
flywheel_version = 1.0.1
17-
registrate_version = MC1.20-1.3.3
18+
registrate_version = MC1.21-1.3.0+62
1819

1920
forgegradle_version = 6.0.6
2021
mixingradle_version = 0.7-SNAPSHOT
2122
mixin_version = 0.8.5
2223
librarian_version = 1.+
23-
parchment_version = 2023.06.26
24+
25+
cc_tweaked_enable = true
26+
cc_tweaked_minecraft_version = 1.21.1
27+
cc_tweaked_version = 1.114.2
28+
29+
#read more on this at https://github.com/neoforged/ModDevGradle?tab=readme-ov-file#better-minecraft-parameter-names--javadoc-parchment
30+
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
31+
parchment_minecraft_version=1.21.1
32+
parchment_mappings_version=2024.11.17
33+
# The Minecraft version range can use any release version of Minecraft as bounds.
34+
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
35+
# as they do not follow standard versioning conventions.
36+
minecraft_version_range=[1.21.1]
37+
# The Neo version must agree with the Minecraft version to get a valid artifact
38+
neo_version=21.1.136
39+
# The Neo version range can use any version of Neo as bounds
40+
neo_version_range=[21.1.136,)
41+
# The loader version range can only use the major version of FML as bounds
42+
loader_version_range=[1,)
43+
44+
## Mod Properties
45+
mod_id=createadditon
46+
# The human-readable display name for the mod.
47+
mod_name=Create Crafts & Additions
48+
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
49+
mod_license=MIT License, Copyright 2025 MRH0
50+
# The mod version. See https://semver.org/
51+
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
52+
# This should match the base package used for the mod sources.
53+
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
54+
mod_group_id=com-mrh0.createaddition
55+
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
56+
mod_authors=MRH0
57+

gradle/wrapper/gradle-wrapper.jar

-17.6 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,10 +85,9 @@ done
8385
# This is normally unused
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
88+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
9091

9192
# Use the maximum available, or set MAX_FD != -1 to use that value.
9293
MAX_FD=maximum
@@ -133,26 +134,29 @@ location of your Java installation."
133134
fi
134135
else
135136
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137+
if ! command -v java >/dev/null 2>&1
138+
then
139+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137140
138141
Please set the JAVA_HOME variable in your environment to match the
139142
location of your Java installation."
143+
fi
140144
fi
141145

142146
# Increase the maximum file descriptors if we can.
143147
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144148
case $MAX_FD in #(
145149
max*)
146150
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
151+
# shellcheck disable=SC2039,SC3045
148152
MAX_FD=$( ulimit -H -n ) ||
149153
warn "Could not query maximum file descriptor limit"
150154
esac
151155
case $MAX_FD in #(
152156
'' | soft) :;; #(
153157
*)
154158
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
159+
# shellcheck disable=SC2039,SC3045
156160
ulimit -n "$MAX_FD" ||
157161
warn "Could not set maximum file descriptor limit to $MAX_FD"
158162
esac
@@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then
197201
done
198202
fi
199203

200-
# Collect all arguments for the java command;
201-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202-
# shell script including quotes and variable substitutions, so put them in
203-
# double quotes to make sure that they get re-expanded; and
204-
# * put everything else in single quotes, so that it's not re-expanded.
204+
205+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
206+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207+
208+
# Collect all arguments for the java command:
209+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210+
# and any embedded shellness will be escaped.
211+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212+
# treated as '${Hostname}' itself on the command line.
205213

206214
set -- \
207215
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

settings.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
pluginManagement {
22
repositories {
3+
mavenLocal()
34
gradlePluginPortal()
4-
maven {
5-
name = 'MinecraftForge'
6-
url = 'https://maven.minecraftforge.net/'
7-
}
5+
maven { url = 'https://maven.neoforged.net/releases' }
86
}
97
}
108

119
plugins {
12-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
13-
}
10+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0'
11+
}

src/main/java/com/mrh0/createaddition/CreateAddition.java

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
package com.mrh0.createaddition;
22

3+
import com.mrh0.createaddition.config.CommonConfig;
34
import com.mrh0.createaddition.index.*;
45
import com.mrh0.createaddition.index.CASounds;
56
import com.mrh0.createaddition.ponder.CAPonderPlugin;
67
import com.mrh0.createaddition.trains.schedule.CASchedule;
7-
import com.simibubi.create.content.fluids.tank.BoilerHeaters;
88
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
99
import com.simibubi.create.foundation.item.ItemDescription;
1010
import com.simibubi.create.foundation.item.KineticStats;
11-
import com.simibubi.create.infrastructure.config.AllConfigs;
1211
import net.createmod.catnip.lang.FontHelper;
1312
import net.createmod.ponder.foundation.PonderIndex;
1413
import net.minecraft.client.renderer.ItemBlockRenderTypes;
1514
import net.minecraft.client.renderer.RenderType;
1615
import net.minecraft.commands.CommandSourceStack;
16+
import net.minecraft.core.registries.Registries;
1717
import net.minecraft.resources.ResourceLocation;
18-
import net.minecraftforge.api.distmarker.Dist;
19-
import net.minecraftforge.common.MinecraftForge;
20-
import net.minecraftforge.event.RegisterCommandsEvent;
21-
import net.minecraftforge.eventbus.api.IEventBus;
22-
import net.minecraftforge.eventbus.api.SubscribeEvent;
23-
import net.minecraftforge.fml.DistExecutor;
24-
import net.minecraftforge.fml.ModList;
25-
import net.minecraftforge.fml.ModLoadingContext;
26-
import net.minecraftforge.fml.common.Mod;
27-
import net.minecraftforge.fml.config.ModConfig;
28-
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
29-
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
30-
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
31-
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
32-
import net.minecraftforge.fml.loading.FMLPaths;
18+
import net.minecraft.world.item.CreativeModeTab;
19+
import net.minecraft.world.item.CreativeModeTabs;
20+
import net.neoforged.api.distmarker.Dist;
21+
import net.neoforged.bus.api.IEventBus;
22+
import net.neoforged.bus.api.SubscribeEvent;
23+
import net.neoforged.fml.ModContainer;
24+
import net.neoforged.fml.ModList;
25+
import net.neoforged.fml.common.Mod;
26+
import net.neoforged.fml.config.ModConfig;
27+
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
28+
import net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent;
29+
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
30+
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
31+
import net.neoforged.neoforge.event.RegisterCommandsEvent;
32+
import net.neoforged.neoforge.event.server.ServerStartingEvent;
33+
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
34+
import net.neoforged.neoforge.registries.DeferredHolder;
35+
import net.neoforged.neoforge.registries.DeferredRegister;
3336
import net.minecraftforge.network.NetworkRegistry;
3437
import net.minecraftforge.network.simple.SimpleChannel;
3538

@@ -40,14 +43,14 @@
4043
import com.mojang.brigadier.CommandDispatcher;
4144
import com.mrh0.createaddition.blocks.liquid_blaze_burner.LiquidBlazeBurnerBlock;
4245
import com.mrh0.createaddition.commands.CCApiCommand;
43-
import com.mrh0.createaddition.config.Config;
4446
import com.mrh0.createaddition.network.EnergyNetworkPacket;
4547
import com.mrh0.createaddition.network.ObservePacket;
4648
import com.simibubi.create.foundation.data.CreateRegistrate;
4749
import com.simibubi.create.foundation.item.TooltipModifier;
48-
import com.simibubi.create.api.stress.BlockStressValues;
4950
import com.simibubi.create.api.boiler.BoilerHeater;
5051

52+
import static net.minecraft.network.chat.Component.translatable;
53+
5154
@Mod(CreateAddition.MODID)
5255
public class CreateAddition {
5356
public static final Logger LOGGER = LogManager.getLogger();
@@ -72,24 +75,33 @@ public class CreateAddition {
7275
.andThen(TooltipModifier.mapNull(KineticStats.create(item))));
7376
}
7477

75-
public CreateAddition() {
76-
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
77-
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
78-
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::postInit);
79-
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onRegister);
78+
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
79+
80+
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> MAIN_TAB = CREATIVE_MODE_TABS.register(MODID, () -> CreativeModeTab.builder()
81+
.withTabsBefore(CreativeModeTabs.COMBAT)
82+
.icon(() -> CABlocks.ELECTRIC_MOTOR.get().asItem().getDefaultInstance())
83+
.title(translatable("tab", "main"))
84+
.build());
85+
86+
public CreateAddition(IEventBus eventBus, ModContainer container) {
87+
eventBus.addListener(this::setup);
88+
eventBus.addListener(this::doClientStuff);
89+
eventBus.addListener(this::postInit);
90+
eventBus.addListener(this::onRegister);
91+
eventBus.addListener(RegisterCapabilitiesEvent.class, CACapabilities::register);
8092
//FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(RecipeSerializer.class, CARecipes::register);
8193

82-
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
83-
MinecraftForge.EVENT_BUS.register(this);
94+
//IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
95+
//MinecraftForge.EVENT_BUS.register(this);
8496

85-
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.COMMON_CONFIG);
86-
Config.loadConfig(Config.COMMON_CONFIG, FMLPaths.CONFIGDIR.get().resolve("createaddition-common.toml"));
97+
container.registerConfig(ModConfig.Type.COMMON, CommonConfig.COMMON_CONFIG);
98+
//CommonConfig.loadConfig(CommonConfig.COMMON_CONFIG, FMLPaths.CONFIGDIR.get().resolve("createaddition-common.toml"));
8799

88100
IE_ACTIVE = ModList.get().isLoaded("immersiveengineering");
89101
CC_ACTIVE = ModList.get().isLoaded("computercraft");
90102
AE2_ACTIVE = ModList.get().isLoaded("ae2");
91103

92-
CACreativeModeTabs.register(eventBus);
104+
//CACreativeModeTabs.register(eventBus);
93105
REGISTRATE.registerEventListeners(eventBus);
94106
CABlocks.register();
95107
CABlockEntities.register();
@@ -147,6 +159,6 @@ public void onRegisterCommandEvent(RegisterCommandsEvent event) {
147159
}
148160

149161
public static ResourceLocation asResource(String path) {
150-
return new ResourceLocation(MODID, path);
162+
return ResourceLocation.fromNamespaceAndPath(MODID, path);
151163
}
152164
}

0 commit comments

Comments
 (0)