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

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.

主站蜘蛛池模板: 江西省| 新营市| 武宁县| 子洲县| 甘泉县| 醴陵市| 洛南县| 阳城县| 石楼县| 榆社县| 浦北县| 绵竹市| 陆良县| 通许县| 城步| 芦山县| 祁东县| 大悟县| 望奎县| 南华县| 巴林左旗| 阿克苏市| 库尔勒市| 错那县| 新绛县| 宜宾县| 苏尼特右旗| 阿瓦提县| 花莲县| 南安市| 高尔夫| 宜都市| 大理市| 阿克陶县| 安岳县| 喀喇沁旗| 柘城县| 定南县| 信宜市| 班戈县| 辛集市|