Fixed grass block in world colouring
This commit is contained in:
parent
3b076fdc7e
commit
26b1db1c25
3 changed files with 14 additions and 0 deletions
|
@ -45,6 +45,7 @@ public class BiomesOPlenty
|
||||||
|
|
||||||
private void init(final FMLInitializationEvent event)
|
private void init(final FMLInitializationEvent event)
|
||||||
{
|
{
|
||||||
|
proxy.init();
|
||||||
GenLayerVisualizer.run();
|
GenLayerVisualizer.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package biomesoplenty.core;
|
package biomesoplenty.core;
|
||||||
|
|
||||||
|
import biomesoplenty.api.block.BOPBlocks;
|
||||||
import biomesoplenty.api.item.BOPItems;
|
import biomesoplenty.api.item.BOPItems;
|
||||||
import biomesoplenty.api.particle.BOPParticleTypes;
|
import biomesoplenty.api.particle.BOPParticleTypes;
|
||||||
import biomesoplenty.common.entity.projectile.EntityMudball;
|
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.particle.Particle;
|
||||||
import net.minecraft.client.renderer.entity.RenderSprite;
|
import net.minecraft.client.renderer.entity.RenderSprite;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.init.Particles;
|
import net.minecraft.init.Particles;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.particles.ItemParticleData;
|
import net.minecraft.particles.ItemParticleData;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.world.ColorizerGrass;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.BiomeColorHelper;
|
||||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy
|
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()));
|
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
|
@Override
|
||||||
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info)
|
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@ public class CommonProxy
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preInit() {}
|
public void preInit() {}
|
||||||
|
public void init() {}
|
||||||
|
|
||||||
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info) {}
|
public void spawnParticle(BOPParticleTypes type, World parWorld, double x, double y, double z, Object... info) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue