MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / setState

Method setState

src/main/java/net/minecraft/block/BlockFurnace.java:139–163  ·  view source on GitHub ↗
(boolean active, World worldIn, BlockPos pos)

Source from the content-addressed store, hash-verified

137 }
138
139 public static void setState(boolean active, World worldIn, BlockPos pos)
140 {
141 IBlockState iblockstate = worldIn.getBlockState(pos);
142 TileEntity tileentity = worldIn.getTileEntity(pos);
143 keepInventory = true;
144
145 if (active)
146 {
147 worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
148 worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
149 }
150 else
151 {
152 worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
153 worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
154 }
155
156 keepInventory = false;
157
158 if (tileentity != null)
159 {
160 tileentity.validate();
161 worldIn.setTileEntity(pos, tileentity);
162 }
163 }
164
165 /**
166 * Returns a new instance of a block's tile entity class. Called on placing the block.

Callers 1

updateMethod · 0.95

Calls 8

getValueMethod · 0.95
validateMethod · 0.95
getDefaultStateMethod · 0.80
getBlockStateMethod · 0.65
getTileEntityMethod · 0.65
withPropertyMethod · 0.65
setBlockStateMethod · 0.45
setTileEntityMethod · 0.45

Tested by

no test coverage detected