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

Method isInsideOfMaterial

src/main/java/net/minecraft/entity/Entity.java:1215–1233  ·  view source on GitHub ↗

Checks if the current block the entity is within of the specified material type

(Material materialIn)

Source from the content-addressed store, hash-verified

1213 * Checks if the current block the entity is within of the specified material type
1214 */
1215 public boolean isInsideOfMaterial(Material materialIn)
1216 {
1217 double d0 = this.posY + (double)this.getEyeHeight();
1218 BlockPos blockpos = new BlockPos(this.posX, d0, this.posZ);
1219 IBlockState iblockstate = this.worldObj.getBlockState(blockpos);
1220 Block block = iblockstate.getBlock();
1221
1222 if (block.getMaterial() == materialIn)
1223 {
1224 float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) - 0.11111111F;
1225 float f1 = (float)(blockpos.getY() + 1) - f;
1226 boolean flag = d0 < (double)f1;
1227 return !flag && this instanceof EntityPlayer ? false : flag;
1228 }
1229 else
1230 {
1231 return false;
1232 }
1233 }
1234
1235 public boolean isInLava()
1236 {

Callers 8

renderWorldPassMethod · 0.95
renderOverlaysMethod · 0.80
renderPlayerStatsMethod · 0.80
onEntityUpdateMethod · 0.80
getToolDigEfficiencyMethod · 0.80
addMovementStatMethod · 0.80
onLivingUpdateMethod · 0.80
drawRenderItemPhysicsMethod · 0.80

Calls 7

getEyeHeightMethod · 0.95
getBlockMethod · 0.95
getMaterialMethod · 0.95
getBlockStateMethod · 0.65
getYMethod · 0.65
getMetaFromStateMethod · 0.45

Tested by

no test coverage detected