diff --git a/build.gradle b/build.gradle index f3c3d46..b4beff6 100644 --- a/build.gradle +++ b/build.gradle @@ -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() } } diff --git a/gradle.properties b/gradle.properties index 7acf2b3..4fe33de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/generated/resources/.cache/0f202e000d40347127b33b6edbbb29689b8cbf86 b/src/generated/resources/.cache/0f202e000d40347127b33b6edbbb29689b8cbf86 index b697e2a..d5ab9bf 100644 --- a/src/generated/resources/.cache/0f202e000d40347127b33b6edbbb29689b8cbf86 +++ b/src/generated/resources/.cache/0f202e000d40347127b33b6edbbb29689b8cbf86 @@ -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 diff --git a/src/generated/resources/.cache/c0433d7e9a88944b9eee890d3d7c6c5760f00428 b/src/generated/resources/.cache/c0433d7e9a88944b9eee890d3d7c6c5760f00428 index 6556f5b..c5502c1 100644 --- a/src/generated/resources/.cache/c0433d7e9a88944b9eee890d3d7c6c5760f00428 +++ b/src/generated/resources/.cache/c0433d7e9a88944b9eee890d3d7c6c5760f00428 @@ -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 diff --git a/src/generated/resources/pack.mcmeta b/src/generated/resources/pack.mcmeta index b44e5bd..245806c 100644 --- a/src/generated/resources/pack.mcmeta +++ b/src/generated/resources/pack.mcmeta @@ -3,7 +3,7 @@ "description": { "translate": "pack.nitrogen_internals.mod.description" }, - "pack_format": 26, + "pack_format": 61, "supported_formats": [ 0, 2147483647 diff --git a/src/main/java/com/aetherteam/nitrogen/client/renderer/NitrogenRenderers.java b/src/main/java/com/aetherteam/nitrogen/client/renderer/NitrogenRenderers.java deleted file mode 100644 index d0c4768..0000000 --- a/src/main/java/com/aetherteam/nitrogen/client/renderer/NitrogenRenderers.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.aetherteam.nitrogen.client.renderer; - -import com.aetherteam.nitrogen.client.renderer.blockentity.NitrogenBlockEntityWithoutLevelRenderer; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; -import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions; -import net.neoforged.neoforge.common.util.Lazy; - -public class NitrogenRenderers { - public static final Lazy blockEntityWithoutLevelRenderer = Lazy.of(() -> - new NitrogenBlockEntityWithoutLevelRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels())); - - public static final IClientItemExtensions entityBlockItemRenderProperties = new IClientItemExtensions() { - @Override - public BlockEntityWithoutLevelRenderer getCustomRenderer() { - return NitrogenRenderers.blockEntityWithoutLevelRenderer.get(); - } - }; -} diff --git a/src/main/java/com/aetherteam/nitrogen/client/renderer/blockentity/NitrogenBlockEntityWithoutLevelRenderer.java b/src/main/java/com/aetherteam/nitrogen/client/renderer/blockentity/NitrogenBlockEntityWithoutLevelRenderer.java deleted file mode 100644 index fdcc8c3..0000000 --- a/src/main/java/com/aetherteam/nitrogen/client/renderer/blockentity/NitrogenBlockEntityWithoutLevelRenderer.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.aetherteam.nitrogen.client.renderer.blockentity; - -import com.aetherteam.nitrogen.item.block.EntityBlockItem; -import com.mojang.blaze3d.vertex.PoseStack; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.geom.EntityModelSet; -import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemDisplayContext; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; - -/** - * Used in the registration of block items that have block entity renderers. - */ -public class NitrogenBlockEntityWithoutLevelRenderer extends BlockEntityWithoutLevelRenderer { - public NitrogenBlockEntityWithoutLevelRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher, EntityModelSet entityModelSet) { - super(blockEntityRenderDispatcher, entityModelSet); - } - - @Override - public void renderByItem(ItemStack stack, ItemDisplayContext context, PoseStack poseStack, MultiBufferSource buffer, int packedLight, int packedOverlay) { - Item item = stack.getItem(); - if (item instanceof EntityBlockItem blockItem && blockItem.getBlockEntity().isPresent()) { - BlockEntity blockEntity = blockItem.getBlockEntity().orElseThrow(() -> new UnsupportedOperationException("BlockEntity was expected, but not supplied.")).get(); - Minecraft.getInstance().getBlockEntityRenderDispatcher().renderItem(blockEntity, poseStack, buffer, packedLight, packedOverlay); - } else { - super.renderByItem(stack, context, poseStack, buffer, packedLight, packedOverlay); - } - } -} diff --git a/src/main/java/com/aetherteam/nitrogen/data/NitrogenDataGenerators.java b/src/main/java/com/aetherteam/nitrogen/data/NitrogenDataGenerators.java index 2ac01bf..0347e6a 100644 --- a/src/main/java/com/aetherteam/nitrogen/data/NitrogenDataGenerators.java +++ b/src/main/java/com/aetherteam/nitrogen/data/NitrogenDataGenerators.java @@ -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( diff --git a/src/main/java/com/aetherteam/nitrogen/entity/BossRoomTracker.java b/src/main/java/com/aetherteam/nitrogen/entity/BossRoomTracker.java index d213157..3085c72 100644 --- a/src/main/java/com/aetherteam/nitrogen/entity/BossRoomTracker.java +++ b/src/main/java/com/aetherteam/nitrogen/entity/BossRoomTracker.java @@ -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); } } } diff --git a/src/main/java/com/aetherteam/nitrogen/integration/rei/BlockStateRenderer.java b/src/main/java/com/aetherteam/nitrogen/integration/rei/BlockStateRenderer.java index 7ea45eb..3aba46a 100644 --- a/src/main/java/com/aetherteam/nitrogen/integration/rei/BlockStateRenderer.java +++ b/src/main/java/com/aetherteam/nitrogen/integration/rei/BlockStateRenderer.java @@ -134,9 +134,9 @@ private BlockPropertyPair getMatchingPair(ItemStack ingredient) { Map, Comparable>>> pairsMap = Stream.of(this.pairs).collect(Collectors.toMap(BlockPropertyPair::block, BlockPropertyPair::properties)); Block block = null; Optional, Comparable>> propertiesMap = Optional.empty(); - if (Minecraft.getInstance().level != null) { + if (Minecraft.getInstance().level != null && Minecraft.getInstance().player != null) { for (Map.Entry, 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(); diff --git a/src/main/java/com/aetherteam/nitrogen/integration/rei/REIUtils.java b/src/main/java/com/aetherteam/nitrogen/integration/rei/REIUtils.java index 309fdb0..a9f1c99 100644 --- a/src/main/java/com/aetherteam/nitrogen/integration/rei/REIUtils.java +++ b/src/main/java/com/aetherteam/nitrogen/integration/rei/REIUtils.java @@ -38,14 +38,14 @@ public static List 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, 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; } diff --git a/src/main/java/com/aetherteam/nitrogen/item/block/EntityBlockItem.java b/src/main/java/com/aetherteam/nitrogen/item/block/EntityBlockItem.java deleted file mode 100644 index 3c0f311..0000000 --- a/src/main/java/com/aetherteam/nitrogen/item/block/EntityBlockItem.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.aetherteam.nitrogen.item.block; - -import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntity; - -import java.util.Optional; -import java.util.function.Supplier; - -/** - * Used for {@link BlockItem}s that have a {@link BlockEntityWithoutLevelRenderer} attached. - */ -public class EntityBlockItem extends BlockItem { - private final Optional> blockEntity; - - public EntityBlockItem(B block, Supplier blockEntity, Properties properties) { - super(block, properties); - this.blockEntity = Optional.ofNullable(blockEntity); - } - - public Optional> getBlockEntity() { - return this.blockEntity; - } -}