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

Method toggleDoor

src/main/java/net/minecraft/block/BlockDoor.java:182–198  ·  view source on GitHub ↗
(World worldIn, BlockPos pos, boolean open)

Source from the content-addressed store, hash-verified

180 }
181
182 public void toggleDoor(World worldIn, BlockPos pos, boolean open)
183 {
184 IBlockState iblockstate = worldIn.getBlockState(pos);
185
186 if (iblockstate.getBlock() == this)
187 {
188 BlockPos blockpos = iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down();
189 IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos);
190
191 if (iblockstate1.getBlock() == this && iblockstate1.getValue(OPEN) != open)
192 {
193 worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, open), 2);
194 worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
195 worldIn.playAuxSFXAtEntity(null, open ? 1003 : 1006, pos, 0);
196 }
197 }
198 }
199
200 /**
201 * Called when a neighboring block changes.

Callers 2

startExecutingMethod · 0.80
resetTaskMethod · 0.80

Calls 8

getBlockMethod · 0.95
getValueMethod · 0.95
withPropertyMethod · 0.95
downMethod · 0.80
playAuxSFXAtEntityMethod · 0.80
getBlockStateMethod · 0.65
setBlockStateMethod · 0.45

Tested by

no test coverage detected