Jump to content

[1.9] [UNSOLVED] Entity Portal Travel


Bektor

Recommended Posts

Did you try looking at the vanilla code for the Nether or End portal and associated Teleporter? I bet those would have what you need.

Already tested it back in 1.8.9, does not work.

They do it with entity.setInPortal or so, but that's teleports you in the vanilla dimension. And this method just sets a boolean

to true and the rest is done in the Entity itself.

Developer of Primeval Forest.

Link to comment
Share on other sites

You didn't follow the rabbit-hole far enough - eventually it should lead you to the ConfigurationManager or whatever the class is that you get from playerMp.mcServer.getConfigurationManager(), which has some nifty methods for interdimensional travel. I use it in 1.8.0, but it may well be named something different now.

Link to comment
Share on other sites

Hm, I still can't figure out how I have to do it now in Minecraft 1.9.

 

But after looking deeper into the code I know that the class which will be returned from getConfigurationManager seems to be gone in 1.9, atleast it does no longer exists in the package and in the MinecraftServer class.

 

So any idea?

Developer of Primeval Forest.

Link to comment
Share on other sites

So the method #getConfigurationManager still exists, but its return type (class) doesn't? O.o

 

I have neither Eclipse nor a 1.9 workspace on this computer, but if the method exists, its return type must exist. You can use your IDE to search, open call and type hierarchies, or just ctrl-click your way through classes and methods until you get there, but you should be able to find it.

 

The method in particular that I have used was called #transferPlayerToDimension

Link to comment
Share on other sites

ServerConfigurationManager

was renamed to

PlayerList

.

 

You can see other name changes in 1.9 by searching here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

If you are still wondering here's an example I made.

if(!event.getEntityLiving().worldObj.isRemote){
				EntityPlayerMP player = (EntityPlayerMP) event.getEntityLiving();
                if (player.timeUntilPortal > 0) {
                    player.timeUntilPortal = 10;
                } else if (player.dimension != ModConfig.DIMENSION_ID) {
                    player.timeUntilPortal = 10;
                    player.mcServer.getPlayerList().transferPlayerToDimension(player, ModConfig.DIMENSION_ID, new TeleporterCustom(player.mcServer.worldServerForDimension(ModConfig.DIMENSION_ID)));
                } else if (player.dimension == ModConfig.DIMENSION_ID) {
                    player.timeUntilPortal = 10;
                    player.mcServer.getPlayerList().transferPlayerToDimension(player, 0, new TeleporterCustom(player.mcServer.worldServerForDimension(0)));
                }
}

Link to comment
Share on other sites

  • 5 months later...

I have a code to transfere entities. I did not tested .

entityIn.getServer().getPlayerList().tranferEntityToDimension(entityIn, worldIn.provider.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(worldIn.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(The dimension Id), new The teleporter(entityIn.getServer().worldServerForDimension(The dimension Id))))

Link to comment
Share on other sites

I have a code to transfere entities. I did not tested .

entityIn.getServer().getPlayerList().tranferEntityToDimension(entityIn, worldIn.provider.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(worldIn.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(The dimension Id), new The teleporter(entityIn.getServer().worldServerForDimension(The dimension Id))))

Good for you, it's just that this thread is over 6 months old, and there's no need to reply to that.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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