Jump to content

Tmtravlr

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Tmtravlr

  1. Hmm, all right. I'll just remove those two files from the pull request. Hopefully everything will work.
  2. Hey, You likely shouldn't be creating your own TemplateManager... Use the one you can get from an instance of the World: world.getSaveHandler().getStructureTemplateManager() See if that works. It should put the structure in the structures folder for the save currently loaded.
  3. Hey, Looks like you forgot to check if the NBT tag is null in addInformation (or call stack.hasTagCompound()). For the right click one, you should use the player.getHeldItem(hand) instead of getActiveItem(), which is for items you're using over a time period, like food and bows. That is probably empty when that right click is called, which is returning an empty item in the result.
  4. Hey! ItemStacks are what are actually registered, not blocks, so just register the item versions of your ores, and it should be fine.
  5. Hey, The first two should really be done from the server (spawning an entity client-side can lead to phantom entities... and running an explosion client side lead to phantom client-side holes since the random number generator on the server doesn't always break the same blocks). If you have something spawning a mob or explosion from the client, it would probably be best to send a custom packet over to the server with info about what mob you want to spawn or about the explosion. I don't think there are vanilla packets for that, but I could be wrong. The third has a vanilla packet. I remember recently using it to create a hammer-like tool that has some custom block-breaking logic. Check out tryHarvestBlock in PlayerInteractionManager, it's sending a SPacketBlockChange packet on line 337 or so.
  6. Hey, I'm creating a pull request in forge. I generated the patches with ./gradlew genPatches, but I see there are two files with a few numbers different which I didn't edit. Should I be concerned about that and remove those files from the commit, or keep them? I'll attach some screenshots of the two file diffs in sourcetree. The AdvancementManager, FunctionManager, and TemplateManager changes look like they're supposed to. Hopefully someone more familiar with making pull requests knows what to do. Tmtravlr. Pictures:
  7. Hey, I've been working on a mod that lets players package up recipes, loot tables, advancements, functions, and structures into a zip file and load them into the game from a certain folder. That way they will load for every world more like a mini-mod, and they can share it. I've gotten loot tables to load easily enough because of the loot table load event, and recipes I just parse and load when the mod loads. However, I don't see a good way to load advancements, functions, or structures... especially since they can be reloaded anytime with the /reload command. Does anyone know of a way to load them, which respects the /reload command to reload them? If not, I can try creating a pull request in MinecraftForge to add events when they load (like how the loot table one works). I figured I'd see if anyone knows a way to do it currently first though, so I don't waste my time. =) Tmtravlr
  8. Thanks, I have actually contributed to Minecraft Forge before. (Time to go dig up my old fork) =) I just wanted to know if it was a good idea in this case.
  9. Hey Leviathan, Yeah, that does help with my problem. I'm glad to see someone else cares about this. =) Adding the looted entity would work great for most cases, since you can get the position from it (I even see you added a biome condition check in your test =D ). There's just the case of someone looting a chest (or other tile entity container) without actually opening it, like if they break it. I'm rather surprised vanilla doesn't add the block position itself to the loot context. Seems like something that should be there. I'm also using loot tables in my mod for block drops, which wouldn't have entities involved if not broken by a player... but I think I can find a way around that. The PR looks good to me, though if there were a way to get the position from chests without the player, that would be even more awesome!
  10. Hi, 1. What do you mean? I never colored the text in the post. 2. I don't want help writing coremods. In fact, I don't want a coremod at all. That's the whole reason for this post. I want to find a way to do these things without a coremod. If I'm going to take the time to do this, I'd rather do it right. 3. I assume you mean the crafting book crash? I'm registering the recipes by creating the JsonContext, then calling recipe = CraftingHelper.getRecipe(json, ctx); where json is the JsonObject and ctx is the JsonContext, And then registering them using ForgeRegistries.RECIPES.register(recipe.setRegistryName(recipeId)); where recipeId is a ResourceLocation with the id I want to replace (or a new id). Is there a better way to read them in and register them? Edit: Maybe my title for the thread is misleading... I'll change it. Wait... can I not change it?
  11. Hey! I can't believe I've been making mods for four years and have never posted here before... Anyway, I need some advice about a mod I'm working on. One of the goals of the mod is to be able to change loot based on things like biome, dimension, etc. which means the loot context needs to record the position where the loot is generated (so then it can be looked at in the loot conditions and functions). Now unfortunately, the vanilla loot system doesn't do this. I've gotten it to work using ASM (by passing my own 'extended' loot context with position info in the different places in the code where loot is generated), but would rather avoid ASM if I can. Would it be worth it to create a pull request in forge adding that to the vanilla loot context, and use that instead? Also, anther goal of the mod is to be able to load loot tables, recipes, advancements, functions, and structures from a file outside of the world files. Basically I want these as a 'middle' source, with files in the world save taking precedence, then these, then built in files. Now fortunately I got loot tables to work nicely with the loot table load event, and discovered recipes are a pain to work with (I can add the recipes just fine in the mod's init, which is what I'm doing now, but if I try overriding the vanilla recipes, it seems to work until I open the vanilla crafting book in the game, which crashes), but the only way I could find to add/override the advancements, functions, and structures was ASM. Would it be a good idea to add a few events in forge much like the loot table load event for when the advancements, functions, and structures load? I appreciate the advice. =) Tmtravlr
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.