mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 15:03:03 +00:00
Partial fix for platform + smartmodels
This commit is contained in:
1 parent
972d0e5bf6
commit
c7d28c57de
3 files changed
+105
-4
No files matched your search
@@ -53,12 +53,15 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
setUnlocalizedName(LibBlockNames.PLATFORM);
|
||||
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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.PLATFORM_VARIANT, }, new IUnlistedProperty[] { BotaniaStateProps.HELD_STATE });
|
||||
return new ExtendedBlockState(this, new IProperty[] { BotaniaStateProps.PLATFORM_VARIANT, },
|
||||
new IUnlistedProperty[] { BotaniaStateProps.HELD_STATE, BotaniaStateProps.HELD_WORLD, BotaniaStateProps.HELD_POS });
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,11 +79,14 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
state = ((IExtendedBlockState) state).withProperty(BotaniaStateProps.HELD_WORLD, world)
|
||||
.withProperty(BotaniaStateProps.HELD_POS, pos);
|
||||
|
||||
if (world.getTileEntity(pos) instanceof TileCamo) {
|
||||
TileCamo tile = ((TileCamo) world.getTileEntity(pos));
|
||||
return ((IExtendedBlockState) state).withProperty(BotaniaStateProps.HELD_STATE, tile.camoState);
|
||||
} else {
|
||||
return ((IExtendedBlockState) state);
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user