Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Solved]Design Approach for adding snow for seasonal change


aw_wolfe
 Share

Recommended Posts

I would like to add snow for seasonal changes and am not sure which approach makes the most sense...better design... Add the ability to snow in areas that are not normally set to snow.

 

The biomes have a boolean snow enabled, but it is read only, so can't change it. Also, the EntityRenderer.renderRainSnow also uses a float temperature value, which is biome specific (height modified), but is also read-only.

My options, as far as I can tell:

1) create a new biome for each one I want to replace an expose the temperature and snow enabled, which I can then set manually as the seasons progress. I've experimented with this, by using the BiomeManager and removing all forests, adding my own class derived form BiomeForest (but not working, something I'm doing isn't working)

2) create a new rain/snow manager that mimics MC behavior from EntityRenderer.renderRainSnow but with my modifications...seems easier to me to implement (mainly copy paste), but less flexible later.

 

I've been struggling to get option 1 working

ImmutableList <BiomeEntry> blist=BiomeManager.getBiomes(BiomeType.WARM);
	Iterator bit=blist.iterator();
	while(bit.hasNext()){
		BiomeEntry en=(BiomeEntry)bit.next();
		if(en.biome.getBiomeName().toLowerCase().contains("forest")){
			
			BiomeManager.removeBiome(BiomeType.WARM, en);
		}
	}
	blist=BiomeManager.getBiomes(BiomeType.COOL);
	bit=blist.iterator();
	while(bit.hasNext()){
		BiomeEntry en=(BiomeEntry)bit.next();
		if(en.biome.getBiomeName().toLowerCase().contains("forest")){
			
			BiomeManager.removeBiome(BiomeType.COOL, en);
		}
	}
//after removing all forest biomes with BiomeManager

BiomeProperties seasons_forest=new Biome.BiomeProperties("SForest").setTemperature(0.1F).setRainfall(0.8F).setSnowEnabled();
	
	BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(new BiomeForestR(BiomeForest.Type.NORMAL, seasons_forest), 10));
	BiomeManager.addBiome(BiomeType.COOL, new BiomeEntry(new BiomeForestR(BiomeForest.Type.NORMAL, seasons_forest), 10));
  
  //this generates a list with "Extreme Hills,Plains,Swampland,SForest
  ImmutableList<BiomeEntry> list=BiomeManager.getBiomes(BiomeType.WARM);
	Iterator it=list.iterator();
	System.out.println("Dump Biomes");
	while(it.hasNext()){
		
		BiomeEntry en=(BiomeEntry)it.next();
		System.out.println(en.biome.getBiomeName());
		
	}

But when I check by playing game the normal forest is created with temp 0.7 and snow enabled=false instead of my 0.1 and snow enable=true.

I am probably doing something wrong with replacing the forests, but I don't want to spend more time pursuing option 1, if it is not the best approach.

 

Thanks,

Tony

Edited by aw_wolfe
Link to comment
Share on other sites

Ok, this is like 4000 times more complicated than you think.Trust me, I did it.

 

The "can snow" boolean is basically garbage and controls nothing AFAICT. Snow is entirely governed by whether or not precipitation (rain) is allowed, the biome's temperature, and the Y level of the block (mountains are colder at the top).

 

You want seasons? You need to create a way to determine the date from the totalWorldTime, adjust the biome temperature and rainfall values as necessary (AND ON THE CLIENT), deal with chunk-border update problems (if no blocks change the grass color doesn't update), and let vanilla rain/snow stuff take over from there.

 

It's a bitch. It doesn't work very well, I had to do some really hackish things (in 1.7) that I'm not proud of, and getting ice to melt and prevent permanently freezing the ocean is basically impossible. 

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Thanks.

I already have a calendar, daytime/night cycle manager (longer days in summer, longer nights in winter). A weather controller (rain more in spring), etc....  The snow was an issue. I also still can't get my forest biome to replace the standard forest.  Is there a good biome tutorial for 1.11.2 ? All biomes tuts I've seen so far are for older version where most of the functions approaches are deprepricated.

 

I'll see if I can manually create own renderRainSnow  () and install on client players. Once I have the effect, then really just need to find where MC adds snow to blocks during snow to complete the effect.

 

I'll post code back here if I can get it working.

Link to comment
Share on other sites

OreCruncher: thanks.....

Tough as Nails looks great. I figured I was re-inventing the wheel a bit on some of what I was doing, but was a good way for me to learn a new environment by starting from scratch on something. Though at some point, tearing your hair out stops being fun :).

 

Will go through it tomorrow, test it, and pull out what I need.

 

Tony

 

 

Link to comment
Share on other sites

9 hours ago, aw_wolfe said:

I also still can't get my forest biome to replace the standard forest.  Is there a good biome tutorial for 1.11.2 ? All biomes tuts I've seen so far are for older version where most of the functions approaches are deprepricated.

Because biomes use forge registries now (just like item and blocks), you can replace them using substitution aliases.

First, read up on forge registries here - http://mcforge.readthedocs.io/en/latest/concepts/registries/.

Now, to replace forest biome, register your own forest biome just like you would a new biome, then retrieve biome registry (either trough Biome or GameRegistry) and call #addSubstitutionAlias(String modid, ResourceLocation nameToReplace, Biome replacement).

Link to comment
Share on other sites

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
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • show the code your use for this is the Event called?, use debugger to check the values in the condition
    • if you add your Biome to the Overworld via BiomeManager#addAdditionalOverworldBiomes, you need to register your Biome via DeferredRegister or RegistryEvent unfortunately a json only Biome does not work in this case
    • use debugger to check the conditions you are using before you render your Entity
    • yes, and then post the correct logs
    • Good Morning, I tried overriding one of the vanilla rock blocks according to instructions in this old thread, but failed for the same reason the org TM did, even though I got a tiny bit farther than he did. I can remove the original block entirely from world spawn, and replace it with custom version, which I want to prevent due to following up workload(adapting recipes etc. to custom block). What I tried solving the issue/actually making replacing(partially) work: 1. I had to use the original Forge variant of registering the block in main class, like that: which actually did use the custom granite block as replacer(not exactly illustrated in the old thread), but didn't consider it on world feature generation... 2. I then believed it was due to not using correct path variables for assets texture/models/blockstates etc., so I created missing asset packets for both, vanilla asset path, and my mod path. This also did not fix the issue with creating holes filled up with Items.AIR on world feature generation. 3. I then tried to remove the vanilla granite block during feature generation, and reimported it after with my replacement set up, during feature generation as well(according to @Luis_ST advice). But the holes were still there, only this time I got my replaced granite block spawned as well. What do I want to achieve(asking myself and you in hope maybe there's a better solution)? Mojang found it a good idea, to give one of the hardest rock materials on this planet, the .harvestLevel(soft as a pillow), so I can harvest it with a wooden pickaxes(which technically is even worth, but doesn't matter since wooden "pickaxe" tools do not exist in my mod). I really just want to compare harvestLevel of any of my tools, against the harvestLevel of the targetBlock, so I can automatically disallow harvesting it, if the tool doesn't match the harvestLevel(which for whatever reason does not work as intended in 1.16.5 Minecraft). Edit: and before you shout "doPlayerHarvestCheck". Yes, I do that! Edit2: Also, why are there Manga Comic Girls, on the right upper corner of my Monitor, stating how can it be that big?(whatever "it" is?)
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.