Jump to content

Quipex

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Quipex

  1. After some time it and refactoring it magically began to work. Seems like some weird caching shit related to 'run' folder. Thanks for the help!
  2. No, just tested on a brand new world, it must be something else. Just to make sure I got you right: it highlights the chests and prompts in console how many chests were checked in total (not 0)?
  3. Weird thing: I've wrapped 1.18 code inside enqueueWork and now it also returns only nulls..
  4. @warjort forgot to ping you above 👆
  5. Good news, now `Thread.currentThread() != this.thread` indeed produces false, but `this.getChunkAt(p_46716_).getBlockEntity(p_46716_, LevelChunk.EntityCreationType.IMMEDIATE)` always gives null for some reason
  6. UPD: saw your comment above, let me check that Ok, so I've debugged and now I can confirm that on the 1.18 Thread.currentThread() != this.thread produces false, when on 1.19 it gives true. Only things that come to my mind are: I made some event handlers static (to compare: 1.18 and 1.19)
  7. What surprises me is that the original 1.18 mod does not wrap inside ctx.get().enqueueWork(lambda) and works just fine
  8. @warjort thanks for the reply, I've tried wrapping the whole before ctx.get().setPacketHandled(true); inside ctx.get().enqueueWork(lambda) but it acted the same. Am I missing something else?
  9. Hello, first of all, I'm new to forge so if I'm missing some basic things, feel free to point me into it. I'm trying to migrate a minecraft mod from 1.18 to 1.19. Its pretty much done, but there is one bug that I can't resolve. On the original mod (1.18) there is packet handler that takes care of the main business logic: it scans cube of a configured radius, finds chests and fills them from player's inventory. Here's github link to the method that does the job. On contrary, my migrated (1.19) method does the same. The main issue is that on the Line 184 after we map BlockPos to BlockEntity and filter by NotNull, we get 0 blocks (at 1.18 it determines everything fine): var blockEntities = BlockPos.betweenClosedStream(minX, minY, minZ, maxX, maxY, maxZ) .map(world::getBlockEntity) .toList(); DropOff.LOGGER.debug("Found {} block entities", blockEntities.size()); var nonNulls = blockEntities.stream() .filter(Objects::nonNull).toList(); DropOff.LOGGER.debug("Found {} non-nulls", nonNulls.size()); This are the sources of Level#getBlockEntity(BlockPos): @Nullable public BlockEntity getBlockEntity(BlockPos p_46716_) { if (this.isOutsideBuildHeight(p_46716_)) { return null; } else { return !this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(p_46716_).getBlockEntity(p_46716_, LevelChunk.EntityCreationType.IMMEDIATE); } } So I guess my issue lays in `Thread.currentThread() != this.thread`. I reckon I did something wrong with the event listeners which led to this problem. Please help me troubleshoot the problem. FYI: 1.19 repo, 1.18 repo
×
×
  • Create New...

Important Information

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