Fixed grass block in world colouring

This commit is contained in:
Adubbz 2019-01-16 10:53:45 +11:00
parent 3b076fdc7e
commit 26b1db1c25
3 changed files with 14 additions and 0 deletions

View file

@ -45,6 +45,7 @@ public class BiomesOPlenty
private void init(final FMLInitializationEvent event)
{
proxy.init();
GenLayerVisualizer.run();
}
}

View file

@ -7,6 +7,7 @@
******************************************************************************/
package biomesoplenty.core;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.api.particle.BOPParticleTypes;
import biomesoplenty.common.entity.projectile.EntityMudball;
@ -14,13 +15,16 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.entity.RenderSprite;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.init.Particles;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.particles.ItemParticleData;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeColorHelper;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
public class ClientProxy extends CommonProxy
@ -36,6 +40,14 @@ public class ClientProxy extends CommonProxy
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, manager -> new RenderSprite<Entity>(manager, BOPItems.mudball, Minecraft.getInstance().getItemRenderer()));
}
@Override
public void init()
{
Minecraft.getInstance().getBlockColors().register((state, world, pos, tintIndex) ->
world != null && pos != null ? BiomeColorHelper.getGrassColor(world, pos) : ColorizerGrass.get(0.5D, 1.0D)
, BOPBlocks.sandy_grass_block, BOPBlocks.loamy_grass_block);
}
@Override
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info)
{

View file

@ -18,6 +18,7 @@ public class CommonProxy
}
public void preInit() {}
public void init() {}
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info) {}
}