This repository has been archived by the owner on Dec 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TerrainHandler.java
52 lines (48 loc) · 1.66 KB
/
TerrainHandler.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package valoeghese.valoeghesesbe.util;
import net.minecraft.block.BlockOldLog;
import net.minecraft.block.BlockPlanks;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.common.eventhandler.Event.Result;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import valoeghese.valoeghesesbe.init.ModBiomes;
import valoeghese.valoeghesesbe.init.ModBlocks;
import valoeghese.valoeghesesbe.world.worldtype.ILakeRemover;
public class TerrainHandler
{
/*
@SubscribeEvent
public static void genBlocks(GetVillageBlockID event)
{
if (event.getBiome() == ModBiomes.VBE_CHRISTMAS_WOODS_OAK)
{
Console.WriteLine("GRWGWRBWRBWRBWBWRBWR");
//event.setCanceled(true);
if (event.getOriginal().getBlock() == Blocks.PLANKS)
{
event.setReplacement(ModBlocks.PLANKS_PINE.getDefaultState());
}
else if (event.getOriginal().getBlock() == Blocks.LOG)
{
event.setReplacement(ModBlocks.LOG_PINE.getDefaultState());
}
else if (event.getOriginal().getBlock() == Blocks.COBBLESTONE)
{
event.setReplacement(ModBlocks.PLANKS_PINE.getDefaultState());
}
}
}
*/
@SubscribeEvent
public static void populationEvent(Populate event)
{
if (event.getType() == Populate.EventType.LAKE)
if (event.getWorld().getBiome(new BlockPos(event.getChunkX() * 16, 64, event.getChunkZ() * 16)) instanceof ILakeRemover)
{
event.setResult(Result.DENY);
}
}
}