官术网_书友最值得收藏!

Understanding the Java documentation

In case you are new to reading API documentation, let's look at a method that is included in the World class to see what information it provides us. Click on the link to view the createExplosion(Location loc, float power, booleansetFire) method. You will be brought to the method description similar to the one shown in the following screenshot:

The screenshot explains each parameter and the return value for the method. This method requires that we pass three parameters to it, explained as follows:

  • Where the explosion should take place
  • How powerful the explosion should be
  • Whether the explosion should cause surrounding blocks to ignite in flames

If the returned value is void then the method will not send any information back to us. In this example, the method returns a boolean value. On reading the documentation we learn that the returned value is whether or not the explosion actually occurred. If another plugin prevented the explosion from happening then the createExplosion method would return false.

主站蜘蛛池模板: 永顺县| 磴口县| 莒南县| 襄樊市| 吴桥县| 洞头县| 海盐县| 苏尼特左旗| 洛隆县| 盐源县| 长垣县| 偃师市| 和田县| 剑阁县| 精河县| 巨野县| 安新县| 黎平县| 利辛县| 乌恰县| 新乡县| 方城县| 民县| 蚌埠市| 泸州市| 惠东县| 思南县| 左贡县| 来凤县| 阳春市| 河池市| 新余市| 津南区| 微博| 阳城县| 历史| 花垣县| 时尚| 揭东县| 山东| 新昌县|