@Override public Map<String, ? extends Property<?>> getProperties(BlockType blockType) { Map<String, Property<?>> map = new TreeMap<>(); Collection<IProperty<?>> propertyKeys = Block.getBlockFromName(blockType.getId()) .getDefaultState() .getPropertyKeys(); for (IProperty<?> key : propertyKeys) { map.put(key.getName(), ForgeAdapter.adaptProperty(key)); } return map; }
@Override public BlockMaterial getMaterial(BlockType blockType) { return materialMap.computeIfAbsent(Block.getBlockFromName(blockType.getId()).getDefaultState().getMaterial(), m -> new ForgeBlockMaterial(m, super.getMaterial(blockType))); }
public InWorldToolOperationIngredient( final Block blk, final boolean b ) { this.state = blk.getDefaultState(); this.blockOnly = b; }
@Nonnull @Override public IBlockState getDisplayTile() { return ModBlocks.pool.getDefaultState(); }
IBlockState old = chunk.getBlockState(pos); Block mcBlock = Block.getBlockFromName(block.getBlockType().getId()); IBlockState newState = mcBlock.getDefaultState(); Map<Property<?>, Object> states = block.getStates(); newState = applyProperties(mcBlock.getBlockState(), newState, states);
public static void init() { BotaniaAPI.registerPureDaisyRecipe("stone", ModBlocks.livingrock.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("logWood", ModBlocks.livingwood.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("netherrack", Blocks.COBBLESTONE.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("soulSand", Blocks.SAND.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("ice", Blocks.PACKED_ICE.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe(LibOreDict.BLAZE_BLOCK, Blocks.OBSIDIAN.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe(Blocks.WATER, Blocks.SNOW.getDefaultState()); }
protected AEBaseStairBlock( final Block block, final String type ) { super( block.getDefaultState() ); Preconditions.checkNotNull( block ); Preconditions.checkNotNull( block.getUnlocalizedName() ); Preconditions.checkArgument( block.getUnlocalizedName().length() > 0 ); this.setUnlocalizedName( "stair." + type ); this.setLightOpacity( 0 ); }
@Override public IBlockState getBlockState() { final Item maybeFacade = this.facade.getItem(); // AE Facade if( maybeFacade instanceof IFacadeItem ) { final IFacadeItem facade = (IFacadeItem) maybeFacade; return facade.getTextureBlockState( this.facade ); } return Blocks.GLASS.getDefaultState(); }
@Nonnull @Override public IBlockState getBlockState(@Nonnull BlockPos pos) { IBlockState state = compose.getBlockState(pos); if(state.getBlock() instanceof BlockCamo) { state = ((TileCamo) compose.getTileEntity(pos)).camoState; } return state == null ? Blocks.AIR.getDefaultState() : state; }
public static MultiblockSet makeMultiblockSet() { Multiblock mb = new Multiblock(); for(BlockPos relativePos : LAPIS_BLOCKS) mb.addComponent(relativePos, Blocks.LAPIS_BLOCK.getDefaultState()); for(BlockPos relativePos : LIVINGROCK_BLOCKS) mb.addComponent(relativePos, ModBlocks.livingrock.getDefaultState()); mb.addComponent(new BlockPos(0, 1, 0), ModBlocks.terraPlate.getDefaultState()); mb.setRenderOffset(new BlockPos(0, 1, 0)); return mb.makeSet(); }
public BlockLivingrockSlab(boolean full) { super(full, ModBlocks.livingrock.getDefaultState()); setHardness(2.0F); setResistance(10.0F); setSoundType(SoundType.STONE); }
private void setBlockIDWithMetadata( final int y, BlockStorageData data ) { if( data.state == CachedPlane.this.matrixBlockState ) { data.state = Platform.AIR_BLOCK.getDefaultState(); } final ExtendedBlockStorage[] storage = this.c.getBlockStorageArray(); final ExtendedBlockStorage extendedBlockStorage = storage[y >> 4]; extendedBlockStorage.set( this.x, y & 15, this.z, data.state ); extendedBlockStorage.setBlockLight( this.x, y & 15, this.z, data.light ); }
@Override public IBlockState getBlockState( final int x, final int y, final int z ) { if( this.range( x, y, z ) ) { return this.w.getBlockState( new BlockPos( x, y, z ) ); } return Blocks.AIR.getDefaultState(); } }
public BlockShimmerrockSlab(boolean full) { super(full, ModBlocks.shimmerrock.getDefaultState()); setHardness(2.0F); setResistance(10.0F); setSoundType(SoundType.STONE); }
public BlockLivingrockBrickSlab(boolean full) { super(full, ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK)); setHardness(2.0F); setResistance(10.0F); setSoundType(SoundType.STONE); }
@Override public void setBlock( final int x, final int y, final int z, final Block blk ) { if( this.range( x, y, z ) ) { this.verticalBits |= 1 << ( y >> 4 ); this.getWorld().setBlockState( new BlockPos( x, y, z ), blk.getDefaultState() ); } }
public static void placeDoubleFlower(World world, BlockPos pos, EnumDyeColor color, int flags) { Block flower = color.getMetadata() >= 8 ? ModBlocks.doubleFlower2 : ModBlocks.doubleFlower1; world.setBlockState(pos, flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flags); world.setBlockState(pos.up(), flower.getDefaultState().withProperty(color.getMetadata() >= 8 ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, color).withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags); }
private void renderBlock(Block block) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(block.getDefaultState(), 1.0F); } }
@Override @SideOnly(Side.CLIENT) public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.HEAD) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); GlStateManager.scale(0.5F, 0.5F, 0.5F); GlStateManager.translate(0, -1.5F, 0.5F); Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(ModBlocks.tinyPlanet.getDefaultState(), 1.0F); } }
public static MultiblockSet makeMultiblockSet() { Multiblock mb = new Multiblock(); for(BlockPos p : PYLON_LOCATIONS) mb.addComponent(p.up(), ModBlocks.pylon.getDefaultState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.GAIA)); for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) mb.addComponent(new BeaconComponent(new BlockPos(i - 1, 0, j - 1))); mb.addComponent(new BeaconBeamComponent(new BlockPos(0, 1, 0))); mb.setRenderOffset(new BlockPos(0, -1, 0)); return mb.makeSet(); }