Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

collapse

Author Topic: Shared Packages - A tool for new plugin developers  (Read 1149 times)

JD9999

  • Plug-in Maker
  • Hero Member

  • Offline
  • ****

  • 738
  • Reputation:
    +44/-0
    • View Profile
Shared Packages - A tool for new plugin developers
« on: June 07, 2015, 04:47:45 AM »
    SharedPackages Help Page!

    Current Version: V1.2.1

    Full Description

    What's in it?
    SharedPackages is a resource for plugin developers to help them write plugins. It contains many useful classes and features that enable developers to do things a lot simpler.

    The current contents are:
    • Converter
    • Date
    • Encoder
    • Exceptions (exceptions already included inside the required package
    • Math
    • MyFirstPlugin
    • Readandwrite
    • Reading
    • Stopwatch
    • TestSharedPackages
    • Timers

    Each package (with the exceptions of the MyFirstPlugin and TestSharedPackages packages) is completely standalone and does not require any other package. Some of the features in the MyFirstPlugin package require the Math package. However, it may not be required for your build.

    The libraries have also been documented, which is available inside the download ZIP.

    As hinted above, SharedPackages has its own built-in tester. By double-clicking the JAR, it will open a GUI with the ability to test each package.
    NOTE: There is no tester for the Stopwatch package and limited testing for the Date and Timer packages. I will try to implement these later.

    What can I do with it?
    The recommended way to use the library is to add the required package(s) into your project. It is also recommenced that these are not subpackages i.e. they are not inside another package as this will mess up imports.

    You can use any feature of the SharedPackages library in your plugin to do whatever you want.

    Errors
    Possible errors have been documented in the library.

    The first thing to do is to run the package's tester. To do this, double-click the JAR file, and press N until the name of your package comes up.

    If there is an error there, report with your OS and version of Java.
    If there is not an error there, please report with your OS, version of Java, and arguments you used to construct the class, as well as the arguments passed to the method that is causing issues.

    Other Features
    • Inside the ReadingTester is a TextPrintStream, that can redirect output and error message to a JTextArea

    You can download the plugin from: http://www.project-rainbow.org/site/index.php?action=downloads;sa=view;id=305

    If you have any problems, questions, or would like some other features, then you can either post them here or with the download, or pm me! :)
    [/list]
    « Last Edit: June 02, 2017, 05:21:52 PM by JD9999 »

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #1 on: July 14, 2015, 05:08:22 AM »
    V0.2 is up! Added BufferedReader, BufferedWriter, and plenty of timers!
    « Last Edit: September 11, 2015, 01:05:47 AM by JD9999 »

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #2 on: September 11, 2015, 12:30:08 AM »
    V0.3 is up! Added RandomAccessFle, Files.file and a stopwatch
    « Last Edit: September 11, 2015, 01:05:58 AM by JD9999 »

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #3 on: June 07, 2016, 01:14:52 AM »
      It's Shared Packages birthday!
      Unfortunately, the update is not quite done yet. However, here are some things to get excited for!

      • Converters! You can now convert an entity to a player, or a specific type of entity. Also, convert a List to a Set and back again! (useful to remove duplicate entries)
      • Astronomical date! If an astronaut ever went to space, what would the time be for them? Set the time they've been away for, and have the difference returned! And not just with numbers...
      • The V0.1 SimpleDate class now has a method to actually get the time.
      • Encoding! You can now encode and decode strings, internally or externally to a file. And make your own!
      • High-level exceptions to display the problem and to be caught simply!
      • Maths! You can do stuff like Pythagoras and Trig in Shared Packages
      • MyFirstPlugin! A few practical classes to make your first plugin simple
      • The V0.1 Readandwrite package has been updated with realistic constructors. NOT COMPATIBLE WITH PREVIOUS VERSIONS
      • Reading, Reading.Instruction, Reading.Practical! A whole bunch of ways to read a file, including reading by separators, searching for a character, or reading something with a Purpose (and a PurposeFormat)
      • Even more timers! Including the new PurposeFileTimer class and the FilePurpose class. And I've fixed something.
      • Web! Read the contents of a website. Or just the text.

      And better yet, each package is individual, so plugin makers only need to put in the package they are using, and users can have one file with all of them.

      Any questions, or if anyone wants a preview, add a reply or PM me!
    « Last Edit: June 07, 2016, 01:22:08 AM by JD9999 »

    Fredashay

    • Plug-in Maker
    • Sr. Member

    • Offline
    • ****

    • 255
    • Reputation:
      +26/-1
    • Personal Text
      "Tira mah! This graw is fredashay!"
      • View Profile
      • ClockPie
    Re: Shared Packages - A tool for new plugin developers
    « Reply #4 on: June 07, 2016, 04:49:50 PM »
    Cool!  That all looks really useful :-)

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #5 on: February 10, 2017, 05:35:28 PM »
    Sorry that it's been so long.
    I have finished writing the main features and the testers, and I have entered bug fixing stage. The features you can expect:

    Converter:
    • Converter that converts a List (ArrayList) to a Set (TreeSet)
    • Converter that converts an entity to a specific type of entity (a custom exception is thrown if the entity is not the specific type of entity
    Date:
    • Astronomical date. Explained in the post above
    • Update to the SimpleDate class for a method that actually gets the time
    Encoder:
    • Three different types of built-in encoders
    • Two interfaces for writing your own encoding
    • An EncoderWriter class to write strings with an encoding (or two encodings - the package supports duel encoding)
    • A LetterEncoding enum that has built in char[] encoding options for TwentySixLetterEncoder
    Math:
    • A package with all the build in exceptions separately. They are included in the package they're related to, but they are also in a separate package if you really like the exception
    • An Algebra class that can complete various functions
    • A Pythagoras class that helps with Pythagoras-related questions
    • A Trig class to help out with Trigonometry-related questions
    MyFirstPlugin:
    • An MC_BlockScanner class to retrieve block(s) from various circumstances
    • An MC_ChunkRecorder to record chunks
    • An MC_EntityCreator class to create whatever entity you want
    readandwrite:
    • Updated constructors with readandwrite package
    • Some methods have been deprecated and will be removed within the next few updates. I will post on the exact version that will happen in
    Reading:
    • The four readers in the Reading package (CharsetReader, ContextReader, FilterReader & Separator Reader) can all be converted to each other using built-in methods. All four readers also can read a File, an InputStream, or a URI
    • CharsetReader to read a string based off a specific charset
    • ContextReader to read a string based of the purpose and possible functions of a string, using the MessagePurpose object. Also methods that define a ProfanitySource object (class that deals with removing profanities) and a PurposeFormat (defining exactly what you expect in a class)
    • FilterReader to read a string and filter it based off the method chosen to read by (examples include readExceptLines(List<String> badLines) and removeLetter(char))
    • FilterReader also has static methods to either remove or asterik words from a string
    • MessagePurpose class that handles using the format of the string to convert it into a more accurate and updated string
    • ProfanitySource for locating and storing profanities. They can all be updated as well
    • Purpose for redirecting the error and output stream. You can then send text to the error or output streams using the methods provided
    • PurposeFormat for defining the format of the text.
    • SeparatorReader for reading a string up to a point or reading it and separating it based on criteria
    • There is a Reading.minecraft package which has a MessagePurpose and a PurposeFormat class to include options for players.
    Timers:
    • filetimer class now has a public count variable, which counts the amount of times the timer has gone off since start. However, the filetimer class has also been deprecated.
    • PurposeFileTimers that reads off either a File or an InputStream and, on completion, executes a TimerPurpose (Explained below). Option for a repeating timer
    • There is a TimerPurpose interface. You would write either a class or an inner class that implements Timers.TimerPurpose. Your class must implement the execute() method.

    Miscellanious
    • A package with all the build in exceptions separately. They are included in the package they're related to, but they are also in a separate package if you really like the exception
    • There are now testers for each package located in the TestSharedPackages package. You can also double-click the SharedPackages.jar as a normal application and it will run.

    Possible additions
    • Constructors for MessagePurpose that automatically redirect the error and output streams (similar to Purpose(String, PrintStream, PrintStream))
    • Add constructors in PurposeFileTimer that supports URI

    Bugs
    • If a MessagePurpose or a PurposeFormat is specified using either CONTAINS_DATE or CONTAINS_DATE_AND_OTHER_VARIABLES, the date will only be correctly properly if the format is dd/mm/yy
    • ContextReader does not support any of the Reading.minecraft classes / unique variables
    • Possible bug with advanced calculations for Astronomical class
    • Exception with AllEncoderBasic (a type of encoder)
    • Possible error with getting the side length of a square in the Pythagoras class
    • Possible error with getting the size of an angle in the Trig class
    • Possible error with getting the length of a side in the Trig class
    • Exception with BufferedReaderTest reading the first line of a file
    There are also numerous bugs in the Reading package, but I have to fix up the tester first.
    Note that all of the features above are subject to removal if the bugs cannot be fixed for that feature.

    There is no Web package because I couldn't get it to work the way I wanted it to. Nor is there a Reading.Instruction or Reading.Practical. I don't remember why I removed those, but it wouldn't have just been for nothing.

    Thank you all for your patience :)

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #6 on: April 20, 2017, 09:34:39 PM »
    I have great news! It is out of bug fixing stage and is into release stage!

    I will be adding a couple of minor things for consistency, or removing a little bit of code clutter, as well as adding Javadoc to it. Other than that, it's ready!

    Reading.Minecraft has been removed (as well), but that only had copies of classes inside the Reading package with slight changes for players. Everything else seems to exist (since my last post).

    When I release it, it will be as a ZIP file, with each package as well as the whole thing. I will also be releasing all my code on GitHub when complete.

    Enjoy! :)

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #7 on: May 16, 2017, 01:51:08 AM »
    SharedPackages V1.0 is up!

    Thanks for all your patience!
    « Last Edit: May 19, 2017, 05:43:35 PM by JD9999 »

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #8 on: May 20, 2017, 05:08:08 PM »
    V1.1.2 is up! Fixed a bug in the RW4 encoder which would cause some characters not to be encoded and decoded correctly!
    « Last Edit: May 27, 2017, 12:45:27 AM by JD9999 »

    JD9999

    • Plug-in Maker
    • Hero Member

    • Offline
    • ****

    • 738
    • Reputation:
      +44/-0
      • View Profile
    Re: Shared Packages - A tool for new plugin developers
    « Reply #9 on: May 30, 2017, 02:12:48 AM »
    V1.2.1 is up! Fixed a bug in ListConverter and Converter where an empty list/set would throw a StringIndexOutOfBoundsException

    V1.2 is up! Added a toString(String) method to the ListConverter and SetConverter classes to have a custom split between each element in the list!
    « Last Edit: June 02, 2017, 05:21:33 PM by JD9999 »

     

    * Notifications

    * Member Info

     
     
    Welcome, Guest. Please login or register.
    Did you miss your activation email?

    * Recent Topics

    Re: Starting a server by Tanigu
    [June 27, 2017, 02:35:21 AM]


    Re: Run.bat not working by JD9999
    [June 09, 2017, 09:41:44 PM]


    Run.bat not working by Stillkill
    [June 09, 2017, 07:43:13 PM]


    Re: Rainbow 1.12 by CodeCrafter47
    [June 07, 2017, 04:39:11 PM]


    Re: Rainbow 1.12 by stevenwnt
    [June 07, 2017, 04:36:42 PM]

    * Forum Stats

    • stats Total Members: 3568
    • stats Total Posts: 12255
    • stats Total Topics: 1652
    • stats Total Categories: 5
    • stats Total Boards: 16
    • stats Most Online: 568