mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Move Grass {Flower} registry to BiomeGenBase as 1.7 made flowers Biome specifc, this means modders who wish to add global base flowers need to add them to all the biomes indavidually.
This commit is contained in:
1 parent
96e23516f6
commit
8ca1179e04
8 files changed
+133
-50
No files matched your search
@@ -81,26 +81,8 @@ public class ForgeHooks
|
||||
this.seed = seed;
|
||||
}
|
||||
}
|
||||
static final List<GrassEntry> grassList = new ArrayList<GrassEntry>();
|
||||
static final List<SeedEntry> seedList = new ArrayList<SeedEntry>();
|
||||
|
||||
public static void plantGrass(World world, Random rand, int x, int y, int z)
|
||||
{
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
|
||||
String flowername = biome.func_150572_a(rand, x, y, z);
|
||||
|
||||
/*
|
||||
field_149992_a.debug("Flower in " + p_149853_1_.getBiomeGenForCoords(i1, k1).biomeName + ": " + s);
|
||||
BlockFlower blockflower = BlockFlower.func_149857_e(s);
|
||||
*/
|
||||
GrassEntry grass = (GrassEntry)WeightedRandom.getRandomItem(world.rand, grassList);
|
||||
if (grass == null || grass.block == null || !grass.block.func_149718_j(world, x, y, z))
|
||||
{
|
||||
return;
|
||||
}
|
||||
world.func_147465_d(x, y, z, grass.block, grass.metadata, 3);
|
||||
}
|
||||
|
||||
public static ItemStack getGrassSeed(World world)
|
||||
{
|
||||
SeedEntry entry = (SeedEntry)WeightedRandom.getRandomItem(world.rand, seedList);
|
||||
@@ -112,7 +94,7 @@ public class ForgeHooks
|
||||
}
|
||||
|
||||
private static boolean toolInit = false;
|
||||
static HashSet<List> toolEffectiveness = new HashSet<List>();
|
||||
//static HashSet<List> toolEffectiveness = new HashSet<List>();
|
||||
|
||||
public static boolean canHarvestBlock(Block block, EntityPlayer player, int metadata)
|
||||
{
|
||||
@@ -233,8 +215,6 @@ public class ForgeHooks
|
||||
|
||||
static
|
||||
{
|
||||
grassList.add(new GrassEntry(Blocks.yellow_flower, 0, 20));
|
||||
grassList.add(new GrassEntry(Blocks.red_flower, 0, 10));
|
||||
seedList.add(new SeedEntry(new ItemStack(Items.wheat_seeds), 10));
|
||||
initTools();
|
||||
}
|
||||
|
||||
@@ -38,18 +38,6 @@ public class MinecraftForge
|
||||
|
||||
private static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler();
|
||||
|
||||
|
||||
/** Register a new plant to be planted when bonemeal is used on grass.
|
||||
* @param block The block to place.
|
||||
* @param metadata The metadata to set for the block when being placed.
|
||||
* @param weight The weight of the plant, where red flowers are
|
||||
* 10 and yellow flowers are 20.
|
||||
*/
|
||||
public static void addGrassPlant(Block block, int metadata, int weight)
|
||||
{
|
||||
ForgeHooks.grassList.add(new GrassEntry(block, metadata, weight));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new seed to be dropped when breaking tall grass.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user