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

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.

主站蜘蛛池模板: 汽车| 阜宁县| 蒙山县| 商水县| 乌鲁木齐县| 永胜县| 凤山县| 华池县| 吐鲁番市| 滨州市| 湖州市| 大宁县| 驻马店市| 潜江市| 浦城县| 横山县| 河源市| 阿鲁科尔沁旗| 定南县| 平乡县| 穆棱市| 郓城县| 呼伦贝尔市| 洪泽县| 体育| 简阳市| 鸡东县| 惠来县| 廊坊市| 比如县| 厦门市| 鄂伦春自治旗| 穆棱市| 福清市| 云林县| 延边| 汝阳县| 普兰店市| 怀来县| 牟定县| 东城区|