Jump to content

imacatlolol

Forge Modder
  • Posts

    274
  • Joined

  • Days Won

    5

Everything posted by imacatlolol

  1. If the block you're trying use is your own block, just override onBlockActivated as I mentioned and put in the code to check the item in your hand. If the item you're using is your own item, override the item's onItemUse function. If neither of them are your own, use the PlayerInteractEvent$RightClickBlock event.
  2. What are you even trying to do? If you're trying to interact with a block you can just override onBlockActivated in your block class. Read the vanilla code for the crafting table.
  3. Entity#pick may be the method you want to use; it emits a ray that collides with blocks in the world. The first parameter is the range, the second is the "partial ticks" (you can just put a value of 1), and the third is if it should work on fluids. The returned RayTraceResult will tell you what kind of thing it hit, as well as its position. From there, you can get the block at that position.
  4. Er, looks like you deleted all of your block state JSONs by mistake.
  5. Spoon-feeding code is frowned upon on these forums, but I can try rewording what I already mentioned in a more tutorial-esque way: Extend SoundType and override all of its "get sound" methods. In the constructor, replace the parameters of SoundEvent with RegistryObject<SoundEvent>. You'll also need to place them is fields, obviously. Put null when the super constructor wants SoundEvent objects, we won't be using them anyways. In the overridden methods, return RegistryObject#get for each of your corresponding objects. If any of that was confusing, you may need to spend some more time learning Java before you start modding.
  6. Hmm, I don't use Eclipse myself so I'm not entirely sure if it's a problem with that or if it's something else... All I usually have to do is press a button which re-imports the Gradle project (I use IntelliJ IDEA). Not sure if Eclipse has a similar function somewhere. You could also try deleting your Gradle cache to force it to refresh. There should be a .gradle folder in your computer's user directory, all you should have to do is delete the caches folder. Not sure if it'll work as I expect, but it may be worth a shot if you can't figure out anything else (unless someone who knows Eclipse better than me can provide some tips).
  7. Sounds like an issue of using outdated MCP mappings. Make sure you're using the latest snapshot version (20200513-1.15.1 at the time of writing this).
  8. My recommendation would be to use World#isRaining in conjunction with Biome#getTemperature (with the biome obtained via World#getBiome). Though, it sounds like you're already doing that; why won't getBiome work for you? Edit: My bad, I was a little too hasty; I've edited my answer.
  9. Ah, I see. Get the world from the player, get the block state from the world using the position, then use the state's block for the comparison.
  10. PlayerInteractEvent$RightClickBlock, consider using your IDE's search function.
  11. BabyEntitySpawnEvent only fires on breeding, so it wouldn't cause the recursion you mentioned as long as you configure the additional babies manually. Analyze the BreedGoal#spawnBaby method to see how you should configure the additional babies. Also, don't forget to use a lower event priority and check if the event is canceled before doing anything in case another mod wants to cancel the spawning.
  12. Ran a quick test, both registries seem to return the same IDs, which makes sense all things considered. So, both the vanilla and forge registries would work for this purpose, unless I'm missing something. In the end I believe it would just be personal preference; most modders seem to use the vanilla registry, but using the forge registry may be preferred by the forge team.
  13. I don't think you would. You'd probably just have to cast the IForgeRegistry to ForgeRegistry and use its getID method, but I'm just assuming that it would return the same result. It certainly wouldn't be any more difficult to work with, I'm sure.
  14. Ah, I see. I'm not super familiar with world gen, but I think this is one of those rare cases where using the numerical IDs is actually necessary, you both were right in the first place. I looked at a couple other major world-gen mods (Betweenlands and Midnight) and they seem to do the same thing, so I don't believe there's any issues with using the vanilla registry here. As for the deprecation warning itself, you can use the SupressWarnings annotation; though you may want to add a comment about why the suppression is needed for your own future reference.
  15. Why do you need the integer id? Integer ids are unreliable and should almost never be used. In any case, Registry is only really meant for vanilla's use. ForgeRegistries is what you would use to access registries.
  16. Use the solution I posted, it's a fine workaround for the time being until Forge makes an official fix.
  17. Yes, that's all you need to do. It won't affect any of the game's normal behaviors, aside from what you change (i.e. the stack size). I recommend adding an option in your mod's config to disable this feature if desired by users, but that's up to you. You may also want to use a different event priority for registering your replaced item to make it harder/easier for other mods to override your replacement by default.
  18. Keep in mind that a lot of the concepts from previous versions can still apply. In the case of extra utilities, it save the item's creation time to NBT, compares it to the world time, then uses PlayerTickEvent to blow up players who have expired ingots in their inventory.
  19. I'd recommend just replacing the registry entry for the item, not sure if using reflection is really the best option here. In any case, ObfuscationReflectionHelper takes the unmapped SRG name, not the mapped name.
  20. TileEntityRendererDispatcher would be what you want. I'm an idiot, ignore me.
  21. It sounds like there's multiple problems at this point, the error in your edited post is different from the one in your original post. If you can't get the arguments to stick, look around for a "Repair Minecraft" button somewhere. I don't know where it is, might be on the modpack's page, probably in one of those "..." menus; it should at least fix the FileNotFoundException.
  22. I don't use the Twitch launcher so I'm kind of just winging it here. In your settings for the Twitch launcher, there should be a Minecraft section. Down at the bottom is where I believe the java settings are. From the sounds of it, I'm skeptical that that's where the problem is, but it's worth checking. Edit: Ooh, didn't see your stealth edit.
  23. Oh pfft, I misread, my bad. What's your full configuration with program/vm arguments? It's having trouble finding the main class, which is an issue I've never seen someone have before.
  24. Stop bumping so often. Use Java 8.
  25. The best option, in my opinion, would be to just modify the sounds.json like a regular resource pack. For reference, these are the vanilla entries for this (in case you don't want to dig through hashed files to find it): "music.dragon": { "sounds": [ { "name": "music/game/end/boss", "stream": true } ] }, "music.end": { "sounds": [ { "name": "music/game/end/end", "stream": true } ] }
×
×
  • Create New...

Important Information

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