mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Fix top half of double flowers not sparkling with correct color. Also disable random offsetting because it's broken
This commit is contained in:
1 file changed
+14
-5
@@ -35,6 +35,8 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
@@ -53,14 +55,12 @@ import java.util.Random;
|
||||
public abstract class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable {
|
||||
private static final int COUNT = 8;
|
||||
|
||||
final int offset;
|
||||
final boolean second;
|
||||
private final boolean second;
|
||||
|
||||
public BlockModDoubleFlower(boolean second) {
|
||||
this.second = second;
|
||||
this.setHardness(0.0F);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
offset = second ? 8 : 0;
|
||||
String name = LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1);
|
||||
GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
@@ -168,14 +168,23 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Block.EnumOffsetType getOffsetType()
|
||||
{
|
||||
return Block.EnumOffsetType.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random par5Random) {
|
||||
state = getActualState(state, world, pos);
|
||||
int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = (hex & 0xFF);
|
||||
|
||||
if(par5Random.nextDouble() < ConfigHandler.flowerParticleFrequency)
|
||||
Botania.proxy.sparkleFX(par1World, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.5 + par5Random.nextFloat() * 0.5, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + 0.3 + par5Random.nextFloat() * 0.5, pos.getY() + 0.5 + par5Random.nextFloat() * 0.5, pos.getZ() + 0.3 + par5Random.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, par5Random.nextFloat(), 5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user