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


  • Posts

  • Joined

  • Last visited

Everything posted by InspectorCaracal

  1. I'm pretty sure they have to be in the "mods" folder, not in another folder inside the mods folder. Try taking them out of the 1.16.5 folder and putting the files straight into the mods folder.
  2. Oof, good to know. And thanks for the link! I can figure the rest out from there if it doesn't translate straight over.
  3. The using tags in code section of the forge docs describes using one set of functions but the example is completely different. Which should I be following?
  4. This is a huge mess but I'd start with the top line there Especially since later on it says
  5. (I don't have a Forge solution so general debugging advice here) Did you manage to track down where exactly it's not working, or is the "not setting it" just a description of the effects? If you aren't sure where exactly it's not working the way it's supposed to, what I like to do to narrow down the issue is put in debug log lines that echo the status of the variables or code at all the steps of the process that's not working. Echoing your input/output for your set and get methods to console, for example, or checking the status of your items list at each step to see where it changes, or doesn't change, and so on. Then you can track down exactly which function call(s) aren't working right and try alternatives for them.
  6. Ahhhh, got it. That's what I get for going and doing my own thing haha edit: Made that change and it all works perfectly now, thanks!
  7. Hmm. Can you make the other mod a dependency and then call the methods from the other mod directly? I'm not experienced at all in mods let alone inter-mod functionality, but if that's possible, it'd be the right way to do it, I think.
  8. Hmm, that all looks fine, I'm not sure why it's not showing up for you. Are you getting any loading errors for the advancement in your debug log or console output? Also, FYI, the "requirements" item is optional; if all your criteria are required, you can just leave it off.
  9. Ultimately this wound up with the field being an Item instead of a Block but I'm running into a small bump again here. After saving and reloading the world, the field seems to be returning "air" instead of the item it's supposed to be. It seems to be because I'm using custom items and the string-to-item conversion is assuming the 'minecraft' namespace, but I can't figure out how to do the item-to-string with the namespace included. This is what I have right now: public void load(BlockState state, CompoundNBT nbt) { super.load(state, nbt); this.honeyType = null; String saved_honey = nbt.getString("Honey"); this.honeyType = ForgeRegistries.ITEMS.getValue(new ResourceLocation(saved_honey)); } public CompoundNBT save(CompoundNBT nbt) { super.save(nbt); nbt.putString("Honey", this.honeyType.toString()); return nbt; }
  10. In the package net.minecraft.command there is a class Commands.class that has the functions that execute commands. If you read the code you'll be able to see how it's done.
  11. It looks like you have Optifine in there which is client-side only
  12. Ah! Perfect! I'll take a look at those functions, they look like exactly what I was trying to dig up.
  13. Hmm, I wonder what I did wrong, then. I changed all the settings to point to Java 8 instead of 16 and then whenever I tried to run it, it told me that it wouldn't work on that version. Well, the older version is a good back-up for cases where changing the settings isn't working for whatever reason, at least.
  14. I had to install an older version of Eclipse from mid-2020 to work with java 8; the current version refused to run when I told it to use 8. If you have a fresh Eclipse install and it's running, it's probably ignoring your jdk 8 path and using the version 16 one instead. Here is the version of Eclipse I'm using.
  15. Okay, straight to the point. How do I convert a block reference to NBT for saving an entity? e.g. a field named "flower" set to Blocks.ROSE_BUSH
  16. What does your custom recipe look like?
  17. Right, sorry, I wasn't clear. What it looks like this does is, if the item has a custom entity, it cancels the spawn event and reschedules a new spawn event for the new entity. But I'd think that would then, on execution, trigger this event again, match the custom entity condition, cancel the spawn, reschedule, etc. I know this isn't what it does and I'm probably missing something completely obvious, but I can't figure out how this doesn't just continually cancel and reschedule the entity spawn and I want to make sure I understand how it works before I try using parts of it myself.
  18. Ah, mild bummer. Yeah, I took a look at it, but I'm not at my dev machine right now so it'll be a few hours before I can try anything out. In the meantime, though, I noticed the delayed executor uses addFreshEntity, which is the same method for bees leaving hives and has me questioning my entire event. I had assumed addFreshEntity triggers the onEntityJoinWorld event, but that makes ForgeInternalHandler look like it would just continually remove and recreate the entity every tick which is obviously not right. Does the executor not trigger events, or does addFreshEntity not count as an entity join event? If it's the latter, what does addFreshEntity trigger, because that's what I need to be using. (Tangentially, I've been continually impressed by the scope of your knowledge of the code base and active presence on the forum, and I know that support work can feel incredibly thankless and exhausting so I wanted to mention that I really appreciate all the help!)
  19. I'll take a look, but does this mean there isn't anything that'll tell me if it's only half loaded? I was really aiming for not executing the code block during chunk loading as much as possible, but as far as I can tell, this is the event to use for bees exiting their hives so I have to account for chunk loading as well.
  20. This looks like you're running client-side mods, which won't work on a server installation. I don't know which ones, but the info is probably in your debug.log or you can try adding them one at a time.
  21. I know I said I didn't want to make a new thread, but it's still not working, so here we are. I have an EntityJoinWorldEvent function. I'm trying to set it so that it has a check to make sure it's not while the chunk is loading. So far, everything I've tried has resulted in the game saying the chunk is loaded during the initial entering-the-game loading phase and then never getting past the 100% indicator. This is what I currently have: @SubscribeEvent public static void beeSpawn(EntityJoinWorldEvent event) { if (event.getEntity() instanceof BeeEntity) { LOGGER.debug("It's a bee!"); BeeEntity bee = (BeeEntity)event.getEntity(); World world = event.getWorld(); if (!world.isClientSide()) { LOGGER.debug("It's the server!"); if (bee.hasHive()) { BlockPos hive_pos = bee.getHivePos(); if (world.getChunkSource().getChunkNow(hive_pos.getX() >> 4, hive_pos.getY() >> 4) != null) { LOGGER.debug("Hive is loaded"); Block hive_block = world.getBlockState(hive_pos).getBlock(); LOGGER.debug(hive_block.toString()); if (hive_block instanceof BeehiveBlock) { BeehiveTileEntity hiveEntity = (BeehiveTileEntity)world.getBlockEntity(hive_pos); if (world.getBiome(hive_pos).getTemperature(hive_pos) < 0.95F) { LOGGER.debug("Bee attempted leaving the hive, but it's too cold."); hiveEntity.addOccupant(bee, false); event.setCanceled(true); } } } else { LOGGER.debug("Hive isn't loaded yet, ignoring"); } } else { LOGGER.debug("Hiveless bee, ignoring"); } } } } And this is what I get to console: [20:10:42] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for dimension minecraft:overworld [20:10:44] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [20:10:44] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [20:10:44] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [20:10:44] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 0% [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: It's a bee! [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: It's the server! [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: Hive isn't loaded yet, ignoring [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: It's a bee! [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: It's the server! [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: Hiveless bee, ignoring [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: It's a bee! [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: It's the server! [20:10:44] [Server thread/DEBUG] [co.cl.be.ev.ModEvents/]: Hive is loaded [20:10:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [20:10:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [20:10:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [20:10:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [20:10:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 83% [20:10:47] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 95% [20:10:48] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 95% [20:10:48] [Render thread/INFO] [minecraft/LoggingChunkStatusListener]: Preparing spawn area: 96% Aaaand then it just sits with the loading screen saying 100% forever. It's obviously getting stuck on "Block hive_block = world.getBlockState(hive_pos).getBlock();" which I'm guessing is because it's trying to access block info while the chunk is loading and causing a deadlock, which means that this is still the wrong way to check if a chunk is fully loaded. How do I fix this?
  22. Unfortunately I'm also new to modding, so I'm not that familiar with the full code base. Maybe someone else'll know? I still definitely recommend looking into where in the original source the lava pools are spawned and seeing if there's anything you can hook into there, just in case.
  23. I'm not on my dev machine so I can't check the code myself, but I'm fairly certain the bee nest generation is attached to and triggered by the tree generation itself. If you want to use that approach, you'll need to hook into the lava pool generation, which I suspect is pretty difficult. Alternatively, I took a peek at some world gen stuff, and have you considered making the valid replacement block be lava source blocks instead of stone? It has the small chance of completely filling an underground lava pool, but otherwise I think it might do what you need.
  • Create New...

Important Information

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