Sign in to follow this  
EarthsDefect

glimmersteel and adamantite ore how to remove!

Recommended Posts

The title says it all, I want to remove glimmersteel and adamantite from my map without deleting or remaking the cave.map. I dont want to delete my players mines.. please someone help!

Share this post


Link to post
Share on other sites

theres a force set as rock method somewhere in there, you could make a chat command mod to call that method and scan over the whole map once for ada/glimmer veins, and when found set them to rock

  • Like 1

Share this post


Link to post
Share on other sites

It might be possible to make a simple script-runner mod for servermodlanucher to fix this if their isn't a built-in command.

 

Server.caveMesh.getData() will return an giant array of integers and its public.

For each integer here is how that integer is divided up: TTCCHHHH; where h is the elevation, T is the tile type, and C is the ceiling offset from the floor.

 

This is java form but it wouldn't be too hard to swap it over to javascript and run it in the onServerStarted folder.

int[] tileDatas = Server.caveMesh.getData();
for (int i = 0; i > tileDatas.length; i++){
	// go through the integers in data.

	int height = tileDatas[i] & 0xFFFF;
	int ceiling = (tileDatas[i] >> 16) & 0xFF;
	int type = (tileDatas[i] >> 24) & 0xFF;
	// unpack the values from the integer

	if (type == ??? || type == ???){
		type = 202; // TILE_TYPE_CAVE_WALL = 202;
	}
	// If a tile type is glimmersteel and adamantite change it to cave rock wall.
	// There is code in server that converts cave wall hits to 50 if it's greater then this. 
	// There is no need to mess with the resources mesh.

	tileDatas[i] = ((type & 0xFF) << 24) + ((ceiling & 0xFF) << 16) + (height & 0xFFFF);
	//repackage the values back into the integer and update the data array entry
}

 

  • Like 1

Share this post


Link to post
Share on other sites

I won't make this as a mod. It's not that I don't want to help. It just that messing with mesh files is potentially catastrophic. I can just see myself making some silly bit-wise logic error, and as a result, you ending up having to re-roll your whole server.

 

 

How about you try using the moon metal mod and set the cap for special veins to 1?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this