warjort
Members-
Posts
5420 -
Joined
-
Last visited
-
Days Won
175
Everything posted by warjort
-
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
Look at the MenuType constructor. It takes a MenuType.MenuSupplier. That functional interface's method takes 2 parameters while you have 3 in your lambda. -
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
You will probably find it easier to get rid of the registerMenu() method and just write the register directly in the static initializer(s). That way the compiler will have more opportunity to infer the correct generic parameters. -
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
That is probably because you are trying to register MenuTypes in a DeferredRegister<Container> Like I said above, try to figure this out for yourself. That means spending time on it to understand what the compiler is telling you, not dumping the compiler errors here for us to fix without you engaging your brain. ๐ -
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
I think you need to take a step back and understand what you are doing. You can't just keep posting compiler errors from random code you write here. -
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
Its more like <T extends AbstractContainerMenu> RegistryObject<MenuType<T>> Your return type is the RegistryObject, the T is a generic parameter definition. I was too hung up on the weird double brackets. ๐ -
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
- RegistryObject<<T extends AbstractContainerMenu> MenuType<T>> + RegistryObject<T extends AbstractContainerMenu> MenuType<T> -
[SOLVED] [1.19] I got some errors while porting my 1.18 mod to 1.19
warjort replied to FantaLaTone's topic in Modder Support
- public static final MenuType<Crate_WhiteOakGUIMenu> WHITE_OAK_CRATE_GUI = registerMenu("white_oak_crate_gui", (id, inv, extraData) -> new Crate_WhiteOakGUIMenu(id, inv, extraData)); + public static final RegistryObject<MenuType<Crate_WhiteOakGUIMenu>> WHITE_OAK_CRATE_GUI = registerMenu("white_oak_crate_gui", (id, inv, extraData) -> new Crate_WhiteOakGUIMenu(id, inv, extraData)); You hold the RegistryObject, then use WHITE_OAK_CRATE_GUI.get() to access it later. -
Old enough that the root certificates it comes with have expired. ๐
-
Look at BookViewScreen.loadPages() - see the constructor for BookEditScreen for how it gets the CompoundTag.
-
Look at how ChestBlock.use() uses getMenuProvider()
-
subscribe for the RegisterKeyMappingsEvent on the mod event bus
-
https://johann.loefflmann.net/en/software/jarfix/index.html
-
[1.18.2] Method for iterating over blocks belonging to a tag
warjort replied to Daeruin's topic in Modder Support
NOTE: What is below is not fully tested, I just wrote it and tested it once to see if it works. I've never used GLMs so I had a go at implementing your requirement, this is what I found out (this is using the forge-1.19 mdk's example mod as a base): First I create src/main/resource/data/forge/loot_modifiers/global_loot_modifiers.json to specify the modification files { "replace": false, "entries": [ "examplemod:leaves" ] } The added the mentioned modification in src/main/resources/data/examplemod/loot_modifiers/leaves.json { "conditions": [ { "condition": "examplemod:blocktag", "blocktag": "minecraft:leaves" } ], "type": "examplemod:singleitem", "item": "minecraft:diamond" } Suprisingly, there is no loot condition for block tags so I had to write that public class BlockTagLootItemCondition implements LootItemCondition { final TagKey<Block> blockTag; BlockTagLootItemCondition(TagKey<Block> blockTag) { this.blockTag = blockTag; } public LootItemConditionType getType() { return ExampleMod.BLOCK_TAG_LOOT_ITEM.get(); } public Set<LootContextParam<?>> getReferencedContextParams() { return ImmutableSet.of(LootContextParams.BLOCK_STATE); } public boolean test(LootContext p_81772_) { BlockState blockstate = p_81772_.getParamOrNull(LootContextParams.BLOCK_STATE); return blockstate != null && blockstate.is(this.blockTag); } public static class Serializer implements net.minecraft.world.level.storage.loot.Serializer<BlockTagLootItemCondition> { public void serialize(JsonObject p_81795_, BlockTagLootItemCondition p_81796_, JsonSerializationContext p_81797_) { p_81795_.addProperty("blocktag", p_81796_.blockTag.location().toString()); } public BlockTagLootItemCondition deserialize(JsonObject p_81805_, JsonDeserializationContext p_81806_) { ResourceLocation resourcelocation = new ResourceLocation(GsonHelper.getAsString(p_81805_, "blocktag")); TagKey<Block> blockTag = TagKey.create(Registry.BLOCK_REGISTRY, resourcelocation); return new BlockTagLootItemCondition(blockTag); } } } Then write my actual modifier. This is a simple one that lets you define one item to add to the drops. public class SingleItemLootModifier extends LootModifier { public static final Supplier<Codec<SingleItemLootModifier>> CODEC = Suppliers.memoize(() -> RecordCodecBuilder.create(inst -> codecStart(inst) .and(ForgeRegistries.ITEMS.getCodec().fieldOf("item").forGetter(m -> m.item)) .apply(inst, SingleItemLootModifier::new) )); private final Item item; public SingleItemLootModifier(LootItemCondition[] conditions, Item item) { super(conditions); this.item = item; } @Override public Codec<? extends IGlobalLootModifier> codec() { return CODEC.get(); } @Override protected @NotNull ObjectArrayList<ItemStack> doApply(ObjectArrayList<ItemStack> generatedLoot, LootContext context) { generatedLoot.add(new ItemStack(item, 1)); return generatedLoot; } } Finally I have register the new condition and loot modifier in the main example mod class public static final DeferredRegister<LootItemConditionType> LOOT_ITEM_CONDITIONS = DeferredRegister.create(Registry.LOOT_ITEM_REGISTRY, MODID); public static final RegistryObject<LootItemConditionType> BLOCK_TAG_LOOT_ITEM = LOOT_ITEM_CONDITIONS.register("blocktag", () -> new LootItemConditionType(new BlockTagLootItemCondition.Serializer())); public static final DeferredRegister<Codec<? extends IGlobalLootModifier>> GLM = DeferredRegister.create(ForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, MODID); public static final RegistryObject<Codec<SingleItemLootModifier>> SINGLE_ITEM_LOOT_MODIFIER = GLM.register("singleitem", SingleItemLootModifier.CODEC); public ExampleMod() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); // Register the commonSetup method for modloading modEventBus.addListener(this::commonSetup); // Register the Deferred Register to the mod event bus so blocks get registered BLOCKS.register(modEventBus); // Register the Deferred Register to the mod event bus so items get registered ITEMS.register(modEventBus); // NEW REGISTRIES HERE! LOOT_ITEM_CONDITIONS.register(modEventBus); GLM.register(modEventBus); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); Now when I break anything in the BlockTags.LEAVES tag it drops a diamond. -
You are trying to use the clumps mod that has not updated to the recent changes in forge 1.19 Forge 1.19 is still under development (there is no recommended release yet). Mods that are not keeping up with updates won't work. For now, you will need to carefully check your mods have had a recent release before trying to use them.
-
You are trying to use a mod for minecraft 1.18.2 with 1.19 How you remove mods depends upon your launcher, e.g. with the vanilla minecraft launcher you delete the file from your mods folder, others like curseforge or multimc have a gui. I would suggest you watch a youtube about modding with your launcher to get to know the basics, or look at your launcher's documentation or tutorials if it has any. This forum is to help with problems with forge. Forge is not itself a launcher.
-
https://github.com/sp614x/optifine/issues/6974
-
https://forums.minecraftforge.net/topic/113924-better-minecraft-modpack-crashed-after-i-put-other-mods-in-it/#comment-505923
-
That method used by lost cities wasn't added until forge 40.1.35: https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.1.60/forge-1.18.2-40.1.60-changelog.txt You have 40.1.0, so you can either; * upgrade forge * talk to the lost cities author to find out which version of that mod is compatible with 40.1.0
-
Exception in server tick loop, Vault Hunters
warjort replied to SolarSquid13's topic in Support & Bug Reports
Your original crash is dated 7/15/22 your second one is 7/14/22? Can I borrow your time travel device. ๐ -
better minecraft server crashing :c can someone help?
warjort replied to Harry_'s topic in Support & Bug Reports
Or since this is a modpack, you could also ask the author of the modpack. -
better minecraft server crashing :c can someone help?
warjort replied to Harry_'s topic in Support & Bug Reports
This is an issue with the additional additions config file. Contact the mod author to ask how to fix the problem. -
Looks like an issue with BetterLoadingScreen, make sure you have the latest version then contact the author. https://github.com/search?q=moveRenderOut&type=code