Recommended Build & Update Guide (1.7.10 - 1.13.1)

Discussion in 'CommandHelper' started by PseudoKnight, Jan 13, 2015.

  1. PseudoKnight

    PseudoKnight Well-Known Member Developer

    Recommended Builds
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [CommandHelper v3.3.3-SNAPSHOT]
    This build supports any Bukkit based server for MC versions: 1.13.1 -

    [CommandHelper v3.3.2]
    This version supports any Bukkit based server for MC versions: 1.7.10 - 1.12.2

    Downloads are no longer available for Minecraft versions older than 1.7.10, but you can build from source from the last time CH supported that version.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    See the bug tracker for known issues
    -------------------------------------------------------------------------------------------------------------------------------------------------
    Update Guide
    Updating to new builds of CommandHelper can sometimes require updates to your scripts and/or extensions. This is not always obvious by the commit messages. Below is a reverse chronological guide to help you with some of these changes to quickly update your code.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [Bukkit/Spigot 1.13.1]
    Block/item numeric ids are no longer guaranteed to be accurate and many material names are changed, though these will be temporarily supported as inputs to functions for some time. This has several consequences that you'll need to address in your scripts.

    Item Array Format Changes
    While you can still input old item arrays, the output of item functions and events has been changed to reflect changes in Minecraft.

    Where previously you might get an item array object in this format:
    PHP:
    {name: BOW, type: 262, data: 81, qty: 1, enchants: {{elevel: 1, etype: DURABLITY}},
    meta: {display: null, lore: null, enchants: {{elevel: 1, etype: DURABILITY}},
    unbreakable: false, flags: {}, repair: 1}}
    Now it will return an array object in this format:
    PHP:
    {name: BOW, qty: 1, meta: {damage: 81, display: null, lore: null, unbreakable: false,
    enchants: {unbreaking: {elevel: 1, etype: DURABILITY}}, flags: {}, repair: 1}}
    Note that the keys "type", "data" and "enchants" were removed from the parent array. The old "type" numeric id has been replaced by "name". The "data" value is only relevant for item durability now, so this was moved into the meta array under the key "damage", and is only present if the item is damageable. (ie. if max durability is above 0) The "enchants" key was redundant to the one in the meta array, and its format has been modified to reflect how you can't have more than one enchantment of the same type. It now uses minecraft names for enchantment keys too, to be easier to use. (old names and format are still accepted)

    Some specific item meta keys have changed as well. For banners, "basecolor" has been removed as it's defined by the banner item name. (eg. "RED_BANNER") Similarly, spawn eggs no longer have the "spawntype" key because that's defined by the material name too. (eg. "BAT_SPAWN_EGG") The map "data" key has been replaced with a meta key "mapid".

    Many material names under the key "name" have been changed, but will always be converted as long as they don't have a name conflict. Most critically, you should probably address any item array with the "data" key, as these best indicate possible conversion problems. For any hard-coded item arrays, delete the "type" and "data" keys (their presence indicates a legacy item array and will be attempted to be converted) and rename the "name" key to the new material name. The new materials names are the same as in the Minecraft wiki and in-game, but they are also listed here. You can move the damage value into the meta array if needed. A convenience function convert_legacy_item() will take an old item array and output a new item array. This is useful for updating items that might be stored in a persistence database. The function data_name() now accepts old material names, ids and string formats and converts them to modern material names. This is useful for conversion of databases or maybe user input.

    Biome Names Changed
    These now better reflect their minecraft names. If you use get|set_biome() functions, you can look up these new enums with reflect_pull('enum', 'BiomeType') or in the documentation.

    Painting Names Changed
    Two paintings just had a space added to them: BURNING_SKULL and DONKEY_KONG.

    Item/Block String Format Deprecated
    The "0:0" format is no longer guaranteed to be accurate, so it's deprecated wherever it's used. In most case you will be warned on compile time if you use these anywhere. If not, you will be warned in the log at runtime, but the item/block will be attempted to be converted. Notably, get|set_block_at() has been deprecated for get|set_block(). If you need to read or write block data, the get|set_blockdata_string() functions are available until further functionality is added. These use the same format as vanilla block commands.

    Changed DyeColor "SILVER" to "LIGHT_GRAY"
    This now matches vanilla and material names to be easier to use. SILVER is still accepted and will be converted, but is discouraged.

    Recipe Keys Required
    Recipes now require a key to be added, where previously it was optional and randomly generated. This should just be a unique name describing the recipe you're adding. (eg. 'key': 'ice_to_packed_ice') Recipe ingredients, of course, should use item arrays instead of the string formats.

    CommandBlock Changes
    In addition the vanilla changes to commands, they no longer automatically process selectors for plugin commands. You will have to implement them yourself if you need this behavior. Though I'm thinking of creating an extension for this or something.

    Event Removals
    Tab_complete_chat is removed because clients no longer send these to the server. Player_prelogin_event is removed because it was deprecated in Bukkit due to syncing issues, and it's mostly redundant to player_login.

    Sound Changes
    Pre-1.9 sound names are all removed and some post 1.9 sounds have been updated to reflect 1.13. However, these will not cause scripts to fail. Instead, it will warn in the log and continue running. play_named_sound() always behaved like this, but silently. play_sound() will now simply warn you if the sound didn't play because the name is incorrect. You can refer the Minecraft wiki or this bukkit page for the complete list. You can also use reflect_pull('enum', 'Sound') to get the list in a script.

    Event Data Changes
    The following events' prefilters, event data, and/or mutable data were updated: piston_retract, piston_extend, block_break, block_place, block_burn, block_ignite, block_from_to, block_dispense, block_grow, note_play, block_fade, item_despawn, item_spawn, item_drop, item_pickup, entity_change_block, entity_interact, inventory_click, inventory_drag, item_swap, player_interact, and vehicle_collide. While some of these are obvious or may not affect you, please refer to the event documentation to update your prefilters and which keys you're reading from. A common theme is "item" prefilters are changed to "itemname", and like "block" keys and prefilters, now use the material name instead of the item/block string format. (eg. "0:0") In a special case in player_interact, if you want to check if they didn't click a block, check where "block" equals null. These are sensible but extensive changes, so I may add a list here later. Searching for "data" in general or "item" in prefilters will help fix a lot of them.

    Other Changes
    There are a number of other changes, but less critical to this guide. If you focus on the above changes, everything else will be easier.

    Extension Compatibility
    These extensions need to be updated to support CommandHelper 3.3.3 and Minecraft 1.13. If not included in this list, it probably does not need to be updated.
    - SKCompat: 3.0.0
    - CHSpigot: 2.0.0
    - CHCitizens: 1.1.7
    - CHVirtualChests: 1.0.6 (or use CH builtin virtual inventories)
    - CHNaughty: 3.10.2
    - CHCitizens: 1.1.7
    - CHWorldGuard: 1.1.1 (region_change event)
    - CHLogBlock in progress

    -------------------------------------------------------------------------------------------------------------------------------------------------
    [CommandHelper Build #3246]
    - CHAdvanced: will not be updated
    CHAdvanced no longer supports build 3246 or higher. The server_command event is now built into the CommandHelper core. The file list function can be replaced by CHFiles extension or equivalent.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [Bukkit/Spigot 1.12.1]
    CommandBlocks now call aliases without needing /runalias. So if you have an alias for a vanilla command and CommandBlocks that use the vanilla command, it may break. A manual fix is to add the "minecraft:" prefix to those commands in the affected CommandBlocks. (eg. /fill to /minecraft:fill) Note: this does NOT affect CommandBlocks that already use /runalias or vanilla commands that do not have aliases.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [Bukkit/Spigot 1.11.2]
    You can no longer set_exp() above 100. In 1.11.2, setting exp to exactly 100 will now give that player a new level and reset exp to 0%. Set to 99 to avoid this.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [Bukkit/Spigot 1.11]
    Minecraft changed entity subtypes to be their own entity type. You may need to search for instances of "guardian", "skeleton", "zombie", and "horse". Changing an entity's subtype using set_entity_spec() is no longer supported. Also if you're checking for an entity type in an event bind, you'll need to update that to include a list of all subtypes. (Example: instead of "HORSE" you'll need to check for "HORSE", "MULE", "DONKEY", "ZOMBIE_HORSE", "SKELETON_HORSE", and/or "LLAMA".)
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [Bukkit/Spigot 1.9]
    One or two player_interact events will fire now with the addition of the off_hand. If two, it's one for each hand. If one, it might be the main_hand or off_hand. Some scripts need to be considered for double event firing. Any script that looks at the item array will need to be updated for off hand support.
    -------------------------------------------------------------------------------------------------------------------------------------------------
    [CommandHelper Build #3042]
    These extensions versions (or higher) are compatible with CH builds 3042+.
    It is almost always recommended to use the latest builds unless you're using old versions of MC, CH, or respective plugins.
    - CHServerCommunication: 0.0.2 (#17)
    - SKCompat: 2.0.0 (#24)
    - CHVault: 2.0.0 (#11)
    - CHPerms: 2.0.0 (#13)
    - CHVirtualChests: 1.0.5 (#11)
    - CHSpigot: 1.4.3 (#16)
    - CHDynmap: 1.1.3 (#10)
    - CHCitizens: 1.1.5 (#11)
    - CHPlotSquared: 0.1.1 (#1)
    - CHStargate: 1.0.2 (#7)
    - CHVotifierListener: 1.0.2 (#2)
    - CHGCC: 1.0.2 (#1)
    - CHPython: 1.0.2 (#5)
    - CHJavascript: 1.0.2 (#10)
    - CHGroovy: 1.0.2 (#10)
    - CH-mcMMO: 0.1.0 (#6)
    - CHDangerous: 1.0.2 (#7)
    - CHHTTPd: 0.0.2 (#23)
    - CHGriefPrevention: 1.2.1 (#6)
    - CHPex: 1.1.1 (#9)
    - CHTag: 1.0.2 (#7)
    - CHBarAPI: 1.0.1 (#7)
    - CHPluginManager: 1.1.0
    - CHWorldGuard: 1.1.0 (#21)
    - CHIRC: 0.0.0 (#8)
    - CHLogblock: 0.1.1 (#5)
    Last edited: Oct 16, 2018
    jb_aero likes this.
  2. Jason Krause

    Jason Krause Member

    Thanks for this PseudoKnight.
  3. spudsrus

    spudsrus Member

    Thanks PseudoKnight, this is super handy!

    Do you have any ballpark estimate on getting CHWorldGuard running on 3.3.1 build 3042 and above?
    =]
  4. PseudoKnight

    PseudoKnight Well-Known Member Developer

    Started working on some changes for someone else. Finished it just for you. It should now also fire on teleports, vehicle enter, vehicle move. This should make it more reliable for certain uses.
  5. spudsrus

    spudsrus Member

    <3
    Thankyou!