Skip to content

Custom Dragon Templates!

Pre-release
Pre-release
Compare
Choose a tag to compare
@2008Choco 2008Choco released this 16 Aug 20:49
· 275 commits to master since this release

Overview

This update has been a while in the working and even at this point, I'm not certain if everything is up-to-par and fully functional. Due to such uncertainty, this release will be labeled as "BETA" and bugs should be expected. A lot of the code base has changed from 1.3.2 to 1.4.0 so things may not work properly. Now is worth noting that if you experience ANY issues, please create an issue in the Issue Tracker so I may see it. The next few versions may be beta builds to fix bugs over time and add a few more new features.

DISCLAIMER: Use this version at your own risk! Please report bugs as soon as possible so they may be fixed

Changelog

  • Dragons may now be created by making a YAML file in the "dragons" folder. They will be parsed, loaded and used when a dragon is spawned in the end! (Examples are provided by default) - Suggested by KnifeKat over on SpigotMC
  • Added a "/template" command containing a few useful features for the new dragon templates
  • Reorganized the package structure a lot, and removed a few unnecessary classes
  • Fixed potential NullPointerExceptions if no loot was loaded
  • Removed a bit of debugging code to do with particle shapes (i.e. "Now Using Open-Ended Helix")
  • Removed unnecessary runnables and handled them elsewhere. May improve efficiency
  • Removed the use of the "loot.yml". You may delete this from the file system as it will not be used
  • Removed the "/dragoneggdrop addloot" subcommand in place of "/template edit addloot"
  • API: Added a new DragonLoot class to manage loot for all dragon templates
  • API: Removed all methods / classes related to LootManager and LootEntry. Central loot management was not needed anymore
  • API: All DragonTemplate fields contain setters that may optionally update the template files
  • API: Added a bunch of methods to various different classes:
    • static RandomCollection#copyOf(RandomCollection) - Copy a random collection
    • RandomCollection#stream() - Create a Stream on the values of the collection
    • RandomCollection#size() - Get the amount of values in the collection
    • RandomCollection#toCollection() - Return a Collection containing all values in the RandomCollection
    • DragonTemplate#getLoot() - Get the loot handler for the template
    • DEDManager#clearTemplates() - Clear all loaded templates from the manager
  • Creating a Dragon

    The main goal for this update was to allow for custom dragons and spawning customizable loot for each and every individual dragon. By default, there are 12 dragons with a few preset values. The loot for some of the dragons only contains sticks with examples on how you may configure the items and in what format they should be. To create your own dragon you may copy and paste or edit an existing dragon file (note that file names must not contain spaces):

    image

    When you open the copied file, you should see some configuration options similar to those below (evidently they will vary depending on which file was copied):

    image

    These options should seem rather familiar because they were originally in the config.yml and used as global configuration options for all dragons. These are now per-dragon and will be used individually. The only difference is the "loot" section which is a slight modification of the loot.yml. Here is a brief overview of each option:

    dragon-name: The name of the dragon above the boss bar. Colour codes are supported
    bar-style: The boss bar style. A list of all possible values may be found here
    bar-color: The boss bar colour. A list of all possible values may be found here

    egg-spawn-chance: The chance that a dragon egg will spawn on the portal
    egg-name: The name to display on the egg. "%dragon%" is a placeholder that will be replaced with the "dragon-name" configuration option
    egg-lore: The lore to display on the egg. "%dragon%" is a placeholder that will be replaced with the "dragon-name" configuration option

    chest-spawn-chance: The chance that a loot chest will spawn in place of an egg. If an egg chance is also provided and both are successful, the chest will spawn loot as well as a dragon egg within the chest
    chest-name: The name of the chest
    min-loot: The minimum amount of loot capable of being generated
    max-loot: The maximum amount of loot capable of being generated

    announce-respawn: Whether to announce in chat that the dragon has respawned
    spawn-weight: The weight that this dragon may spawn. Supports decimal values

    loot: A list of all the loot. Each loot must be categorized with an arbitrary tag (i.e. '1', '2', '3', 'potato'). This is due to the limitation of YAML syntax

    Once everything has been properly configured, start the server and the file will be parsed and loaded. If your server is already running, running "/ded reload" will also re-parse and load all templates from file. That's it! A new dragon was made!