Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Releases: Tuke-Nuke/TuSKe

Fixed force drop effect, java 7 and new metrics

02 Jun 23:08
Compare
Choose a tag to compare

[#] Fixed:

  • Force Player Drop effect showing errors that couldn't found a default slot in the event, when reloading.
  • GUI expressions not working inside of gui effect (run when closing, from advanced guis).

These last two was since last update, but I didn't included them in changelog.

[+] Added new metrics system: The old McStats is gone and everyone now is using bStats.

[-] Removed java 7 support: For obvious reason: In case your server still in java 7, you should update it asap. It was supported before since I didn't used any java 8 features, but now I do.

To update, just use the main command /tuske (making sure the option updater.download_pre_releases is true) or manually download it.

GUI Manager 2, Custom Recipe fixes, Performance increased, Documentation generator

28 May 19:36
Compare
Choose a tag to compare

[+] Added:

  • GUI Manager 2: New features, new syntaxes, faster and better. See the new tutorial

  • Option to remove a specific recipe.

    Example

    remove all recipes of {_tool} from all recipes
    loop all recipes of {_tool}:
        remove loop-recipe from all recipes
    -
    loop all recipes of {_tool}:
        delete loop-recipe #Remove from server
        reset loop-recipe #In case it is a custom recipe, it will delete only the custom recipe, 
        #remainning the default vanilla recipe (where it only checks the id and data).

  • New evaluate effect: Some additions compared the one from SkQuery.

    Example

    Syntax:

    evaluate [logging [[the] error[s]] in %variable list%]: (%strings%|<.+>)

    Description:

    It allows you to parse a string as skript code and execute it. The main difference is that it does support multiple lines at once and can be parse a code from a section, examples:

    evaluate: "kill player" 
    evaluate: "broadcast ""Hello""" #Using quotes
    evaluate: broadcast "Hello" #Quotes not needed, it can parse directly from it
    
    set {_effect} to "send"
    evaluate:
        if player is a op:
            %{_effect}% "True" #Before parsing the code, it will convert all expressions/variables to text
    
    evaluate logging errors in {_errors::*}: "this is not a valid Skript effect/condition"
    if {_errors::*} is set: #It will contains a skript error
        loop {_errors::*}:
            send loop-value
            # The error message format is:
            # <Error message>: <wrong expression> (TuSKe/evaluate.sk, line <line of code>, '<whole line>')
            # The file 'TuSKe/evaluate.sk' is fictitious, it doesn't create one.

  • Added documentation generator for all addons.

    • It will create a file containing everything from a addon separated.
    • Some useful informations like return type and changers of an expression, event values of an event and the possible values of a type. All types have its own file separated since is not possible to determine which addon it is from.
    • Also, there is a new online documentation at wiki page. This is a working progress of automatic documentation generator.
  • Added new event for SimpleClans: #4

    [on] clan chat:
        #It is called when a player say something in private clan chat.
        player: Who sent the message
        event-clan: The clan, the same as "player's clan"
        event-string: The message. Currently it can't be setted (I forgot about that). Next release I will make a expression for it
        cancellable

[=] Changed

  • Better performance changes.
    • More self triggable stuffs. What does it means? Some stuffs that are only enabled when they are beeing used.
      • The custom events (on anvil merge, on anvil rename, on inventory move ...) is one of example above. Before, those events were based of inventory click event, where it was checking this event even when you are not using the custom events. But now, the listener is disabled if you are not using them.
      • The GUI Manager also follow that rules: It will only use the inventory click event when there is a GUI open. How does it works?
        • A GUI is opened to a player > The inventory checking is enabled for a single the player >The player closes the GUI > The inventory checking is disabled.
      • Some internal stuffs that uses that idea.

[#] Fixed:

  • Fixes for Recipe Manager:
    • Throwing a console error when registering a shaped recipe.
    • Shapped recipes that are lower than 3x3 was returning missing air ingredients in ingredients of %recipe%.
    • Items with same ingredients (id an data) but with different nbt (name, lore ...) weren't working properly when crafting, now it does. But a warning
      • It has a visual bug when you have the condition above and you switch the ingredients to make 2 recipes different, sometimes the result item becomes invisible, but the item still there. I tried using update inventory of player but no success.
  • all commands was returning Skript commands as skript:<command>.
  • Fixed the updater, sometimes it doesn't check the version properly.

If you didn't have problems with the updater, just execute /tuske update plugin or install it manually.

New regex expression and fixed expressions and event values

02 Mar 07:19
Compare
Choose a tag to compare

[+] Added new regex expression: Thank's for it @Syst3ms and @Ayase-san

(first|random) string matching [pattern] %regex/string% #Return a single string
random strings matching [pattern] %regex/string%" #Return a string

It will generate a string with given regex.

the first in the first expression will return the first matching of a pattern

send "%first string matching ""(1|2)""%" #It will always return '1'

the random in the first expression will return a strign randomly

send "%random string matching ""(1|2)""%" #Can return '1' or '2' randomly

The second syntax is a dangerous syntax: It returns a list of possible matching strings.

set {_matching::*} to random strings matching "[A-Z]" #It will return the alphabetic

Why is it dangerous? Well, if you use patterns that can return a huge number of possibilities (like .+ or .{1,10000}) you gonna crash your server. I tried to make it softly but without success. I may make a possibility to avoid it. For now, you can try the async effect from MundoSK to see if it can run without freezing your server.

[#] Fixed:
Issue #2

#Effects:
cancel drops #It was throwing a console error

#Expressions:
[all] [registered] commands #It wasn't returning correctly all commands, now it does.

#Command Info expressions:
#It was excluding Bukkit/Minecraft commands.
#Somehow it includes the '/stop' and '/restart',
#I thought it wasn't registered commands.

<command info> of command %string%

#A note:
plugin of command "stop" #It will return null since it wasn't registered by a plugin.

Fixed all expressions/conditions that wasn't accepting the type %regex% when it was in a variable.

[=] Changed:

#From:
dragged slots

#To:
dragged (top|bottom) slots

The event values of on inventory drag had a little changed: Now the expression above changed to return two list of dragged slots, one for the top and other for the bottom, and the event-inventory had any change, but it only returns the top inventory.

Example:

on inventory drag:
    if dragged top slots is set: #The list will return null when there isn't any slots that was dragged in top inventory.
        send "You've spread the %old dragged item% in slots %dragged top slots%"
    else if dragged bottom slots is set:
        cancel event

Fixed functions support syntaxes

24 Feb 19:16
Compare
Choose a tag to compare

[#] Fixed effects/expressions that was using a function (evaluate a function or the gui manager):

  • Throwing a error in case you were using new parser from Bensku's fork.
  • The function getting the last value in a loop.

Fixed GUI function effect and new expression.

22 Feb 18:10
Compare
Choose a tag to compare

[#] Fixed effects/expressions related to functions:

Some effects was using a workaround to make possible to get a function (in GUI Manager specifically) and it was bugging sometimes when the function has complex parameters (more than one parameter or/and list parameters).
For GUI Manager: Now it's possible to run a function even if it wasn't loaded yet or is below the code.
So it's possible to make like this:

make gui slot 0 of player with stone to run function doSomething()
#Som lines below...
function doSomething(i: int = 1):
    broadcast "Hello there!"

Or call the own function that the effect is inside:

function openGUI(p: Player, type: String):
    if arg is "1":
        open virtual chest inventory named "Example 1" to {_p}
        make gui slot 0 of {_p} with stone named "Go to page 2" to run function openGUI({_p}, "2")
    else if arg is "2":
        open virtual chest inventory named "Example 2" to {_p}
        make gui slot 0 of {_p} with stone named "Go back to page 1" to run function openGUI({_p}, "1")

[+] Added an expression to get the last attacker of a entity.

last attacker of %entity%
%entity%'[s] last attacker

Note: There is a possibility to this expression return a block, I tried some damages that is caused by blocks and I couldn't make it detect the Block. I'm not sure if it is normal or was fixed in new Spigot releases.
This expression returns null if the entity didn't get any damage yet or wasn't caused by a entity.

on damage:
    send "%last attacker of victim%" to victim
    wait a tick
    send "%last attacker of victim%" to victim #The last attacker will be the 'attacker' because it is a tick later.

Recipe support and fixes.

14 Feb 01:34
Compare
Choose a tag to compare

Finally done recipe support. This is a normal release, which means it was updated with previous changes on Spigot/SkUnity.

[+] Some new expression for recipes.

#Expressions:
[the] shape of %recipe% #Return a list of strings, like "abc", "def" and "ghi"
[the] furnace level of %recipe% #This and the one above isn't too much necessary, just in case you want some recipe's info.
recipe from ingredients %itemstacks%

Note: Soonly, the expression result item of %itemstacks/recipe% won't accept the itemstacks anymore. Use recipe from ingredients %itemstacks% instead.

#Previously:
set {_resultItem} to result item of stone #will return a stone buttom
#Now:
set {_resultItem} to result item of recipe from ingredients stone

Note 2: In the effects to register a shaped or shapeless recipe, you need to include the custom in the pattern, so it will accept custom ingredients.

[#] Fixed the expression recipe from ingredients %itemstacks% (previously result item of %itemstacks%), not it can detect most of recipes easily only by its ingredients.

Just update it with /tuske update plugin if you are 1.7-beta+

Recipe Support done and some little fixes.

26 Jan 04:09
Compare
Choose a tag to compare

It might be the final beta, beforing release updated weekly again.

[#] Fixed the expressions to get rgb colors of a item, if the item was setted in a variable.

[#] Fixed Recipe Manager, so far is working nice. shaped and shapeless recipes now work nice, previously it wasn't checking the ingredients correctly in they right positions.

To do:

  • Add the recipe support for the events and expressions, since the custom recipes are stored separately and checked when it is prepared. So the expressions as recipes of %item stack% won't return the ingredients with lores and items (if any) so far. I let to do it in a new release.

[+] Added 1.11 support for the syntax that needs to be updated for every version:

player data of %offline player%
save player data of %player% #This one isn't version dependent, but it's used for the expression above.
make %player% drop %itemstack% [from his inventory]

Also, this syntax now will work for any future version, but it can be unstable since it might change.

[+] Added an option use_only_enum_names in the config, it is only in case some types is causing conflict with other skript stuffs. For example, in case the inventory type chest is somehow causing conflict with the item chest, you can enable it and it will accept the inventory type as InventoryType.CHEST in case sensitive.

[+] Added a auto generated docs: It isn't fancy yet, it's just to be a hand in case the skUnity docs is down.
You can disable the generation of file if you want (I don't know why if someone would bother with that).

[+] Added event-recipe for the events on craft and on prepare item craft. But the to do above refers about this too.

[+] Some new expression about command info (Actually it was done since 1.6.9.7 but never released):

file [location] of command %string%
command %string%'[s] file location #It returns the script where this command came from, in case it is a script command.

[=] Changed syntaxes:

#From
[all] commands
#To
[all] [registered] [script] commands

If you use script, the expression will return only the commands that came from Skript.

Just download it below or use ingame command. /tuske update

Damage modifiers and config fix

22 Dec 20:02
Compare
Choose a tag to compare
Pre-release

[#] Fixed error while enabling TuSKe:

  • Can't create the config fo the first time.
  • Error with missing "PlayerItemDamageEvent"

[+] Added damage modifier, that returns the amount of damage of specific modifiers. It returns an number

damage [modifier] %damage modifier%

Type:
Damage modifier:
absorption - This represents the damage reduction caused by the absorption potion effect.
armor - This represents the damage reduction caused by wearing armor.
base - This represents the amount of damage being done.
blocking - This represents the damage reduction caused by blocking, only present for Players.
hard hat - This represents the damage reduced by a wearing a helmet when hit by a falling block.
magic - This represents the damage reduction caused by the combination of: Armor enchantments Witch's potion resistance
resistance - This represents the damage reduction caused by the Resistance potion effect.

It should be used in on damage event. More about it soon, no time right now.
Example:

on damage:
    if damage magic is set:
        clear damage magic #Will set the value to 0
    else if damage armor is set:
        add 10 to damage armor

You can add, remove and set values, clear/deletevalues is the same to set to 0 and reset will set the value to the first value before all changes.

Note: I didn't make more test to it yet, as I read in Bukkit, you can't apply modifiers that isn't setted. e.g You can't set damage value for blocking when the entity wasn't blocking. It won't cause any errors, since I handled them all, you need to check if the expression is setted before make changes.

To get the list of modifiers of a specific event you need to do it:

set {_modifiers::*} to absorption, amor, base, blocking, hard hat, magic and resistance
loop {_modifiers::*}:
    if damage loop-value is not set:
        remove loop-value from {_modifiers::*}

In next update I will see more things that uses damage modifiers.

Shapped recipe fix and jukebox expressions

10 Dec 16:34
Compare
Choose a tag to compare

[+] Added two new syntax for jukebox:

#Expression:
[jukebox] record of %block% #Returns an itemstack, you can set it, but only the material, setting to air make the song stop

#Effect:
eject record [(of|from)] %block% #Stop the song and pull the record off

[#] Fixed a bug with shape, that was make it doesn't get the input strings.

What was done internally:

  • Some fast and simple way to register types.
  • Simple recode of GUI Manager, it is loading the script a bit faster and improved the performance when formatting/clicking the item.

Known bugs:

  • When you shift click in a item with a macro (or something really fast), it executes the next gui in the inventory too. Certainly it is an old bug since I didn't make any changes at this part.

Recipes support and some fixes

07 Dec 15:29
Compare
Choose a tag to compare
Pre-release

It is the first pre-release version. I will make it before 1.7.1 and just to test some new incomming features.
You can use the version normally, but the new features are in test mode and might or might not work.

[+] Added an type %regex%. It is used in regex expressions to parse the regex pattern. Also added an expression to check what was wrong on last pattern.

#Expression:
[last] regex [parser] error

#Example
set {_regex} to "(.*" parsed as regex
if last regex parser error is set:
    send regex error to player #It will show that the pattern doesn't have a closing bracket.
set {_result} to regex replace "(.*)" with "$3" in "whatever"
if last regex parser error is set:
    send regex error to player #It will send that there isn't any group 3 in the pattern.

[+] Added register recipe effect with custom ingredients (name, lore, whatever accepted).
It still in progress, only Shaped recipe can register the ingredients with custom item, but the furnace recipe will be the same as previous one: You can't set the name and lore for the source item.

(create|register) [new] [custom] shaped recipe with (return|result) %itemstack% using [ingredients] %itemstacks% [with shape %strings%]
(create|register) [new] [custom] shapeless recipe with (return|result) %itemstack% using [ingredients] %itemstacks%
(create|register) [new] [custom] furnace recipe with (return|result) %itemstack% using [source] %itemstack% [with experience %number%]

Explanation about recipes.

[+] Added an expression to return the Offline Player from a uuid:

#Expression:
offline player from [uuid] %string%

#Example:
set {_uuid} to uuid of "Tuke_Nuke" parsed as offline player
set {_player} to offline player from  {_uuid}

What was done internally:

  • Starting to recode most of the stuffs. For now, I only recoded all the Register.class
  • Remake the config file, I added an option to disable some features, like uncompatible versions or a bugged/crashing one. You don't need to care about it, all features are enabled by default, it's only a key if I found something crashing and give an option to disable it. I still need to add this option for most features that may change if you are using an old versions or modded servers.
  • Recoded the updater, now it checks here, in GitHub, but it needs some fixes to prevent to check beta/pre-release versions when it is disabled in the config.

To do:

  • Remake the GUI Manager. I have a testing one that works better.
  • Remake the custom enchantments. It needs a recode and add some new ideas.
  • Try to debug and test why some long effects take so long to load the script. It is a Skript problem, that is getting solved with the new parser, but I will try something to make it not too laggy.
  • Add more recipe support, like values for the related events, and fix some old expressions about it.
  • Finalize the first beta of Block Effect! (the name may change)