Jump to content

SoniEx2

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by SoniEx2

  1. Can we get an IDE plugin that is aware that the strings in those things are actually fully qualified names? That way I don't need to use string refactoring which doesn't even work when you use "rename"-type refactoring in IDEA. (proof: make class, put FQN in some string somewhere, open class in editor, run shift+f6 while with the cursor over the class name, etc, watch as the FQN string is untouched. there are also a few other cases where it doesn't work properly.) Also would be nice if it displays an error when the FQN doesn't specify an IRecipeFactory/IConditionFactory/etc. (Alternatively, could someone hack an event-based IRecipeFactory/IConditionFactory/etc registration system with a coremod? That just so happens to also solve my problem, and is much simpler than an IDE plugin.)
  2. Actually @ is invalid in package names. We could also use super for the parent package (a la @Mod.super), which is also invalid in package names. So no, no ambiguity there. Also what do you mean requires parsing binary files? They're already parsed by the time _factories.json is loaded. And you'll need to parse those binary files anyway if you wanna add IDE support (error reporting) for factories.
  3. I'd like to be able to use @Mod as a shorthand for the package in which the @Mod is in, in _factories.json. That is, the following _factories.json: { "conditions": { "zero_max_energy": "@Mod.conditions.ZeroMaxEnergy" } } in assets/powercrops/recipes, should use the modid from the path (powercrops) to fetch the matching @Mod, and use the package it's in. In powercrops case, this is io.github.soniex2.powercrops. Currently I'm using package powercrops for _factories.json stuff (e.g. as in powercrops.ZeroMaxEnergy), because it's easier.
  4. Why's the crop block not a crop by default?
  5. Okay figured out how to use the awful _factories.json-based system, nvm.
  6. I need to select between 2 different recipe outputs based on a config value. How do I do that? Create dummy item name and register an alias based on the config? How do I register alias? Reflect into ForgeRegistry?
  7. It seems the old pre-1.12 way of registering tile entities (in preinit) still works, but is that the right way to do it?
  8. Currently, BlockCrops,getPlantType defaults to EnumPlantType.Plains. It would make more sense if it defaulted to EnumPlantType.Crop instead. (I do not mean BlockBush should default to Crop type, I mean only BlockCrops specifically should default to Crop type!)
  9. Currently in the process of porting to 1.12. Previously, in 1.11.2, I had: @Mod.EventHandler @SideOnly(Side.CLIENT) public void yUNoPerMethodDependenciesClient(FMLPreInitializationEvent event) { yUNoPerMethodDependencies(event); ModelLoader.setCustomModelResourceLocation(powerSeeds, 0, new ModelResourceLocation(new ResourceLocation(MODID, ItemPowerSeeds.ITEMID), "")); ModelLoader.setCustomModelResourceLocation(realizedPowerSeeds, 0, new ModelResourceLocation(new ResourceLocation(MODID, ItemRealizedPowerSeeds.ITEMID), "")); } (https://bitbucket.org/SoniEx2/powercrops/src/3003fdfde9fbaa245b3b366e2a718b27c619570f/src/main/java/io/github/soniex2/powercrops/PowerCrops.java?at=master&fileviewer=file-view-default#PowerCrops.java-91:97) This no longer works in 1.12. How do I register item models in 1.12?
  10. I have a mod. It registers a Block, and an ItemSeeds which uses that Block. I'd like to let other mods replace the Block using the overrides system, without them also having to replace the ItemSeeds. To do that, the only way I know of is to make my own subclass of ItemSeeds that doesn't use the final Block inside it, but rather uses some sort of thing that stays in sync with the registry. This involves overriding all ItemSeeds methods in my subclass, which defeats using ItemSeeds in the first place. The question is, is there a better way?
  11. Sorry, extend the ItemSeeds and override all of the methods that touch the final Block field.
  12. I need to override the ItemSeeds methods, not my own items. I want other mods to be able to override my stuff painlessly.
  13. Those would be IRegistryDelegate? Also, that's not exactly what I'd call "a better way", since I still need to override everything.
  14. What I came up with is, I could extend ItemSeeds and hope nobody's reflecting into the crops field, then override the relevant methods using a static @ObjectHolder field instead of a private final (instance) field, such that I need different classes for different seeds, but at least the Block is automatically updated. That would probably work, but is there a better way I can do it?
  15. How can I make it so I don't need to override the item when I override the block, at least for my own items? Also it's called "override" in the code.
  16. Forge has a mechanism for overriding blocks. You can replace any block with your own Block as long as it's not Blocks.AIR. This mechanism doesn't extend to final Block fields like the ones found in ItemSeeds. You can crash anything that uses ItemSeeds by overriding the underlying Block. (You *can* override both the block *and* the item, but eh.)
  17. As we know, vanilla classes aren't fan of overrides. For example, if we look at ItemSeeds, we have this thing: private final Block crops; What this means is that if someone overrides your crops block you have nothing you can do and the whole game breaks, because the registry Block is now different. How do I fix this? (@ObjectHolders are still as broken as they were before, since they do nothing to help this.)
  18. I'd like to have potion effect hooks. Currently you can tell a potion is active, but not when it's triggered. For example, the poison 1 effect only triggers once every 25 ticks based on the effect duration, dealing half a heart of damage when it does so. You can't currently hook when it triggers, but I would like that hook. This is useful if, for example, you want to make potions last half as long, but trigger as they would normally; that is, half as many times as they'd trigger otherwise. Such halving of potions would be implemented by ticking them twice every tick, but only letting the effect trigger every other time. Other uses include changing the way effects are processed (poison gains regen-like abilities if you're zombie morph? regen damages you? etc). The hook should be cancellable. The best place to put it is in PotionEffect.performEffect. The event needs to include the entity, and the effect itself. An example mod that would use this hook is available here.
  19. I wrote a coremod because the hook I needed doesn't exist. I explained how the hook works. now you come and tell me I didn't? I also had linked an example mod that would use the hook.
  20. I wrote a coremod to piss Lex off. The coremod is pretty simple, less than 100 lines: [code to insert call to a @Cancelable Event into PotionEffect.performEffect] All it does is patch PotionEffect.performEffect such that it calls my code, and then my code decides whether to run normal routines or exit (basically a cancellable event). The handler code just grabs the effective ItemStack and calls this method on it: public boolean checkPotion(PotionEffect potion, EntityLivingBase entity, ItemStack is) { NBTTagCompound tag = is.getOrCreateSubCompound("chew"); NBTTagCompound subtag = tag.getCompoundTag("potion"); String key = Potion.REGISTRY.getNameForObject(potion.getPotion()).toString().intern(); boolean b = subtag.getBoolean(key); subtag.setBoolean(key, !b); tag.setTag("potion", subtag); return b; } Which simply makes the potion tick only half the time. Would it be possible to have this event in Forge?
  21. Forge should detect if it's running as root and quit immediately. Mods that want root should use an out-of-process daemon for their root needs. Forge should work with CurseForge to stop mods from using root.
  22. This one? http://www.minecraftforge.net/forum/topic/59111-item-transactions/
  23. I logged in this morning and my post is gone???
  24. I have a signature??? I don't think I can see signatures for some reason... Anyway, I mean, I only used it once for stripping my own methods clean on the standalone server without causing MethodNotFoundErrors and stuff so I could go proxyless, but tbh it only lasted like one version. (Not that there aren't better ways to go proxyless, but I hadn't figured that out back then.) Also, base edits are like, minecraft.jar editing and stuff, not coremodding.
×
×
  • Create New...

Important Information

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