Skip to content

Commit

Permalink
feat: port to 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Dec 21, 2024
1 parent 2d9caeb commit 1303bd6
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 97 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ neoForge {
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
}

data {
data()
clientData {
clientData()
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath(), '--existing', file('src/generated/resources/').getAbsolutePath()
}
}
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ mod_credits=The Aether Team
mod_authors=AlphaMode, bconlon, Blodhgarm
mod_description=A library used for the Aether series of mods.

minecraft_version=1.21.3
minecraft_version_range=[1.21.3,1.21.4)
minecraft_version=1.21.4
minecraft_version_range=[1.21.4,1.21.5)

moddevgradle_version=2.0.61-beta

neo_version=21.3.58
neo_version_range=[21.3.58,)
neo_version=21.4.33-beta
neo_version_range=[21.4.33-beta,)

loader_version_range=[4,)

# Dependencies
#jei_version=19.21.0.246
rei_version=17.0.794
cloth_config_version=16.0.143
architectury_version=14.0.4
rei_version=18.0.796
cloth_config_version=17.0.144
architectury_version=15.0.1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.4 2024-03-19T10:35:14.783783 Pack Metadata
0630d1efb0bbb9dc4800686ffcefbe74cfadbed7 pack.mcmeta
// 1.21.4 2024-12-21T15:46:06.456637 Pack Metadata
0a296f6e9cdeaa2055948e3d9a12e190096365de pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.4 2024-03-19T10:35:14.7727851 Languages: en_us for mod: nitrogen_internals
// 1.21.4 2024-12-21T15:46:06.4516382 Languages: en_us for mod: nitrogen_internals
bfd0f7b37a636551b37e23f9b9b8fe61b080951b assets/nitrogen_internals/lang/en_us.json
2 changes: 1 addition & 1 deletion src/generated/resources/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": {
"translate": "pack.nitrogen_internals.mod.description"
},
"pack_format": 26,
"pack_format": 61,
"supported_formats": [
0,
2147483647
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import java.util.Optional;

public class NitrogenDataGenerators {
public static void onInitializeDataGenerator(GatherDataEvent event) {
public static void onInitializeDataGenerator(GatherDataEvent.Client event) {
DataGenerator generator = event.getGenerator();
PackOutput packOutput = generator.getPackOutput();

// Client Data
generator.addProvider(event.includeClient(), new NitrogenLanguageData(packOutput));
generator.addProvider(true, new NitrogenLanguageData(packOutput));

// pack.mcmeta
generator.addProvider(true, new PackMetadataGenerator(packOutput).add(PackMetadataSection.TYPE, new PackMetadataSection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void grantAdvancements(DamageSource damageSource) {
for (UUID uuid : this.dungeonPlayers()) {
Player player = this.boss().level().getPlayerByUUID(uuid);
if (player != null) {
player.awardKillScore(this.boss(), this.boss().getDeathScore(), damageSource);
player.awardKillScore(this.boss(), damageSource);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ private BlockPropertyPair getMatchingPair(ItemStack ingredient) {
Map<Block, Optional<Reference2ObjectArrayMap<Property<?>, Comparable<?>>>> pairsMap = Stream.of(this.pairs).collect(Collectors.toMap(BlockPropertyPair::block, BlockPropertyPair::properties));
Block block = null;
Optional<Reference2ObjectArrayMap<Property<?>, Comparable<?>>> propertiesMap = Optional.empty();
if (Minecraft.getInstance().level != null) {
if (Minecraft.getInstance().level != null && Minecraft.getInstance().player != null) {
for (Map.Entry<Block, Optional<Reference2ObjectArrayMap<Property<?>, Comparable<?>>>> entry : pairsMap.entrySet()) {
ItemStack stack = entry.getKey().getCloneItemStack(Minecraft.getInstance().level, BlockPos.ZERO, entry.getKey().defaultBlockState());
ItemStack stack = entry.getKey().getCloneItemStack(Minecraft.getInstance().level, BlockPos.ZERO, entry.getKey().defaultBlockState(), true, Minecraft.getInstance().player);
stack = stack.isEmpty() ? new ItemStack(Blocks.STONE) : stack;
if (stack.getItem() == ingredient.getItem()) {
block = entry.getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public static List<EntryIngredient> toIngredientList(BlockPropertyPair... pairs)
*/
private static ItemStack setupIngredient(BlockPropertyPair recipeResult) {
ItemStack stack = ItemStack.EMPTY;
if (Minecraft.getInstance().level != null) {
if (Minecraft.getInstance().level != null && Minecraft.getInstance().player != null) {
BlockState resultState = recipeResult.block().defaultBlockState();
if (recipeResult.properties().isPresent()) {
for (Map.Entry<Property<?>, Comparable<?>> propertyEntry : recipeResult.properties().get().entrySet()) {
resultState = BlockStateRecipeUtil.setHelper(propertyEntry, resultState);
}
}
stack = recipeResult.block().getCloneItemStack(Minecraft.getInstance().level, BlockPos.ZERO, resultState);
stack = recipeResult.block().getCloneItemStack(Minecraft.getInstance().level, BlockPos.ZERO, resultState, true, Minecraft.getInstance().player);
}
return stack.isEmpty() ? new ItemStack(Blocks.STONE) : stack;
}
Expand Down

This file was deleted.

0 comments on commit 1303bd6

Please sign in to comment.