Inactive [Mech/Fun] FortuneCookie v1.1 - Show you a wise saying, when eating a cookie![1337]

Discussion in 'Inactive/Unsupported Plugins' started by Dark-Panther, Apr 8, 2011.

  1. Offline

    Dark-Panther

    Fortune Cookie - Show you a wise saying, when you enjoy a cookie!
    Version: v1.1

    Back in development!

    Isn't a Fortune Cookie a nice thing? A pearl of wisedom or a prediction about the futur...​
    Wouldn't it be great to have such Cookies on your Server?​
    Here you have it! FortuneCookie show you a message with a interesting sentence...​
    This is my second cookie plugin ;) I like cookies​
    Features:
    • When eating a Cookie, it'll show you a message with a intelligent sentence!
    • 50 pearls of wisedom (with the best of Gandhi & co!)
    Download: FortuneCookie.jar
    Mirror: Attached Files!
    Source Code

    Install: Drop it in your plugin folder and have fun! :D

    TODO:
    • make the sentence configurable
    • Add more pearls of wisedom
    • Any suggestions?
    All versions:

    Show Spoiler




    For more cool Stuff and Informations about this Plugin:
    www.darkpantherx.wordpress.com




    Changelog:
    Version 1.1
    • Bug fix: No annoying error message anymore!
    • Added new sentence!
    Version 1.0
    • First release with the new function of cookies
    Thanks to:
    NOTE: The one, who finds my real name in the sentence of the plugin and post it here can have all early previews of this plugin, when there are any changes! ;)
     

    Attached Files:

    kahlilnc likes this.
  2. Offline

    aPunch

    I am at a loss for words. So simple, yet so awesome. 100% approval from me! :D
     
  3. Offline

    Dark-Panther

    Thank you :D I just hope, that they'll add that plugin to the plugin list ;)
     
  4. Offline

    fernferret

    Any chance of getting that huge array out of the code and into a yml file so people could put their own phrases in? Other than that, great idea!
     
    keeperoflenneth likes this.
  5. Offline

    keeperoflenneth

    Totally. using the YML setup it would be great to have our own fortune text! Plus it would make your ever expanding library of fortunes easier to update ^.^ no recompiling.
     
  6. Offline

    Blocksberg

    I sometimes get this error in my server console:

    Code:
    [SEVERE] Could not pass event PLAYER_INTERACT to FortuneCookie
    java.lang.NullPointerException
            at DarkPantherX.FortuneCookie.Cookieevents.onPlayerInteract(Cookieevents.java:92)
            at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:252)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
            at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:64)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:356)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    00:45:42 [INFO] Haudruffix lost connection: disconnect.endOfStream
    The plugin does work, tho!
     
  7. Offline

    Dark-Panther


    Yeah... I'm a bit new with java, so if anyone would help me with the .yml file, i would do this...
    Because I had the same idea, but I didn't know how to configure the .yml correct...


    Strange, I've never seen this error, while I was testing the plugin... I'll look at the source code, but I can't explain that, 'cause I've never seen it before... :S
     
  8. Offline

    nicholaslimck

    Regarding the name... Ralph? From 'Ralph is bad for your Health'?:D
     
  9. Offline

    TheCubeMaster

    I got build 670
    08:53:22 [SEVERE] Could not pass event PLAYER_INTERACT to FortuneCookie
    java.lang.NullPointerException
    at DarkPantherX.FortuneCookie.Cookieevents.onPlayerInteract(Cookieevents.java:92)
    at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:252)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
    at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:64)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:356)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    08:53:23 [SEVERE] Could not pass event PLAYER_INTERACT to FortuneCookie
    java.lang.NullPointerException
    at DarkPantherX.FortuneCookie.Cookieevents.onPlayerInteract(Cookieevents.java:92)
    at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:252)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:663)
    at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:35)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    I still got a fortune
     
  10. Offline

    Brandi

    ahahaha nice idea
    ahahaha just cant stop laughing
    and im happy cause i have a cookie ^^
    _____________________________________________________________________________
    [coal]<<<<<< cookie verbrannt xDDD
     
  11. Offline

    keeperoflenneth

    I'll see what i can do. I've done a bit of work with java in college, but not alot lol...
    Permissions should have documentation on yml stuff though. I'll see what i can find and get back to you. I peeked at the source, basically it should be something like this i would imagine:
    • 1) read the external file (yml should have stuff on this to parse it)
    • 2) count the number of entries under myQuotes(or w/e you decide to call it)
    • 3) instead of the array you have, set it equal to an array derived from the variable from the yml sheet. if you call the node in it something like "Quotes:" then you would reference it like an array Quotes.quote[23] for the 23rd quote. and just set the limit of your random number to be the total number of available quotes
    again, that's just speculation- i will look into it and see what i find. If any local experts want to beat me to that feel free. haha.

    EDIT:
    Okay, this is what i found from googling. It's basically what i thought- they used a buffered read/write to mess with the yml files, as seen in the FileManager class that Permissions uses. I don't know if you can implement this directly, or what. Up til 5 minutes ago I figured YAML was a Bukkit thing. There are like 4 ports of it to java from other places and it was all very confusing, so if somebody has any info on which one to use by all means--
    Hope that helps some, and good luck! It's officially over my head now haha.
     
  12. Offline

    Dark-Panther

    Man, when it works, you can assume, that nothing bad is happening... I use this plugin too (because I made it ;) )
    I'll look at it, but you dont have to copypaste it two times... but thank you... ;)

    Nearly ;) that was a trick ;) ralph is one of my friends but good try! Try it again! ;)

    Thank you for your poste, I'll look at it later
     
  13. Offline

    themagicalcake

    whats your other plugin
     
  14. Offline

    Dark-Panther

    Cookiez and Eternalapple
     
  15. Offline

    Koutacles

    Re: guessing the name. I've had two fortunes.
    "Tim is with you" (Tim)
    and "Luka is watching" (Luka).
     
  16. Offline

    softaz59

    Hi! Nice Work !

    How can I change the sentence? (english -> French)

    I don't find a file....

    (I am French, sorry for my bad english)
     
  17. Offline

    Dark-Panther

    Right with the first one ;) I'll send you an early message, when I'm done with the version 1.1 ;)
    Is in work, but in the mean time: I'm from switzerland, so I can write and spreak french too. I can change the sentence for you to French...
    Qu'est-ce que tu pense?
     
  18. Offline

    softaz59

    Bonne idée !

    Nice Idea !


    Mais si je veux les changer moi même ? Comment je peux faire ?
     
  19. Offline

    anonymous

    I'll wait until we can configure messages :)

    Lots of spelling mistakes too.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  20. Offline

    woodzy

    is your name Tim?
     
  21. Offline

    Dark-Panther

    Don't blame me, I've got a translator (not google, a real person :p )
    Yes, you got it ;)
     
  22. Offline

    valdark

    working just fine on 706
     
  23. Offline

    woodzy

    WOOT!! when do i get my cookie?
     
  24. Offline

    Dark-Panther

    When I completed the new version of the plugin, you can have it first ;)
     
  25. Offline

    noahwhygodwhy

    you should make a poster, i would defiantly put it on my tag.
     
  26. Offline

    Dark-Panther

    A poster? :) Can you explain me, how you meaned that?
     
  27. Offline

    noahwhygodwhy

  28. Offline

    WhosDaMan

    I will get this when the fortune becomes configurable!

    /bookmark
     
  29. Offline

    Matthew Jay

    Bloody Hell This Seems Cool But I Wanted To Make Up My Own fortunes
     

Share This Page