Jump to content

Recommended Posts

Posted

I seem to not be able to set my dimensions spawn, Im adding an End like dimension (one floating island) and i spawn way out of where i should be. I've added these into my world provider but i still seem to spawn in at the same position that i would be in the overworld (coords carrying over from the overworld dimension)

@Override
    public boolean canCoordinateBeSpawn(int x, int z) {
        return this.worldObj.getGroundAboveSeaLevel(new BlockPos(x, 0, z)) == EssenceBlocks.corbaStone;
    }

@Override
public BlockPos getRandomizedSpawnPoint() {
	return new BlockPos(0, 63, 0);
}

@Override
public BlockPos getSpawnPoint() {
	return new BlockPos(0, 63, 0);
}

@Override
public void setSpawnPoint(BlockPos pos) {
	super.setSpawnPoint(new BlockPos(0, 63, 0));
}

@Override
    public BlockPos getSpawnCoordinate() {
        return new BlockPos(0, 63, 0);
    }

@Override
    public int getAverageGroundLevel() {
        return 63;
    }

 

I even got so desperate that i called an event:

@SubscribeEvent
public void transferDims(PlayerChangedDimensionEvent e) {
	if(e.toDim == Config.corba) {
		SlayerAPI.addChatMessage(e.player, "In corba");
		e.player.setLocationAndAngles(0, 63, 0, 0.0F, 0.0F);
	}
}

And it prints the message in chat, so why doesnt it set my location..?

 

As always, any help would be muchly appreciated :D

 

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

  • 2 months later...
Posted

I have a similar problem right now.

 

I am unable to set the bed spawn point except in 2 special circumstances.

 

I have tried using

player.setSpawnChunk(bedPos, true, playerDimension);

and

player.setSpawnPoint(bedPos, true);

 

The only times I can sucessfully set a bed spawn point is when

1. A new map where no bed point has been set.

or

2. A player death where an actual bed was slept in then destroyed or removed before the death.

This resets its ability to set a bed location with either function above.

 

Both functions seem to set a set of variables or a set of HashMap in EntityPlayer.  But these do not seem to be updating what Minecraft seems to be actually using to determine where to spawn players. 

 

This looks like a BUG either in Forge or Minecraft 1.8.

(ATTENTION FORGE DEV TEAM?)

 

I also tested for this problem in Minecraft 1.7.10 and that version works well.

 

I need this fixed now as well for one of my mods I am trying to sucessfully code for Minecraft 1.8.

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2131444

 

Posted

Umm... Looks like you should notify the coding team. Is there a bug report thingy somewhere?

Posted

I would love to report it properly in the right place.  Im new to this forum and am trying.  I will look around more.  If anyone knows where to report this properly I would appreciate knowing.  Please tell me.

 

Thanks.

Posted

I went there and read the rules

 

3 points down in first sections it says:

"This is a support forum for players, not for modders needing help with code. Modders go to the Modder Support forum."

 

This here seems to be the modder's support forum unless im confused.

 

Maybe there is a bug reporting thing somewhere.

 

Posted

I have been studying the source code such as EntityPlayer.

 

Its seems right.  I did find a spot the needed a "return;" but doesnt hurt anything if its not there.  If you use setSpawnChunk(...) with a good playerPos in dimension 0 it should do a "return;" right after setting the spawnChunk and spawnForced variables.  BUT it drops past that and adds an entry in the hash map for other dimension bed spawns for dimension 0 but that shouldnt really bother anything.

 

When the player wakes it can call the setSpawnPoint(..) function.  This seems normal.

 

So my next thought is that when I respawn from death why does it send me to the bed location that is wrong? 

 

So where is the code for when "You died" screen shows up and you then hit the button "respawn" ?  Its not picking the right respawn location in every circumstance.

 

So I can set the bed spawn with setSpawnPoint or setSpawnChunk but that is NOT where the "respawn" button sends me.  Where is that code?  I need help. 

 

Posted

On the Gui 'GuiGameOver', when you clickes Respawn button, It calls EntityPlayerSP#respawnPlayer().

It sends the packet 'C16PacketClientStatus' with the flag 'PERFORM_RESPAWN'.

When the Server gets the packet, it ensures that the player really died,

and call ServerConfigurationManager#recreatePlayerEntity(EntityPlayerMP playerIn, int dimension, boolean conqueredEnd)

There it removes the died player and create a 'clone' player.

 

At there, it gets the spawn position by EntityPlayer#getBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn). (the bedLocation parameter is set to the EntityPlayer#getBedLocation(dimension) )

I inspected the code, and I cannot find any clue for the problem.

 

..Wait, where did you put EntityPlayer#setSpawnPoint(bedPos, true);

Since it seems that WorldProvider methods related with spawning is not automatically called when the spawn point is not set.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

my guess would be that the world's spawnpoint is only used for spawning in new players, and the player's bed location is used otherwise, and that may default to the world's spawnpoint. Just a guess from reading the thread, I don't have time to dig into code right now.

Posted

 

SOLUTION FOUND!

 

Ok, so, lol.  I found the problem.  It was so small and so simple that I feel stupid.

 

In my defence: I did multiple checks of my code and studied Minecraft and Forge code for hours.  I learned a bit.  :)

 

The problem with the bug was totally mine and was NOT a bug in forge or minecraft at all.  When I upgraded my code to mc1.8 I changed 1 tiny little thing from a set of coordinates to a BlockPosition and it was wrong. LOL.  oops!  This will be released in a new version of SpawnCommands Teleport mod soon.

 

I actually learned a bit from studying the Minecraft and Forge source code.  It was long and fun.

 

Im adjusting to other minor things as well.  This may take a few days to get the update out for my mod as life does interfere with the coding fun.

 

My apologies and appreciation to those that make Mineraft and MinecraftForge!  :)

 

 

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

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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