• Recently Browsing

    No registered users viewing this page.

  • Posts

    • this is the code where i think weher is the error   package net.luis.cave.world.gen; import net.luis.cave.Cave; import net.luis.cave.init.CaveBlocks; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.pattern.BlockMatcher; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.placement.ConfiguredPlacement; import net.minecraft.world.gen.placement.CountRangeConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.registries.ForgeRegistries; @Mod.EventBusSubscriber(modid = Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.MOD) public class OreGen { @SubscribeEvent public static void generateOres(FMLLoadCompleteEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { if (biome.getCategory() == Biome.Category.THEEND) { genOre(biome, 1, 12, 256, 10, OreFeatureConfig.FillerBlockType.create("ENDSTONE", "end_stone", new BlockMatcher(Blocks.END_STONE)), CaveBlocks.ENDERITE_ORE.get().getDefaultState(), 3); } else if (biome.getCategory() == Biome.Category.NETHER) { } else { genOre(biome, 15, 8, 50, 5, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.JADE_ORE.get().getDefaultState(), 6); genOre(biome, 7, 1, 25, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.LIMONITE_ORE.get().getDefaultState(), 10); genOre(biome, 2, 1, 65, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.ROSITE_ORE.get().getDefaultState(), 1); genOre(biome, 5, 4, 9, 1, OreFeatureConfig.FillerBlockType.NATURAL_STONE, CaveBlocks.SAPHIRE_ORE.get().getDefaultState(), 2); } } } private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); } }  
    • It's called in: private static void commonSetup(FMLCommonSetupEvent event) { DeferredWorkQueue.runLater(() -> { CapCompScreen.register(); PacketHandler.register(); }); } which in turn is called in the Common Proxy class as: final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(CommonProxy::commonSetup);
    • When do you call the register method?
    • Installer of Forge 34.1.25 gives me a 0kb jar file.   Edit: Found out the problem. The download link is being flagged as suspicious by both Firefox and Chrome.
    • I have a button in my screen class to send a packet to the container in order to update the inventory (client to server), according to this. Opening the gui and clicking the button in-game, I receive an invalid message error that originates from: PacketHandler.CHANNEL.send(PacketDistributor.ALL.noArg(), new CapCompContainer(ModContainerTypes.MULTI_9X3.get(), containerID, containerInd, senderInv, 3)); According to this the issue could stem from registration, but I ensured that the packet is registered in FMLCommonSetup and specified the network direction PLAY_TO_SERVER.   Classes: PacketHandler PacketUpdateContainer CapCompContainer CapCompScreen
  • Topics

  • Who's Online (See full list)