From dcc2c9c5d3a75d6bad8f8a9e01cdda51db4f0552 Mon Sep 17 00:00:00 2001 From: "Craig (Jeryn)" Date: Mon, 25 Mar 2024 11:25:51 +0000 Subject: [PATCH] Recipe Repair (#208) Co-authored-by: Clayton T <34910888+CommandrMoose@users.noreply.github.com> Co-authored-by: MagicMaan <38400400+Magicmaan@users.noreply.github.com> --- .../tardis_refined/TardisRefined.java | 3 --- .../arguments/UpgradeArgumentType.java | 6 ++--- .../common/crafting/ManipulatorCrafting.java | 3 ++- .../registry/ARSStructurePieceRegistry.java | 2 -- .../fabric/events/ModEvents.java | 9 +++++-- .../neoforge/TardisLevelOperatorImpl.java | 2 +- .../common/data/BiomeModifierProvider.java | 26 ------------------- .../common/data/ConsolePatternProvider.java | 6 +++-- .../common/data/HumProvider.java | 1 - .../common/data/ItemModelProvider.java | 4 --- .../common/data/LangProviderEnglish.java | 7 ----- .../common/data/ProviderBlockTags.java | 1 - .../data/ProviderConfiguredFeatures.java | 4 +-- .../common/data/ProviderEntityTags.java | 1 - .../common/data/ProviderLootTable.java | 3 +-- .../common/data/RecipeProvider.java | 2 +- .../common/data/ShellPatternProvider.java | 7 +++-- .../common/data/TRBlockModelProvider.java | 6 ----- .../common/data/WorldGenProvider.java | 1 - .../neoforge/CodecJsonReloadListenerImpl.java | 10 ++++--- .../MergeableCodecJsonReloadListenerImpl.java | 6 +++-- .../world/neoforge/TRForgeBiomeModifiers.java | 4 ++- .../neoforge/ImmersivePortalsImpl.java | 2 +- .../neoforge/ClientForgeBus.java | 2 +- .../tardis_refined/neoforge/ClientModBus.java | 4 --- .../tardis_refined/neoforge/CommonBus.java | 9 ++++++- .../neoforge/PatternReloadListenerImpl.java | 8 +++--- .../neoforge/DeferredRegistryImpl.java | 4 +-- .../registry/neoforge/ItemRegistryImpl.java | 1 - forge/src/main/resources/META-INF/mods.toml | 4 +-- forge/src/main/resources/pack.mcmeta | 6 +++-- 31 files changed, 62 insertions(+), 92 deletions(-) diff --git a/common/src/main/java/whocraft/tardis_refined/TardisRefined.java b/common/src/main/java/whocraft/tardis_refined/TardisRefined.java index 3bbcc38e5..08caf3b1b 100644 --- a/common/src/main/java/whocraft/tardis_refined/TardisRefined.java +++ b/common/src/main/java/whocraft/tardis_refined/TardisRefined.java @@ -9,7 +9,6 @@ import org.slf4j.Logger; import whocraft.tardis_refined.client.TRParticles; import whocraft.tardis_refined.common.capability.upgrades.Upgrades; -import whocraft.tardis_refined.common.crafting.ManipulatorCrafting; import whocraft.tardis_refined.common.hum.TardisHums; import whocraft.tardis_refined.common.network.TardisNetwork; import whocraft.tardis_refined.common.network.messages.sync.SyncConsolePatternsMessage; @@ -21,7 +20,6 @@ import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.common.world.ChunkGenerators; import whocraft.tardis_refined.common.world.Features; -import whocraft.tardis_refined.registry.ARSStructurePieceRegistry; import whocraft.tardis_refined.patterns.ConsolePatterns; import whocraft.tardis_refined.patterns.ShellPatterns; import whocraft.tardis_refined.registry.*; @@ -72,7 +70,6 @@ public static void init() { TardisHums.registerDefaultHums(); ARSStructurePieceRegistry.register(); - ManipulatorCrafting.registerRecipes(); } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java b/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java index e5798f860..c6c61e899 100644 --- a/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java +++ b/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java @@ -13,9 +13,6 @@ import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.common.capability.upgrades.Upgrade; import whocraft.tardis_refined.common.capability.upgrades.Upgrades; -import whocraft.tardis_refined.common.tardis.TardisDesktops; -import whocraft.tardis_refined.common.tardis.themes.DesktopTheme; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.constants.ModMessages; import java.util.Collection; @@ -28,6 +25,7 @@ public class UpgradeArgumentType implements ArgumentType { private static final Collection EXAMPLES = Stream.of(Upgrades.COORDINATE_INPUT).map((upgrade) -> { return upgrade != null ? upgrade.getId().toString() : ""; }).collect(Collectors.toList()); + public static final DynamicCommandExceptionType INVALID_UPGRADE_EXCEPTION = new DynamicCommandExceptionType((upgrade) -> Component.translatable(ModMessages.CMD_ARG_UPGRADE_INVALID, upgrade)); public static UpgradeArgumentType upgradeArgumentType() { @@ -41,11 +39,13 @@ public ResourceLocation parse(StringReader reader) throws CommandSyntaxException @Override public CompletableFuture listSuggestions(CommandContext context, SuggestionsBuilder builder) { + return SharedSuggestionProvider.suggestResource(Upgrades.UPGRADE_REGISTRY.keySet(), builder); } @Override public Collection getExamples() { + EXAMPLES.add("*"); return EXAMPLES; } diff --git a/common/src/main/java/whocraft/tardis_refined/common/crafting/ManipulatorCrafting.java b/common/src/main/java/whocraft/tardis_refined/common/crafting/ManipulatorCrafting.java index 60c01b401..be46ca0ce 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/crafting/ManipulatorCrafting.java +++ b/common/src/main/java/whocraft/tardis_refined/common/crafting/ManipulatorCrafting.java @@ -2,7 +2,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.Blocks; -import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.blockentity.device.ManipulatorCraftingRecipe; import whocraft.tardis_refined.common.blockentity.device.ManipulatorCraftingRecipeItem; import whocraft.tardis_refined.registry.BlockRegistry; @@ -18,6 +17,8 @@ public class ManipulatorCrafting { public static void registerRecipes() { + MANIPULATOR_CRAFTING_RECIPES.clear(); + register(new ManipulatorCraftingRecipe(Arrays.asList( new ManipulatorCraftingRecipeItem(new BlockPos(0, 0, 0), Blocks.SMOOTH_STONE_SLAB), new ManipulatorCraftingRecipeItem(new BlockPos(0, 0, 1), BlockRegistry.ZEITON_FUSED_IRON_BLOCK.get()), diff --git a/common/src/main/java/whocraft/tardis_refined/registry/ARSStructurePieceRegistry.java b/common/src/main/java/whocraft/tardis_refined/registry/ARSStructurePieceRegistry.java index 28181476b..ccd177198 100644 --- a/common/src/main/java/whocraft/tardis_refined/registry/ARSStructurePieceRegistry.java +++ b/common/src/main/java/whocraft/tardis_refined/registry/ARSStructurePieceRegistry.java @@ -13,10 +13,8 @@ public class ARSStructurePieceRegistry { public static List ROOMS = new ArrayList<>(); public static void register() { - registerCorridors(); registerRooms(); - } public static void registerCorridors() { diff --git a/fabric/src/main/java/whocraft/tardis_refined/fabric/events/ModEvents.java b/fabric/src/main/java/whocraft/tardis_refined/fabric/events/ModEvents.java index 797fe0802..f6c6473d2 100644 --- a/fabric/src/main/java/whocraft/tardis_refined/fabric/events/ModEvents.java +++ b/fabric/src/main/java/whocraft/tardis_refined/fabric/events/ModEvents.java @@ -1,10 +1,9 @@ package whocraft.tardis_refined.fabric.events; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; -import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; +import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; -import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.minecraft.server.level.ServerLevel; @@ -14,6 +13,7 @@ import whocraft.tardis_refined.client.TardisClientData; import whocraft.tardis_refined.command.TardisRefinedCommand; import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.crafting.ManipulatorCrafting; import whocraft.tardis_refined.common.dimension.TardisTeleportData; import whocraft.tardis_refined.common.dimension.fabric.DimensionHandlerImpl; import whocraft.tardis_refined.common.util.MiscHelper; @@ -36,8 +36,13 @@ public static void addCommonEvents() { } }); ServerLifecycleEvents.SERVER_STARTED.register(server -> { + + // Load Levels ServerLevel world = server.getLevel(Level.OVERWORLD); DimensionHandlerImpl.loadLevels(world); + + //Register Recipes + ManipulatorCrafting.registerRecipes(); }); ServerLifecycleEvents.SERVER_STOPPING.register(server -> DimensionHandlerImpl.clear()); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/capability/neoforge/TardisLevelOperatorImpl.java b/forge/src/main/java/whocraft/tardis_refined/common/capability/neoforge/TardisLevelOperatorImpl.java index b99966067..cb5e580b9 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/capability/neoforge/TardisLevelOperatorImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/capability/neoforge/TardisLevelOperatorImpl.java @@ -59,7 +59,7 @@ public static void onLevelTick(TickEvent.LevelTickEvent event) { } public static Optional get(ServerLevel level) { - if(level == null) { + if (level == null) { return Optional.empty(); } return level.getCapability(TARDIS_DATA).resolve(); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/BiomeModifierProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/BiomeModifierProvider.java index c80dbae3c..a07605f2a 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/BiomeModifierProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/BiomeModifierProvider.java @@ -1,47 +1,21 @@ package whocraft.tardis_refined.common.data; -import com.google.common.collect.ImmutableList; import net.minecraft.core.HolderGetter; import net.minecraft.core.HolderSet; -import net.minecraft.core.RegistrySetBuilder; import net.minecraft.core.registries.Registries; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.DataProvider; import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BiomeTags; -import net.minecraft.tags.BlockTags; import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.VerticalAnchor; -import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -import net.minecraft.world.level.levelgen.feature.Feature; -import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; -import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; -import net.minecraft.world.level.levelgen.placement.HeightRangePlacement; -import net.minecraft.world.level.levelgen.placement.InSquarePlacement; import net.minecraft.world.level.levelgen.placement.PlacedFeature; -import net.minecraft.world.level.levelgen.placement.RarityFilter; -import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest; -import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; -import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; import net.neoforged.neoforge.common.world.BiomeModifier; import net.neoforged.neoforge.common.world.BiomeModifiers; -import net.neoforged.neoforge.data.event.GatherDataEvent; import net.neoforged.neoforge.registries.NeoForgeRegistries; import whocraft.tardis_refined.TardisRefined; -import whocraft.tardis_refined.common.world.Features; -import whocraft.tardis_refined.common.world.feature.NbtTemplateFeature; -import whocraft.tardis_refined.common.world.feature.config.NbtTemplateFeatureConfig; -import whocraft.tardis_refined.registry.BlockRegistry; import whocraft.tardis_refined.registry.FeatureKeys; import whocraft.tardis_refined.registry.TagKeys; -import java.util.List; -import java.util.Set; - -import static net.minecraft.data.worldgen.features.FeatureUtils.createKey; -import static whocraft.tardis_refined.common.data.ProviderConfiguredFeatures.TARDIS_ROOT_CLUSTER_CONF_FEATURE; import static whocraft.tardis_refined.common.data.ProviderPlacedFeatures.TARDIS_ROOT_CLUSTER_PLACED_FEATUE; public class BiomeModifierProvider { diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ConsolePatternProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ConsolePatternProvider.java index fadcaeb76..223c73002 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ConsolePatternProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ConsolePatternProvider.java @@ -8,13 +8,15 @@ import net.minecraft.data.DataProvider; import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.TardisRefined; -import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme; import whocraft.tardis_refined.patterns.ConsolePattern; import whocraft.tardis_refined.patterns.ConsolePatternCollection; import whocraft.tardis_refined.patterns.ConsolePatterns; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.CompletableFuture; public class ConsolePatternProvider implements DataProvider { diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/HumProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/HumProvider.java index 2eca53896..672c5ee66 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/HumProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/HumProvider.java @@ -10,7 +10,6 @@ import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.hum.HumEntry; import whocraft.tardis_refined.common.hum.TardisHums; -import whocraft.tardis_refined.registry.SoundRegistry; import java.util.ArrayList; import java.util.HashMap; diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ItemModelProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ItemModelProvider.java index 00c5a4a4f..d820cec02 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ItemModelProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ItemModelProvider.java @@ -53,10 +53,6 @@ protected void registerModels() { basicItem(ItemRegistry.RAW_ZEITON.getId()); - - - - } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java b/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java index edab4ced4..c57f6f5f0 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java @@ -17,12 +17,6 @@ import whocraft.tardis_refined.registry.ItemRegistry; import whocraft.tardis_refined.registry.SoundRegistry; -import javax.imageio.ImageIO; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; - public class LangProviderEnglish extends LanguageProvider { public LangProviderEnglish(DataGenerator gen) { @@ -216,7 +210,6 @@ protected void addTranslations() { } - public void addControl(ConsoleControl control, String name) { add(control.getTranslationKey(), name); } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderBlockTags.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderBlockTags.java index af49f294c..2ba4280bf 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderBlockTags.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderBlockTags.java @@ -12,7 +12,6 @@ import org.jetbrains.annotations.Nullable; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.registry.BlockRegistry; -import whocraft.tardis_refined.registry.RegistrySupplier; import java.util.concurrent.CompletableFuture; diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderConfiguredFeatures.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderConfiguredFeatures.java index ec5bf8d6b..bc428ad6b 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderConfiguredFeatures.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderConfiguredFeatures.java @@ -40,8 +40,8 @@ public static void bootstrap(BootstapContext> context) { ConfiguredFeature tardisRootCluster = new ConfiguredFeature<>(Features.NBT_FEATURE.get(), new NbtTemplateFeatureConfig(templateLocation, 0)); HolderGetter> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); - register(context, ORE_ZEITON, Feature.ORE, new OreConfiguration(ImmutableList.of(OreConfiguration.target(stoneReplaceable, BlockRegistry.ZEITON_ORE.get().defaultBlockState()), OreConfiguration.target(deepslateReplaceable, BlockRegistry.ZEITON_ORE_DEEPSLATE.get().defaultBlockState())), 9)); - register(context, ORE_ZEITON_SMALL, Feature.ORE, new OreConfiguration(ImmutableList.of(OreConfiguration.target(stoneReplaceable,BlockRegistry.ZEITON_ORE.get().defaultBlockState()), OreConfiguration.target(deepslateReplaceable, BlockRegistry.ZEITON_ORE_DEEPSLATE.get().defaultBlockState())), 4)); + register(context, ORE_ZEITON, Feature.ORE, new OreConfiguration(ImmutableList.of(OreConfiguration.target(stoneReplaceable, BlockRegistry.ZEITON_ORE.get().defaultBlockState()), OreConfiguration.target(deepslateReplaceable, BlockRegistry.ZEITON_ORE_DEEPSLATE.get().defaultBlockState())), 9)); + register(context, ORE_ZEITON_SMALL, Feature.ORE, new OreConfiguration(ImmutableList.of(OreConfiguration.target(stoneReplaceable, BlockRegistry.ZEITON_ORE.get().defaultBlockState()), OreConfiguration.target(deepslateReplaceable, BlockRegistry.ZEITON_ORE_DEEPSLATE.get().defaultBlockState())), 4)); context.register(TARDIS_ROOT_CLUSTER_CONF_FEATURE, tardisRootCluster); } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderEntityTags.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderEntityTags.java index ccfa16f3e..2176976cf 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderEntityTags.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderEntityTags.java @@ -20,7 +20,6 @@ public class ProviderEntityTags extends EntityTypeTagsProvider { public static final TagKey> ENTITY_BLACKLIST = TagKey.create(Registries.ENTITY_TYPE, new ResourceLocation("carryon", "entity_blacklist")); - public ProviderEntityTags(PackOutput output, CompletableFuture completableFuture, @Nullable ExistingFileHelper existingFileHelper) { super(output, completableFuture, TardisRefined.MODID, existingFileHelper); } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderLootTable.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderLootTable.java index 850f8df11..0ba967f48 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderLootTable.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ProviderLootTable.java @@ -11,7 +11,6 @@ import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import org.jetbrains.annotations.NotNull; -import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.registry.BlockRegistry; import whocraft.tardis_refined.registry.EntityRegistry; import whocraft.tardis_refined.registry.ItemRegistry; @@ -48,7 +47,7 @@ protected Iterable getKnownBlocks() { ArrayList<@NotNull Block> blocks = new ArrayList<>(); for (Block entry : BlockRegistry.BLOCKS.getRegistry().stream().toList()) { ResourceLocation blockId = BlockRegistry.BLOCKS.getRegistry().getKey(entry); - if(!blockId.toString().contains("minecraft")) { + if (!blockId.toString().contains("minecraft")) { blocks.add(entry); } } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/RecipeProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/RecipeProvider.java index 9cdc691c5..8a7b0926a 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/RecipeProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/RecipeProvider.java @@ -36,7 +36,7 @@ protected void buildRecipes(RecipeOutput consumer) { ShapelessRecipeBuilder.shapeless(RecipeCategory.TOOLS, BlockRegistry.ZEITON_FUSED_COPPER_BLOCK.get()).requires(ItemRegistry.ZEITON_INGOT.get()).requires(Items.COPPER_BLOCK).unlockedBy("has_crafting_table", has(ItemRegistry.ZEITON_INGOT.get())).save(consumer); ShapelessRecipeBuilder.shapeless(RecipeCategory.TOOLS, BlockRegistry.ZEITON_FUSED_IRON_BLOCK.get()).requires(ItemRegistry.ZEITON_INGOT.get()).requires(Items.IRON_BLOCK).unlockedBy("has_crafting_table", has(ItemRegistry.ZEITON_INGOT.get())).save(consumer); - ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, BlockRegistry.ZEITON_BLOCK.get()).pattern("ZZZ").pattern("ZZZ").pattern("ZZZ").define('Z', ItemRegistry.ZEITON_INGOT.get()).unlockedBy("has_crafting_table", has(ItemRegistry.ZEITON_INGOT.get())).save(consumer); + ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, BlockRegistry.ZEITON_BLOCK.get()).pattern("ZZZ").pattern("ZZZ").pattern("ZZZ").define('Z', ItemRegistry.ZEITON_INGOT.get()).unlockedBy("has_crafting_table", has(ItemRegistry.ZEITON_INGOT.get())).save(consumer); // Smelting SimpleCookingRecipeBuilder.smelting(Ingredient.of(ItemRegistry.RAW_ZEITON.get()), RecipeCategory.MISC, ItemRegistry.ZEITON_INGOT.get(), 0.7F, 300).unlockedBy("has_any_zeiton", has(ItemRegistry.RAW_ZEITON.get())).save(consumer, new ResourceLocation(TardisRefined.MODID, "smelt_zeiton")); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ShellPatternProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ShellPatternProvider.java index 7f771b30e..3f3e802d9 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ShellPatternProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ShellPatternProvider.java @@ -13,15 +13,18 @@ import whocraft.tardis_refined.patterns.ShellPatterns; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.CompletableFuture; public class ShellPatternProvider implements DataProvider { protected final DataGenerator generator; private final boolean addDefaults; - protected Map data = new HashMap<>(); private final String modid; + protected Map data = new HashMap<>(); public ShellPatternProvider(DataGenerator generator, String modid) { this(generator, modid, true); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/TRBlockModelProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/TRBlockModelProvider.java index 234cf3eae..c4c876620 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/TRBlockModelProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/TRBlockModelProvider.java @@ -15,8 +15,6 @@ import whocraft.tardis_refined.common.block.device.TerraformerBlock; import whocraft.tardis_refined.registry.BlockRegistry; -import java.io.IOException; - import static whocraft.tardis_refined.registry.BlockRegistry.BLOCKS; public class TRBlockModelProvider extends BlockStateProvider { @@ -31,7 +29,6 @@ public JsonObject emptyBlockState(Block block) { } - public JsonObject terraformer(Block block) { VariantBlockStateBuilder builder = getVariantBuilder(block).forAllStates(blockState -> blockState.getValue(TerraformerBlock.ACTIVE) ? ConfiguredModel.builder().modelFile(models().getExistingFile(new ResourceLocation(TardisRefined.MODID, "block/terraformer_on"))).build() : @@ -79,7 +76,6 @@ public JsonObject antiGravityBlock(Block block) { } - @Override protected void registerStatesAndModels() { ResourceLocation leavesTexture = new ResourceLocation("tardis_refined:block/ars_leaves"); @@ -98,7 +94,6 @@ protected void registerStatesAndModels() { emptyBlockState(BlockRegistry.ARS_EGG.get()); - threeDeeRotating(BlockRegistry.LANDING_PAD.get(), new ResourceLocation(TardisRefined.MODID, "block/landing_pad")); threeDeeRotating(BlockRegistry.FLIGHT_DETECTOR.get(), new ResourceLocation(TardisRefined.MODID, "block/flight_detector")); @@ -137,5 +132,4 @@ protected void registerStatesAndModels() { } - } \ No newline at end of file diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/WorldGenProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/WorldGenProvider.java index b313cb089..f4aa56aea 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/WorldGenProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/WorldGenProvider.java @@ -11,7 +11,6 @@ import net.neoforged.neoforge.registries.NeoForgeRegistries; import whocraft.tardis_refined.TardisRefined; - import java.util.Set; import java.util.concurrent.CompletableFuture; diff --git a/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/CodecJsonReloadListenerImpl.java b/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/CodecJsonReloadListenerImpl.java index 1a216ac88..842edbdd7 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/CodecJsonReloadListenerImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/CodecJsonReloadListenerImpl.java @@ -12,13 +12,13 @@ import java.util.function.Consumer; import java.util.function.Function; -public class CodecJsonReloadListenerImpl{ +public class CodecJsonReloadListenerImpl { public static CodecJsonReloadListener create(String folderName, Codec codec) { return new Impl(folderName, codec); } - public static class Impl extends CodecJsonReloadListener{ + public static class Impl extends CodecJsonReloadListener { public Impl(String folderName, Codec codec) { super(folderName, codec); } @@ -29,8 +29,10 @@ public CodecJsonReloadListener setSyncPacket(NetworkManager networkManager, Func return this; } - /** Generate an event listener function for Forge's dedicated on-datapack-sync event which is timed at the correct point when datapack registries are synced. - * The event is fired when a player logs in or if server resources were reloaded successfully, so there is no need to add it in the login event **/ + /** + * Generate an event listener function for Forge's dedicated on-datapack-sync event which is timed at the correct point when datapack registries are synced. + * The event is fired when a player logs in or if server resources were reloaded successfully, so there is no need to add it in the login event + **/ private Consumer getDatapackSyncListener(final NetworkManager networkManager, final Function, MessageS2C> packetFactory) { return event -> { this.handleSyncPacket(event.getPlayer(), networkManager, packetFactory); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/MergeableCodecJsonReloadListenerImpl.java b/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/MergeableCodecJsonReloadListenerImpl.java index df70e050c..369dd60ed 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/MergeableCodecJsonReloadListenerImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/util/neoforge/MergeableCodecJsonReloadListenerImpl.java @@ -30,8 +30,10 @@ public MergeableCodecJsonReloadListener setSyncPacket(NetworkManager networkMana return this; } - /** Generate an event listener function for Forge's dedicated on-datapack-sync event which is timed at the correct point when datapack registries are synced. - * The event is fired when a player logs in or if server resources were reloaded successfully, so there is no need to add it in the login event **/ + /** + * Generate an event listener function for Forge's dedicated on-datapack-sync event which is timed at the correct point when datapack registries are synced. + * The event is fired when a player logs in or if server resources were reloaded successfully, so there is no need to add it in the login event + **/ private Consumer getDatapackSyncListener(final NetworkManager networkManager, final Function, MessageS2C> packetFactory) { return event -> { this.handleSyncPacket(event.getPlayer(), networkManager, packetFactory); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/world/neoforge/TRForgeBiomeModifiers.java b/forge/src/main/java/whocraft/tardis_refined/common/world/neoforge/TRForgeBiomeModifiers.java index d7b81c471..40c01e133 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/world/neoforge/TRForgeBiomeModifiers.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/world/neoforge/TRForgeBiomeModifiers.java @@ -3,7 +3,9 @@ import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.TardisRefined; -/** List of Resource Keys that are specific to the Forge platform*/ +/** + * List of Resource Keys that are specific to the Forge platform + */ public class TRForgeBiomeModifiers { public static final ResourceLocation ADD_TARDIS_CORAL_CLUSTER = new ResourceLocation(TardisRefined.MODID, "add_tardis_coral_cluster"); diff --git a/forge/src/main/java/whocraft/tardis_refined/compat/portals/neoforge/ImmersivePortalsImpl.java b/forge/src/main/java/whocraft/tardis_refined/compat/portals/neoforge/ImmersivePortalsImpl.java index f4e1a4625..61f449bf9 100644 --- a/forge/src/main/java/whocraft/tardis_refined/compat/portals/neoforge/ImmersivePortalsImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/compat/portals/neoforge/ImmersivePortalsImpl.java @@ -5,7 +5,7 @@ public class ImmersivePortalsImpl { public static EntityType retrievePortalType() { - //TODO Uh oh! return IPRegistry.PORTAL.get(); + //TODO Uh oh! return IPRegistry.PORTAL.get(); return null; } } diff --git a/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientForgeBus.java b/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientForgeBus.java index c2e5640a4..55b955cd9 100644 --- a/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientForgeBus.java +++ b/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientForgeBus.java @@ -23,7 +23,7 @@ public static void tickTARDIS(TickEvent.ClientTickEvent event) { } @SubscribeEvent - public static void onRenderOverlay(RenderGuiOverlayEvent.Post guiOverlayEvent){ + public static void onRenderOverlay(RenderGuiOverlayEvent.Post guiOverlayEvent) { GravityOverlay.renderOverlay(guiOverlayEvent.getGuiGraphics().pose()); } } diff --git a/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java b/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java index bb6d12f47..e1c2a11ec 100644 --- a/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java +++ b/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java @@ -4,10 +4,7 @@ import net.minecraft.client.particle.ParticleEngine; import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; import net.minecraft.client.renderer.entity.EntityRenderers; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.item.DyeableLeatherItem; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.Mod; @@ -33,7 +30,6 @@ import whocraft.tardis_refined.client.renderer.blockentity.shell.GlobalShellRenderer; import whocraft.tardis_refined.client.renderer.blockentity.shell.RootShellRenderer; import whocraft.tardis_refined.client.renderer.entity.ControlEntityRenderer; -import whocraft.tardis_refined.common.items.ScrewdriverItem; import whocraft.tardis_refined.registry.BlockEntityRegistry; import whocraft.tardis_refined.registry.EntityRegistry; import whocraft.tardis_refined.registry.ItemRegistry; diff --git a/forge/src/main/java/whocraft/tardis_refined/neoforge/CommonBus.java b/forge/src/main/java/whocraft/tardis_refined/neoforge/CommonBus.java index b0b8010c8..7ade1962e 100644 --- a/forge/src/main/java/whocraft/tardis_refined/neoforge/CommonBus.java +++ b/forge/src/main/java/whocraft/tardis_refined/neoforge/CommonBus.java @@ -10,8 +10,10 @@ import net.neoforged.neoforge.event.TickEvent; import net.neoforged.neoforge.event.entity.living.LivingDestroyBlockEvent; import net.neoforged.neoforge.event.level.BlockEvent; +import net.neoforged.neoforge.event.server.ServerStartedEvent; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.command.TardisRefinedCommand; +import whocraft.tardis_refined.common.crafting.ManipulatorCrafting; import whocraft.tardis_refined.common.dimension.TardisTeleportData; import whocraft.tardis_refined.common.hum.TardisHums; import whocraft.tardis_refined.common.tardis.TardisDesktops; @@ -62,8 +64,13 @@ public static void onBlockBreak(BlockEvent.BreakEvent event) { } @SubscribeEvent - public static void onEntityBlockBreak(LivingDestroyBlockEvent event){ + public static void onEntityBlockBreak(LivingDestroyBlockEvent event) { event.setCanceled(MiscHelper.shouldCancelBreaking(event.getEntity().level(), event.getEntity(), event.getPos(), event.getState())); } + @SubscribeEvent + public static void onServerStart(ServerStartedEvent event) { + ManipulatorCrafting.registerRecipes(); + } + } \ No newline at end of file diff --git a/forge/src/main/java/whocraft/tardis_refined/patterns/neoforge/PatternReloadListenerImpl.java b/forge/src/main/java/whocraft/tardis_refined/patterns/neoforge/PatternReloadListenerImpl.java index d77364d85..5d62af275 100644 --- a/forge/src/main/java/whocraft/tardis_refined/patterns/neoforge/PatternReloadListenerImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/patterns/neoforge/PatternReloadListenerImpl.java @@ -15,7 +15,7 @@ import java.util.function.Consumer; import java.util.function.Function; -public class PatternReloadListenerImpl{ +public class PatternReloadListenerImpl { public static

PatternReloadListener createListener(String folderName, Codec

codec, final Function, List> merger) { return new Impl(folderName, codec, merger); @@ -32,8 +32,10 @@ public PatternReloadListener setSyncPacket(NetworkManager networkManager, Functi return this; } - /** Generate an event listener function for Forge's dedicated on-datapack-sync event which is timed at the correct point when datapack registries are synced. - * The event is fired when a player logs in or if server resources were reloaded successfully, so there is no need to add it in the login event **/ + /** + * Generate an event listener function for Forge's dedicated on-datapack-sync event which is timed at the correct point when datapack registries are synced. + * The event is fired when a player logs in or if server resources were reloaded successfully, so there is no need to add it in the login event + **/ private Consumer getDatapackSyncListener(final NetworkManager networkManager, final Function>, MessageS2C> packetFactory) { return event -> { this.handleSyncPacket(event.getPlayer(), networkManager, packetFactory); diff --git a/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/DeferredRegistryImpl.java b/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/DeferredRegistryImpl.java index ff654f2fc..0c51dfa32 100644 --- a/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/DeferredRegistryImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/DeferredRegistryImpl.java @@ -8,8 +8,8 @@ import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; import whocraft.tardis_refined.registry.DeferredRegistry; -import whocraft.tardis_refined.registry.RegistrySupplierHolder; import whocraft.tardis_refined.registry.RegistrySupplier; +import whocraft.tardis_refined.registry.RegistrySupplierHolder; import java.util.LinkedHashMap; import java.util.Map; @@ -67,7 +67,7 @@ public RegistrySupplier register(String id, Supplier supplie @Override public RegistrySupplierHolder registerHolder(String id, Supplier sup) { DeferredHolder deferredHolder = this.register.register(id, sup); - RegistrySupplierHolder registryHolder = RegistrySupplierHolder.create(this.registryKey, deferredHolder.getId()); + RegistrySupplierHolder registryHolder = RegistrySupplierHolder.create(this.registryKey, deferredHolder.getId()); return registryHolder; } diff --git a/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/ItemRegistryImpl.java b/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/ItemRegistryImpl.java index 1716aab61..5936fab3a 100644 --- a/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/ItemRegistryImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/registry/neoforge/ItemRegistryImpl.java @@ -5,7 +5,6 @@ import net.minecraft.world.item.ItemStack; import whocraft.tardis_refined.constants.ModMessages; import whocraft.tardis_refined.registry.BlockRegistry; -import whocraft.tardis_refined.registry.ItemRegistry; public class ItemRegistryImpl { public static CreativeModeTab getCreativeTab() { diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 6cfe1f18f..ff6078121 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,7 +1,7 @@ modLoader = "javafml" loaderVersion = "${neoforge_loader_version_range}" license = "${license}" -issueTrackerURL="${issue_tracker_url}" #optional +issueTrackerURL = "${issue_tracker_url}" #optional [[mods]] modId = "${mod_id}" version = "${mod_version}" @@ -19,7 +19,7 @@ modId = "neoforge" mandatory = true versionRange = "${neoforge_version_range}" ordering = "NONE" # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory -side="BOTH" # Physical side this dependency is applied on - BOTH, CLIENT or SERVER +side = "BOTH" # Physical side this dependency is applied on - BOTH, CLIENT or SERVER [[dependencies."${mod_id}"]] modId = "minecraft" mandatory = true diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta index fe8f0d5a9..afd0b30de 100644 --- a/forge/src/main/resources/pack.mcmeta +++ b/forge/src/main/resources/pack.mcmeta @@ -1,6 +1,8 @@ { "pack": { "description": "${mod_name} resources", - "pack_format": ${pack_format} - } + "pack_format": ${ + pack_format +} +} }