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

Understanding the Java 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, boolean setFire) method. You will be brought to a method description that is 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, which is explained as follows:

  • Where the explosion should take place
  • How powerful the explosion should be
  • Whether the explosion should cause the 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, you will 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 will return false.

主站蜘蛛池模板: 仁寿县| 河西区| 潞城市| 上蔡县| 新田县| 平舆县| 长兴县| 烟台市| 滨州市| 南京市| 东辽县| 怀柔区| 巴楚县| 阳东县| 石狮市| 太谷县| 云梦县| 平山县| 普定县| 高邮市| 金沙县| 乐亭县| 汨罗市| 福安市| 张掖市| 曲阜市| 漯河市| 宜君县| 苗栗市| 宁国市| 旺苍县| 天长市| 新野县| 恩平市| 博乐市| 丹阳市| 连云港市| 理塘县| 永州市| 依兰县| 淳化县|