Posted April 12, 20169 yr Hi, Currently, while looking through the code, neither vanilla or anything Forge adds takes into account custom dimension teleporters. See net.minecraft.world.WorldServer line 119: this.worldTeleporter = new Teleporter(this); Whenever I want to teleport an entity, I have to create a new instance of my custom teleporter class. While this works fine, it's not really ideal, because the teleporter instances do not share a cached portal position list. (Thus, everytime something teleports, the teleporter has to search within a wide range of blocks for a matching portal). If Forge added the ability to register Teleporters (in DimensionManager?), then a system could be made in which only 1 teleporter instance is made for a WorldServer of a certain dimension (therefore the teleporter instance would not have to search for a portal everytime, reducing teleport time, which I'm sure everyone can agree is a good thing). At the moment, you can make the cache variable static and do manual removal checks, but I feel an actual alternative is better. Just a thought - SH
April 12, 20169 yr OR, get this, You could NOT create a NEW instance of your Teleporter every time, and instead use a single instance that you manage for the world. Maybe... Naw that would make to much sense... I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
April 12, 20169 yr Author Yes, you could do that. However, because vanilla teleporter class requires a WorldServer instance in the constructor, it would have to be made either in a method that subscribes to the World.Load event or making a variable in the portal block that gets instated if (teleporter == null). Either way is fine, but I just figured that if Forge spent the time to write all the other dimension stuff, they might as well go the whole way and make things neat.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.