Jump to content

[1.17.x] Replacing/extending functions from vanilla class


spiritfilled

Recommended Posts

Is there a way of tweaking some vanilla class:
I want to, change this code from Level.class (World.class on 1.16.x i think)

public abstract class Level extends net.minecraftforge.common.capabilities.CapabilityProvider<Level> implements LevelAccessor, AutoCloseable, net.minecraftforge.common.extensions.IForgeLevel {
...
public boolean isRainingAt(BlockPos p_46759_) {
      if (!this.isRaining()) {
         return false;
      } else if (!this.canSeeSky(p_46759_)) {
         return false;
      } else if (this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, p_46759_).getY() > p_46759_.getY()) {
         return false;
      } else {
         Biome biome = this.getBiome(p_46759_);
         return biome.getPrecipitation() == Biome.Precipitation.RAIN && biome.getTemperature(p_46759_) >= 0.15F;
      }
}
  ... }

what i want to do is, make the rain stop or start on specific area (or better change climate).
Biome's climate settings(temperature, humidity) can be changed, but i think only once, on world generation, I think

source: [1.17.1]
net.minecraft.world.level;
net.minecraft.world.level.biome;
net.minecraftforge.event.world.BiomeLoadingEvent;

im nowhere near what im trying to do... but if anyone has an idea how to achieve it, or anything similar, any help is appreciated :3

can the class be replaced with extention???

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



×
×
  • Create New...

Important Information

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