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

Retrieve chunk coord info? (UPDATE#1; STILL UNSOLVED :( )


sarydactl
 Share

Recommended Posts

Yep, it's me again v vv . I finally figured out what the TickHandler/EventHandler could be used for, so I've opted to use it as a last resort for this snow-melting business. However, I have no idea how to pull up world chunk information.

 

package com.REMINISC3.chronocube;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.WorldServer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.gameevent.TickEvent;
import net.minecraft.entity.player.*;
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
import cpw.mods.fml.relauncher.SideOnly;

public class Teferi {
@SubscribeEvent
public void onServerTick(ServerTickEvent event){
	if (!(TimeKeeper.seasonreal()==4)){
            int k = THISISCHUNKX * 16;
            int l = THISISCHUNKZ * 16;
            int i1;
            int j1;
            int updateLCG = (new Random()).nextInt();
            int k1;
            int l1;
            updateLCG = updateLCG * 3 + 1013904223;
            i1 = updateLCG >> 2;
            j1 = i1 & 15;
            k1 = i1 >> 8 & 15;
            l1 = WorldServer.getPrecipitationHeight(j1 + k, k1 + l);

            if (WorldServer.isBlockFreezableNaturally(j1 + k, l1 - 1, k1 + l))
            {
                WorldServer.setBlock(j1 + k, l1 - 1, k1 + l, Blocks.water);
            }
            if (WorldServer.isRaining())
            {Block block = WorldServer.getBlock((j1+k), (l1-1), (k1+l));
            if (block.getMaterial() == Material.snow)
            {   WorldServer.setBlockToAir(j1 + k, l1 - 1, k1 + l);
            }
            }
	}
}
}

 

THISISCHUNKX and THISISCHUNKZ is what I'm trying to replace. I've found ChunkCoordIntPair, but trying to retrieve stuff from there gives me errors. I'm not sure why =/ .

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



×
×
  • Create New...

Important Information

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