mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 04:32:23 +00:00
TIL you don't set default values for unlisted properties
This commit is contained in:
6 files changed
+9
-22
No files matched your search
@@ -210,16 +210,13 @@ public class SpecialFlowerModel implements IModelCustomData {
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
|
||||
if(state.getBlock() != ModBlocks.specialFlower)
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand);
|
||||
Botania.LOGGER.info("Getting " + (face == null ? "gen" : face.getName()) + " quads");
|
||||
IExtendedBlockState extendedState = ((IExtendedBlockState) state);
|
||||
String subtileId = extendedState.getValue(BotaniaStateProps.SUBTILE_ID);
|
||||
|
||||
IBakedModel ret = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
|
||||
if(subtileId != null) { // Todo remove - workaround for subtile ID being null?
|
||||
Optional<IBakedModel> specialModel = bakedBlockModels.getUnchecked(extendedState.getValue(BotaniaStateProps.SUBTILE_ID));
|
||||
if(specialModel.isPresent())
|
||||
ret = specialModel.get();
|
||||
}
|
||||
Optional<IBakedModel> specialModel = bakedBlockModels.getUnchecked(subtileId);
|
||||
if(specialModel.isPresent())
|
||||
ret = specialModel.get();
|
||||
|
||||
return ret.getQuads(state, face, rand);
|
||||
}
|
||||
|
||||
@@ -64,10 +64,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
|
||||
GameRegistry.addRecipe(new SpecialFloatingFlowerRecipe());
|
||||
RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, "");
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.ISLAND_TYPE, IFloatingFlower.IslandType.GRASS)
|
||||
.withProperty(BotaniaStateProps.SUBTILE_ID, "daybloom")
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -58,11 +58,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable,
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.HELD_STATE, null)
|
||||
.withProperty(BotaniaStateProps.HELD_WORLD, null)
|
||||
.withProperty(BotaniaStateProps.HELD_POS, null)
|
||||
.withProperty(BotaniaStateProps.PLATFORM_VARIANT, PlatformVariant.ABSTRUSE));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.PLATFORM_VARIANT, PlatformVariant.ABSTRUSE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -57,6 +57,7 @@ import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.client.render.IModelRegister;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -132,9 +133,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
setSoundType(SoundType.PLANT);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.SUBTILE_ID, "daybloom")
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
super(Material.IRON, LibBlockNames.CORPOREA_CRYSTAL_CUBE);
|
||||
setHardness(5.5F);
|
||||
setSoundType(SoundType.METAL);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState()).withProperty(Properties.AnimationProperty, null).withProperty(Properties.StaticProperty, true));
|
||||
setDefaultState(blockState.getBaseState().withProperty(Properties.StaticProperty, true));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -82,9 +82,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
setSoundType(SoundType.GROUND);
|
||||
setLightLevel(1F);
|
||||
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.ISLAND_TYPE, IslandType.GRASS)
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
Reference in new issue
Block a user