Solved The inventory wont accept strings

Discussion in 'Plugin Development' started by NortherKnight, Oct 17, 2015.

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

    NortherKnight

    Im trying to name a custom inventory with a string but it gives a whole bounch of errors event tho I check the string before passing it in and it is completed.
    PS: The plugin.mobName contains "§" signs but they work when i write them out
    Code:
    player.sendMessage("       " + plugin.mobName + "'s Rewards!");
    String invName = "       " + plugin.mobName + "'s Rewards!";
    Inventory i = Bukkit.createInventory(null, 9, invName);
    Errors in the console:
    Code:
    [20:05:48 ERROR]: Could not pass event PlayerInteractEntityEvent to IronG v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot_ser
    ver.jar:git-Spigot-fdc1440-53fac9f]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot_serve
    r.jar:git-Spigot-fdc1440-53fac9f]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot_ser
    ver.jar:git-Spigot-fdc1440-53fac9f]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot_ser
    ver.jar:git-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1315) [spigot_serve
    r.jar:git-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:52) [spigot_server.jar:gi
    t-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:11) [spigot_server.jar:gi
    t-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot_server.ja
    r:git-Spigot-fdc1440-53fac9f]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_45]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_45]
            at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot_server.jar:git-Spigot-f
    dc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:714) [spigot_server.j
    ar:git-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot_server.j
    ar:git-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:653) [spigot_server.j
    ar:git-Spigot-fdc1440-53fac9f]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:556) [spigot_server
    .jar:git-Spigot-fdc1440-53fac9f]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
    Caused by: java.lang.IllegalArgumentException: Title cannot be longer than 32 characters
            at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[spigot_server.jar:git-Spigot
    -fdc1440-53fac9f]
            at org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryCustom$MinecraftInventory.<init>(C
    raftInventoryCustom.java:59) ~[spigot_server.jar:git-Spigot-fdc1440-53fac9f]
            at org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryCustom.<init>(CraftInventoryCustom
    .java:32) ~[spigot_server.jar:git-Spigot-fdc1440-53fac9f]
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.createInventory(CraftServer.java:1525) ~[spigo
    t_server.jar:git-Spigot-fdc1440-53fac9f]
            at org.bukkit.Bukkit.createInventory(Bukkit.java:938) ~[spigot_server.jar:git-Spigot-fdc1440
    -53fac9f]
            at com.NortherKnight.irong.MobConstructor.createInventory(MobConstructor.java:69) ~[?:?]
            at com.NortherKnight.irong.MobConstructor.onPlayerInteract(MobConstructor.java:260) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot_ser
    ver.jar:git-Spigot-fdc1440-53fac9f]
            ... 15 more
     
  2. Offline

    MisterErwin

    @NortherKnight
     
  3. Offline

    mcdorli

    1.: You don't own the norhterknight.com domain.

    2.: Inventory can only have 32 letters in it's name

    Edit: Got ninja'd by @MisterErwin
     
  4. Offline

    NortherKnight

    @mcdorli Um is it a problem if i use northerknight.com for my package naming? I mean it is my username :/
     
  5. Offline

    mcdorli

    And? You don't own the domain just because you have it as a username. Use me.northerking or create a github page and use the domain of that. If somebody buys the northerking.com domain, then they can even sue you.
     
  6. Offline

    Scimiguy

    @mcdorli
    He's just a little confused trying to follow the Java Naming Conventions.

    @NortherKnight
    Like dorli said, if you don't have a base domain, use me.________ for your package names
    He also gave you the solution to your inventory problem, so if you could mark this thread solved, that'd be great.
     
  7. Offline

    mythbusterma

    @NortherKnight

    Alternatively, reverses of email addresses are also acceptable.
     
Thread Status:
Not open for further replies.

Share This Page