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

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.

主站蜘蛛池模板: 柳林县| 任丘市| 新干县| 巴塘县| 浦东新区| 玉环县| 乌拉特后旗| 普宁市| 鹤壁市| 射阳县| 阿图什市| 历史| 韶关市| 手游| 登封市| 虹口区| 兰西县| 观塘区| 台州市| 龙里县| 高青县| 永顺县| 正宁县| 东宁县| 永和县| 内黄县| 从江县| 子洲县| 上林县| 台江县| 措勤县| 桑日县| 曲水县| 九江市| 麦盖提县| 濮阳市| 都江堰市| 临湘市| 七台河市| 宜黄县| 惠来县|