stargate-rewritten / Stargate-Bukkit

The original, and still the best, survival-friendly portal plugin.
https://sgrewritten.org/paper
GNU Lesser General Public License v3.0
33 stars 12 forks source link

Several faults fail to print #352

Closed Pheotis closed 5 months ago

Pheotis commented 5 months ago

Bug Description

Many of the error states when trying to create an invalid gate fail to print anything user-facing.

Reproduction Steps

  1. Make a valid portal image image

  2. Create a duplicate portal image image

Desired Behaviour

This action should fail with faultExists

Observed Behaviour

This action fails with no user-facing error.

Trace Logs

[15:57:07 INFO]: [Stargate] Checking permissions for entity CraftPlayer{name=Pheotis}
[15:57:07 INFO]: [Stargate] Amount of GateFormats: 2
[15:57:07 INFO]: [Stargate] --------- nether.gate ---------
[15:57:07 INFO]: [Stargate] Chose a format rotation of 3.141592653589793 radians
[15:57:07 INFO]: [Stargate] ---Validating CONTROL_BLOCK
[15:57:07 INFO]: [Stargate] ---Validating FRAME
[15:57:07 INFO]: [Stargate] FRAME returned negative
[15:57:07 INFO]: [Stargate] ---Validating CONTROL_BLOCK
[15:57:07 INFO]: [Stargate] ---Validating FRAME
[15:57:07 INFO]: [Stargate] ---Validating IRIS
[15:57:07 INFO]: [Stargate] ....Choosing network name....
[15:57:07 INFO]: [Stargate] initial name is 'Pheotis'
[15:57:07 INFO]: [Stargate] Ended up with: PERSONAL, cbd37628-2e35-4356-a2b8-7121895ef5b3
[15:57:07 INFO]: [Stargate] Selected with flags 41
[15:57:07 INFO]: [Stargate] Checking create permissions
[15:57:07 INFO]: [Stargate]  Checking permission 'sg.create.world.world'. returned true
[15:57:07 INFO]: [Stargate]  Checking permission 'sg.create.network.personal'. returned true
[15:57:07 INFO]: [Stargate]  Checking permission 'sg.create.design.nether'. returned true
[15:57:07 INFO]: [Stargate]  Network is not full, maxGates = -1
[15:57:07 INFO]: [Stargate]  player has permission = true

Other Information

No response

Pheotis commented 5 months ago

A higher debug level reveals:

org.sgrewritten.stargate.exception.name.NameConflictException: portal of name 'test' already exist in network '<@default@>'
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.network.StargateNetwork.addPortal(StargateNetwork.java:156)
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.network.StargateNetworkManager.savePortal(StargateNetworkManager.java:249)
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.api.network.PortalBuilder.build(PortalBuilder.java:304)
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.listener.BlockEventListener.onSignChange(BlockEventListener.java:194)
         at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor41.execute(Unknown Source)
         at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77)
         at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81)
         at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
         at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
         at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131)
         at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:627)
         at net.minecraft.world.level.block.entity.SignBlockEntity.setMessages(SignBlockEntity.java:226)
         at net.minecraft.world.level.block.entity.SignBlockEntity.lambda$updateSignText$4(SignBlockEntity.java:187)
         at net.minecraft.world.level.block.entity.SignBlockEntity.updateText(SignBlockEntity.java:201)
         at net.minecraft.world.level.block.entity.SignBlockEntity.updateSignText(SignBlockEntity.java:186)
         at net.minecraft.server.network.ServerGamePacketListenerImpl.updateSignText(ServerGamePacketListenerImpl.java:3457)
         at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleSignUpdate$20(ServerGamePacketListenerImpl.java:3438)
         at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
         at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
         at net.minecraft.server.TickTask.run(TickTask.java:18)
         at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151)
         at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
         at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511)
         at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195)
         at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125)
         at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488)
         at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411)
         at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135)
         at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377)
         at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238)
         at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
         at java.base/java.lang.Thread.run(Thread.java:1583)
Pheotis commented 5 months ago

Overly long signs also fail to print faultLength

org.sgrewritten.stargate.exception.name.NameLengthException: Invalid length of name '123456789012345' , name length must be above 0 and under 13
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.network.portal.StargatePortal.<init>(StargatePortal.java:116)
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.util.portal.PortalCreationHelper.createPortal(PortalCreationHelper.java:67)
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.api.network.PortalBuilder.build(PortalBuilder.java:295)
         at Stargate-1.0.0.16-NIGHTLY-3.jar//org.sgrewritten.stargate.listener.BlockEventListener.onSignChange(BlockEventListener.java:194)
         at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor41.execute(Unknown Source)
         at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77)
         at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81)
         at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
         at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
         at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131)
         at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:627)
         at net.minecraft.world.level.block.entity.SignBlockEntity.setMessages(SignBlockEntity.java:226)
         at net.minecraft.world.level.block.entity.SignBlockEntity.lambda$updateSignText$4(SignBlockEntity.java:187)
         at net.minecraft.world.level.block.entity.SignBlockEntity.updateText(SignBlockEntity.java:201)
         at net.minecraft.world.level.block.entity.SignBlockEntity.updateSignText(SignBlockEntity.java:186)
         at net.minecraft.server.network.ServerGamePacketListenerImpl.updateSignText(ServerGamePacketListenerImpl.java:3457)
         at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleSignUpdate$20(ServerGamePacketListenerImpl.java:3438)
         at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
         at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
         at net.minecraft.server.TickTask.run(TickTask.java:18)
         at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151)
         at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
         at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511)
         at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195)
         at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125)
         at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488)
         at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411)
         at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135)
         at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377)
         at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238)
         at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
         at java.base/java.lang.Thread.run(Thread.java:1583)
Pheotis commented 5 months ago

When caused by CHARGE_FREE_DESTINATION, ecoInsolvent fails to print.

  1. Make a free portal.
  2. Go through it as a bankrupt non-exempt non-owner user.
  3. Return through another, non-free, portal as the same bankrupt non-exempt non-owner user while CHARGE_FREE_DESTINATION is false.

    The user will go through as expected.

  4. Toggle CHARGE_FREE_DESTINATION and repeat.

    The user will be unable to go through (they are bankrupt), but will not be told why (ecoInsolvent fails to print)