PSA - Latest Teleportation API Changes

So, some people may have noticed that there was a hefty change with the API in 4.1-SNAPSHOT where our Teleportation API had some minor changes. The biggest issue was that a few method signature changes were made, which resulted in a backwards incompatible change. Any plugins that were previously compiled would crash as the following log can display:

[21:47:32 ERROR] [Sponge]: Error occurred while executing command 'tp 0 100 0' for source EntityPlayerMP['Polyzium'/321, l='world', x=-102,44, y=69,00, z=4,30]: org.spongepowered.api.entity.living.player.Player.setLocation(Lorg/spongepowered/api/world/Location;)V
java.lang.NoSuchMethodError: org.spongepowered.api.entity.living.player.Player.setLocation(Lorg/spongepowered/api/world/Location;)V
        at io.github.hsyyid.essentialcmds.cmdexecutors.TeleportExecutor.execute(TeleportExecutor.java:118) ~[TeleportExecutor.class:8.1.6]
        at org.spongepowered.api.command.spec.CommandSpec.process(CommandSpec.java:331) ~[CommandSpec.class:1.8.9-4.1.0-BETA-328]
        at org.spongepowered.api.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:331) ~[SimpleDispatcher.class:1.8.9-4.1.0-BETA-328]
        at org.spongepowered.common.command.SpongeCommandManager.process(SpongeCommandManager.java:269) [SpongeCommandManager.class:1.8.9-4.1.0-BETA-328]
        at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:80) [bd.class:?]
        at net.minecraft.network.NetHandlerPlayServer.func_147361_d(SourceFile:690) [lm.class:?]
        at net.minecraft.network.NetHandlerPlayServer.func_147354_a(SourceFile:677) [lm.class:?]
        at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:37) [ie.class:?]
        at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9) [ie.class:?]
        at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:115) [PacketUtil.class:1.8.9-4.1.0-BETA-328]
        at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$0(SourceFile:39) [fh$1.class:?]
        at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [fh$1.class:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
        at net.minecraft.util.Util.func_181617_a(SourceFile:44) [g.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(SourceFile:143) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(SourceFile:299) [ko.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(SourceFile:535) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:451) [MinecraftServer.class:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]

Now, under normal circumstances, we would never have backwards incompatible changes without a new major API release, but, the circumstances were that if the changes were not made, we would not be able to have the additions of the Teleportation API implementation in Minecraft 1.8.9 support.

Fortunately, with the tools that we have readily available (and some of our implementations already require on a normal basis for different reasons), we have added backwards compatible implementations of the old methods that previously existed, and will allow any plugins using such methods to continue to function.

The latest build of SpongeForge (build 1385) has these backwards compatible changes such that both the old and new methods will work.

We, as the Sponge Team, are sorry for any confusion this may have caused and are thankful for your understanding while we are continuing development.

14 Likes