Inactive [EDIT] Copycat v1.0 - Render images from a URL [1.4.6-R0.4]

Discussion in 'Inactive/Unsupported Plugins' started by Javanator, Apr 12, 2011.

  1. Offline

    Javanator

    Copycat - Image to Block Renderer [1.4.6-R0.4]


    Version 1.0
    Sorry for the inconvenience, but I have moved the home of the plugin to this location to here.


    Version: v1.0

    Description:
    Copycat allows players to render images from a URL into the Minecraft world. Just target a block and type a command. I don't do documentation very well, but /cc help should be enough for you to figure it out. Configuration is XML based and human friendly for manual editing.

    Features:
    • Player defined shortcuts
    • World restriction
    • Administrative enablement/disablement
    • Administrative size clamping (in XML based config)
    • Transparency support
    • Block Profile support
    • Horizontal or vertical image orientation
    Download Here

    Source Code (SVN):
    https://bukkit-modders.googlecode.com/svn

    Having Trouble?
    If you are having trouble getting the plugin to work, you need to post some descriptive information, such a stack trace, what you were doing, command used, etc. Otherwise, you are most likely going to be ignored.

    Changelog:

    Version 0.6
    • Updated to conform with 1.2.3 API
    • Added a couple new blocks
    • Please delete your pluginConfig.xml to get support for the latest blocks
    Version 0.5
    • Performance and memory improvements
    • fixed help
    Version 0.4
    • Finally got horizontal image orientations to work.
    • Added fully parameterized image draw (not documented in help)
    • Removed memory resident config (no more reload necessary after editing .xml)
    • Added the ability to change the trigger command
    Version 0.3
    • Added block profile support in pluginConfig.xml
    • Fixed transparency loss on image scaling for palette based images (png and gif)
    • Added image scaling capabilities /set dimensions <width> <height>
    • Increased default image size and improved reliability in large image handling
    • DELETE your old pluginConfig.xml so that it is regenerated with a new one to support the new features
    Version 0.2
    • Delete your old .jar. I am now using a new filename for releases. CopyCat.jar
    • Fixed server path with spaces bug
    • changed command trigger from /copycat to just /cc
    • provided more helpful help and better argument checking
    • Added operator undo /cc op undo <playername>
    • Added config reload /cc op reloadConfig
    Version 0.1
    • Initial Release
    Usage Info:

    Target a block, which will become the lower left corner of your image. Then type the magic words:
    /cc mario or /cc shortcut copy mario

    Horizontal/Flat image orientation is based on your look angle. Look down enough at your targeted block and the image will be rendered beneath your feet.

    I added support for fully parameterized drawing. Use it at your own risk. I've tested it, but am unsure how it would work if coordinates for unexplored map areas are used, etc. The format for this is:
    • /cc shortcut copy <shortcut> <X> <Y> <Z> <yaw> <pitch>
    • Yaw is a rotation angle 0 < 360 degrees. It will be snapped to the nearest 90 degree angle
    • Pitch is the up/down angle. Use a number > 45 degrees to orient the image flat
    You may also change the command trigger from /cc to something else. To do this follow the below:
    1. Extract the contents of the CopyCat.jar -- Its just a zip file! rename it to .zip
    2. Edit the plugin.yml file
    3. change cc to whatever you like.
    4. Repack the .zip and rename to .jar again with your edited .yml file.
    I've set a reasonable maxImageWidth and maxImageHeight in the default pluginConfig.xml. If you increase it, beware. This will make your server cry for mercy. For example, a 300x300 image means changing 90,000 blocks, which is a pretty heavy operation.


    2011-07-21_18.20.37.png
    2011-07-18_10.18.03.png
     

    Attached Files:

  2. Offline

    rmb938

    Can you add a scale option? Right now the images are huge
     
  3. Offline

    Javanator

    Yes, I already have plans to put that in the next release.
     
  4. Offline

    MarsXTC

    Is there a way to like, increase the text you can write? Sometimes Im trying to finish out a image, but it has a few characters missing so it does not work,
     
  5. Offline

    Javanator

    The minecraft client chat window doesnt wrap so you just have to keep typing blindly and hope you get it right. You can also use one of those URL shortening services like tinyurl or bit.ly for your images. I know this kind of stinks, but I cant think of an easy solution.

    If you're a server admin, you can edit the plugin config file directly and just copy/paste. Once you do that you can do /cc op reloadConfig to activate it. This is what I do during my testing because I need to wipe out the config a lot if i am adding features.
     
  6. Offline

    MarsXTC

    I just checked the plugins folder, i guess I can just blindly type, but when I do /cc shortcut spongebob(lolyes) Copy it doesnt show up, and its a JPG file.
     
  7. Offline

    Javanator

    Is that the exact command you are using? The syntax is /cc shortcut copy myshortcut Alternatively, after making your shortcut you can also do /cc myshortcut and it will copy as well. I am not sure what the behavior is if a shortcut name has parentheses in it. I think it should be OK, but might need special encoding if pasted directly into the XML file. I would avoid it in any case. Also, your shortcut names cannot have spaces in it because spaces are used to separate command arguments.
     
  8. Offline

    MarsXTC

    I dont do the lolyes part, I just wanted to point out , LOL Yes I did one of spongebob. I dont have any shortcut names in it

    13:10:35 [SEVERE] Exception in thread "pool-1-thread-2"
    13:10:35 [SEVERE] java.lang.NullPointerException
    13:10:36 [SEVERE] at org.bukkit.craftbukkit.TextWrapper.wrapText(TextWrapp
    er.java:33)
    13:10:36 [SEVERE] at org.bukkit.craftbukkit.entity.CraftPlayer.sendMessage
    (CraftPlayer.java:83)
    13:10:36 [SEVERE] at org.bukkitmodders.copycat.CopycatCommand.performComma
    nd(CopycatCommand.java:73)
    13:10:36 [SEVERE] at org.bukkitmodders.copycat.AbstractCopycatCommand$1.ru
    n(AbstractCopycatCommand.java:46)
    13:10:36 [SEVERE] at java.util.concurrent.ThreadPoolExecutor$Worker.runTas
    k(Unknown Source)
    13:10:36 [SEVERE] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Un
    known Source)
    13:10:36 [SEVERE] at java.lang.Thread.run(Unknown Source)
    Thats wha tI get
    Im not sure if that happens for every image I do. but the spongebob one just wont show up.

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

    Malchus

    Does this support permissions? Because I am the owner and an op with the permission node * and every time i type /cc help it just keeps referencing me to type /cc help. :p I do not understand.
     
  10. Offline

    DeanDip

    How does transparency work? I just tried a gif and a png image with transparency in it, and with both of them, the transparent area was made into black wool.
     
  11. Offline

    Javanator

    i
    One of the more recent builds seened to break ops.txt for me. I was in it and wasnt really an op. This link helped me out:
    http://webcache.googleusercontent.c...d=1&hl=en&ct=clnk&gl=us&source=www.google.com Its a google cache link, because the normal link required forum signup to view.

    The short of it is that I had to make myself an OP via the console. I dont know if the ops.txt is still used or not. I didnt bother to play with it, but i suspect it isnt.

    I used a JPEG to test, but I don't think the encoding matters. If you can give me links to some images i can check them out.

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

    DeanDip

  13. Offline

    HowDareYouKitty

    v0.2 Sometimes crashes my server, Also /cc undo crashes my server too lol
     
  14. Offline

    Javanator

    While i am sorry that it crashes your server, just saying that it crashes your server is of little help in determining a cause and getting it fixed. if you have some logs, the error messages within would be most helpful, along with the circumstances surrounding the crash (what you were doing), build version, etc. I don't purposely make it buggy, but it is less than a week old and being only 1 person, I test it as best as I can with what I have. I cannot account for all permutations of other plugins, build versions and other variables out in the wild.
     
  15. Offline

    derchris

    I have the same transparency problem.
    Here is a GIF which has transparency enabled:

    http://myminecraft.eu/pics/le-chuck.gif

    But as with the other users, showing as black wool.
    Haven't tried PNG or JPEG yet.

    Edit: Must be the GIF format. A PNG version is working.
     
  16. Offline

    MrKlassic

    everytime i type /cc help it says type /cc for help ?! plz help me
     
  17. Offline

    Juze

    *Facepalm* Do what it says. /cc
     
  18. Offline

    MrKlassic

    yea still when i type /cc help it says /cc help samething

    everytime i type a command with the url it says type /cc help for help

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

    KyGreatwind

    how did you set it up, because im using craftbukkit build 677 and it just dosnt work
     
  20. Offline

    Vinnie

    When i try to do anything it just tells me to type /cc help.. D:
     
  21. Offline

    Brycey92

    CB[677]
    TYPING "/CC HELP" RETURNS "TYPE /CC HELP FOR HELP"!!! IT DOESN'T WORK AT ALL!!!
    Yes, the big, bold, red, underlined, all caps text is warranted here.
     
    MrKlassic likes this.
  22. Offline

    Javanator

    Good for you, now how about providing some useful information? Since it is obviously working for some people in this form, maybe you could provide a server log? Build version? Anything remotely useful?
     
  23. Offline

    Brycey92

    My CB build is [677]
    and my CopyCat is 0.2.

    22:51:57 [INFO] Brycey92 issued server command: copycat copy bumpty
    22:51:57 [SEVERE] Error processing command
    javax.xml.bind.DataBindingException: javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:131)
    at org.bukkitmodders.copycat.managers.ConfigurationManager.<init>(ConfigurationManager.java:33)
    at org.bukkitmodders.copycat.Plugin.getConfigurationManager(Plugin.java:41)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.doCopy(CopyCatPlayerListener.java:230)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.performCommand(CopyCatPlayerListener.java:70)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.access$000(CopyCatPlayerListener.java:31)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener$1.run(CopyCatPlayerListener.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:503)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:204)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:179)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:230)
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:128)
    ... 12 more
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:200)
    ... 15 more
    22:51:57 [SEVERE] Error processing command
    javax.xml.bind.DataBindingException: javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:131)
    at org.bukkitmodders.copycat.managers.ConfigurationManager.<init>(ConfigurationManager.java:33)
    at org.bukkitmodders.copycat.Plugin.getConfigurationManager(Plugin.java:41)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.doCopy(CopyCatPlayerListener.java:230)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.performCommand(CopyCatPlayerListener.java:70)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.access$000(CopyCatPlayerListener.java:31)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener$1.run(CopyCatPlayerListener.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: Content is not allowed in prolog.]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:503)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:204)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:179)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:230)
    at javax.xml.bind.JAXB.unmarshal(JAXB.java:128)
    ... 12 more
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:200)
    ... 15 more
     
  24. Offline

    Javanator

    This is useful information. It looks like there is something in your .xml configuration file that is causing the error. Can you please upload it? The stack trace mentions the XML prolog. This is the portion of XML that has something like the below. Also of help would be your operating system and Java version if you know it. I am using the Sun/Oracle JDK but I do know that other Java implementations sometimes have trouble with UTF-8.
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
     
  25. Offline

    Brycey92

    I'm running the latest version of Mac OS X Snow Leopard, so Java should be up to date. The xml is attached.

    Update: I deleted the xml file and tried again. Here is the log.

    23:13:34 [SEVERE] Nag author: '<NoAuthorGiven>' of 'CopyCat' about the following: onPlayerCommandPreprocess has been replaced with a new signature, (PlayerCommandPreprocessEvent)
    23:13:34 [SEVERE] Nag author: '<NoAuthorGiven>' of 'CopyCat' about the following: onPlayerCommandPreprocess has been replaced with a new signature, (PlayerCommandPreprocessEvent)
    23:13:55 [SEVERE] Error processing command
    java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.performCommand(CopyCatPlayerListener.java:67)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.access$000(CopyCatPlayerListener.java:31)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener$1.run(CopyCatPlayerListener.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    23:13:55 [SEVERE] Error processing command
    java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.performCommand(CopyCatPlayerListener.java:67)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener.access$000(CopyCatPlayerListener.java:31)
    at org.bukkitmodders.copycat.listeners.CopyCatPlayerListener$1.run(CopyCatPlayerListener.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
     

    Attached Files:

  26. Offline

    Javanator



    I looked at your config. You did a manual edit that was wrong. You edited the XML example snippet rather than your actual player.

    See below:
    Code:
        <preferences>
            <playerPreferences playerEnabled="false" playerName="examplePlayer">
                <buildmode>wool</buildmode>
                <shortcuts>
                    <!--  Dont edit this. This is just an example -->
                    <shortcut url="http://aurl" name="shortuctname" />
                    <shortcut url="file://aurl" name="anothershortuctname" />
                </shortcuts>
            </playerPreferences>
            <playerPreferences playerEnabled="true" playerName="Brycey92">
                <shortcuts>
                <!--  This is your player -->
                    <shortcut url="http://www.mariowiki.com/images/0/0d/Paper_Bumpty.png"
                        name="bumpty" />
                </shortcuts>
            </playerPreferences>
        </preferences>
    And here it is:
    bumpty-ss.png
     
  27. Offline

    Brycey92

    How did you do that?
    Are you using a newer version of the plugin?
    When I try "/cc copy bumpty" it says "type /cc help for help"
    and when I use "/copycat copy bumpty" it says "Unknown console command. Type "help" for help."
    the only thing that works is "/copycat help".
    HELP!!!
     
  28. Offline

    Javanator

    I think you may have two plugin versions installed. The latest plugin should no longer respond to /copycat commands. only /cc. So to fix it, you have to delete the old .jar file. Starting with this version, i changed to a fixed filename instead of a versioned filename for release so future versions will not have this problem.

    It would probably be a good idea to remove the .xml file also.
     
  29. Offline

    Brycey92

    *Facepalm*
    I deleted the old jar file and it works! Thank you so much for your help!
     
  30. Offline

    dwmcc

    Installed Copycat v0.1 (current latest) on Bukkit v677 with Minecraft Server 1.4. Works beautifully. The option of image scalability would be nice, still a wonderful plugin. Plugin pic attached.[​IMG]
     
  31. Offline

    Javanator

    "Works beautifully" is all i was aiming for in 0.2 release. The recent craftbukkit updates really slowed things down a bit but i'm on track again. Next release should be coming around the weekend. I already have build profiles working so that you can configure different block types (administratively in xml) for the image rendering. The image scaling is also mostly in there. I also think i know what's going on with the hit-miss transparency rendering and will attack that soon.

    I wish i could say that I also can get images to render oriented horizontally instead of just vertically, but that is wishful thinking. Matrix maths i used to know 10 years ago are no longer with me. But maybe after knocking the other awesome features out, i can concentrate on it and make it work through pure strength of will.
     
    dwmcc likes this.

Share This Page