Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by InspectorCaracal

  1. This has nothing to do with the OP but it's a direct result of my previous post and I hate how I keep making new threads so I'm reusing this one >.> I'm trying to implement my entity join event solution, but I'm stuck because I can't figure out how to check if a chunk is fully loaded or not. My searching turned up exactly one solution, which is for 1.14 and references World.getChunkProvider().isChunkLoaded(pos) - which doesn't appear to exist in 1.16 How do I check if a chunk is fully loaded in 1.16.x?
  2. So to summarize, it sounds like if I have a specific change in mind, the first step is to make absolutely sure there are no existing hooks that can do the thing, and then, if it's likely enough other people will want to modify the thing themselves to cause inter-mod compatability issues, I should look into making a forge hook PR everyone can use, and if it's not likely, then I don't really need to worry about it and can just replace them. Which is extremely reasonable. p.s. Thanks to going back and reviewing all the stuff that is in Forge already, I think I got a solution involving cancelling the bee entity join event and re-adding the bee data to the hive as an alternative to changing the release conditions, so I shouldn't have to break into anything after all. It's kinda tricky to find the stuff I need to use as a fresh modder but I'm continually impressed by how Forge is put together to let you do stuff.
  3. Ah, hmm! I hadn't thought about adding a hook to Forge myself. I'll have to sit down and go through everything to figure out if there's a most generally useful approach that could use a new hook. I've already done all those things, but it's a good reminder to look at the original source. (Speaking of flow of original code, the changes I want to make are on the TileEntity for the hive, not the bee, but that's tangential.) Although, when I was investigating the bee-goals angle, I couldn't find an easy way to replace or add AI goals without writing your own custom extension class? I don't need it for this, but if there's a hook for that, I'd love to learn what it is.
  4. I've been enjoying my dive into Forge modding so far, but I'm being presented with a pretty steep compatability conundrum at the moment. (I'm interested in general best practices and solutions, not just this specific case, but to make explaining it easier, I'm just going to talk about my current specific scenario rather than try to generalize.) My current end-goal here is bee hibernation: if the temperature at the hive's location is below freezing, then the bees won't come out. For my own hives, this is a trivial modification, since they already use mod classes that extend vanilla and I can override methods there with impunity. But this does Absolutely Nothing for the vanilla bee nests. The obvious solution is to replace all the vanilla bee nests with my own modded version as well, but that raises potential compatability issues if there's ever a different hypothetical mod that also wants to extend beehive functionality. I'd likely have to write in compatability with other mods on a case-by-case basis. (The only other thing I've stumbled across is coremods and I am absolutely not going to touch core modding. If I can't do a thing without coremodding I am simply not going to do it.) So, that said: what should I be doing here? Is replacing the vanilla entities with modded extensions typical, or is there a better solution?
  5. Yep, already figured that out. I changed it over to official anyway because it was easier to look up the unmapped names in the official mappings file.
  6. Without knowing the details of your code or the finer points of registering blocks, my first thought when I see "my mod was working, then I made one change and everything broke" is: did you triple-check for typos on the new lines? That's usually what it is for me.
  7. Ah, never mind what I originally wrote here, there is a different thing going on.
  8. YES, IT WORKS!! Perfect! Thank you! Now I just need to dig into the obfuscation stuff to make sure this'll work outside of dev, but I can do all that on my own.
  9. Sorry, I'm not very good at keeping track of specific terminology and tend to just throw the closest word I can think of at it. Anyway, let me rephrase my question a little more clearly. Is the thing I'm supposed to modify a field called "matchingStates", or is it the field called "BEEHIVE"? I assumed you meant matchingStates at first, but there's no field by that name or even a similar name in PointOfInterestType, or even in the entire code base. I ran with it being the BEEHIVE field yesterday because I knew where that was, but it didn't work, and I want to find out if that's where you were pointing me before putting more work into figuring out what I might've done wrong. edit: Oh, it just occurred to me while looking at the fields again that you might've meant `Set<BlockState> blockStates` so I'm going to give that one a shot
  10. Tangentially, I just found this thread while researching to make sure I do the enqueueWork bit properly and I got to "Vanilla loves hardcoding things" and BOY is that the theme of my past week working on this lmfaooo
  11. By PointOfInterestType#matchingStates do you mean the variable holding the registered POI type?
  12. Well, that fix handles the specific problem I was having in regards to the constructor re: inheritance, but I'll be damned if I make another thread again at this point so my last remaining problem (optimistically) which I hunted down trying to figure it out is that the bees will only identify a hive as a valid potential target if they're BEEHIVE or BEE_NEST in the PointOfInterestType registry. Is there something else I can overload somewhere to get my hives in there?
  13. Oooh, a Digimon server! Did you mod it yourself or are you using a pack?
  14. I'm familiar with type casting, thank you. 😜 See: "not have it cast to Block" I suppose I will thank you for reminding me to look up the explicit typecasting syntax for Java, since that was a useful side-effect. I admit I started this thread in the hopes of discussing the general concept and implementation of a block activation method override done via an event handler, not for basic Java or debugging, but oh well. Anyway! Based on my own attempt, the original topic doesn't seem like a very useful way to replace the onUseActivation method, because bypassing the entire use chain is rather more of a pain in the butt than it's worth. It's definitely a solid way to add an additional check beforehand, though, which I wish was good enough for what I'm doing (it should be!) but oof. The bee code has everything hardcoded in like three different places, it's really annoying. I'm going to have to just extend the classes with my own versions after all.
  15. Your server will have a default version of java that gets used when you just use the command "java" - in this case, it sounds like java 16 What you need to do is instead of just "java -jar etc", use the path to the java executable in place of java. So instead of "java -jar etc." it's "/full/path/to/java1.8/executable -jar etc"
  16. I know this post is relatively ancient and all but please for the love of all good things, NOBODY SHOULD USE W3SCHOOLS EVER. It is not associated with w3.org It is full of OUTRIGHT WRONG INFORMATION It is a Bad Website and will teach you Bad Code, and anyone else who stumbles on this thread should know this. I'm all for using lots of reference and tutorial websites and examples when learning to code, but not W3Schools. Please. Anything else.
  17. I'm making my own beehives and I want to create them with the vanilla BeehiveBlock and BeehiveTileEntity classes. I've gotten it 99% working, except that when I place my custom hive, I get a warning and bees don't seem to recognize it (indicating there's no valid beehive te present). [minecraft/TileEntity]: Block entity invalid: minecraft:beehive @ BlockPos{x=-232, y=65, z=60} I'm not clear on why exactly this is happening, but my best guess is that it's due to the BeehiveTileEntity initially being registered with the bee nest and beehive blocks: public static final TileEntityType<BeehiveTileEntity> BEEHIVE = register("beehive", TileEntityType.Builder.create(BeehiveTileEntity::new, Blocks.BEE_NEST, Blocks.BEEHIVE)); I've tried registering it with my own block in my registry class according to the TileEntityType registry docs and examples, but it didn't seem to affect anything. Is there a different syntax for adding new valid blocks to an already registered TileEntityType? edit: I should specify, the BeehiveTileEntity class has TileEntityType.BEEHIVE hardcoded into the constructor, which is likely what's complicating things.
  18. Aaagh, I just found an entire place it redundantly checks if bees should be angry which is again hardcoded to lit campfires, which means this idea isn't going to work for my end goal anyway.
  19. Right, I actually went and tried this and I don't know if it's just Eclipse complaining about something that would work in practice, but at least according to it, this won't do what I need. I need to run a method off of an instance. In order to get the instance, I need a variable to put the results of getBlock into. If I declare that variable as anything besides a Block type, Eclipse informs me that it's an error The method call in question is `.takeHoney(worldIn, hive_state, pos)` If I call it as BeehiveBlock.takeHoney I get the static/non-static mismatch; if I call it as hive_state.getBlock().takeHoney then I get a message that Block doesn't have a takeHoney method AND the static/non-static mismatch; if I try to do `BeehiveBlock hive = hive_state.getBlock()` then I get a type mismatch message.
  20. I've hit a bit of an additional road block on this particular quest. Several, in fact, which is making me start to question if this is doable. >.> First: the only way to get the associated block from the BlockState appears to be getBlock() which returns an instance of Block. But I need to know if the associated block is specifically a BeehiveBlock and if so, be able to access the BeehiveBlock methods on the block instance, not have it cast to Block. Second: The onBlockActivated method usually returns back an ActionResultType. Where does that usually go? I assume I'll need to either handle the effects that would normally happen when the event got the result back from the method, or pass the result on to wherever it's supposed to go, for the faux-override code. If either of these aren't doable then I suppose I'm back to the drawing board.
  21. edit: Ahh, never mind, I found the answer elsewhere, I need to call the methods on an instance.
  22. I do all my own coding without an IDE and had to set up Eclipse for this, too, and honestly I'm kind of loving it? The nice thing about being a stickler for simple DIY approaches is you get to fully appreciate modern conveniences when you're forced to try them. Being able to jump right to function declarations by right clicking on them has been a lifesaver for me so far!
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.