TobiasDeBruijn / HaroTorch

Modded's MegaTorch on Spigot
GNU General Public License v3.0
1 stars 4 forks source link

[BUG] Torches don't work on Paper 1.18.1 #17

Closed zaphiredfox closed 1 year ago

zaphiredfox commented 2 years ago

Describe the bug HaroTorch has been working flawlessly for us on our 1.17 server since we added it, been nearly a year I think. We just updated to Paper 1.18.1 and updated HaroTorch to 2.4.3, but now it seems HaroTorch isn't working anymore. They'll place just fine, torch file is created on the server, particle effects work, etc, no indication that anything is wrong, but mobs continue to spawn like it wasn't even there. I've tried changing various settings and restarting the server, even removed a few other plugins just in case, but nothing seems to make a difference. I'm stumped.

To Reproduce Unknown. Was working on Paper 1.17, but not on Paper 1.18.1. Nothing else really changed.

Version Minecraft version: Paper 1.18.1-152 HaroTorch version: 2.4.3 Java version: openjdk17-17.0.1+12.1 OS version: FreeBSD 13 (figured this may be important to know as I've had other plugins fail due to issues with FreeBSD's database tools)

Additional context We were on the older version of HaroTorch prior to updating to Paper 1.181 (from 1.17). After the upgrade, HaroTorch would not load and generated errors on the console. I saw there was a newer version so I downloaded and installed. Of course I didn't read the note about the config format change or the update process, so when the new one loaded but none of our existing torches worked, I just nuked the entire config folder and started fresh. Wasn't till another few days later that players informed me the torches still weren't working, even after replacing them all with newly crafted ones. I've checked for file-system permission issues and plugin conflicts, but haven't found anything helpful.

TobiasDeBruijn commented 2 years ago

Hey there,

Thanks for opening this issue! It's definitely strange that this is happening, as it definitely should not be. I'll investigate this thoroughly, as it could be an accidental breaking change on the Spigot, or Paper side of things.

For your later point regarding the torches not working after a plugin update, this is a known issue due to package renaming internally. I renamed the plugins package root from nl.thedutchmc to dev.array21, without thinking of the potential side effects of this. In a future update the storage format will likely switch to json or some other standard format, of course with an automatic conversion process.

Thanks again for bringing this issue to my attention, I appreciate it!

TobiasDeBruijn commented 2 years ago

Hi there,

Sorry that it took me this long, it's been a busy year. Does the issue still persist on Paper 1.19?

QuibblingAsh42 commented 2 years ago

Greetings, I stumbled onto this issue as I'm experiencing the same. Can confirm it's still happening on 1.19. Damn creeper done blowed up my storage! :) Let me know what other info I can get to help you resolve.

TobiasDeBruijn commented 2 years ago

Interesting. Do you see any errors in the console from HaroTorch?

TobiasDeBruijn commented 2 years ago

Interestingly, launched a Paper server myself, and I was unable to spawn a monster when a torch is placed. So it appears the torch's core functionality is working. The issue might thus lie in the spawn event handler.

Do you have any other plugins installed that could affect the spawning of entities?

QuibblingAsh42 commented 2 years ago

No errors on the console. This morning I tested by placing a spawner a few blocks away from the torch, and still got spawns. I was also able to use an egg to place a zombie.

I don't have any plugins that are specifically for affecting spawning, but here's a list of current in case there's known issues. The only thing I can think of is MobsToEggs, but that only impacts them once spawned.

CraftBook CrisTreeCapitator DropHeads floodgate GetSpawners Geyser-Spigot HaroTorch-2.4.4-RELEASE LCLPGraveStones LuckPerms MobisElevatorSigns.jar MobsToEggs SavageGraveyards veinminer WorldEdit

TobiasDeBruijn commented 2 years ago

You mention spawners, might be that GetSpawners is causing issues here. Do you experience the same issues with naturally spawning mobs (not from spawners). or when using spawn eggs?

QuibblingAsh42 commented 2 years ago

Yes. GetSpawners was a relatively new addition, and I was getting natural spawns prior to adding it. I should mention my base was in the midst of 4 (yes, 4) slime chunks, and that's what I was primarily getting. However, I did have the occasional creeper and zombie.

But! I had primarily been testing in that world adding new plugins as I went along. I have just created a brand new world with all of the plugins already in place and am getting errors in the console now when I travel around. I have not placed any torches yet. I just restarted the server with a new seed and have been flying around in creative checking out the sights.

Hopefully, this is helpful:

[10:04:02 ERROR]: Could not pass event CreatureSpawnEvent to HaroTorch-V2 v2.4.4 java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.bukkit.Location.getWorld()" is null at dev.array21.harotorch.events.CreatureSpawnEventListener.torchInRange(CreatureSpawnEventListener.java:83) ~[HaroTorch-2.4.4-RELEASE.jar:?] at dev.array21.harotorch.events.CreatureSpawnEventListener.onCreatureSpawnEvent(CreatureSpawnEventListener.java:59) ~[HaroTorch-2.4.4-RELEASE.jar:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor22.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-232] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.java:740) ~[paper-1.19.2.jar:git-Paper-232] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.doEntityAddEventCalling(CraftEventFactory.java:645) ~[paper-1.19.2.jar:git-Paper-232] at net.minecraft.server.level.ServerLevel.addEntity(ServerLevel.java:1477) ~[?:?] at net.minecraft.server.level.ServerLevel.addFreshEntity(ServerLevel.java:1385) ~[?:?] at net.minecraft.world.level.ServerLevelAccessor.lambda$addFreshEntityWithPassengers$0(ServerLevelAccessor.java:16) ~[?:?] at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:?] at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:?] at net.minecraft.world.level.ServerLevelAccessor.addFreshEntityWithPassengers(ServerLevelAccessor.java:16) ~[?:?] at net.minecraft.world.level.NaturalSpawner.spawnCategoryForPosition(NaturalSpawner.java:297) ~[?:?] at net.minecraft.world.level.NaturalSpawner.spawnCategoryForChunk(NaturalSpawner.java:213) ~[?:?] at net.minecraft.world.level.NaturalSpawner.spawnForChunk(NaturalSpawner.java:183) ~[?:?] at net.minecraft.server.level.ServerChunkCache.tickChunks(ServerChunkCache.java:764) ~[?:?] at net.minecraft.server.level.ServerChunkCache.tick(ServerChunkCache.java:648) ~[?:?] at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:685) ~[?:?] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1535) ~[paper-1.19.2.jar:git-Paper-232] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.19.2.jar:git-Paper-232] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.2.jar:git-Paper-232] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-232] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-232] at java.lang.Thread.run(Unknown Source) ~[?:?]

TobiasDeBruijn commented 2 years ago

Hm that is super interesting. The getWorld call on Location (of the mob that spawned) is returning null. From the doc:

Returns:
    World that contains this location, or null if it is not set

I'm honestly not sure how this happens, but it seems like a bug on the server side, considering you're not using Multiverse or something like that.

QuibblingAsh42 commented 2 years ago

Is there someplace I can set that manually? Since it was on my list of plugins to play around with, I did add in Multiverse, but still getting the same errors even with the worlds imported into MV.

I completely forgot to mention that I'm unable to craft the torch, either. Can only get it via a give command.

TobiasDeBruijn commented 2 years ago

Now that is even more interesting. Only reason that'd happen is if anything errors out on startup. When the plugin loads it adds the recipe for the torch.

Do you get the NullPointerException even if you're not using any custom worlds, and just use the default world created by the server?

QuibblingAsh42 commented 2 years ago

I don't have any custom worlds yet. However, as mentioned I was using this in the default world, and it didn't work but also didn't generate any errors. I've just created a new world, but just used a new seed, and am using that. That's the one I'm getting the errors in.

And...actually, I just noticed the title of this thread and realized I never noticed this was for 1.18. I'm actually on 1.19. Could that be it?

TobiasDeBruijn commented 2 years ago

That shouldn't make a difference.

I'll look into it further

TobiasDeBruijn commented 1 year ago

This might have been fixed by v2.5.0 (See also: #18)

zaphiredfox commented 1 year ago

HUZZAH!! Can confirm, HaroTorch is working now!!