Jump to content

Recommended Posts

Posted

Hey Modders,

 

I'm working on a mod that allows the user to switch dimensions from a GUI menu. The intention is that I will add multiple dimensions at a later date but for now I am just working with the main three that we have in the game.

 

The issue I am currently running into is when I shift from the End (Dimension 1) to the Overworld (Dimension 0). The problem is that the overworld does not render until the player logs out and logs back in. What I mean by does not render is that the screen becomes grey and stays grey until the person relogs.

 

Here's the current code:

public double[] shift(EntityPlayer entity, double[] position){
		if (entity.ridingEntity == null && entity.riddenByEntity == null && entity instanceof EntityPlayerMP)
		{
			if (entity instanceof EntityPlayerMP)
			{
				EntityPlayerMP thePlayer = (EntityPlayerMP) entity;
				if (entity.dimension == 1){
					entity.setPosition(position[0], position[1]+1, position[2]);
					thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new Teleporter(thePlayer.mcServer.worldServerForDimension(0)));

				} else if (entity.dimension == 0){
					position[0] = entity.posX;
					position[1] = entity.posY;
					position[2] = entity.posZ;
					thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 1, new Teleporter(thePlayer.mcServer.worldServerForDimension(1)));
				}
			}
		}
		return position;
}

 

Can anyone point me in the right direction as to a tutorial, or a package that I can look investigate to solve my issue?

Posted

One thing I've tried after playing around with a "Emergency Teleport" is the function "setPositionAndUpdate" in the EntityPlayer class.

 

Unfortunately this does not seem to solve the problem when coming back from the end to the OverWorld.

 

I'm going to look into the End Portal Code and hopefully find where they send back to the overworld (skipping the message code).

 

However, if anyone has any ideas I'd greatly appreciate it.

Posted

This is what I found in ServerConfigurationManager in 1.5, never coded dimensions afterwards.

 

  public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
    {
        transferPlayerToDimension(par1EntityPlayerMP, par2, mcServer.worldServerForDimension(par2).getDefaultTeleporter());
    }

    public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
    {
        int j = par1EntityPlayerMP.dimension;
        WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
        par1EntityPlayerMP.dimension = par2;
        WorldServer worldserver1 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
        worldserver.removePlayerEntityDangerously(par1EntityPlayerMP);
        par1EntityPlayerMP.isDead = false;
        this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter);
        this.func_72375_a(par1EntityPlayerMP, worldserver);
        par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
        par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
        this.updateTimeAndWeatherForPlayer(par1EntityPlayerMP, worldserver1);
        this.syncPlayerInventory(par1EntityPlayerMP);
        Iterator iterator = par1EntityPlayerMP.getActivePotionEffects().iterator();

        while (iterator.hasNext())
        {
            PotionEffect potioneffect = (PotionEffect)iterator.next();
            par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(par1EntityPlayerMP.entityId, potioneffect));
        }

        GameRegistry.onPlayerChangedDimension(par1EntityPlayerMP);
    }

Posted
  On 1/29/2014 at 4:17 PM, Roymond said:

I'm working on a mod that allows the user to switch dimensions from a GUI menu.

I hope your teleportation code isn't in a client side only class.

 

You should look into the ender pearl code, it is pretty straight forward.

Posted
  On 1/29/2014 at 11:24 PM, GotoLink said:

  Quote

I'm working on a mod that allows the user to switch dimensions from a GUI menu.

I hope your teleportation code isn't in a client side only class.

 

You should look into the ender pearl code, it is pretty straight forward.

 

I'm pretty sure that the class is not Client Side Only. The current code executes switching dimensions when you right click on the item. It's weird because transporting to the end works perfectly. Every time it renders. It's coming back to the Over World that is the problem.

 

Is the code for the End Game Script (after you defeat the dragon and get the player message) worth taking a look at? Or maybe even initial spawn?

Posted
  On 1/31/2014 at 6:14 PM, darty11 said:

Question: Do you use a teleporter class to return to the overworld?

 

Right now I am using the "transferPlayerToDimension" function to return to the over world. It requires an EntityPlayerMP, the dimension ID and a teleporter.

Posted

Right now, I am using the base Teleporter class from the package "net.minecraft.world"

 

The reason I've been questioning whether I need a custom teleport class is because I'm not building a portal. I am just switching dimensions when the user right clicks on the item.

Posted

You need a custom teleporter if you are not using the nether portal.

 

Though you might want to try using this:

par3EntityPlayer.travelToDimension(1);

Due to the way travelToDimension works, it will transfer any players in the end to the over world, and any players not in the end to the end.

Posted
  On 1/31/2014 at 8:10 PM, darty11 said:

You need a custom teleporter if you are not using the nether portal.

 

Though you might want to try using this:

par3EntityPlayer.travelToDimension(1);

Due to the way travelToDimension works, it will transfer any players in the end to the over world, and any players not in the end to the end.

 

I've given this a go and unfortunately it doesn't solve the problem. I'm still experiencing the same issue. When I return to the overworld, I am greeted with a grey screen. The coordinates are the same, and the player does not fall, but the graphics do not render until I reload the world.

Posted

Unfortunately that doesn't seem to work either... At this point, here is the entire class file for the Dimension Watch (I'm calling it the Dimension Watch)

 

package roymond.teleports;

import net.minecraft.world.Teleporter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;


public class dimensionwatch extends Item {

double[] position = {0,0,0};

public EntityPlayer player;

public dimensionwatch(int par1) {
	super(par1);
	// TODO Auto-generated constructor stub
}

@Override
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer entity)
    {
	shift(entity,position);
	System.out.println(position[0] + " " + position[1] + " " + position[2]);
	return par1ItemStack;
	}

public double[] shift(EntityPlayer entity, double[] position){
		if (entity.ridingEntity == null && entity.riddenByEntity == null && entity instanceof EntityPlayerMP)
		{
				EntityPlayerMP thePlayer = (EntityPlayerMP) entity;
				if (thePlayer.dimension == 1 && !thePlayer.worldObj.isRemote){

					thePlayer.travelToDimension(0);
					thePlayer.setPositionAndUpdate(position[0], position[1]+1, position[2]);

					//thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new Teleporter(thePlayer.mcServer.worldServerForDimension(0)));
				} else if (thePlayer.dimension == 0 && !thePlayer.worldObj.isRemote){
					position[0] = entity.posX;
					position[1] = entity.posY;
					position[2] = entity.posZ;
					thePlayer.travelToDimension(1);
					//thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 1, new Teleporter(thePlayer.mcServer.worldServerForDimension(1)));
				}
		}
		return position;
}

}

 

And here is the Item's declaration in the base mod:

		
public Item dimensionSwitcher = new dimensionwatch(500).setUnlocalizedName("dimensionSwitcher").setCreativeTab(CreativeTabs.tabCombat);

 

 

Posted

Ok, it looks like you are going to need a custom teleporter. That appears to be the only way around it as vanilla seams to assume that you are coming from the nether when you use thePlayer.travelToDimension(0);, so you are going to need to bypass travelTo dimension and use your own teleporter. I would help but I have to go for awhile.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Temu  bunch of Coupon Codes for Temu  to get FTemuREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!   Temu  coupon codes for New users 100€ Off - acy240173 Temu  discount code for New customers- acy240173 Temu  100€ coupon code- acy240173 what are Temu  codes - acy240173  does Temu  give you €300- acy240173 Yes Verified Temu  coupon code October2025- acy240173 Temu  New customer offer acy240173 Temu  discount code2025 acy240173 100 off coupon code Temu  acy240173 Temu  100 off any order acy240173 100 dollar off Temu  code acy240173 Temu  Coupon Code ( acy240173 ) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173 ) or ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173 ) at checkout!! Temu  coupon code for First Order - {acy240173} Temu  coupon code for New Users- {acy240173} Temu  coupon code for Existing Users- {acy240173} Temu  coupon code 100€ Off- {acy240173} Temu  coupon 30% Off code - {acy240173} - Temu  new user coupon code: acy240173 - Free gift on Temu : acy240173 - Temu  90% discount coupon code: acy240173 - Temu  100€ coupon code for first order: acy240173   Is the Temu  100€ Coupon Legit?  Yes, there are several legit Temu  coupon codes [ acy240173] available for 100€ off. Here are the options you can use: Code [acy240173]: This code provides a 100€ discount legit on your first order when you register and is reported to work effectively during checkout. Code [acy240173]: New users can also use this code to receive a 100€ discount on purchases over €249. Code [acy240173]: This code is available for both new and existing users, offering a 100€ discount on your order. Code [acy240173]: Another option for both new and existing users, this code allows you to save 100€ on your purchase.   Temu  Coupon code 100€ off for this month For October2025, several active Temu  coupon codes can help you save on your purchases: 40% Off Site-Wide: Use code "acy240173" to get 40% off everything. This code is widely used and verified for site-wide discounts on orders over €20. 40€ Off for New Customers: New customers can receive a €20 voucher by downloading the Temu  app and participating in an H5 page game. This voucher can be redeemed using a specific coupon “acy240173”. 40% Off Selected Items: There is also a 40% off coupon “acy240173” available for select items on the Temu  website. Remember to check the specific terms and conditions for each coupon, such as minimum purchase requirements and applicable product categories.   Temu  coupon code 100€ off for new and existing customer Temu  90% OFF promo code "acy240173 " will save you 100€ on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu  offers 100€ off coupon code [acy240173] Temu  Coupon code [acy240173 ] for existing users can get up to 50% discount on product during checkout. Temu  Coupon Codes for Existing Customers-[acy240173 ] Temu  values its loyal customers and offers various promo codes, including the Legit Temu  Coupon Code [acy240173 ] or [acy240173 ], which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.   Temu  Coupon Code 100€ Off for all users  There are specific Temu  coupon codes [acy240173] mentioned for South Africa in the provided search results. The results focus on general Temu  coupon codes [acy240173] and discounts, as well as codes for other countries like the Germany, UK, Canada, Mexico, Kuwait, Austria, Italy, Australia, France , Switzerland, Poland, Saudi Arabia, Germany, Sweden, Portugal, New Zealand, UAE, Belgium, Germany, and France.   Temu  Coupon Code 30% Off: acy240173 Temu  Coupon Code 100€ Off: acy240173 Temu  Coupon Code 100€ Off United States : acy240173 Temu  Coupon Code 100€ Off Germany: acy240173 Temu  Coupon Code 100€ Off Sweden : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 50% : acy240173 Temu  Coupon Code 100€ Off United Kingdom : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Italy : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Belgium : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Canada : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Estonia : acy240173 Temu  Coupon Code 100€ Off Switzerland : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon 30% Off + Free Shipping & More There are a bunch of Coupon Codes for Temu  to get FREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173) \ Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!Temu  Coupon Code Mexico : acy240173 Temu  Coupon Code 100€ Off Ireland : acy240173 Temu  Coupon Code 100€ Off Norway: acy240173 Temu  Coupon Code 100€ Off New Zealand : acy240173 Temu  Coupon Code 100€ Off Poland : acy240173 Temu  Coupon Code 100€ Off Serbia : acy240173 Temu  Coupon Code 100€ Off Armenia : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Greece : acy240173 Temu  Coupon Code 100€ Off Japan : acy240173 Temu  Coupon Code 100€ Off Iceland : acy240173 Temu  Coupon Code 100€ Off Bahrain : acy240173 Temu  Coupon Code 100€ Off Philippines : acy240173 Temu  Coupon Code 100€ Off Portugal : acy240173 Temu  Coupon Code 100€ Off Romania: acy240173 Temu  Coupon Code 100€ Off Slovakia : acy240173 Temu  Coupon Code 100€ Off Malta: acy240173 Temu  Coupon Code 100€ Off France  : acy240173 Temu  Coupon Code 100€ Off South Africa : acy240173 Temu  Coupon Code 100€ Off Hungary : acy240173 Temu  Coupon Code 100€ Off Brazil : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 100€ Off Morocco : acy240173 Temu  Coupon Code 100€ Off Kazakhstan : acy240173 Temu  Coupon Code 100€ Off Colombia : acy240173 Temu  Coupon Code 100€ Off Chile : acy240173 Temu  Coupon Code 100€ Off Israel : acy240173 Temu  Coupon Code 100€ Off Qatar: acy240173 Temu  Coupon Code 100€ Off Slovenia : acy240173 Temu  Coupon Code 100€ Off Uruguay : acy240173 Temu  Coupon Code 100€ Off Latvia: acy240173 Temu  Coupon Code 100€ Off Jordan : acy240173 Temu  Coupon Code 100€ Off Ukraine : acy240173 Temu  Coupon Code 100€ Off Moldova : acy240173 Temu  Coupon Code 100€ Off Oman: acy240173 Temu  Coupon Code 100€ Off Mauritius : acy240173 Temu  Coupon Code 100€ Off Republic of Korea : acy240173 Temu  Coupon Code 100€ Off Dominican Republic: acy240173 Temu  Coupon Code 100€ Off Czech Republic : acy240173 Temu  Coupon Code 100€ Off United Arab Emirates : acy240173 Temu  Coupon Code 100€ Off Peru : acy240173 Temu  Coupon Code 100€ Off Azerbaijan : acy240173 Temu  Coupon Code 100€ Off Saudi Arabia : acy240173 Temu  Coupon Code 100€ Off Croatia : acy240173   Conclusion The Temu  Coupon Code 100€ Off "acy240173" provides a significant discount of 100€ for users in Bahrain. This offer is available for both new and existing customers, allowing them to save substantially on their purchases.In addition to the 100€ discount, customers can also enjoy a 50% off on their orders. To redeem this coupon, simply sign up for a Temu  account, add items worth 100€ or more to your cart, and enter the code during checkout to apply the discounts automatically.   FAQs about the 100€ Off Coupon Code Q1: Who can use the 100€ off coupon? A: The coupon is available for both new and existing users, although different codes may apply to each group. Q2: Can multiple coupon codes be used at once? A: Generally, only one coupon code can be applied per transaction. However, some codes may offer bundled benefits. Q3: Do these coupons expire? A: Many Temu  coupons do not have an expiration date, making them convenient for users to redeem at their leisure. Q4: Are there specific conditions for using these coupons? A: Yes, some coupons may require a minimum purchase amount or specific item categories to be eligible for the discount. Q5: How can I find the latest Temu  Coupon Code 100€ Off 100€ Offs? A: Users can check within their account under "Coupons & offers" or look for updates on promotional websites and forums.
    • You could try this script: https://inconnu-plugins.de/tutorial/server-auto-restart
    • I have already tried other versions of MCP, from 2841 to 2860.
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • The official documentation says next to nothing and I have had no success finding reference snippets (e.g. minimap mods and other stuff that involves directly drawing to the screen). Google searches and GPT outputs reference deprecated and/or removed content from older versions. Legends speak of a layered rendering system that also has next to no documentation. Any help is appreciated. Even drawing just a single pixel is enough.
  • Topics

×
×
  • Create New...

Important Information

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