Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm trying to make it so that the world both rains and snows in certain biomes. The only problem with this is that the snow doesn't disappear after the snow storms, making everything look like a taiga after it snows once. How do I make the snow block check conditions other than nearby light sources to see if it can decay? I'm looking through vanilla to see where the decay class is, but I can't find it for the life of me.

 

EDIT1:

 

Okay, I have this code going on:

package com.REMINISC3.chronocube;

import net.minecraft.block.Block;
import net.minecraft.block.BlockSnow;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;

public class SnowMan extends BlockSnow {
    private boolean func_150155_m(World test, int i, int j, int k)
    {	if (test.canLightningStrikeAt(i, j, k))
    {
	test.setBlockToAir(i, j, k);
	return false;
    }
    else return true;
    }
}

 

The goal is that when it rains, snow slabs disappear. Unfortunately, it's being ignored. How do I tell the game to apply this to snow slabs? I am apparently unable to override anything in the base class.

Hi

 

I think you have four choices

1) use ASM + Reflection to modify the BlockSnow base class (tricky)

2) add your own snow generation to the world tick, placing your own BlockSnow instead of vanilla.  see WorldServer.func_147456_g()            this.theProfiler.endStartSection("iceandsnow");

3) add your own snow destruction code to the world tick (each tick, check a few blocks at the 'precipitation height' to see if they are snow), and melt them if they are.

4) use your own WorldProvider and override eg canSnowAt() with something that changes depending on whether you want snow to form or to melt.

 

I would personally try (4) first.  It looks like the most straightforward to me.

 

-TGG

  • Author

Thanks much for responding!

 

I think the most straightforward/convenient would actually be #3. However, I have a somewhat noobish question. Where would I call for the snow destruction code? Just from the main modclass, or...?

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.