import cn.nukkit.block.BlockLiquid; //导入依赖的package包/类
private Map<String, Object> getMaterial(Block b) {
Map<String, Object> map = new LinkedHashMap<String, Object>();
Item item = Item.get(b.getId(), b.getDamage());
map.put("powerSource", b.isPowerSource());
map.put("lightOpacity", Block.lightFilter[b.getId()]);
map.put("lightValue", b.getLightLevel());
// map.put("usingNeighborLight", b.getUseNeighborBrightness(bs));
map.put("hardness", b.getHardness());
map.put("resistance", b.getResistance());
// map.put("ticksRandomly", b.tickRate());
map.put("tickRate", b.tickRate());
map.put("fullCube", b.isSolid() && !b.isTransparent());
map.put("slipperiness", b.getFrictionFactor());
map.put("renderedAsNormalBlock", !b.isTransparent());
//map.put("solidFullCube", b.isSolidFullCube());
map.put("liquid", b instanceof BlockLiquid);
map.put("solid", b.isSolid());
map.put("movementBlocker", b.hasEntityCollision());
//map.put("blocksLight", m.blocksLight());
map.put("burnable", b.getBurnAbility() > 0);
map.put("opaque", !b.isTransparent());
map.put("replacedDuringPlacement", b.canBeReplaced());
map.put("toolRequired", b.getToolType() != 0);
map.put("canBeFlowedInto", b.canBeFlowedInto());
// map.put("fragileWhenPushed", b instanceof BlockFlowable);
// map.put("unpushable", m.getMobilityFlag() == EnumPushReaction.BLOCK);
// map.put("adventureModeExempt", b.getField(m, Material.class, "isAdventureModeExempt", "field_85159_M"));
map.put("mapColor", rgb(b.getColor().getRGB()));
map.put("ambientOcclusionLightValue", b.isSolid() ? 0.2F : 1.0F);
// try {
// map.put("ambientOcclusionLightValue", b.b.getAmbientOcclusionLightValue(bs));
// } catch (NoSuchMethodError ignored) {
// map.put("ambientOcclusionLightValue", b.isBlockNormalCube(bs) ? 0.2F : 1.0F);
// }
map.put("grassBlocking", false); // idk what this property was originally supposed to be...grass uses a combination of light values to check growth
return map;
}
请发表评论