Plugin already initial problem

Discussion in 'Plugin Development' started by MoseMister, Jan 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    MoseMister

    hey, i have a error that comes up on craftbukkit 1.7.2 dev build 0.3 (all the 0.3 builds) however not the 0.2 or 0.1 builds

    the error code when booting up is this
    Code:
    org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin already initialized!
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:137) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:308) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:231) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:257) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.<init>(CraftServer.java:235) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at net.minecraft.server.v1_7_R1.PlayerList.<init>(PlayerList.java:63) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at net.minecraft.server.v1_7_R1.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
    Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:98) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:59) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at Ships.Ships.<init>(Ships.java:12) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_45]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_45]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_45]
        at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_45]
        at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_45]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:52) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        ... 9 more
    Caused by: java.lang.IllegalStateException: Initial initialization
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:101) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:59) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at Ships.Ships.<init>(Ships.java:12) ~[?:?]
        at Ships.Bloki.<init>(Bloki.java:10) ~[?:?]
        at Ships.Ships.<clinit>(Ships.java:173) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_45]
        at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_45]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:40) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[craftbukkit-1.7.2-R0.3.jar:git-Bukkit-1.7.2-R0.2-10-gd51ccd1-b2987jnks]
        ... 9 more
    [10:22:41] [Server thread/INFO]: [Config Cleaner Ships] Loading Config Cleaner Ships v1
    
    i am willing to give you any source code needed, i just want it fixed so it can work in the future


    i have already tried changing the package folders
    i know for some of my users it works on 1.7.2 dev build 0.3 fine

    thank you for replying
     
  2. Offline

    Niknea

    Can I see your code? For classes Ships and Bloki.
     
  3. Offline

    MoseMister

    Ships
    Code:java
    1. package Ships;
    2.  
    3. import java.util.logging.Logger;
    4.  
    5. import org.bukkit.Bukkit;
    6. import org.bukkit.ChatColor;
    7. import org.bukkit.plugin.Plugin;
    8. import org.bukkit.plugin.PluginDescriptionFile;
    9. import org.bukkit.plugin.PluginManager;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class Ships
    13. extends JavaPlugin
    14. {
    15. static boolean SuportKingdoms;
    16. static String activateText;
    17. static String alternativText;
    18. static int AirShipRequiredBlock;
    19. static int AirShipRequiredPercent;
    20. static int AirShipTheMinimumNumberOfBlocks;
    21. static int AirShipTheMaximumNumberOfBlocks;
    22. static int AirShip2RequiredBlock;
    23. static int AirShip2RequiredPercent;
    24. static int AirShip2TheMinimumNumberOfBlocks;
    25. static int AirShip2TheMaximumNumberOfBlocks;
    26. static int AirShip2FuelId;
    27. static int AirShip2FuelIdAlt;
    28. static int AirShip2Speed;
    29. static int ShipRequiredBlock;
    30. static int ShipRequiredPercent;
    31. static int ShipTheMinimumNumberOfBlocks;
    32. static int ShipTheMaximumNumberOfBlocks;
    33. static int AirShipFuelId;
    34. static int AirShipFuelIdAlt;
    35. static int ShipSpeed;
    36. static int AirShipSpeed;
    37. static int MarsShipRequiredBlock;
    38. static int MarsShipRequiredPercent;
    39. static int MarsShipTheMinimumNumberOfBlocks;
    40. static int MarsShipTheMaximumNumberOfBlocks;
    41. static int MarsShipSpeed;
    42. static int waterlevel;
    43. static int EngineSpeed;
    44. static int ConfigVersion;
    45. static boolean CreateConfig;
    46. static boolean ProtectFire;
    47. static boolean BootUpDebug;
    48. static boolean BlockDebug;
    49. static boolean EntityDebug;
    50. static boolean ItemDebug;
    51. static boolean VesselDebug;
    52. static boolean RotateDebug;
    53. static boolean Acacia_Leaves;
    54. static boolean Wooden_Planks;
    55. static boolean Stone;
    56. static boolean Dirt;
    57. static boolean Grass;
    58. static boolean Cobblestone;
    59. static boolean Sand;
    60. static boolean Gravel;
    61. static boolean Gold_Ore;
    62. static boolean Iron_Ore;
    63. static boolean Coal_Ore;
    64. static boolean Wood_Log;
    65. static boolean Leaves;
    66. static boolean Sponge;
    67. static boolean Glass_Block;
    68. static boolean Lapis_Ore;
    69. static boolean Lapis_Block;
    70. static boolean Dispenser;
    71. static boolean SandStone;
    72. static boolean Note_Block;
    73. static boolean Piston_Sticky;
    74. static boolean Web_Block;
    75. static boolean Piston_Normal;
    76. static boolean Piston_Head;
    77. static boolean Gold_Block;
    78. static boolean Iron_Block;
    79. static boolean Bricks;
    80. static boolean TNT;
    81. static boolean Bookshelf;
    82. static boolean Cobblestone_Mossy;
    83. static boolean Obsidian;
    84. static boolean Spawner;
    85. static boolean Wooden_Stairs;
    86. static boolean Diamond_Ore;
    87. static boolean Diamond_Block;
    88. static boolean Crafting_Table;
    89. static boolean Redstone_Ore;
    90. static boolean Snow;
    91. static boolean Snow_Block;
    92. static boolean Clay;
    93. static boolean JukeBox;
    94. static boolean Fence;
    95. static boolean Pumpkin;
    96. static boolean Soul_Sand;
    97. static boolean Glowstone;
    98. static boolean Cake;
    99. static boolean Jack_O_Lantern;
    100. static boolean Redstone_Repeater;
    101. static boolean Silverfish_Blocks;
    102. static boolean Stone_Brick;
    103. static boolean Iron_Bars;
    104. static boolean Glass_Pane;
    105. static boolean Melon_Block;
    106. static boolean Fence_Gate;
    107. static boolean Brick_Stairs;
    108. static boolean Stone_Brick_Stairs;
    109. static boolean Nether_Brick;
    110. static boolean Nether_Brick_Fence;
    111. static boolean Nether_Brick_Stairs;
    112. static boolean Enchantment_Table;
    113. static boolean Brewing_Stand;
    114. static boolean Cauldron;
    115. static boolean Redstone_Lamp;
    116. static boolean Double_Wood_Slab;
    117. static boolean Wood_Slab;
    118. static boolean Sandstone_Stairs;
    119. static boolean Emerald_Ore;
    120. static boolean Ender_Chest;
    121. static boolean Emerald_Block;
    122. static boolean Command_Block;
    123. static boolean Beacon;
    124. static boolean Cobblestone_Wall;
    125. static boolean Head;
    126. static boolean Redstone_Block;
    127. static boolean Quartz_Ore;
    128. static boolean Quartz_Block;
    129. static boolean Quartz_Stairs;
    130. static boolean Clay_Stained;
    131. static boolean Hay_Bale;
    132. static boolean Carpet;
    133. static boolean Hardened_Clay;
    134. static boolean Coal_Block;
    135. static boolean Glass_Stained;
    136. static boolean Glass_Pane_Stained;
    137. static boolean Daylight;
    138. static boolean Netherrack;
    139. static boolean Iron_Door;
    140. static boolean Wool;
    141. static boolean Dropper;
    142. static boolean Rail_Activtor;
    143. static boolean Hopper;
    144. static boolean Redstone_Comparator;
    145. static boolean PressurePlate_Weighted_Heavy;
    146. static boolean PressurePlate_Weighted_Light;
    147. static boolean Chest_Trapped;
    148. static boolean Anvil;
    149. static boolean Button_Wooden;
    150. static boolean Tripwire_Hook;
    151. static boolean Flower_Pot;
    152. static boolean String;
    153. static boolean Button_Stone;
    154. static boolean Door_Trap;
    155. static boolean Redstone_Torch;
    156. static boolean PresurePlate_Wooden;
    157. static boolean Stone_PressurePlate;
    158. static boolean Lever;
    159. static boolean Ladder;
    160. static boolean Door_Wooden;
    161. static boolean Furnace;
    162. static boolean Redstone;
    163. static boolean Chest;
    164. static boolean Torch;
    165. static boolean Fire;
    166. static boolean Bed;
    167. static boolean Wooden_Acacia;
    168. static boolean Wooden_Acacia_Stairs;
    169.  
    170. static Logger log = Logger.getLogger("Minecraft");
    171. ShipsMaping mys;
    172. static String swiat;
    173. static Bloki ShipsBlock = new Bloki();
    174.  
    175. @Override
    176. public void onDisable()
    177. {
    178. Bukkit.getServer().getScheduler().cancelAllTasks();
    179. PluginDescriptionFile p = this.getDescription();
    180. this.log.info("[" + p.getName() + "] Thank you for using Ships");
    181. }
    182.  
    183. @Override
    184. public void onEnable()
    185. {
    186. Object blok = null;
    187.  
    188. this.log.info(ChatColor.GREEN + "--------[Ships]-------");
    189.  
    190. PluginManager PM = getServer().getPluginManager();
    191. PM.registerEvents(new ShipsListener(), this);
    192.  
    193. PluginDescriptionFile p = this.getDescription();
    194. this.log.info("Booting up Ships" + p.getVersion());
    195. this.log.info("If any errors are found, please contact mose from the dev.bukkit page");
    196.  
    197. ShipsSettings.LoadSettings();
    198. Bloki.LoadSettings();
    199.  
    200. getLogger().info("----recommended errors----");
    201.  
    202. if(BootUpDebug == true) {
    203. Ships.log.info("---- Debug BootUp - Config ----");
    204. Ships.log.info("--Checking airship values--");
    205. Ships.log.info("The Required % = " + AirShipRequiredPercent);
    206. Ships.log.info("The Minimum number of blocks needed = " + AirShipTheMinimumNumberOfBlocks);
    207. Ships.log.info("The Miximum number of blocks needed = " + AirShipTheMaximumNumberOfBlocks);
    208. Ships.log.info("The fuel id = " + AirShipFuelId);
    209. Ships.log.info("The Alt fuel id = " + AirShipFuelIdAlt);
    210. Ships.log.info("The EOT speed = " + AirShipSpeed);
    211. Ships.log.info("--------");
    212. Ships.log.info("--Checking Other values--");
    213. Ships.log.info("Protect againced fire = " + ProtectFire);
    214. Ships.log.info("the default water level = " + waterlevel);
    215. Ships.log.info("Engine speed = " + EngineSpeed);
    216. Ships.log.info("--------");
    217. Ships.log.info("--Checking Debug Values--");
    218. Ships.log.info("BootupDebug = " + BootUpDebug);
    219. Ships.log.info("VesselDebug = " + VesselDebug);
    220. Ships.log.info("EntityDebug = " + EntityDebug);
    221. Ships.log.info("ItemDebug = " + ItemDebug);
    222. Ships.log.info("BlockDebug = " + BlockDebug);
    223. Ships.log.info("RotateDebug = "+ RotateDebug);
    224. Ships.log.info("--------");
    225. Ships.log.info("--Materials--");
    226. Ships.log.info("Beacon = " + Beacon);
    227. Ships.log.info("Bookshelf = " + Bookshelf);
    228. Ships.log.info("Brewing_Stand = " + Brewing_Stand);
    229. Ships.log.info("Quartz_Block = " + Quartz_Block);
    230. Ships.log.info("--------");
    231. Ships.log.info("--Testers Materials--");
    232. Ships.log.info("Bed = " + Bed);
    233. }
    234.  
    235. if(ItemDebug == true) {
    236. Ships.log.warning("Debug WILL spam the console of what the ships plugin is doing");
    237. }
    238.  
    239. if (Wooden_Planks == false) {
    240. this.log.warning(" Wooden Planks has been disabled in config, this is not recommended");
    241. }
    242.  
    243. if (Silverfish_Blocks == false) {
    244. if(Stone == true) {
    245. this.log.warning("Stone has been enabled on your server but Silverfish_Blocks have not, this may make vessels break");
    246. }
    247. if(Cobblestone == true) {
    248. this.log.warning("Cobblestone has been enabled on your server but Silverfish_Blocks have not, this may make vessels break");
    249. }
    250. if(Stone_Brick == true) {
    251. this.log.warning("Stone_Brick has been enabled on your server but Silverfish_Blocks have not, this may make your vessels break");
    252. }
    253. }
    254.  
    255. if (Netherrack == false) {
    256. this.log.warning("Netherrack are disabled in config, turn them on to use Airships");
    257. }
    258.  
    259. if (Daylight == false) {
    260. this.log.warning("Daylight sensors are disabled in config, turn them on to use MarsShips");
    261. }
    262.  
    263. if (Furnace == false) {
    264. this.log.warning("Furnaces are disabled in config, turn them on to use Airships");
    265. }
    266.  
    267. if (Fire == false) {
    268. this.log.warning("Fire is disabled in config, turn it on to use Airships");
    269. }
    270.  
    271. if (Cake == false) {
    272. this.log.info("Cake is a lie");
    273. }
    274.  
    275. getLogger().info(" --------[Ships]-------");
    276.  
    277. Plugin plugin = Bukkit.getPluginManager().getPlugin("Ships");
    278. }
    279. }
    280.  


    Bloki
    Code:java
    1. package Ships;
    2.  
    3. import java.util.TreeMap;
    4.  
    5. public class Bloki
    6. extends Ships
    7. {
    8. static TreeMap<Integer, Boolean> Ships = new TreeMap();
    9.  
    10. public Bloki()
    11. {
    12. // sign
    13. Ships.put(Integer.valueOf(63), Boolean.valueOf(true));
    14. //wall sign
    15. Ships.put(Integer.valueOf(68), Boolean.valueOf(true));
    16. //locked chest
    17. Ships.put(Integer.valueOf(95), Boolean.valueOf(false));
    18. //Slabs
    19. Ships.put(Integer.valueOf(44), Boolean.valueOf(false));
    20. //double slabs
    21. Ships.put(Integer.valueOf(43), Boolean.valueOf(false));
    22. }
    23.  
    24. public static void LoadSettings() {
    25. if(Wooden_Planks == true) {
    26. Ships.put(Integer.valueOf(5), Boolean.valueOf(false));
    27. }
    28. if (Stone == true) {
    29. Ships.put(Integer.valueOf(1), Boolean.valueOf(false));
    30. }
    31. if (Dirt == true) {
    32. Ships.put(Integer.valueOf(3), Boolean.valueOf(false));
    33. }
    34. if (Grass == true) {
    35. Ships.put(Integer.valueOf(2), Boolean.valueOf(false));
    36. }
    37. if (Cobblestone == true) {
    38. Ships.put(Integer.valueOf(4), Boolean.valueOf(false));
    39. }
    40. if (Sand == true) {
    41. Ships.put(Integer.valueOf(12), Boolean.valueOf(false));
    42. }
    43. if (Gravel == true) {
    44. Ships.put(Integer.valueOf(13), Boolean.valueOf(false));
    45. }
    46. if (Gold_Ore == true) {
    47. Ships.put(Integer.valueOf(14), Boolean.valueOf(false));
    48. }
    49. if (Iron_Ore == true) {
    50. Ships.put(Integer.valueOf(15), Boolean.valueOf(false));
    51. }
    52. if (Coal_Ore == true) {
    53. Ships.put(Integer.valueOf(16), Boolean.valueOf(false));
    54. }
    55. if (Wood_Log == true) {
    56. Ships.put(Integer.valueOf(17), Boolean.valueOf(false));
    57. }
    58. if (Leaves == true) {
    59. Ships.put(Integer.valueOf(18), Boolean.valueOf(false));
    60. }
    61. if (Sponge == true) {
    62. Ships.put(Integer.valueOf(19), Boolean.valueOf(false));
    63. }
    64. if (Glass_Block == true) {
    65. Ships.put(Integer.valueOf(20), Boolean.valueOf(false));
    66. }
    67. if (Lapis_Ore == true) {
    68. Ships.put(Integer.valueOf(21), Boolean.valueOf(false));
    69. }
    70. if (Lapis_Block == true) {
    71. Ships.put(Integer.valueOf(22), Boolean.valueOf(false));
    72. }
    73. if (Dispenser == true) {
    74. Ships.put(Integer.valueOf(23), Boolean.valueOf(false));
    75. }
    76. if (SandStone == true) {
    77. Ships.put(Integer.valueOf(24), Boolean.valueOf(false));
    78. }
    79. if (Note_Block == true) {
    80. Ships.put(Integer.valueOf(25), Boolean.valueOf(false));
    81. }
    82. if (Piston_Sticky == true) {
    83. Ships.put(Integer.valueOf(29), Boolean.valueOf(false));
    84. }
    85. if (Web_Block == true) {
    86. Ships.put(Integer.valueOf(30), Boolean.valueOf(false));
    87. }
    88. if (Piston_Normal == true) {
    89. Ships.put(Integer.valueOf(33), Boolean.valueOf(false));
    90. }
    91. if (Piston_Head == true) {
    92. Ships.put(Integer.valueOf(34), Boolean.valueOf(false));
    93. }
    94. if (Gold_Block == true) {
    95. Ships.put(Integer.valueOf(41), Boolean.valueOf(false));
    96. }
    97. if (Iron_Block == true) {
    98. Ships.put(Integer.valueOf(42), Boolean.valueOf(false));
    99. }
    100. if (Bricks == true) {
    101. Ships.put(Integer.valueOf(45), Boolean.valueOf(false));
    102. }
    103. if (TNT == true) {
    104. Ships.put(Integer.valueOf(46), Boolean.valueOf(false));
    105. }
    106. if (Bookshelf == true) {
    107. Ships.put(Integer.valueOf(47), Boolean.valueOf(false));
    108. }
    109. if (Cobblestone_Mossy == true) {
    110. Ships.put(Integer.valueOf(48), Boolean.valueOf(false));
    111. }
    112. if (Obsidian == true) {
    113. Ships.put(Integer.valueOf(49), Boolean.valueOf(false));
    114. }
    115. if (Spawner == true) {
    116. Ships.put(Integer.valueOf(52), Boolean.valueOf(false));
    117. }
    118. if (Diamond_Ore == true) {
    119. Ships.put(Integer.valueOf(56), Boolean.valueOf(false));
    120. }
    121. if (Diamond_Block == true) {
    122. Ships.put(Integer.valueOf(57), Boolean.valueOf(false));
    123. }
    124. if (Wooden_Stairs == true) {
    125. Ships.put(Integer.valueOf(53), Boolean.valueOf(false));
    126. Ships.put(Integer.valueOf(134), Boolean.valueOf(false));
    127. Ships.put(Integer.valueOf(135), Boolean.valueOf(false));
    128. Ships.put(Integer.valueOf(136), Boolean.valueOf(false));
    129. }
    130. if (Crafting_Table == true) {
    131. Ships.put(Integer.valueOf(58), Boolean.valueOf(false));
    132. }
    133. if (Redstone_Ore == true) {
    134. Ships.put(Integer.valueOf(73), Boolean.valueOf(false));
    135. Ships.put(Integer.valueOf(74), Boolean.valueOf(false));
    136. }
    137. if (Snow == true) {
    138. Ships.put(Integer.valueOf(78), Boolean.valueOf(false));
    139. }
    140. if (Snow_Block == true) {
    141. Ships.put(Integer.valueOf(80), Boolean.valueOf(false));
    142. }
    143. if (Clay == true) {
    144. Ships.put(Integer.valueOf(82), Boolean.valueOf(false));
    145. }
    146. if (JukeBox == true) {
    147. Ships.put(Integer.valueOf(84), Boolean.valueOf(false));
    148. }
    149. if (Fence == true) {
    150. Ships.put(Integer.valueOf(85), Boolean.valueOf(false));
    151. }
    152. if (Pumpkin == true) {
    153. Ships.put(Integer.valueOf(86), Boolean.valueOf(false));
    154. }
    155. if (Soul_Sand == true) {
    156. Ships.put(Integer.valueOf(88), Boolean.valueOf(false));
    157. }
    158. if (Glowstone == true) {
    159. Ships.put(Integer.valueOf(89), Boolean.valueOf(false));
    160. }
    161. if (Cake == true) {
    162. Ships.put(Integer.valueOf(92), Boolean.valueOf(false));
    163. }
    164. if (Jack_O_Lantern == true) {
    165. Ships.put(Integer.valueOf(91), Boolean.valueOf(false));
    166. }
    167. if (Redstone_Repeater == true) {
    168. Ships.put(Integer.valueOf(93), Boolean.valueOf(false));
    169. Ships.put(Integer.valueOf(94), Boolean.valueOf(false));
    170. }
    171. if (Glass_Stained == true) {
    172. Ships.put(Integer.valueOf(95), Boolean.valueOf(false));
    173. }
    174. if (Silverfish_Blocks == true) {
    175. Ships.put(Integer.valueOf(97), Boolean.valueOf(false));
    176. }
    177. if (Stone_Brick == true) {
    178. Ships.put(Integer.valueOf(98), Boolean.valueOf(false));
    179. }
    180. if (Iron_Bars == true) {
    181. Ships.put(Integer.valueOf(101), Boolean.valueOf(false));
    182. }
    183. if (Glass_Pane == true) {
    184. Ships.put(Integer.valueOf(102), Boolean.valueOf(false));
    185. }
    186. if (Melon_Block == true) {
    187. Ships.put(Integer.valueOf(103), Boolean.valueOf(false));
    188. }
    189. if (Fence_Gate == true) {
    190. Ships.put(Integer.valueOf(107), Boolean.valueOf(false));
    191. }
    192. if (Brick_Stairs == true) {
    193. Ships.put(Integer.valueOf(108), Boolean.valueOf(false));
    194. }
    195. if (Stone_Brick_Stairs == true) {
    196. Ships.put(Integer.valueOf(109), Boolean.valueOf(false));
    197. }
    198. if (Nether_Brick == true) {
    199. Ships.put(Integer.valueOf(112), Boolean.valueOf(false));
    200. }
    201. if (Nether_Brick_Fence == true) {
    202. Ships.put(Integer.valueOf(113), Boolean.valueOf(false));
    203. }
    204. if (Nether_Brick_Stairs == true) {
    205. Ships.put(Integer.valueOf(114), Boolean.valueOf(false));
    206. }
    207. if (Enchantment_Table == true) {
    208. Ships.put(Integer.valueOf(116), Boolean.valueOf(false));
    209. }
    210. if (Brewing_Stand == true) {
    211. Ships.put(Integer.valueOf(117), Boolean.valueOf(false));
    212. }
    213. if (Cauldron == true) {
    214. Ships.put(Integer.valueOf(118), Boolean.valueOf(false));
    215. }
    216. if (Redstone_Lamp == true) {
    217. Ships.put(Integer.valueOf(123), Boolean.valueOf(false));
    218. Ships.put(Integer.valueOf(124), Boolean.valueOf(false));
    219. }
    220. if (Double_Wood_Slab == true) {
    221. Ships.put(Integer.valueOf(125), Boolean.valueOf(false));
    222. }
    223. if (Wood_Slab == true) {
    224. Ships.put(Integer.valueOf(126), Boolean.valueOf(false));
    225. }
    226. if (Sandstone_Stairs == true) {
    227. Ships.put(Integer.valueOf(128), Boolean.valueOf(false));
    228. }
    229. if (Emerald_Ore == true) {
    230. Ships.put(Integer.valueOf(129), Boolean.valueOf(false));
    231. }
    232. if (Ender_Chest == true) {
    233. Ships.put(Integer.valueOf(130), Boolean.valueOf(false));
    234. }
    235. if (Emerald_Block == true) {
    236. Ships.put(Integer.valueOf(133), Boolean.valueOf(false));
    237. }
    238. if (Command_Block == true) {
    239. Ships.put(Integer.valueOf(137), Boolean.valueOf(false));
    240. }
    241. if (Beacon == true) {
    242. Ships.put(Integer.valueOf(138), Boolean.valueOf(false));
    243. }
    244. if (Cobblestone_Wall == true) {
    245. Ships.put(Integer.valueOf(139), Boolean.valueOf(false));
    246. }
    247. if (Head == true) {
    248. Ships.put(Integer.valueOf(144), Boolean.valueOf(false));
    249. }
    250. if (Redstone_Block == true) {
    251. Ships.put(Integer.valueOf(152), Boolean.valueOf(false));
    252. }
    253. if (Quartz_Ore == true) {
    254. Ships.put(Integer.valueOf(153), Boolean.valueOf(false));
    255. }
    256. if (Quartz_Block == true) {
    257. Ships.put(Integer.valueOf(155), Boolean.valueOf(false));
    258. }
    259. if (Quartz_Stairs == true) {
    260. Ships.put(Integer.valueOf(156), Boolean.valueOf(false));
    261. }
    262. if (Clay_Stained == true) {
    263. Ships.put(Integer.valueOf(159), Boolean.valueOf(false));
    264. }
    265. if (Acacia_Leaves == true) {
    266. Ships.put(Integer.valueOf(161), Boolean.valueOf(false));
    267. }
    268. if (Wooden_Acacia == true) {
    269. Ships.put(Integer.valueOf(162), Boolean.valueOf(false));
    270. }
    271. if (Wooden_Acacia_Stairs) {
    272. Ships.put(Integer.valueOf(163), Boolean.valueOf(false));
    273. Ships.put(Integer.valueOf(164), Boolean.valueOf(false));
    274. }
    275. if (Hay_Bale == true) {
    276. Ships.put(Integer.valueOf(170), Boolean.valueOf(false));
    277. }
    278. if (Hardened_Clay == true) {
    279. Ships.put(Integer.valueOf(172), Boolean.valueOf(false));
    280. }
    281. if (Coal_Block == true) {
    282. Ships.put(Integer.valueOf(173), Boolean.valueOf(false));
    283. }
    284. if (Glass_Pane_Stained == true) {
    285. Ships.put(Integer.valueOf(160), Boolean.valueOf(false));
    286. }
    287. //Experimental Materials
    288. if (Daylight == true) {
    289. Ships.put(Integer.valueOf(151), Boolean.valueOf(false));
    290. }
    291. if (Netherrack == true) {
    292. Ships.put(Integer.valueOf(87), Boolean.valueOf(false));
    293. }
    294. if (Iron_Door == true) {
    295. Ships.put(Integer.valueOf(71), Boolean.valueOf(false));
    296. }
    297. if (Wool == true) {
    298. Ships.put(Integer.valueOf(35), Boolean.valueOf(false));
    299. }
    300. if (Carpet == true) {
    301. Ships.put(Integer.valueOf(171), Boolean.valueOf(true));
    302. }
    303. if (Dropper == true) {
    304. Ships.put(Integer.valueOf(158), Boolean.valueOf(true));
    305. }
    306. if (Rail_Activtor == true) {
    307. Ships.put(Integer.valueOf(157), Boolean.valueOf(true));
    308. }
    309. if (Hopper == true) {
    310. Ships.put(Integer.valueOf(154), Boolean.valueOf(true));
    311. }
    312. if (Redstone_Comparator == true) {
    313. Ships.put(Integer.valueOf(150), Boolean.valueOf(true));
    314. Ships.put(Integer.valueOf(149), Boolean.valueOf(false));
    315. }
    316. if (PressurePlate_Weighted_Heavy == true) {
    317. Ships.put(Integer.valueOf(148), Boolean.valueOf(false));
    318. }
    319. if (PressurePlate_Weighted_Light == true) {
    320. Ships.put(Integer.valueOf(147), Boolean.valueOf(false));
    321. }
    322. if (Stone_PressurePlate == true) {
    323. Ships.put(Integer.valueOf(70), Boolean.valueOf(false));
    324. }
    325. if (Chest_Trapped == true) {
    326. Ships.put(Integer.valueOf(146), Boolean.valueOf(true));
    327. }
    328. if (Anvil == true) {
    329. Ships.put(Integer.valueOf(145), Boolean.valueOf(true));
    330. }
    331. if (Button_Wooden == true) {
    332. Ships.put(Integer.valueOf(143), Boolean.valueOf(true));
    333. }
    334. if (Tripwire_Hook == true) {
    335. Ships.put(Integer.valueOf(131), Boolean.valueOf(true));
    336. }
    337. if (Flower_Pot == true) {
    338. Ships.put(Integer.valueOf(140), Boolean.valueOf(true));
    339. }
    340. if (String == true) {
    341. Ships.put(Integer.valueOf(132), Boolean.valueOf(false));
    342. }
    343. if (Button_Stone == true) {
    344. Ships.put(Integer.valueOf(77), Boolean.valueOf(true));
    345. }
    346. if (Door_Trap == true) {
    347. Ships.put(Integer.valueOf(96), Boolean.valueOf(true));
    348. }
    349. if (Redstone_Torch == true) {
    350. Ships.put(Integer.valueOf(76), Boolean.valueOf(true));
    351. Ships.put(Integer.valueOf(75), Boolean.valueOf(true));
    352. }
    353. if (PresurePlate_Wooden == true) {
    354. Ships.put(Integer.valueOf(72), Boolean.valueOf(true));
    355. }
    356. if (Lever == true) {
    357. Ships.put(Integer.valueOf(69), Boolean.valueOf(true));
    358. }
    359. Ships.put(Integer.valueOf(68), Boolean.valueOf(true));
    360. if (Ladder == true) {
    361. Ships.put(Integer.valueOf(65), Boolean.valueOf(true));
    362. }
    363. if (Door_Wooden == true) {
    364. Ships.put(Integer.valueOf(64), Boolean.valueOf(true));
    365. }
    366. if (Furnace == true) {
    367. Ships.put(Integer.valueOf(62), Boolean.valueOf(true));
    368. Ships.put(Integer.valueOf(61), Boolean.valueOf(true));
    369. }
    370. if (Redstone == true) {
    371. Ships.put(Integer.valueOf(55), Boolean.valueOf(true));
    372. }
    373. if (Chest == true) {
    374. Ships.put(Integer.valueOf(54), Boolean.valueOf(true));
    375. }
    376. if (Torch == true) {
    377. Ships.put(Integer.valueOf(50), Boolean.valueOf(true));
    378. }
    379. if (Fire == true) {
    380. Ships.put(Integer.valueOf(51), Boolean.valueOf(true));
    381. }
    382. if (Bed == true) {
    383. Ships.put(Integer.valueOf(26), Boolean.valueOf(true));
    384. }
    385. }
    386. }
    387.  
     
  4. Offline

    Deleted user

    MoseMister
    Probably because you're extending Ships?
     
  5. Offline

    CeramicTitan

    I agree, I think this is your problem. Also no matter where you put it, == true will always be a redundant check. Also there are else if statements in java
     
  6. Offline

    MoseMister

    so bukkit does not allow to extend classes any more?
     
  7. Offline

    Deleted user

    MoseMister
    You can extend classes. Just not your main plugin class
     
  8. Offline

    MoseMister

    zombiekiller753
    CeramicTitan

    if i take out the extends the integers are not read any more due to the fact that it can not find them any more.

    im new to java so help would be awesome.

    but how would i get the integer values to be read again, without setting a new integer value with the same name?
     
  9. Offline

    Deleted user

    MoseMister

    Either make some getters, or change them all to public
     
  10. Offline

    MoseMister

    zombiekiller753

    did not see your post.
    my main class is the ships class ... can i not extend to it? or should i not use extends JavaProject?
     
  11. Offline

    Deleted user

    MoseMister
    Did you not see my post?

    I know your main class is Ship.

    Either make all the variables public, or make getters for them :/

    MoseMister
    What errors?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 11, 2022
  12. Offline

    MoseMister

    zombiekiller753

    when i remove the extends. all the booleans get a error under them (in eclipse)
    hover over them it wants me to do either
    • create consent
    • create local variable
    • create field
     
  13. Offline

    Deleted user

    MoseMister
    Oh.

    Put 'Ship.' in front of each variable

    MoseMister

    (facepalm)

    Change that to 'Ships.'
    The basic idea is accessing the class.

    MoseMister

    And does it work?

    Also, don't do ==true
    Just do

    if (Ships.Wooden_Planks) {
    }

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 11, 2022
Thread Status:
Not open for further replies.

Share This Page