Some progress on floating flowers

This commit is contained in:
Vincent Lee committed 2015-12-28 14:17:10 -06:00
1 parent bf07f10ac7
commit b701f197ee
6 files changed
+324 -10

No files matched your search

@@ -36,12 +36,14 @@ import org.apache.commons.lang3.tuple.Pair;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import javax.vecmath.Matrix4f;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public class SpecialFlowerModel implements IModelCustomData {
@@ -108,6 +110,12 @@ public class SpecialFlowerModel implements IModelCustomData {
ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();
builder.addAll(blockModels.values());
builder.addAll(itemModels.values());
// Force mini island model to be loaded and baked, for use elsewhere. See <TODO>
for (IFloatingFlower.IslandType i : IFloatingFlower.IslandType.values()) {
builder.add(new ModelResourceLocation("botania:miniIsland", i.name().toLowerCase(Locale.ROOT)));
}
return builder.build();
}
@@ -76,7 +76,7 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
@Override
public int getMetaFromState(IBlockState state) {
return ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMetadata();
return state.getValue(BotaniaStateProps.COLOR).getMetadata();
}
@Override
@@ -90,7 +90,7 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockAccess world, BlockPos pos) {
return ColoredLightHelper.getPackedColor(((EnumDyeColor) world.getBlockState(pos).getValue(BotaniaStateProps.COLOR)), originalLight);
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
}
@Override
@@ -110,7 +110,7 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
@Override
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
int hex = ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue;
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = (hex & 0xFF);
@@ -168,11 +168,6 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
return false;
}
@Override
public int getRenderType() {
return LibRenderIDs.idMiniIsland;
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileFloatingFlower();