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

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.

主站蜘蛛池模板: 北安市| 姜堰市| 泽库县| 犍为县| 丰县| 安仁县| 梨树县| 博兴县| 炉霍县| 阜城县| 温宿县| 新民市| 乃东县| 丹阳市| 清丰县| 巢湖市| 卢湾区| 临海市| 临海市| 大安市| 富锦市| 黎城县| 综艺| 大宁县| 基隆市| 永丰县| 海安县| 特克斯县| 武川县| 天柱县| 中山市| 迁安市| 泸定县| 应用必备| 沙河市| 浦县| 方正县| 尼勒克县| 黄平县| 时尚| 北辰区|